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 a particular community or collection, you’ll still see that community or collection’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!
Scoped searching, however, is a different and rather nastier problem. Out of the box, Manakin’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’t be any all-of-DSpace search available from a community’s page. The “all of DSpace” scope should be replaced by an “all of the institution’s community” scope.
(I initially thought there shouldn’t be any broad-scope search at all. This was completely wrongheaded of me. If you’re in a departmental collection, you should be able to search the entire institution’s collections. I mention this so that you won’t make the same mistake.)
At present, I have solved about half this problem. The half I can’t solve is the search-results page, which uses the site-default theme no matter what I do, and cannot be made to respect the scoping established on the search page. I am annoyed by this, but I’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?)
However, I have solved the search-box scoping problem. It’s a start. Here’s how you can too.
First, you need to know when you’re on the main community page. For this, you need to record that page’s handle in the theme’s XSLT. This got slightly hairy for me because my test and production servers have different handle prefixes. If yours don’t, your solution is easier than mine. Anyway, here’s mine (and yes, I’m giving away the farm here a bit, revealing which community I’m doing this for, but I don’t see that that’s a problem):
<xsl:variable name="handle-prefix" select="substring-after(/dri:document/dri:meta/dri:repositoryMeta/dri:repository/@repositoryIdentifier, 'hdl:')"/>
<xsl:variable name="uwmad-handle">
<xsl:choose>
<xsl:when test="$handle-prefix='1960'">1960/10498</xsl:when>
<xsl:when test="$handle-prefix='1793'">1793/8334</xsl:when>
</xsl:choose>
</xsl:variable>
Now you need to mess with the radio buttons in the search form. On your community’s main page, you’ll replace them with a hidden input containing that community’s handle as scope. Everywhere else, you’ll sneakily change the “everything” scope to search just your community. Take a deep breath — a lot of code here:
<xsl:choose>
<!-- when we're on the UW-Madison home page, don't offer a choice of scope -DS -->
<xsl:when
test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container']=concat(’hdl:’,$uwmad-handle)”>
<input id=”ds-search-form-scope-container” name=”scope” type=”hidden”>
<xsl:attribute name=”value”>
<xsl:value-of select=”$uwmad-handle”/>
</xsl:attribute>
</input>
</xsl:when>
<xsl:otherwise>
<label>
<!– edited so that a scope of “all” ONLY searches UW-Madison stuff –>
<input id=”ds-search-form-scope-all” type=”radio” name=”scope”
checked=”checked”>
<xsl:attribute name=”value”>
<xsl:value-of select=”$uwmad-handle”/>
</xsl:attribute>
</input>
<i18n:text>All of MINDS@UW-Madison</i18n:text>
</label>
<br/>
<label>
<input id=”ds-search-form-scope-container” type=”radio” name=”scope”>
<xsl:attribute name=”value”>
<xsl:value-of
select=”substring-after(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='focus'][@qualifier='container'],’:')”
/>
</xsl:attribute>
</input>
<xsl:choose>
<xsl:when
test=”/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']”
>This Collection</xsl:when>
<xsl:when
test=”/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']”
>This Community</xsl:when>
</xsl:choose>
</label>
</xsl:otherwise>
</xsl:choose>
As best I can tell, this works quietly and without fuss. Best kind of hack!



