<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Caveat Lector &#187; Manakin</title>
	<atom:link href="http://cavlec.yarinareth.net/category/librariana/dspace/manakin/feed/" rel="self" type="application/rss+xml" />
	<link>http://cavlec.yarinareth.net</link>
	<description>Reader Beware!</description>
	<pubDate>Mon, 01 Dec 2008 21:04:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>The dangers of reused code</title>
		<link>http://cavlec.yarinareth.net/2008/10/30/the-dangers-of-reused-code/</link>
		<comments>http://cavlec.yarinareth.net/2008/10/30/the-dangers-of-reused-code/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 17:16:11 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/?p=3403</guid>
		<description><![CDATA[So because the title of an item on display is shown at the top of item-display pages (imagine!) in my Manakin themes, I went and took the title out of the metadata listing to avoid redundancy and clutter.
One small problem with that. The same code gets called in the case when the item is being [...]]]></description>
			<content:encoded><![CDATA[<p>So because the title of an item on display is shown at the top of item-display pages (imagine!) in my Manakin themes, I went and took the title out of the metadata listing to avoid redundancy and clutter.</p>
<p>One small problem with that. The same code gets called in the case when the item is being edited or checked over, but in that case the page title is &#8220;Item submission&#8221; or something similarly inane, so the item title doesn&#8217;t appear <em>anywhere</em> on the page. Doubleplusungood.</p>
<p>My current fix is to put the title back in if the string &#8220;workflow&#8221; appears in the URL anywhere. That&#8217;s&#8230; kinda hacky, I admit, and I&#8217;m not entirely sure it handles all edge cases, but it&#8217;s at least not as broken as before.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/10/30/the-dangers-of-reused-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fugly Manakin hack: User-friendly file descriptions</title>
		<link>http://cavlec.yarinareth.net/2008/10/27/fugly-manakin-hack-user-friendly-file-descriptions/</link>
		<comments>http://cavlec.yarinareth.net/2008/10/27/fugly-manakin-hack-user-friendly-file-descriptions/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 18:36:50 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/?p=3396</guid>
		<description><![CDATA[DSpace&#8217;s JSPUI had one pleasantly usable feature: instead of displaying the MIME type of a file, it displayed a short admin-editable file-type description. &#8220;PDF&#8221; is a vast improvement over &#8220;application/pdf.&#8221; For one thing, it&#8217;s shorter.
Unfortunately, Manakin only knows from MIME types, since METS isn&#8217;t very friendly to niceties like user-friendly file descriptors. Fixing that was [...]]]></description>
			<content:encoded><![CDATA[<p>DSpace&#8217;s JSPUI had one pleasantly usable feature: instead of displaying the MIME type of a file, it displayed a short admin-editable file-type description. &#8220;PDF&#8221; is a vast improvement over &#8220;application/pdf.&#8221; For one thing, it&#8217;s <em>shorter</em>.</p>
<p>Unfortunately, Manakin only knows from MIME types, since METS isn&#8217;t very friendly to niceties like user-friendly file descriptors. Fixing that was on my to-do list. I was told by the DSpace developers that the right and proper way to fix that was to insert PREMIS metadata into the METS. To do this, I would have to figure out PREMIS and then write an Aspect (I think) to twiddle the METS.</p>
<p>People, I am <em>too damn lazy</em> for that. So you get this fugly hack instead. I don&#8217;t feel too bad about it; storing descriptions in the database is kind of a fugly hack too.</p>
<p>First, figure out what&#8217;s actually in your DSpace instance by way of MIME types by running this query on your database: <code>select mimetype, short_description from bitstreamformatregistry order by mimetype;</code>. (You will probably immediately notice a potential problem with this hack: text/plain has two values, depending on whether it&#8217;s a content or license bitstream. I <em>think</em> this is not actually a problem, because this hack should only get called for content bitstreams.)</p>
<p>Then create a template in your theme as below, making one <code>&lt;xsl:when&gt;</code> for each MIME type you want a user-friendly description for.</p>
<pre>&lt;xsl:template name="getFileTypeDesc"&gt;
    &lt;xsl:param name="mimetype"/&gt;
    &lt;xsl:choose&gt;
        &lt;xsl:when test="$mimetype='application/pdf'"&gt;
            &lt;xsl:text&gt;PDF&lt;/xsl:text&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
            &lt;xsl:value-of select="$mimetype"/&gt;
        &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;</pre>
<p>The <code>&lt;xsl:otherwise&gt;</code> returns the MIME type as a last-ditch descriptor.</p>
<p>Next, go to the code that builds each bitstream row; I&#8217;d show you mine, but I have hacked the living daylights out of it because I cannot <em>stand</em> unnecessary HTML tables. Look for the MIME-type code (hint: it&#8217;s the contents of <code>&lt;with-param&gt;</code> below) and replace it with the following:</p>
<pre>&lt;xsl:call-template name="getFileTypeDesc"&gt;
    &lt;xsl:with-param name="mimetype"&gt;
        &lt;xsl:value-of select="substring-before($file/@MIMETYPE,'/')"/&gt;
        &lt;xsl:text&gt;/&lt;/xsl:text&gt;
        &lt;xsl:value-of select="substring-after($file/@MIMETYPE,'/')"/&gt;
    &lt;/xsl:with-param&gt;
&lt;/xsl:call-template&gt;</pre>
<p>Whenever you add a new content-type to the repository, you&#8217;ll have to add a new <code>&lt;xsl:when&gt;</code>&#8212;but realistically, how often does that happen? I&#8217;ve done it once a year, maybe? Less?</p>
<p>It&#8217;s a fugly hack, but it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/10/27/fugly-manakin-hack-user-friendly-file-descriptions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Yay usability!</title>
		<link>http://cavlec.yarinareth.net/2008/10/16/yay-usability/</link>
		<comments>http://cavlec.yarinareth.net/2008/10/16/yay-usability/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 15:54:39 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/?p=3385</guid>
		<description><![CDATA[So at work we&#8217;ve gone the DSpace-1.5-plus-Manakin route, rolling out two new themes along with the new release. If I&#8217;ve seemed crustier and more irritable than usual lately? Getting a release ready to go, and dealing with the inevitable post-release bug list, does that to me.
So, yes, I&#8217;ve been swearing at Manakin a lot lately. [...]]]></description>
			<content:encoded><![CDATA[<p>So at work we&#8217;ve gone the DSpace-1.5-plus-Manakin route, rolling out two new themes along with the new release. If I&#8217;ve seemed crustier and more irritable than usual lately? Getting a release ready to go, and dealing with the inevitable post-release bug list, does that to me.</p>
<p>So, yes, I&#8217;ve been swearing at Manakin a lot lately. Not as much as I&#8217;ve been swearing at IE6, admittedly, but there have been some &#8220;wait, what? how could you <em>do</em> that? what were you <em>thinking</em>?&#8221; moments. (And just so the Manakin devs know: if y&#8217;all change the pattern of the browse URLs one more time, I&#8217;m agonna take out a contract on ya. I let it go into production with broken links!)</p>
<p>This morning, though, I had to add an eperson to a collection as submitter, collection admin, and review step performer. It took me many fewer clicks and scans to do that than in the past; the ability to search for an eperson instead of browsing an obtuse list is great! Thank you, thank you, <em>thank you</em> for cleaning up this little chore.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/10/16/yay-usability/feed/</wfw:commentRss>
		</item>
		<item>
		<title>And it was good</title>
		<link>http://cavlec.yarinareth.net/2008/09/17/and-it-was-good/</link>
		<comments>http://cavlec.yarinareth.net/2008/09/17/and-it-was-good/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:59:47 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/?p=3369</guid>
		<description><![CDATA[Earlier this week, the godly sysadmin got the last of his major hacks into 1.5, and got our test installation up and running thereupon.
Yesterday I got down to brass tacks installing my themes, which promptly broke because the Manakin devs fixed their misspelling of &#8220;standardAttributes.&#8221; (I&#8217;m not pointing and laughing. Really I&#8217;m not. These things [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this week, the godly sysadmin got the last of his major hacks into 1.5, and got our test installation up and running thereupon.</p>
<p>Yesterday I got down to brass tacks installing my themes, which promptly broke because the Manakin devs fixed their misspelling of &#8220;standardAttributes.&#8221; (I&#8217;m not pointing and laughing. Really I&#8217;m not. These things happen.) That was a simple enough fix, as were a couple of messages.xml fixes.</p>
<p>And today I hacked at the bad stuff. My scoped search box was amazingly unbelievably broken, but I got it fixed after a lot of unnecessary metaprogramming and a similar amount of <em>very</em> necessary cussing. (If the fit comes upon you to program Javascript inside XSLT? For your own sanity, I urge you to resist it.)</p>
<p>The other thing that broke badly was my <a href="http://cavlec.yarinareth.net/2007/12/20/moving-community-and-collection-logos/">big logo hack</a>. The problem was that Manakin doesn&#8217;t put METS metadata inside the DRI any more; it&#8217;s all called by reference. Since the logo URL lives in METS, I had to figure out how to make XSLT call the right METS file and return the URL from it. Once I had <em>that</em> sorted, the $context-path variable confused me rather, but Tim Donohue kindly got me straightened out and flying right, and so the logos are now fixed as well.</p>
<p>At this point, I have some minor XSLT and CSS tweaks to do before I&#8217;m willing to set 1.5 free, but I think I can tear through them in a day or two (although considering the number of meetings I&#8217;ve got for the next three workdays, it may take longer than that). If I get through those, I can start wading through the wishlist. Drop-dead rollout date is Open Access Day, and I&#8217;m fairly confident we&#8217;ll make that.</p>
<p>And it was a good day.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/09/17/and-it-was-good/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Search scope in consortial repositories</title>
		<link>http://cavlec.yarinareth.net/2008/03/13/search-scope-in-consortial-repositories/</link>
		<comments>http://cavlec.yarinareth.net/2008/03/13/search-scope-in-consortial-repositories/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 13:25:30 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2008/03/13/search-scope-in-consortial-repositories/</guid>
		<description><![CDATA[If you run a consortial repository, one of the things Manakin brings you is the possibility of separating each institution in your repository from the others visually, such that each institution practically seems to have its own site!
Manakin is actually pretty careful about the URL design of its scoped browsing. If you start browsing inside [...]]]></description>
			<content:encoded><![CDATA[<p>If you run a consortial repository, one of the things Manakin brings you is the possibility of separating each institution in your repository from the others visually, such that each institution practically seems to have its own site!</p>
<p>Manakin is actually pretty careful about the URL design of its scoped browsing. If you start browsing inside a particular community or collection, you&#8217;ll still see that community or collection&#8217;s design (as opposed to the default), because the URL hangs onto the handle, which is what the theme chooser uses to decide which theme to display. Very smart!</p>
<p>Scoped <em>searching</em>, however, is a different and rather nastier problem. Out of the box, Manakin&#8217;s search box is designed to allow the user to choose between two types of search: the entire repository, and the currently-browsed community or collection. This is a problem for consortial repositories who want their institution-level communities to seem wholly independent of each other. There shouldn&#8217;t <em>be</em> any all-of-DSpace search available from a community&#8217;s page. The &#8220;all of DSpace&#8221; scope should be replaced by an &#8220;all of the institution&#8217;s community&#8221; scope.</p>
<p>(I initially thought there shouldn&#8217;t be any broad-scope search at all. This was completely wrongheaded of me. If you&#8217;re in a departmental collection, you should be able to search the entire institution&#8217;s collections. I mention this so that you won&#8217;t make the same mistake.)</p>
<p>At present, I have solved about half this problem. The half I <em>can&#8217;t</em> solve is the search-results page, which uses the site-default theme no matter <em>what</em> I do, and cannot be made to respect the scoping established on the search page. I am annoyed by this, but I&#8217;m pretty sure that solving it is beyond my abilities. (What it would take, I suspect, is sticking information about the referring page and its theme into the DRI. Somebody want to write an Aspect to do that?)</p>
<p>However, I <em>have</em> solved the search-box scoping problem. It&#8217;s a start. Here&#8217;s how you can too.</p>
<p>First, you need to know when you&#8217;re on the main community page. For this, you need to record that page&#8217;s handle in the theme&#8217;s XSLT. This got slightly hairy for me because my test and production servers have different handle prefixes. If yours don&#8217;t, your solution is easier than mine. Anyway, here&#8217;s mine (and yes, I&#8217;m giving away the farm here a bit, revealing which community I&#8217;m doing this for, but I don&#8217;t see that that&#8217;s a problem):</p>
<pre>&lt;xsl:variable name="handle-prefix" select="substring-after(/dri:document/dri:meta/dri:repositoryMeta/dri:repository/@repositoryIdentifier, 'hdl:')"/&gt;
&lt;xsl:variable name="uwmad-handle"&gt;
    &lt;xsl:choose&gt;
        &lt;xsl:when test="$handle-prefix='1960'"&gt;1960/10498&lt;/xsl:when&gt;
        &lt;xsl:when test="$handle-prefix='1793'"&gt;1793/8334&lt;/xsl:when&gt;
    &lt;/xsl:choose&gt;
&lt;/xsl:variable&gt;</pre>
<p>Now you need to mess with the radio buttons in the search form. On your community&#8217;s main page, you&#8217;ll replace them with a hidden <code>input</code> containing that community&#8217;s handle as scope. Everywhere else, you&#8217;ll sneakily change the &#8220;everything&#8221; scope to search just your community. Take a deep breath &#8212; a lot of code here:</p>
<pre>&lt;xsl:choose&gt;
    &lt;!-- when we're on the UW-Madison home page, don't offer a choice of scope -DS --&gt;
    &lt;xsl:when
        test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container']=concat(&#8217;hdl:&#8217;,$uwmad-handle)&#8221;&gt;
        &lt;input id=&#8221;ds-search-form-scope-container&#8221; name=&#8221;scope&#8221; type=&#8221;hidden&#8221;&gt;
            &lt;xsl:attribute name=&#8221;value&#8221;&gt;
                &lt;xsl:value-of select=&#8221;$uwmad-handle&#8221;/&gt;
            &lt;/xsl:attribute&gt;
        &lt;/input&gt;
    &lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;
        &lt;label&gt;
            &lt;!&#8211; edited so that a scope of &#8220;all&#8221; ONLY searches UW-Madison stuff &#8211;&gt;
            &lt;input id=&#8221;ds-search-form-scope-all&#8221; type=&#8221;radio&#8221; name=&#8221;scope&#8221;
                checked=&#8221;checked&#8221;&gt;
                &lt;xsl:attribute name=&#8221;value&#8221;&gt;
                    &lt;xsl:value-of select=&#8221;$uwmad-handle&#8221;/&gt;
                &lt;/xsl:attribute&gt;
            &lt;/input&gt;
            &lt;i18n:text&gt;All of MINDS@UW-Madison&lt;/i18n:text&gt;
        &lt;/label&gt;
        &lt;br/&gt;
        &lt;label&gt;
            &lt;input id=&#8221;ds-search-form-scope-container&#8221; type=&#8221;radio&#8221; name=&#8221;scope&#8221;&gt;
                &lt;xsl:attribute name=&#8221;value&#8221;&gt;
                    &lt;xsl:value-of
                        select=&#8221;substring-after(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container'],&#8217;:')&#8221;
                    /&gt;
                &lt;/xsl:attribute&gt;
            &lt;/input&gt;
            &lt;xsl:choose&gt;
                &lt;xsl:when
                    test=&#8221;/dri:document/dri:meta/dri:objectMeta/dri:object[@objectIdentifier=/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container']]/mets:METS/mets:structMap[@TYPE='LOGICAL']/mets:div[@TYPE='DSpace Collection']&#8221;
                    &gt;This Collection&lt;/xsl:when&gt;
                &lt;xsl:when
                    test=&#8221;/dri:document/dri:meta/dri:objectMeta/dri:object[@objectIdentifier=/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container']]/mets:METS/mets:structMap[@TYPE='LOGICAL']/mets:div[@TYPE='DSpace Community']&#8221;
                    &gt;This Community&lt;/xsl:when&gt;
            &lt;/xsl:choose&gt;
        &lt;/label&gt;
    &lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;</pre>
<p>As best I can tell, this works quietly and without fuss. Best kind of hack!</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/03/13/search-scope-in-consortial-repositories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Argh, Manakin, don&#8217;t do that!</title>
		<link>http://cavlec.yarinareth.net/2008/02/05/argh-manakin-dont-do-that/</link>
		<comments>http://cavlec.yarinareth.net/2008/02/05/argh-manakin-dont-do-that/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 15:44:18 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2008/02/05/argh-manakin-dont-do-that/</guid>
		<description><![CDATA[Manakin has one seriously broken behavior that I can&#8217;t figure out how to fix, but there&#8217;s a workaround that I recommend to everyone.
If you try to click on a link to a page that needs you to be logged in, Manakin duly asks you to log in and then shoots you over to your page. [...]]]></description>
			<content:encoded><![CDATA[<p>Manakin has one seriously broken behavior that I can&#8217;t figure out how to fix, but there&#8217;s a workaround that I recommend to everyone.</p>
<p>If you try to click on a link to a page that needs you to be logged in, Manakin duly asks you to log in and then shoots you over to your page. Fine. If, however, you click a login link from an open page, once you&#8217;re logged in, Manakin returns you to the root (main) page of your repository.</p>
<p>Let me count the ways in which this is broken:</p>
<ol>
<li>It doesn&#8217;t clearly inform you that you&#8217;ve logged in properly. When I first ran into this, I wondered if I had!</li>
<li>If you came from a page with a different theme (visual design) from the main repository page, welcome to total confusion!</li>
<li>It doesn&#8217;t take you to a page that does anything <em>useful</em> with your logged-in status. If you&#8217;re coming from an open page, you probably logged in to deposit an item or handle something in your workflow. To do this from the main page, you&#8217;re stuck clicking at least once, and probably twice!</li>
<li>It&#8217;s not what the JSP UI does. The JSP UI sensibly sends you to your profile (&#8221;My DSpace&#8221;) page. Switching to Manakin and not fixing this behavior will confuse every single existing user of your repository. (How did TAMU not find this out on user testing? Didn&#8217;t they test? Or do they not have any existing JSP UI users?)</li>
</ol>
<p>My recommendation is <em>never to link to Manakin&#8217;s login page</em> in a theme. Instead, link to Manakin&#8217;s profile page (&#8221;/profile&#8221; instead of &#8220;/login&#8221;). You can still label it &#8220;Log in&#8221; if you like. This way, Manakin will say &#8220;oops! can&#8217;t go to your profile page if you&#8217;re not logged in!&#8221; It will then log you in and send you to your profile page. Which is correct, not-confusing behavior.</p>
<p><b>Edited to add</b>: To make this happen by default, go to Navigation.java <em>in the EPerson aspect</em> of Manakin. Find &#8220;/login&#8221; and change it to &#8220;/profile&#8221;. Install and rebuild. You&#8217;re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/02/05/argh-manakin-dont-do-that/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Theming different parts and pages in Manakin</title>
		<link>http://cavlec.yarinareth.net/2008/01/17/theming-different-parts-and-pages-in-manakin/</link>
		<comments>http://cavlec.yarinareth.net/2008/01/17/theming-different-parts-and-pages-in-manakin/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 15:53:30 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2008/01/17/theming-different-parts-and-pages-in-manakin/</guid>
		<description><![CDATA[I&#8217;m sure everyone else figured this out already and I&#8217;m the only one who didn&#8217;t, but just in case someone else is as slow on the uptake as I am&#8230;
You set which pages get which theme in Manakin via [dspace]/config/xmlui.xconf. Each theme gets a theme element with its name, the path to it, and&#8230; a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure everyone else figured this out already and I&#8217;m the only one who didn&#8217;t, but just in case someone else is as slow on the uptake as I am&#8230;</p>
<p>You set which pages get which theme in Manakin via <code><i>[dspace]</i>/config/xmlui.xconf</code>. Each theme gets a <code>theme</code> element with its name, the path to it, and&#8230; a selection regex! REGEX! Pattern-matching!</p>
<p>This means you can set up a theme just to hit certain pages or sections of the site, as long as they have a distinctive, <em>non-handle-based</em> URL. Want a theme just for the admin section? Easy-peasy. Do <code>regex=".*/admin/.*"</code>. How cool is that?</p>
<p>Unfortunately, this coolness breaks down with regard to distinctive community and collection pages, because those have handles and so can&#8217;t be caught via regex, not to mention that Manakin is set up to cascade a theme down to item pages. This is irksome, because after all, community and collection pages are (after a fashion) <em>home pages</em>, and as such may well want to look or behave a bit differently from item or browse pages. To some extent, Manakin caters to this; the innermost content on a community/collection page is in its own template.</p>
<p>However, if you want to customize the header or the navbar or anything on a community or collection page, you&#8217;re sunk&#8212;except you&#8217;re not, because I figured this one out for you. At the top of your theme, add these variable definitions:</p>
<pre>&lt;xsl:variable name="is_comm" select="boolean(/dri:document/dri:body/dri:div[@n='community-home'])&#8221;/&gt;
&lt;xsl:variable name=&#8221;is_coll&#8221; select=&#8221;boolean(/dri:document/dri:body/dri:div[@n='collection-home'])&#8221;/&gt;
&lt;xsl:variable name=&#8221;is_item&#8221; select=&#8221;boolean(/dri:document/dri:body/dri:div[@n='item-view'])&#8221;/&gt;</pre>
<p>With these, you can do conditional logic anywhere in the stylesheet you need to. E.g. <code>&lt;xsl:if test="$is_comm"&gt;</code>. It just works!</p>
<p>Now if I only understood what themes.xmap does and whether I should actually care&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/01/17/theming-different-parts-and-pages-in-manakin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Redoing navigation in Manakin</title>
		<link>http://cavlec.yarinareth.net/2008/01/15/redoing-navigation-in-manakin/</link>
		<comments>http://cavlec.yarinareth.net/2008/01/15/redoing-navigation-in-manakin/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 16:12:02 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2008/01/15/redoing-navigation-in-manakin/</guid>
		<description><![CDATA[One of the commoner tasks involved in redesigning DSpace is reorganization of or additions to the navigation bar. Manakin does not make this simple, but there are ways to do an end-run around it.
The essential problem is that the elements of the navigation bar are not set at the theme level in XSLT, but at [...]]]></description>
			<content:encoded><![CDATA[<p>One of the commoner tasks involved in redesigning DSpace is reorganization of or additions to the navigation bar. Manakin does not make this simple, but there are ways to do an end-run around it.</p>
<p>The essential problem is that the elements of the navigation bar are not set at the theme level in XSLT, but at the Aspect level, in Java. (DSpace has always suffered from the arrogant notion that it knows interaction design better than you do. Often it is wrong, but the bad interactions are hard-coded in so deep it&#8217;s next to impossible to jettison them.)</p>
<p>If you choose, you can go into aspects/ArtifactBrowser/src/org/dspace/app/xmlui/artifactbrowser/Navigation.java and mess around in some rather inscrutable code to make changes that affect the entire Manakin installation. I admit to having done this to get rid of DSpace&#8217;s completely pointless browse-by-date function. However, I do <em>not</em> recommend this if adding links is what you need to do, and I <em>triply</em> do not recommend it for theme-specific navigation links.</p>
<p>I have now tested <a href="http://cavlec.yarinareth.net/archives/2007/12/28/kludging-manakin-includepagemeta/">my sitemap.xmap hack</a>, and I am pleased to say that it works exactly as I expected it would. For the situation where you want the normal Manakin sidebar, but you <em>also</em> want a few theme-specific additions, it is a decent way to go. After I threw another temper tantrum on the dspace-tech list, we can eventually expect a better way to inject content into Manakin DRI files. Until then, though, hacking sitemap.xmap works.</p>
<p>If you want to <em>rearrange</em> content in the navigation bar, beyond simply changing wording or adding a few links to the end, you have some work ahead of you. This is because the content and order of the sidebar is not set on the theme level; it&#8217;s hardcoded into the Java Aspect gizmo. (Is this stupid? Yes, this is stupid. These kind of interaction-design decisions <em>do not belong</em> in Java; they belong with the designers who are not supposed to be using Java. Eventually, however, I think it will be possible to move Manakin in a more productive direction.)</p>
<p>It is possible to work around this. The easy way to do it is to go into the <code>dri:options</code> template and <em>rip out</em> the <code>&lt;xsl:apply-templates&gt;</code> call, replacing it with hard-coded links. I think this is fully justifiable, though it&#8217;s rather annoying that (unless you set up theme inheritance somehow) you have to do it for every theme you write.</p>
<p>(Note also that doing it this way makes possible a rather interesting trick: you <em>could</em> actually make a DSpace community or collection a seamless part of Somebody Else&#8217;s Website. Grab up their site design and navigation bar to theme the community/collection with, then add a link on both sites that goes directly to the community/collection, and there you are. Nice trick, isn&#8217;t it? I really want to try it.)</p>
<p>The hard way to work around Manakin&#8217;s hard-coded navigation is to replace the <code>&lt;xsl:apply-templates&gt;</code> call with markup that pulls the appropriate links out of the DRI. What&#8217;s <em>really</em> hard about this is that without the <code>&lt;xsl:apply-templates&gt;</code> call, you&#8217;ll have to go through and figure out the logged-in-user and administrative linksets as well. I haven&#8217;t been quite daring enough to do this yet, but somebody ought to.</p>
<p>Because navigation is too important a part of interaction design to be left to a bunch of <em>developers</em>, yeah? (Sorry. Been rereading Alan Cooper.)</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2008/01/15/redoing-navigation-in-manakin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kludging Manakin: IncludePageMeta</title>
		<link>http://cavlec.yarinareth.net/2007/12/28/kludging-manakin-includepagemeta/</link>
		<comments>http://cavlec.yarinareth.net/2007/12/28/kludging-manakin-includepagemeta/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 17:47:18 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2007/12/28/kludging-manakin-includepagemeta/</guid>
		<description><![CDATA[So I&#8217;m about to start wrangling my new DSpace/Manakin theme into shape in Internet Explorer, as you might have gathered from yesterday&#8217;s howl of anguish, and it occurred to me to wonder how to alter the stylesheet setup in Manakin to take note of more versions of IE. (Out of the box, it understands &#8220;IE&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m about to start wrangling my new DSpace/Manakin theme into shape in Internet Explorer, as you might have gathered from <a href="http://cavlec.yarinareth.net/archives/2007/12/27/ieeeeeeeeee/">yesterday&#8217;s howl of anguish</a>, and it occurred to me to wonder how to alter the stylesheet setup in Manakin to take note of more versions of IE. (Out of the box, it understands &#8220;IE&#8221; and &#8220;IE6.&#8221; I am wondering about IE5. Anything previous to that can jump off a cliff and die horribly.)</p>
<p>What I found was actually a limited but relatively simple way to add static information into a Manakin theme without mucking around in Java and whatnot. Note well, it&#8217;s a big fat ugly nasty <em>kludge</em>&#8212;but it&#8217;ll <em>work</em>, and future versions are highly unlikely to break it.</p>
<p>Open up a sitemap.xmap file. Look for the &#8220;Step 2&#8243; comment, which introduces some <code>map:transform</code>s based on browser type. That&#8217;s your loophole, right there; the information there is going straight into the DRI, in <code>/document/meta/pageMeta/metadata</code> elements. (I&#8217;ve left out the namespaces, but you can&#8217;t in your XSLT. All the above are in the DRI namespace.)</p>
<p>So let&#8217;s take a closer look. The <code>metadata</code> elements in the DRI are structured more or less like good old familiar Dublin Core. There&#8217;s an <code>element</code> attribute and a <code>qualifier</code> attribute, and the value is there as the element&#8217;s content, so:</p>
<p><code>&lt;metadata element="stylesheet" qualifier="screen"&gt;style.css&lt;/metadata&gt;</code></p>
<p>How does the sitemap.xmap file make that happen in the DRI? Thusly:</p>
<p><code>&lt;map:parameter name="stylesheet.screen" value="style.css"/&gt;</code></p>
<p>See? Simple. But as I said, limited&#8212;this isn&#8217;t where you&#8217;re going to be able to put your entire static Help pages or FAQ. But you <em>could</em>, for example, introduce a new navigation bar or the like without having to hack the living hell out of Navigation.java in the ArtifactBrowser Aspect (which is frankly what I did, though it&#8217;s a lousy idea because that Aspect governs the entire system, not just one theme, so I&#8217;ll probably be replacing that hack with something based on this).</p>
<p>Now, if you&#8217;ve been paying close attention to that sitemap.xmap file, you&#8217;ll have noticed that all the code I&#8217;ve been referring to is inside some conditional stuff (<code>map:select</code> and <code>map:when</code>). I must say I haven&#8217;t tried this yet, but I <em>think</em> the way to just plain old add some stuff is to go outside the <code>map:select</code> element altogether and do something like this:</p>
<pre>&lt;map:transform type="IncludePageMeta"&gt;
  &lt;map:parameter name="newElement.newQualifier" value="newValue"/&gt;
&lt;/map:transform&gt;</pre>
<p>It should Just Work, showing up in your DRI where you can grab it via XSLT for whatever nefarious purpose you have in mind.</p>
<p>Kludge at your own risk, as always&#8230; but as kludges go, I think this one&#8217;s fairly safe and harmless.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2007/12/28/kludging-manakin-includepagemeta/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Moving community and collection logos</title>
		<link>http://cavlec.yarinareth.net/2007/12/20/moving-community-and-collection-logos/</link>
		<comments>http://cavlec.yarinareth.net/2007/12/20/moving-community-and-collection-logos/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 18:02:35 +0000</pubDate>
		<dc:creator>Dorothea</dc:creator>
		
		<category><![CDATA[Manakin]]></category>

		<guid isPermaLink="false">http://cavlec.yarinareth.net/archives/2007/12/20/moving-community-and-collection-logos/</guid>
		<description><![CDATA[I don&#8217;t want to admit how long it took me to get this right. Weeks. A small glitch elsewhere in the stylesheet that would occasionally throw a wobbly and occasionally not did not help matters. (Have I mentioned that debugging XSLT server-side is an inordinate pain in the posterior? I haven&#8217;t? Well, it is.)
Still. If [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t want to admit how long it took me to get this right. Weeks. A small glitch elsewhere in the stylesheet that would occasionally throw a wobbly and occasionally <em>not</em> did not help matters. (Have I mentioned that debugging XSLT server-side is an inordinate pain in the posterior? I haven&#8217;t? Well, it is.)</p>
<p>Still. If you hate as much as I do that community and collection logos live inside the community/collection box and not in the <code>h1</code> of the page the way $DEITY intended, read on.</p>
<p>I actually had to comment out the <code>ds-logo-wrapper</code> bit in DS-METS-1.0-DIM.xsl, because nothing I did in my theme seemed to override it. The other sneaky way to dispense with it is to set it to <code class="css">display:none</code> in your CSS.</p>
<p>For our first trick, we will fossick around in the METS and the DRI to determine whether there&#8217;s a logo at all, and whether we&#8217;re actually on a community or collection page. Add the following variables to the top level of your theme&#8217;s stylesheet (look for the <code>context-path</code> variable and put them beside those):</p>
<pre>&lt;!-- Whether the current page has a logo associated with it. --&gt;
    &lt;xsl:variable name="has_logo" select="boolean(/dri:document/dri:meta/dri:objectMeta/dri:object/mets:METS/mets:fileSec/mets:fileGrp[@USE='LOGO'])&#8221;/&gt;

&lt;!&#8211;  Whether the current page is a community or collection home page. &#8211;&gt;
     &lt;xsl:variable name=&#8221;is_comm&#8221; select=&#8221;boolean(/dri:document/dri:body/dri:div[@n='community-home'])&#8221;/&gt;
    &lt;xsl:variable name=&#8221;is_coll&#8221; select=&#8221;boolean(/dri:document/dri:body/dri:div[@n='collection-home'])&#8221;/&gt;</pre>
<p>Next, we will go into the template where we want the logo to live and add this to it:</p>
<pre>&lt;xsl:if test="$is_coll or $is_comm"&gt;
  &lt;img&gt;
    &lt;xsl:attribute name="src"&gt;
      &lt;xsl:value-of select="/dri:document/dri:meta/dri:objectMeta/dri:object/mets:METS/mets:fileSec/mets:fileGrp[@USE='LOGO']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href&#8221;/&gt;
    &lt;/xsl:attribute&gt;
    &lt;xsl:attribute name=&#8221;class&#8221;&gt;logo&lt;/xsl:attribute&gt;
    &lt;xsl:attribute name=&#8221;id&#8221;&gt;commcollogo&lt;/xsl:attribute&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&#8221;$is_comm&#8221;&gt;
        &lt;xsl:attribute name=&#8221;alt&#8221;&gt;xmlui.dri2xhtml.METS-1.0.community-logo-alt&lt;/xsl:attribute&gt;
        &lt;xsl:attribute name=&#8221;attr&#8221; namespace=&#8221;http://apache.org/cocoon/i18n/2.1&#8243;&gt;alt&lt;/xsl:attribute&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test=&#8221;$is_coll&#8221;&gt;
        &lt;xsl:attribute name=&#8221;alt&#8221;&gt;xmlui.dri2xhtml.METS-1.0.collection-logo-alt&lt;/xsl:attribute&gt;
        &lt;xsl:attribute name=&#8221;attr&#8221; namespace=&#8221;http://apache.org/cocoon/i18n/2.1&#8243;&gt;alt&lt;/xsl:attribute&gt;
      &lt;/xsl:when&gt;
    &lt;/xsl:choose&gt;
  &lt;/img&gt;
&lt;/xsl:if&gt;</pre>
<p>There is an additional wrinkle if (as I did) you want the logo to live in the <code>ds-div-head</code> with the community&#8217;s name in it. For this, you need to test whether a given head on the page is an <code>h1</code>, or you&#8217;ll get the damn logo on every head on the page. (Yep. I made that mistake.)</p>
<p>The fix is relatively easy; just change the <code>xsl:if</code> line above to <code>&lt;xsl:if test="$head_count=1 and ($is_coll or $is_comm)"&gt;</code> and you&#8217;re golden.</p>
<p>I hope somebody else uses this. Figuring it out drove me crazy for weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://cavlec.yarinareth.net/2007/12/20/moving-community-and-collection-logos/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
