helix84,

Your previous discoveries are correct. The Resource Policies don't 
appear in the default METS output alongside DRI.

As Resource Policies appear in a separate table (resource_policy) in the 
DSpace database, they aren't described in the DIM metadata.

Currently the METS generated by the XMLUI only really includes the DIM 
metadata and information about bitstreams in the Item. It doesn't 
include any other extra information about the Item (namely resource 
policies as you pointed out).

I don't know of any real reason *why* the METS or the DRI couldn't 
include information about Resource Policies. It probably *should* in fact.

== Now, for a cool way to "hack" this ==

However, there is a way to do this *dynamically* by using the 
METSRightsCrosswalk (This crosswalk is the same one used by the AIP 
Backup & Restore tools to translate Resource Policies to/from the 
METSRights schema: 
https://wiki.duraspace.org/display/DSDOC18/DSpace+AIP+Format#DSpaceAIPFormat-METSRightsSchema)

This is a cool hack I "discovered" when I was at U of Illinois a few 
years ago. I'd forgotten it until now.

In the XMLUI, you can actually enable *ANY* Crosswalk dynamically, by 
adding parameters to the normal METS document request.

For example, here's a normal XMLUI METS document from the demo site:
http://demo.dspace.org/xmlui/metadata/handle/10673/3/mets.xml

Now, if I add a parameter to it, I can enable the METSRightsCrosswalk 
(which is named "METSRIGHTS" in dspace.cfg):

http://demo.dspace.org/xmlui/metadata/handle/10673/3/mets.xml?rightsMDTypes=METSRIGHTS

In English: this is telling the XMLUI to execute the crosswalk named 
"METSRIGHTS" and place the results into the "rightsMD" section of the 
METS document. You'll notice if you visit that page, that now you have a 
new "<mets:rightsMD>" section that displays METSRights information about 
the Resource Policies.  The way the METSRights crosswalk translates the 
Resource Policies is described here:
https://wiki.duraspace.org/display/DSDOC18/DSpace+AIP+Format#DSpaceAIPFormat-METSRightsSchema

Now, for the final trick. To get the XMLUI to *ALWAYS* enable the 
METSRIGHTS schema, you'd need to do one of two things:

[Option #1] Modify the Java code in 
org.dspace.app.xmlui.objectmanager.ItemAdapter (which generates METS for 
Items) to have a default setting for the "amdTypes" variable:

if(amdTypes.size()==0)
    setAmdTypes("rightsMD", "METSRIGHTS");

OR

[Option #2] Alternatively, hack it in your XMLUI Theme by telling 
structural.xsl to always pass that "?rightsMDTypes=METSRIGHTS" parameter 
when it loads the METS file.  To do that, you'd do something like this 
(this is just a sample for the "summaryView" mode, you may also want it 
for the "detailView" mode):

  <xsl:template match="dri:reference" mode="summaryView">
     <xsl:variable name="externalMetadataURL">
         <xsl:text>cocoon:/</xsl:text>
         <xsl:value-of select="@url"/>
         <!-- If this is an Item, display METRights section, so we
              know which files have access restrictions.
              This requires the METSRightsCrosswalk is enabled!-->
         <xsl:if test="@type='DSpace Item'">
             <xsl:text>?rightsMDTypes=METSRIGHTS</xsl:text>
         </xsl:if>
     </xsl:variable>
     <!-- This comment just displays the full URL in an HTML comment, 
for easy reference.-->
     <xsl:comment> External Metadata URL: <xsl:value-of 
select="$externalMetadataURL"/> </xsl:comment>
     <xsl:apply-templates select="document($externalMetadataURL)" 
mode="summaryView"/>
     <xsl:apply-templates />
   </xsl:template>


Hopefully this helps. Also, yes, this probably should all be documented 
somewhere else (if someone gets to it, please, feel free!). This reminds 
me of the previous brief discussion between helix84 and Andrea Schweer 
about possibly creating an XMLUI Cookbook of various hacks/tips/snippets 
that could be useful.

- Tim

On 6/6/2012 6:40 AM, helix84 wrote:
> OK, we currently have item metadata accessible for rendering in XMLUI as
> /metadata/handle/xxx/yyy/mets.xml
> I just found out that it's also available in ORE format:
> /metadata/handle/xxx/yyy/ore.xml
> but this format doesn't store resource policies, either.
> These generators seem to be defined in XMLUI's sitemap.xmap.
>
> What about adding a DIM generator and adding resource policy
> information to DIM? Since DIM is an internal format, we should be able
> to put in whatever we want.
>
> Regards,
> ~~helix84
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to