Changes between Version 1 and Version 2 of extractSubtemplates


Ignore:
Timestamp:
May 3, 2012, 1:55:24 AM (12 years ago)
Author:
simonp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • extractSubtemplates

    v1 v2  
    3131This extract subtemplates function works as follows:
    3232
    33  * Identify fragments of metadata that they would like to manage as reusable subtemplates. This can be done using an XPath. eg. the XPath /grg:RE_Register/grg:containedItem/gnreg:RE_RegisterItem identifies register items in an ISO19135 register record such as that describing the ANZLIC Geographic Extent Names vocabulary.
     33 * Identify fragments of metadata that they would like to manage as reusable subtemplates. This can be done using an XPath. eg. the XPath /grg:RE_Register/grg:containedItem/gnreg:RE_RegisterItem identifies register items in an ISO19135 register record such as that describing the ANZLIC Geographic Extent Names vocabulary and shown in the following example:
     34
     35{{{
     36<grg:containedItem>
     37      <gnreg:RE_RegisterItem gco:isoType="grg:RE_RegisterItem" uuid="da078149-ba39-4cb9-817d-7229e479243b">
     38         <grg:itemIdentifier>
     39            <gco:Integer>59</gco:Integer>
     40         </grg:itemIdentifier>
     41         <grg:name>
     42            <gco:CharacterString>AUSTRALIA EXCLUDING EXTERNAL TERRITORIES</gco:CharacterString>
     43         </grg:name>
     44         <grg:status>
     45            <grg:RE_ItemStatus>valid</grg:RE_ItemStatus>
     46         </grg:status>
     47         <grg:dateAccepted>
     48            <gco:Date>2006-10-10</gco:Date>
     49         </grg:dateAccepted>
     50         <grg:definition>
     51            <gco:CharacterString>AUSTRALIA EXCLUDING EXTERNAL TERRITORIES|-9|-44|154|112|Australia</gco:CharacterString>
     52         </grg:definition>
     53         .......
     54         <gnreg:itemExtent>
     55            <gmd:EX_Extent>
     56               <gmd:geographicElement>
     57                  <gmd:EX_GeographicBoundingBox>
     58                     <gmd:westBoundLongitude>
     59                        <gco:Decimal>112</gco:Decimal>
     60                     </gmd:westBoundLongitude>
     61                     <gmd:eastBoundLongitude>
     62                        <gco:Decimal>154</gco:Decimal>
     63                     </gmd:eastBoundLongitude>
     64                     <gmd:southBoundLatitude>
     65                        <gco:Decimal>-44</gco:Decimal>
     66                     </gmd:southBoundLatitude>
     67                     <gmd:northBoundLatitude>
     68                        <gco:Decimal>-9</gco:Decimal>
     69                     </gmd:northBoundLatitude>
     70                  </gmd:EX_GeographicBoundingBox>
     71               </gmd:geographicElement>
     72            </gmd:EX_Extent>
     73         </gnreg:itemExtent>
     74         <gnreg:itemIdentifier>
     75            <gco:CharacterString>http://www.ga.gov.au/anzmeta/gen/AUS</gco:CharacterString>
     76         </gnreg:itemIdentifier>
     77      </gnreg:RE_RegisterItem>
     78   </grg:containedItem>
     79}}}
     80
    3481 * Identify a field or fields within the fragment that will be used as the title of the subtemplate. It is important to choose a set of fields that will allow a human to identify the subtemplate when they choose to either reuse the subtemplate in a new record or edit in the subtemplate directories interface.
    3582 * Write a small XSLT that when applied to the subtemplate, will extract the title information. As an example, here is an XSLT that when applied to an ISO19135 register item (gnreg:RE_RegisterItem), will extract the name of the register item (grg:name/gco:CharacterString) for use as the title of the subtemplate.
     
    4592
    4693  <xsl:template match="gnreg:RE_RegisterItem">
    47     <title><xsl:value-of select="@uuid"/></title>
     94    <title><xsl:value-of select="grg:name/gco:CharacterString"/></title>
    4895  </xsl:template>
    4996
     
    54101 * Choose 'Extract templates' from the 'Actions on selected set' drop down menu at the top right of the search interface.
    55102 * Enter the XPath of the fragment, server side path name of the XSLT to extract a title for the subtemplate to be created from the fragment and a category to which the created subtemplates will be assigned. See the following example:
     103
    56104 * Run the command and check the logs to see whether your XPath and title extraction XSLT are doing what you expect.
    57105 * Check the checkbox alongside the 'Yes, I really want to do this' when you're sure that everything is ok. The end result will be that the fragments of metadata specified by the XPath will be removed from the records in the selected set and saved as subtemplates and then linked into the records that use them. Here is what part of the register record example used here looks like with an XLink replacing the original gnreg:RE_RegisterItem:
    58106
    59 {{
    60 }}
     107{{{
     108   <grg:containedItem>
     109      <gnreg:RE_RegisterItem gco:isoType="grg:RE_RegisterItem" xlink:href="http://localhost:8080/geonetwork/src/eng/?da078149-ba39-4cb9-817d-7229e479243b">
     110   </grg:containedItem>
     111}}}
    61112   
    62113 * Check the subtemplates created in the Administration->Directories function.
     
    64115=== Backwards Compatibility Issues ===
    65116
    66 === New libraries added ===
    67 Explain which and why new libraries are required for that proposal ...
     117None?
    68118
    69119== Risks ==
    70120
     121Need more functions to manage the links between records and subtemplates.
     122
    71123== Participants ==
    72  * List of participants and role (if necessary) in current GIP
     124 * Simon Pigot