Revision: 15645
http://exist.svn.sourceforge.net/exist/?rev=15645&view=rev
Author: jenspetersen
Date: 2012-01-06 11:52:46 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
[tamboti] Simplified dialog for choosing mods templates. Removed retrieve-mods.xql from search collection, a consequence of 15642.
Modified Paths:
--------------
apps/tamboti/modules/edit/body/18-location.xml
apps/tamboti/modules/edit/code-tables/document-type-codes.xml
apps/tamboti/modules/edit/edit.css
apps/tamboti/modules/edit/edit.xq
apps/tamboti/modules/edit/get-instance.xq
apps/tamboti/modules/edit/save.xq
Removed Paths:
-------------
apps/tamboti/modules/search/retrieve-mods.xql
Modified: apps/tamboti/modules/edit/body/18-location.xml
===================================================================
--- apps/tamboti/modules/edit/body/18-location.xml 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/body/18-location.xml 2012-01-06 11:52:46 UTC (rev 15645)
@@ -248,96 +248,68 @@
</div>
</span>
</div>
- <!--url repeat begins-->
<xf:repeat nodeset="./mods:url" id="location-url-repeat">
-
- <!--url input begins-->
- <!--DLF/Aquifer: N/A-->
- <!--Cluster: include-->
<xf:group appearance="full" ref=".[@dateLastAccessed]">
<xf:input ref="./@dateLastAccessed" class="text_50">
<xf:label>Date Last Accessed<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='dateLastAccessed']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> This field is intended to express the date that a digital resource has last been accessed remotely. This may be useful to a user trying to access the site because of the volatility of Web content. A structured date of the form "2010-08-12" is recommended. </p>
- </xf:hint>
</xf:input>
</xf:group>
- <!--DLF/Aquifer: RECOMMENDED IF APPLICABLE-->
- <!--Cluster: include-->
<xf:group appearance="full" ref=".[@access]">
<xf:select1 ref="./@access" selection="open">
<xf:label>Access<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='access']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Access indicates the type of resource that the user or aggregator will access when following the URL link. It has the values: preview, raw object, and object in context. The value "preview" indicates a link to a thumbnail or snippet of text. The value "raw object" indicates a direct link to the object described (e.g., a jpg or pdf document). Used only when the object is represented by a single file. The value "object in context" indicates a link to the object within the context of its environment (with associated metadata, navigation, etc.) If at all possible, refer in URL to an object in context, i.e. an object in the context of a web page, with access to metadata and possibilities for navigation. <!--It is particularly useful to provide a flag in the context of OAI service providers harvesting metadata.--></p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='url-access-type-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
</xf:group>
- <!--DLF/Aquifer: REQUIRED-->
- <!--Cluster: include-->
<xf:group appearance="full" ref=".[@usage]">
<xf:select1 ref="./@usage">
<xf:label>Usage<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-usage']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> This field indicates how the object represented by the link will be used. There is only one possible value, "primary display", which indicates that the link is the most appropriate to display for end users. </p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='url-usage-type-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
</xf:group>
- <!--DLF/Aquifer: OPTIONAL-->
- <!--Cluster: omit-->
<xf:group appearance="full" ref=".[@displayLabel]">
<xf:input ref="./@displayLabel" class="text_50">
<xf:label>Display Label<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='displayLabel']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Display Label provides additional text associated with the URL if needed for display purposes. Use Display Label to supply additional explanatory information related to the URL. Include the preferred text and capitalization, but do not include delimiters such as colons. </p>
- </xf:hint>
</xf:input>
</xf:group>
- <!--DLF/Aquifer: OPTIONAL-->
- <!--Cluster: include-->
<xf:group appearance="full" ref=".[@note]">
<xf:textarea ref="./@note" class="textarea" mediatype="dojo">
<xf:label>Note<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-url-note']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Note includes notes that are associated with the link that is included as the value of the URL element. </p>
- </xf:hint>
</xf:textarea>
</xf:group>
<xf:group appearance="full" ref=".">
@@ -351,31 +323,19 @@
</xf:label>
</xf:input>
</xf:group>
- <!--url input ends-->
</xf:repeat>
- <!--url repeat ends-->
</xf:group>
- <!--url ends-->
- <!--location/holdingSimple begins-->
- <!--DLF/Aquifer: N/A-->
- <!--Cluster: hide-->
<xf:group appearance="full" class="fieldset level-2" ref=".[mods:holdingSimple]">
<div class="join">
<span class="legend">Holdings Simple</span>
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> General information about what the institution identified in Physical Location holds of the resource and its specific location within the institution. Holdings information consists of copy-specific information about the resource, information about the specific location within an institution, version information, and other information that is peculiar to the institution. Holding Simple consists of a single subelement, Copy Information which has several subelements. Holding Simple is not repeatable; if additional holdings statements are needed for the resource, repeat Location with appropriate subelements. If more granularity is required, Holding External may be used in lieu of Holding Simple with elements from an external schema. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='holdingSimple']/help"/>
</div>
</span>
</div>
- <!--location/holdingSimple repeat begins-->
- <!-- NB: repeat not used-->
<xf:repeat nodeset="./mods:holdingSimple" id="location-holding-simple-repeat">
- <!--location/holdingSimple input begins-->
- <!--no attributes-->
- <!--location/holdingSimple input ends-->
- <!--location/copyInformation begins-->
<xf:group appearance="full" class="fieldset level-3">
<div class="join">
<span class="legend">Copy Information</span>
@@ -383,7 +343,7 @@
<xf:trigger>
<xf:label>+</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:insert nodeset="mods:copyInformation" at="index('location-copyInformation-repeat')" position="before"/>
+ <xf:insert nodeset="mods:copyInformation" at="index('copyInformation-repeat')" position="before"/>
</xf:action>
</xf:trigger>
</span>
@@ -391,49 +351,38 @@
<xf:trigger>
<xf:label>–</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation" at="index('location-copyInformation-repeat')"/>
+ <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation" at="index('copyInformation-repeat')"/>
</xf:action>
</xf:trigger>
</span>
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Information about a specific tangible instance of a bibliographic resource or set which comprises one or more pieces via indication of sublocation and/or locator. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='copyInformation']/help"/>
</div>
</span>
</div>
- <!--location/copyInformation repeat begins-->
- <xf:repeat nodeset="./mods:copyInformation" id="location-copyInformation-repeat">
- <!--location/copyInformation input begins-->
- <!--no attributes-->
- <!--no input-->
- <!--location/form begins-->
+ <xf:repeat nodeset="./mods:copyInformation" id="copyInformation-repeat">
<xf:group appearance="full" class="fieldset level-4">
<div class="join">
<span class="legend">Form</span>
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Form is a designation of a particular physical presentation of a resource. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-form']/help"/>
</div>
</span>
</div>
- <!--location/form repeat begins-->
- <!-- NB: repeat is not used -->
- <xf:repeat nodeset="./mods:form" id="location-form-repeat">
- <!--location/form input begins-->
+ <xf:repeat nodeset="./mods:form" id="form-repeat">
<xf:group appearance="full" ref=".[@authority]">
<xf:select1 ref="./@authority">
<xf:label>Authority<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='authority']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> The name of the authoritative list for a controlled value is recorded here. </p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='genre-authority-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
@@ -445,13 +394,10 @@
<xf:label>Form<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-form']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Form is a designation of a particular physical presentation of a resource. This is equivalent to Form under Physical Description. Form may be included under Copy Information when the record refers to multiple forms and there is different detailed holdings information associated with each form. Otherwise, use Form under Physical Description. Here </p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='genre-marcgt-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
@@ -463,50 +409,35 @@
<xf:label>Form<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-form']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Form is a designation of a particular physical presentation of a resource. This is equivalent to Form under Physical Description. Form may be included under Copy Information when the record refers to multiple forms and there is different detailed holdings information associated with each form. Otherwise, use Form under Physical Description. </p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='genre-marcsmd-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
</xf:group>
- <!--NB: make other code tables-->
+ <!--NB: make other code tables-->
<xf:group appearance="full" ref=".[not(@authority='marcgt') and not(@authority='marcsmd')]">
<xf:select1 ref="." selection="open">
<xf:label>Form<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-form']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Form is a designation of a particular physical presentation of a resource. This is equivalent to Form under Physical Description. Form may be included under Copy Information when the record refers to multiple forms and there is different detailed holdings information associated with each form. Otherwise, use Form under Physical Description. </p>
- </xf:hint>
<xf:itemset nodeset="instance('code-tables')/code-table[code-table-name='genre-marcgt-code']/items/item">
<xf:label ref="label"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
</xf:group>
- <!--location/form input ends-->
- <!--location/form delete begins-->
- <!-- <xf:trigger ref=".[count(../mods:form) > 1]" class="delete-button"> <xf:label class="xforms-group-label-centered">Delete This Form</xf:label> <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:name/mods:form" at="index('location-form-repeat')"/> </xf:trigger> -->
- <!--location/form delete ends-->
</xf:repeat>
- <!--location/form repeat ends-->
- <!--location/form add begins-->
- <!-- <xf:trigger ref=".[count(mods:form) > 0]" class="add-button"> <xf:label>Add Form</xf:label> <xf:action ev:event="DOMActivate"> <xf:insert nodeset="mods:form" at="index('location-form-repeat')" position="before" origin="instance('insert-templates')/mods:form"/> <xf:setvalue ref="instance('save-data')/mods:form[last()]" value="''"/> </xf:action> </xf:trigger> -->
- <!--location/form add ends-->
+ <!-- <xf:trigger ref=".[count(mods:form) > 0]" class="add-button"> <xf:label>Add Form</xf:label> <xf:action ev:event="DOMActivate"> <xf:insert nodeset="mods:form" at="index('form-repeat')" position="before" origin="instance('insert-templates')/mods:form"/> <xf:setvalue ref="instance('save-data')/mods:form[last()]" value="''"/> </xf:action> </xf:trigger> -->
</xf:group>
- <!--location/form ends-->
- <!--location/sublocation begins-->
<xf:group appearance="full" class="fieldset level-4">
<div class="join">
<span class="legend">Sublocation</span>
@@ -514,7 +445,7 @@
<xf:trigger>
<xf:label>+</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:insert nodeset="mods:sublocation" at="index('location-sublocation-repeat')" position="before"/>
+ <xf:insert nodeset="mods:sublocation" at="index('sublocation-repeat')" position="before"/>
</xf:action>
</xf:trigger>
</span>
@@ -522,40 +453,31 @@
<xf:trigger>
<xf:label>–</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation/mods:sublocation" at="index('location-sublocation-repeat')"/>
+ <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation/mods:sublocation" at="index('sublocation-repeat')"/>
</xf:action>
</xf:trigger>
</span>
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Department, division or section of an institution holding a copy of the resource. Sublocation may be repeated for multiple equivalent items in different sublocations within the institution named in Physical Location. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='sublocation']/help"/>
</div>
</span>
</div>
- <!--location/sublocation repeat begins-->
- <xf:repeat nodeset="./mods:sublocation " id="location-sublocation-repeat">
- <!--location/sublocation input begins-->
+ <xf:repeat nodeset="./mods:sublocation " id="sublocation-repeat">
<xf:group appearance="full" ref=".">
<xf:input ref="." class="text_50">
<xf:label>Sublocation<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='sublocation']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Department, division or section of an institution holding a copy of the resource. </p>
- </xf:hint>
</xf:input>
</xf:group>
- <!--location/sublocation input ends-->
</xf:repeat>
- <!--location/sublocation repeat ends-->
</xf:group>
- <!--location/sublocation ends-->
- <!--location/shelfLocator begins-->
<xf:group appearance="full" class="fieldset level-4">
<div class="join">
<span class="legend">Shelf Locator</span>
@@ -563,7 +485,7 @@
<xf:trigger>
<xf:label>+</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:insert nodeset="mods:sublocation" at="index('location-sublocation-repeat')" position="before"/>
+ <xf:insert nodeset="mods:sublocation" at="index('sublocation-repeat')" position="before"/>
</xf:action>
</xf:trigger>
</span>
@@ -571,40 +493,31 @@
<xf:trigger>
<xf:label>–</xf:label>
<xf:action ev:event="DOMActivate">
- <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation/mods:sublocation" at="index('location-sublocation-repeat')"/>
+ <xf:delete ev:event="DOMActivate" nodeset="instance('save-data')/mods:location/mods:holdingSimple/mods:copyInformation/mods:sublocation" at="index('sublocation-repeat')"/>
</xf:action>
</xf:trigger>
</span>
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Shelfmark or other shelving designation that indicates the location identifier for a copy. Shelf Locator may be given at the bibliographic description level under Location (i.e. Shelf Locator of the entire resource) or at the item level under Holding Simple (when Shelf Locator may vary by each physical piece). </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='shelfLocator']/help"/>
</div>
</span>
</div>
- <!--location/shelfLocator repeat begins-->
<xf:repeat nodeset="./mods:shelfLocator " id="location-shelfLocator-repeat">
- <!--location/shelfLocator input begins-->
<xf:group appearance="full" ref=".">
<xf:input ref="." class="text_50">
<xf:label>Shelf Locator<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='shelfLocator']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Shelfmark or other shelving designation that indicates the location identifier for a copy. </p>
- </xf:hint>
</xf:input>
</xf:group>
- <!--location/shelfLocator input ends-->
</xf:repeat>
- <!--location/shelfLocator repeat ends-->
</xf:group>
- <!--location/shelfLocator ends-->
- <!--location/electronicLocator begins-->
<xf:group appearance="full" class="fieldset level-4">
<div class="join">
<span class="legend">Electronic Locator</span>
@@ -627,33 +540,24 @@
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Uniform Resource Location (URL) of the resource. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='electronicLocator']/help"/>
</div>
</span>
</div>
- <!--location/electronicLocator repeat begins-->
<xf:repeat nodeset="./mods:electronicLocator " id="location-electronicLocator-repeat">
- <!--location/electronicLocator input begins-->
<xf:group appearance="full" ref=".">
<xf:input ref="." class="text_50">
<xf:label>Electronic Locator<span class="xforms-help">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-help-value">
- <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='template']/help"/>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='electronicLocator']/help"/>
</div>
</span>
</xf:label>
- <xf:hint>
- <p> Uniform Resource Location (URL) of the resource. </p>
- </xf:hint>
</xf:input>
</xf:group>
- <!--location/electronicLocator input ends-->
</xf:repeat>
- <!--location/electronicLocator repeat ends-->
</xf:group>
- <!--location/electronicLocator ends-->
- <!--location/note begins-->
<xf:group appearance="full" class="fieldset level-4">
<div class="join">
<span class="legend">Note</span>
@@ -676,7 +580,7 @@
<span class="xforms-hint">
<span onmouseover="show(this, 'hint', true)" onmouseout="show(this, 'hint', false)" class="xforms-hint-icon"/>
<div class="xforms-hint-value">
- <p> Note relating to a specific copy of a document. Use for notes relating to the specific copy information of a resource that do not fit in one of the other available subelements. A link may be supplied in lieu of or in addition to the content. Each note should be entered in a separate Note. </p>
+ <xf:output mediatype="application/xhtml+xml" incremental="true" ref="instance('code-tables')/code-table[code-table-name='hint-code']/items/item[value='location-note']/help"/>
</div>
</span>
</div>
Modified: apps/tamboti/modules/edit/code-tables/document-type-codes.xml
===================================================================
--- apps/tamboti/modules/edit/code-tables/document-type-codes.xml 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/code-tables/document-type-codes.xml 2012-01-06 11:52:46 UTC (rev 15645)
@@ -8,31 +8,19 @@
</item>
<item>
<label>Periodical</label>
- <value>periodical-latin</value>
+ <value>periodical</value>
<classifier>stand-alone</classifier>
<sort>1</sort>
</item>
<item>
- <label>Periodical With Transliteration</label>
- <value>periodical-transliterated</value>
- <classifier>stand-alone</classifier>
- <sort>1</sort>
- </item>
- <item>
<label>Edited Volume</label>
- <value>edited-volume-latin</value>
+ <value>edited-volume</value>
<classifier>stand-alone</classifier>
<sort>1</sort>
</item>
<item>
- <label>Edited Volume with Transliteration</label>
- <value>edited-volume-transliterated</value>
- <classifier>stand-alone</classifier>
- <sort>1</sort>
- </item>
- <item>
<label>Article in Periodical</label>
- <value>article-in-periodical-latin</value>
+ <value>article-in-periodical</value>
<classifier>stand-alone</classifier>
<sort>1</sort>
<hint>
@@ -57,34 +45,6 @@
</hint>
</item>
<item>
- <label>Article in Periodical with Transliteration</label>
- <value>article-in-periodical-transliterated</value>
- <classifier>stand-alone</classifier>
- <hint>
- <p>For an <strong>Article in Periodical</strong>, on the <strong>Publication</strong> tab, one would normally input the following
- information:</p>
- <p>Input the name(s) of the author(s) in <strong>Names and Roles</strong>, selecting "author" as Role. Divide the name into Given Name and
- Family Name, if possible.</p>
- <p>Transliterate the name(s), if necessary.</p>
- <p>Input the title of the article in <strong>Title Information</strong>, dividing this into Title and Subtitle, if possible. If the title begins
- with an article like "A" or "The," remove this from the title and input it in Non Sort.</p>
- <p>Transliterate and translate the title, if necessary.</p>
- <p>In case the publication is (also) electronic, input in <strong>URL</strong> the web address of the publication.</p>
- <p>Finally, in <strong>Identifier</strong> input the DOI number of the article, if available.</p>
- <p> </p>
- <p>Use the <strong>Container</strong> tab to catalogue the periodical that the article occurs and the position of the article inside the
- periodical.</p>
- <p>Input the title of the periodical in <strong>Periodical Title</strong>. Follow the same guidelines that apply to monograph titles.</p>
- <p>Input the name(s) of the editor(s) of the periodical in <strong>Names and Roles</strong>. Choose "personal," "corporate" or "conference" as
- Type of Name as applies to the periodical in question. If the "editor" is personal, select "Given Name" and "Family Name" instead of "(none
- selected)."</p>
- <p>In <strong>Location of Article in Periodical</strong> note the volume number, issue number and year of publication of the periodical in which
- the article has appeared. Enter the page numbers of the article in the volume and/or issue it occurs in.</p>
- <p>Finally, in <strong>Identifier</strong> input the ISSN number of the periodical and its DOI, if available.</p>
- </hint>
- <sort>1</sort>
- </item>
- <item>
<label>Article in Periodical</label>
<value>related-article-in-periodical</value>
<classifier>related-item</classifier>
@@ -98,31 +58,19 @@
</item>
<item>
<label>Contribution to Edited Volume</label>
- <value>related-contribution-to-edited-volume-latin</value>
+ <value>related-contribution-to-edited-volume</value>
<classifier>related-item</classifier>
<sort>1</sort>
</item>
<item>
- <label>Contribution to Edited Volume With Transliteration</label>
- <value>related-contribution-to-edited-volume-transliterated</value>
- <classifier>related-item</classifier>
- <sort>1</sort>
- </item>
- <item>
<label>Contribution to Edited Volume</label>
- <value>contribution-to-edited-volume-latin</value>
+ <value>contribution-to-edited-volume</value>
<classifier>stand-alone</classifier>
<sort>1</sort>
</item>
<item>
- <label>Contribution to Edited Volume with Transliteration</label>
- <value>contribution-to-edited-volume-transliterated</value>
- <classifier>stand-alone</classifier>
- <sort>1</sort>
- </item>
- <item>
<label>Monograph</label>
- <value>monograph-latin</value>
+ <value>monograph</value>
<classifier>stand-alone</classifier>
<hint>
<p>For a <strong>Monograph</strong>, on the <strong>Monograph</strong> tab, one would normally input the following information:</p>
@@ -148,45 +96,12 @@
<sort>1</sort>
</item>
<item>
- <label>Monograph with Transliteration</label>
- <value>monograph-transliterated</value>
- <classifier>stand-alone</classifier>
- <hint>
- <p>For a <strong>Monograph</strong>, on the <strong>Monograph</strong> tab, one would normally input the following information:</p>
- <p>Input the name(s) of the author(s) in <strong>Names and Roles</strong>, selecting "author" as Role. Divide the name into Given Name and
- Family Name, if possible.</p>
- <p>If there is more than one author, repeat the <strong>Names and Roles</strong> fields by clicking the '+' button.</p>
- <p>Input the title of the monograph in <strong>Title Information</strong>, dividing this into Title and Subtitle, if possible. If the title
- begins with an article like the English "A" or "The", remove this from the title and input it in Non Sort.</p>
- <p>In <strong>Origin Information</strong>, input the city in which the publisher resides and the name of the publisher. If more than one of
- these is in evidence, input the main one or the first of them. Finally, input the year the monograph was issued or copyrighted. </p>
- <p>In <strong>Physical Description</strong>, input the extent of the monograph in pages, e.g. "ix, 214 p."</p>
- <p>In case the monograph is (also) electronic, input in <strong>URL</strong> the web address of the monograph.</p>
- <p>Finally, in <strong>Identifier</strong> input the ISBN number of the monograph, preferably a 13-digit ISBN, and a DOI, if available.</p>
- <p> </p>
- <p>Use the <strong>Monograph Series</strong> tab only if the monograph is part of a series.</p>
- <p>Input the title of the series in <strong>Series Title</strong>. Follow the same guidelines that apply to monograph titles.</p>
- <p>Input the name(s) of the editor(s) of the series in <strong>Names and Roles</strong>. Choose "personal," "corporate" or "conference" as Type
- of Name as applies to the monograph in question. If the "editor" is not personal, select "(none selected)" instead of "Given Name" and
- "Family Name."</p>
- <p>In <strong>Location of Monograph in Series</strong> note the volume number of the monograph within the series.</p>
- <p>In <strong>Identifier</strong> input the ISSN number of the monograph series and a DOI, if available.</p>
- </hint>
- <sort>1</sort>
- </item>
- <item>
<label>Book Review</label>
- <value>book-review-latin</value>
+ <value>book-review</value>
<classifier>stand-alone</classifier>
<sort>1</sort>
</item>
<item>
- <label>Book Review with Transliteration</label>
- <value>book-review-transliterated</value>
- <classifier>stand-alone</classifier>
- <sort>1</sort>
- </item>
- <item>
<label>SUEBS Tibetan</label>
<value>suebs-tibetan</value>
<classifier>stand-alone</classifier>
@@ -205,11 +120,11 @@
<classifier>stand-alone</classifier>
<sort>2</sort>
</item>
- <item>
+ <!--<item>
<label>MADS record</label>
<value>mads</value>
<classifier>stand-alone</classifier>
<sort>3</sort>
- </item>
+ </item>-->
</items>
</code-table>
\ No newline at end of file
Modified: apps/tamboti/modules/edit/edit.css
===================================================================
--- apps/tamboti/modules/edit/edit.css 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/edit.css 2012-01-06 11:52:46 UTC (rev 15645)
@@ -534,7 +534,7 @@
}
div.xforms-help-value p,
-div.xforms-hint-value p
+div.xforms-help-value li
{
margin-bottom:.5em;
font-weight:normal;
Modified: apps/tamboti/modules/edit/edit.xq
===================================================================
--- apps/tamboti/modules/edit/edit.xq 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/edit.xq 2012-01-06 11:52:46 UTC (rev 15645)
@@ -18,37 +18,35 @@
declare namespace e="http://www.asia-europe.uni-heidelberg.de/";
declare namespace mads="http://www.loc.gov/mads/";
-declare function local:get-target-collection($target-collection as xs:string) as xs:string {
- let $target-collection := uu:escape-collection-path(request:get-parameter("collection", ""))
- return $target-collection};
-
declare function local:create-new-record($id as xs:string, $type-request as xs:string, $target-collection as xs:string) as empty() {
- (: Copy the template into data and store it with the ID as file name. :)
- let $log := util:log("DEBUG", ("##$id-edit1): ", $id))
- let $log := util:log("DEBUG", ("##$target-collection1): ", $target-collection))
- let $template-doc := doc(concat($config:edit-app-root, '/instances/', $type-request, '.xml')),
- (: Store it in the right location :)
- (:$log := util:log("DEBUG", ("##$type-request): ", $type-request)),:)
- $stored := xmldb:store($config:mods-temp-collection, concat($id, '.xml'), $template-doc),
-
- (: TEMP whilst eXist-db permissions remain rwu, once they are rwx - this can be changed to rw :)
- $null := sm:chmod(xs:anyURI($stored), "rwu------"),
-
- (: Get the remaining parameters. :)
- (: Parameter 'host' is used when related records are created. :)
- $host := request:get-parameter('host', ""),
- $languageOfResource := request:get-parameter("languageOfResource", ""),
- $scriptOfResource := request:get-parameter("scriptOfResource", ""),
- $transliterationOfResource := request:get-parameter("transliterationOfResource", ""),
- $languageOfCataloging := request:get-parameter("languageOfCataloging", ""),
- $scriptOfCataloging := request:get-parameter("scriptOfCataloging", ""),
- (: Determine if script is Latin or not. :)
- (:$scriptTypeOfResource := doc(concat($config:edit-app-root, "/code-tables/language-3-type-codes.xml"))/code-table/items/item[value = $languageOfResource]/data(scriptClassifier),:)
- (:$scriptTypeOfCataloging := doc(concat($config:edit-app-root, "/code-tables/language-3-type-codes.xml"))/code-table/items/item[value = $languageOfCataloging]/data(scriptClassifier),:)
-
- $doc := doc($stored)
-
- (: Note that we can not use "update replace" if we want to keep the default namespace. :)
+ (: Copy the template into data and store it with the ID as file name. :)
+ (:let $log := util:log("DEBUG", ("##$id-edit1): ", $id)):)
+ (:let $log := util:log("DEBUG", ("##$target-collection1): ", $target-collection)):)
+ let $transliterationOfResource := request:get-parameter("transliterationOfResource", "")
+ let $type-request :=
+ if ($type-request = ('related-article-in-periodical', 'related-book-chapter','suebs-tibetan', 'insert-templates', 'new-instance', 'mads'))
+ (: These document types do not (yet) divide into latin and transliterated. :)
+ then $type-request
+ else
+ if ($transliterationOfResource)
+ then concat($type-request, '-transliterated')
+ else concat($type-request, '-latin')
+ let $template-doc := doc(concat($config:edit-app-root, '/instances/', $type-request, '.xml'))
+ (: Store it in the right location :)
+ let $stored := xmldb:store($config:mods-temp-collection, concat($id, '.xml'), $template-doc)
+ (: NB: TEMP whilst eXist-db permissions remain rwu, once they are rwx - this can be changed to rw :)
+ let $null := sm:chmod(xs:anyURI($stored), "rwu------")
+
+ (: Get the remaining parameters. :)
+ (: Parameter 'host' is used when related records are created. :)
+ let $host := request:get-parameter('host', "")
+ let $scriptOfResource := request:get-parameter("scriptOfResource", "")
+ let $languageOfResource := request:get-parameter("languageOfResource", "")
+ let $languageOfCataloging := request:get-parameter("languageOfCataloging", "")
+ let $scriptOfCataloging := request:get-parameter("scriptOfCataloging", "")
+ let $doc := doc($stored)
+
+ (: Note that we cannot use "update replace" if we want to keep the default namespace. :)
return (
(: Update record with ID attribute. :)
@@ -68,7 +66,7 @@
return
update insert $language-insert into $doc/mods:mods
,
- (: Save creation date and language and script of cataloguing :)
+ (: Save library reference, creation date, and language and script of cataloguing :)
let $recordInfo-insert:=
<mods:recordInfo lang="eng" script="latn">
<mods:recordContentSource authority="marcorg">DE-16-158</mods:recordContentSource>
@@ -88,7 +86,7 @@
return
update insert $recordInfo-insert into $doc/mods:mods
,
- (: Save name of user collection, name of template used, script type and transliteration scheme used into mods:extension. :)
+ (: Save name of user collection, name of template used, and transliteration scheme used into mods:extension. :)
(: NB: it should not be necessary to save $target-collection in the document, to be picked up in save.xq and then removed! :)
update insert
<extension xmlns="http://www.loc.gov/mods/v3" xmlns:e="http://www.asia-europe.uni-heidelberg.de/">
@@ -111,8 +109,8 @@
declare function local:create-xf-model($id as xs:string, $tab-id as xs:string, $instance-id as xs:string) as element(xf:model) {
let $instance-src := concat('get-instance.xq?tab-id=', $tab-id, '&id=', $id, '&data=', $config:mods-temp-collection)
- let $log := util:log("DEBUG", ("##-$tab-id): ", $tab-id))
- let $log := util:log("DEBUG", ("##$id-edit2): ", $id))
+ (:let $log := util:log("DEBUG", ("##-$tab-id): ", $tab-id)):)
+ (:let $log := util:log("DEBUG", ("##$id-edit2): ", $id)):)
return
<xf:model>
@@ -122,7 +120,7 @@
the full 3.4 schema is reflected in full-3.4-instance.xml. :)
<xf:instance xmlns="http://www.loc.gov/mods/v3" src="instances/insert-templates.xml" id='insert-templates' readonly="true"/>
- (: A selection of elements and attributes from the MODS schema used for default records. :)
+ (: A fairly full selection of elements and attributes from the MODS schema used for default records. :)
<xf:instance xmlns="http://www.loc.gov/mods/v3" src="instances/new-instance.xml" id='new-instance' readonly="true"/>
(: A selection of elements and attributes from the MADS schema used for default records. :)
@@ -159,8 +157,8 @@
};
declare function local:create-page-content($id as xs:string, $tab-id as xs:string, $type-request as xs:string, $target-collection as xs:string, $instance-id as xs:string, $record-data as xs:string, $type-data as xs:string) as element(div) {
-let $log := util:log("DEBUG", ("##$id-edit3): ", $id))
-let $log := util:log("DEBUG", ("##$target-collection2): ", $target-collection))
+(:let $log := util:log("DEBUG", ("##$id-edit3): ", $id)):)
+(:let $log := util:log("DEBUG", ("##$target-collection2): ", $target-collection)):)
(: Get the part of the form that belongs to the tab called. :)
let $form-body := collection(concat($config:edit-app-root, '/body'))/div[@tab-id = $instance-id],
(: Get the relevant information to display on the top line, starting with "Editing record". :)
@@ -307,12 +305,12 @@
(: If a document type is specified, then we will need to use that instance as the template. :)
let $record-id := request:get-parameter('id', '')
-let $record-data := concat($config:mods-temp-collection, "/", $record-id,'.xml')
+let $temp-record-path := concat($config:mods-temp-collection, "/", $record-id,'.xml')
(: If the record has been made with Tamoboti, it will have a template.
If the record is being opened from the search interface, the template name has to be retrieved in order to serve the right subform. :)
(: NB: $stored-template has no value when a stored record is loaded for the first time. :)
-let $stored-template := doc($record-data)/mods:mods/mods:extension/e:template
+let $stored-template := doc($temp-record-path)/mods:mods/mods:extension/e:template
(: Get the type parameter which shows which record template has been chosen.:)
let $type-request := request:get-parameter('type', $stored-template)
(: If there is no type parameter, use the stored template instead. :)
@@ -327,7 +325,7 @@
if type-sort is 3, it is a mads record and the MADS forms should be shown;
otherwise it is an unspecified instance and Title Information should be shown. :)
let $type-sort := doc($type-data)/code-table/items/item[value = $type-request]/sort
-let $log := util:log("DEBUG", ("##$type-sort): ", $type-sort))
+(:let $log := util:log("DEBUG", ("##$type-sort): ", $type-sort)):)
(: Get the default tab-id. If no tab is specified, default to the compact-a tab in the case of a template to be used with Basic Input Forms;
otherwise default to Title Information. :)
let $default-tab-id :=
@@ -341,7 +339,7 @@
let $tab-id := request:get-parameter('tab-id', $default-tab-id)
let $target-collection := uu:escape-collection-path(request:get-parameter("collection", ""))
-let $log := util:log("DEBUG", ("##$target-collection3): ", $target-collection))
+(:let $log := util:log("DEBUG", ("##$target-collection3): ", $target-collection)):)
(: Get id parameter. Default to "new" if empty. :)
let $id-param := request:get-parameter('id', 'new')
@@ -355,7 +353,8 @@
else $id-param
(: If we are creating a new record, then we need to call get-instance.xq with new=true to tell it to get the entire template;
-if not, we copy the record from the target collection to temp. :)
+if we are editing an existing record, we copy the record from the target collection to temp, unless there is already a record in temp. :)
+(: What if A edits a certain record, leaving it is temp, and B edits the same record - does B then start off where A left off? :)
let $create-new-from-template :=
if ($new-record)
then local:create-new-record($id, $type-request, $target-collection)
@@ -367,11 +366,11 @@
(: For a compact-b form, determine which subform to serve, based on the template. :)
let $instance-id := local:get-instance-id($tab-id, $type-request)
-(: $style appears to be introduced in order to use the xf namespace in css. :)
+(: NB: $style appears to be introduced in order to use the xf namespace in css. :)
let $style := <style type="text/css"><![CDATA[@namespace xf url(http://www.w3.org/2002/xforms);]]></style>
let $model := local:create-xf-model($id, $tab-id, $instance-id)
-let $content := local:create-page-content($id, $tab-id, $type-request, $target-collection, $instance-id, $record-data, $type-data)
-let $log := util:log("DEBUG", ("##$target-collection4): ", $target-collection))
+let $content := local:create-page-content($id, $tab-id, $type-request, $target-collection, $instance-id, $temp-record-path, $type-data)
+(:let $log := util:log("DEBUG", ("##$target-collection4): ", $target-collection)):)
return
style:assemble-form('', attribute {'mods:dummy'} {'dummy'}, $style, $model, $content, false())
Modified: apps/tamboti/modules/edit/get-instance.xq
===================================================================
--- apps/tamboti/modules/edit/get-instance.xq 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/get-instance.xq 2012-01-06 11:52:46 UTC (rev 15645)
@@ -32,7 +32,7 @@
(: now get the eval string ready for use :)
let $eval-string := concat('$instance/', '(', $path-string, ')')
-let $log := util:log("DEBUG", ("##$eval-string): ", $eval-string))
+(:let $log := util:log("DEBUG", ("##$eval-string): ", $eval-string)):)
return
if ($tab-id eq 'mads')
then
Modified: apps/tamboti/modules/edit/save.xq
===================================================================
--- apps/tamboti/modules/edit/save.xq 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/edit/save.xq 2012-01-06 11:52:46 UTC (rev 15645)
@@ -35,12 +35,13 @@
};
declare function xf:do-updates($item, $doc) {
- (: This checks to see if we have a titleInfo in the saved document.
+ (: This first checks to see if we have a titleInfo in the saved document.
If we do then it first deletes the titleInfo in the saved document.
- Next it goes through each titleInfo in the incoming record and inserts it in the saved document.
- If name (the "next" element in the canonical order) occurs in the saved document, the titleInfo is inserted before name, maintaining order in the document.
- (: The canonical order is: titleInfo, name, originInfo, part, physicalDescription, targetAudience, typeOfResource, genre, subject, classification, abstract, tableOfContents, note, relatedItem, identifier, location, accessCondition, language, recordInfo, extension. :)
- If name does not occur, titleInfo is inserted at the end of the saved document.:)
+ Then it goes through each titleInfo in the incoming record and inserts it in the saved document.
+ If name (the "next" element in the canonical order) occurs in the saved document, titleInfo is inserted before name, maintaining order.
+ If name does not occur, titleInfo is inserted at the default position, i.e. at the end of the saved document.
+ The canonical order is: titleInfo, name, originInfo, part, physicalDescription, targetAudience, typeOfResource, genre, subject, classification, abstract, tableOfContents, note, relatedItem, identifier, location, accessCondition, language, recordInfo, extension.
+ This is then repeated for the remaining elements in the canonical order.:)
if ($item/mods:titleInfo)
then
@@ -279,73 +280,77 @@
else ()
};
-(: looks for a collection containing a record with the uuid in users collection and commons collection. :)
+(: Look for the collection containing the record with the uuid in the users collection and in the commons collection.
+This means that the record temporarily in the temp collection is not found. :)
declare function save:find-live-collection-containing-uuid($uuid as xs:string) as xs:string? {
- let $live-record := fn:collection($config:users-collection, $config:mods-commons)/mods:mods[@ID = $uuid]
+ let $live-record := collection($config:users-collection, $config:mods-commons)/mods:mods[@ID = $uuid]
return
- if (fn:not(fn:empty($live-record)))
- then fn:replace(fn:document-uri(fn:root($live-record)), "(.*)/.*", "$1")
+ if (not(empty($live-record)))
+ then replace(document-uri(root($live-record)), "(.*)/.*", "$1")
else ()
};
-(: NB: Why must this information be created in edit.xq, only to be destroyed here, after being read below, at let $target-collection? The value of $target-collection in edit.xq is correctlt set. :)
+(: NB: Why must this information be created in edit.xq, only to be removed here, after being read below at let $target-collection?
+The value of $target-collection in edit.xq is correctly set. :)
declare function save:remove-new-docs-target-collection($resource-path as xs:string) {
update delete doc($resource-path)//e:collection
};
-(: this is where the form "POSTS" documents to this XQuery using the POST method of a submission :)
+(: This is where the form "POSTS" documents to this XQuery using the POST method of a submission :)
let $item := clean:clean-namespaces(request:get-data()/element())
(: This service takes an incoming POST and saves the appropriate records :)
(: Note that the incoming @ID is required :)
-(: Why does this return the temp collection, when the URL contains the target collection as "collection"? :)
+(: NB: Why does this return the temp collection, when the URL contains the target collection as "collection"? :)
let $collection := request:get-parameter('collection', ())
let $action := request:get-parameter('action', 'save')
-(: check to see if we have an indentifier in the incoming post :)
let $incoming-id := $item/@ID
-(: if we do not have an ID then throw an error :)
+(: If we do not have an ID, then throw an error :)
return
- if ( string-length($incoming-id) = 0 )
+ if (string-length($incoming-id) eq 0)
then
<error>
<message class="warning">ERROR! Attempted to save a record with no ID specified.</message>
</error>
else
- (: else we are doing an update to an existing file with an ID :)
+ (: otherwise, we are doing an update to an existing file with an ID (unless the action is cancel). :)
let $file-to-update := concat($incoming-id, '.xml')
+ (: This always resolves to /db/resources/temp/ :)
let $file-path := concat($collection, '/', $file-to-update)
- (: This is the document on disk to be updated :)
+ (: This is the document in temp to be updated :)
let $doc := doc($file-path)/mods:mods
- (: If the incoming has any part then we update it in the document.
- Note that is has the side effect of adding the mods prefix in the data files.
+ (: If the incoming has any part then we update it in the document with do-updates.
+ This has the side effect of adding the mods namespace prefix in the data files.
To remedy this, clean:clean-namespaces() is applied to the record. :)
(: TODO: figure out some way to pass the element name to an XQuery function and then do an eval on the update :)
let $updates :=
- if ($action eq 'cancel')
+ if ($action eq 'cancel')
+ (: Remove the document from temp. :)
then xmldb:remove($collection, $file-to-update)
else
- if ($action eq 'close')
+ if ($action eq 'close')
+ (: If the user terminates editing. :)
then
- (: get the target collection. If its an edit to an existing document we can find this by its uuid,
- otherwise it can be found in the e:collection element of the document. :)
+ (: Get the target collection. If it's an edit to an existing document, we can find this by its uuid,
+ otherwise it can be found in the e:collection element of the document, added in edit.xq. :)
(: NB: it should not be required to use e:collection. :)
let $target-collection :=
let $live-target-collection := save:find-live-collection-containing-uuid($incoming-id)
return
- if (fn:not(fn:empty($live-target-collection)))
+ if (not(empty($live-target-collection)))
then $live-target-collection
else $doc/mods:extension/e:collection/string()
return
(
xf:do-updates($item, $doc),
xmldb:move($collection, $target-collection, $file-to-update),
- save:remove-new-docs-target-collection(fn:concat($target-collection, "/", $file-to-update)),
- (: set the same permissions on the new file as the parent collection :)
- security:apply-parent-collection-permissions(xs:anyURI(fn:concat($target-collection, "/", $file-to-update)))
+ save:remove-new-docs-target-collection(concat($target-collection, "/", $file-to-update)),
+ (: Set the same permissions on the new file as the parent collection :)
+ security:apply-parent-collection-permissions(xs:anyURI(concat($target-collection, "/", $file-to-update)))
)
else xf:do-updates($item, $doc)
return ()
\ No newline at end of file
Deleted: apps/tamboti/modules/search/retrieve-mods.xql
===================================================================
--- apps/tamboti/modules/search/retrieve-mods.xql 2012-01-05 18:40:56 UTC (rev 15644)
+++ apps/tamboti/modules/search/retrieve-mods.xql 2012-01-06 11:52:46 UTC (rev 15645)
@@ -1,2373 +0,0 @@
-module namespace mods="http://www.loc.gov/mods/v3";
-
-declare namespace mads="http://www.loc.gov/mads/v2";
-declare namespace xlink="http://www.w3.org/1999/xlink";
-declare namespace fo="http://www.w3.org/1999/XSL/Format";
-declare namespace functx = "http://www.functx.com";
-declare namespace e = "http://www.asia-europe.uni-heidelberg.de/";
-
-import module namespace config="http://exist-db.org/mods/config" at "../config.xqm";
-import module namespace uu="http://exist-db.org/mods/uri-util" at "uri-util.xqm";
-
-(: Removes titleIfo, name and relatedItem nodes that do not contain nodes required by the respective elements. :)
-declare function mods:remove-parent-with-missing-required-node($node as node()) as node() {
-element {node-name($node)}
-{
-for $element in $node/*
-return
- if ($element instance of element(mods:titleInfo) and not($element/mods:title/text()))
- then ()
- else
- if ($element instance of element(mods:name) and not($element/mods:namePart/text()))
- then ()
- else
- if ($element instance of element(mods:relatedItem))
- then
- if (not(((string-length($element) > 0) or ($element/@xlink:href))))
- then ()
- else $element
- else $element
-}
-};
-
-declare option exist:serialize "media-type=text/xml";
-
-(: TODO: A lot of restrictions to the first item in a sequence ([1]) have been made; these must all be changed to for-structures or string-joins. :)
-
-(: ### general functions begin ###:)
-
-declare function functx:substring-before-last-match($arg as xs:string?, $regex as xs:string) as xs:string? {
- replace($arg,concat('^(.*)',$regex,'.*'),'$1')
-} ;
-
- (:~
-: Used to transform the camel-case names of MODS elements into space-separated words.
-: @param
-: @return
-: @see http://www.xqueryfunctions.com/xq/functx_camel-case-to-words.html
-:)
-declare function functx:camel-case-to-words($arg as xs:string?, $delim as xs:string ) as xs:string? {
- concat(substring($arg,1,1), replace(substring($arg,2),'(\p{Lu})', concat($delim, '$1')))
-};
-
-(:~
-: Used to capitalize the first character of $arg.
-: @param
-: @return
-: @see http://http://www.xqueryfunctions.com/xq/functx_capitalize-first.html
-:)
-declare function functx:capitalize-first($arg as xs:string?) as xs:string? {
- concat(upper-case(substring($arg,1,1)),
- substring($arg,2))
-};
-
-(:~
-: Used to remove whitespace at the beginning and end of a string.
-: @param
-: @return
-: @see http://http://www.xqueryfunctions.com/xq/functx_trim.html
-:)
-declare function functx:trim($arg as xs:string?) as xs:string {
- replace(replace($arg,'\s+$',''),'^\s+','')
-};
-
-(:~
-: Used to clean up unintended sequences of punctuation. These should ideally be removed at the source.
-: @param
-: @return
-:)
-(: Function to clean up unintended punctuation. These should ideally be removed at the source. :)
-declare function mods:clean-up-punctuation($element as node()) as node() {
- element {node-name($element)}
- {$element/@*,
- for $child in $element/node()
- return
- if ($child instance of text())
- then
- replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
- ($child)
- (:, '\s*\)', ')'):) (:, '\s*;', ';'):) (:, ',,', ','):) (:, '”\.', '.”'):) (:, '\. ,', ','):) (:, ',\s*\.', ''):) (:,'\.\.', '.'):) (:,'\.”,', ',”'):)
- , '\s*\.', '.')
- , '\s*,', ',')
- , ' :', ':')
- , ' ”', '”')
- , '\.\.', '.')
- , '“ ', '“')
- , '\?\.', '?')
- , '!\.', '!')
- ,'\.”\.', '.”')
- ,' \)', ')')
- ,'\( ', '(')
- else mods:clean-up-punctuation($child)
- }
-};
-
-
-(: ### general functions end ###:)
-
-
-(:~
-: The <b>mods:get-language-term</b> function returns
-: the <b>human-readable label</b> of the language value passed to it.
-: This value can set in many mods elements and attributes.
-: languageTerm can have two types, text and code.
-: Type code can use two different authorities,
-: recorded in the code tables language-2-type-codes.xml and language-3-type-codes.xml,
-: as well as the authority valueTerm noted in language-3-type-codes.xml.
-: The most commonly used values are checked first, letting the function exit quickly.
-: The function returns the human-readable label, based on searches in the code values and in the label.
-:
-: @param $node A mods element or attribute recording a value, in textual or coded form
-: @return The language label string
-:)
-declare function mods:get-language-label($language as item()*) as xs:string* {
- let $languageTerm :=
- let $languageTerm := doc(concat($config:edit-app-root, '/code-tables/language-3-type-codes.xml'))/code-table/items/item[value = $language]/label
- return
- if ($languageTerm)
- then $languageTerm
- else
- let $languageTerm := doc(concat($config:edit-app-root, '/code-tables/language-3-type-codes.xml'))/code-table/items/item[valueTwo = $language]/label
- return
- if ($languageTerm)
- then $languageTerm
- else
- let $languageTerm := doc(concat($config:edit-app-root, '/code-tables/language-3-type-codes.xml'))/code-table/items/item[valueTerm = $language]/label
- return
- if ($languageTerm)
- then $languageTerm
- else
- let $languageTerm := doc(concat($config:edit-app-root, '/code-tables/language-3-type-codes.xml'))/code-table/items/item[upper-case(label) = $language/upper-case(label)]/label
- return
- if ($languageTerm)
- then $languageTerm
- else
- let $languageTerm := doc(concat($config:edit-app-root, '/code-tables/language-3-type-codes.xml'))/code-table/items/item[upper-case(label) = upper-case($language)]/label
- return
- if ($languageTerm)
- then $languageTerm
- else $language
- return $languageTerm
-};
-
-(:~
-: The <b>mods:get-script-term</b> function returns
-: the <b>human-readable label</b> of the script value passed to it.
-: @param
-: @return
-:)
-declare function mods:get-script-term($language as node()*) as xs:string* {
- let $scriptTerm :=
- let $scriptTerm := doc(concat($config:edit-app-root, '/code-tables/script-codes.xml'))/code-table/items/item[value = $language/mods:scriptTerm[@authority]]/label
- return
- if ($scriptTerm)
- then $scriptTerm
- else
- let $scriptTerm := doc(concat($config:edit-app-root, '/code-tables/script-codes.xml'))/code-table/items/item[value = $language/mods:scriptTerm]/label
- return
- if ($scriptTerm)
- then $scriptTerm
- else ()
- return $scriptTerm
-};
-
-(:~
-: The <b>mods:language-of-resource</b> function returns
-: the <b>string</b> value of the language for the resource.
-: This value is set in mods/language/languageTerm.
-: The function feeds this value to the function mods:get-language.
-: It is assumed that if two languageTerm's exist under one language, these are equivalent.
-: It is possible to have multiple mods/language for resources, just as it is possible to set the code value to 'mul', meaning Multiple languages.
-: The value is set in the dialogue which leads to the creation of a new records.
-:
-: @see xqdoc/xqdoc-display;get-language
-: @param $language The MODS languageTerm element, child of the top-level language element
-: @return The language label string
-:)
-declare function mods:language-of-resource($language as element()*) as xs:anyAtomicType* {
- let $languageTerm := $language/mods:languageTerm[1]
- return
- if ($languageTerm)
- then mods:get-language-label($languageTerm)
- else ()
-};
-
-declare function mods:script-of-resource($language as element()*) as xs:anyAtomicType* {
- let $scriptTerm := $language/mods:scriptTerm
- return
- if ($scriptTerm)
- then mods:get-script-term($language)
- else ()
-};
-
-
-(:~
-: The <b>mods:language-of-cataloging</b> function returns
-: the <b>$string</b> value of the language for cataloguing the resource.
-: This value is set in mods/recordInfo/languageOfCataloging.
-: The function feeds this value to the function mods:get-language.
-: It is assumed that if two languageTerm's exist under one language, these are equivalent.
-: It is possible to have multiple mods/language, for resources, just as it is possible to set the code value to 'mul', meaning Multiple languages.
-: The value is set in the dialogue which leads to the creation of a new records.
-:
-: @see xqdoc/xqdoc-display;get-language
-: @param $entry The MODS languageOfCataloging element, child of the top-level recordInfo element
-: @return The language label string
-:)
-declare function mods:language-of-cataloging($language as element(mods:languageOfCataloging)*) as xs:anyAtomicType? {
- let $languageTerm := $language/mods:languageTerm[1]
- return
- if ($languageTerm)
- then mods:get-language-label($languageTerm)
- else ()
-};
-
-(:~
-: The <em>mods:get-role-label-for-detail-view</em> function returns
-: the <em>human-readable value</em> of the roleTerm passed to it.
-: Whereas mods:get-role-label-for-detail-view returns the author/creator roles that are placed in front of the title in detail view,
-: mods:get-role-label-for-detail-view returns the secondary roles that are placed after the title in list view and in relatedItem in detail view.
-: The value occurs in mods/name/role/roleTerm.
-: It can have two types, text and code.
-: Type code can use the marcrelator authority, recorded in the code table role-codes.xml.
-: The most commonly used values are checked first, letting the function exit quickly.
-: The function returns the human-readable label, based on searches in the code values and in the label values.
-:
-: @param $node A mods element or attribute recording a role term value, in textual or coded form
-: @return The role term label string
-:)
-declare function mods:get-role-label-for-detail-view($roleTerm as item()?) as item()? {
- let $roleLabel :=
- (: Is the roleTerm a role label? :)
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[upper-case(label) eq upper-case($roleTerm)]/label
- (: Prefer the label proper, since it contains the form presented in the detail view, e.g. "Editor" instead of "edited by". :)
- return
- if ($roleLabel)
- then $roleLabel
- else
- (: Is the roleTerm a role term @code? :)
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[value eq $roleTerm]/label
- return
- if ($roleLabel)
- then $roleLabel
- else $roleTerm
- return functx:capitalize-first($roleLabel)
-};
-
-declare function mods:get-roles-for-detail-view($name as element()*) as item()* {
- if ($name/mods:role/mods:roleTerm/text())
- then
- let $roles := $name/mods:role
- for $role at $pos in $name/mods:role
- return
- distinct-values(
- if ($pos eq 1)
- then mods:get-role-terms-for-detail-view($role)
- else (' and ', mods:get-role-terms-for-detail-view($role))
- )
- else
- (: Default values in the absence of $roleTerm. :)
- if ($name/@type eq 'corporate')
- then 'Corporation'
- else 'Author'
-};
-
-declare function mods:get-role-terms-for-detail-view($role as element()*) as item()* {
- let $roleTerms := $role/mods:roleTerm
- for $roleTerm at $pos in distinct-values($roleTerms)
-
- return
- if ($roleTerm)
- then mods:get-role-label-for-detail-view($roleTerm)
- else ()
-
-};
-
-(:~
-: The <em>mods:get-role-label-for-list-view</em> function returns
-: the <em>human-readable value</em> of the roleTerm passed to it.
-: Whereas mods:get-role-label-for-detail-view returns the author/creator roles that are placed in front of the title in detail view,
-: mods:get-role-label-for-detail-view returns the secondary roles that are placed after the title in list view and in relatedItem in detail view.: The value occurs in mods/name/role/roleTerm.
-: It can have two types, text and code.
-: Type code can use the marcrelator authority, recorded in the code table role-codes.xml.
-: The most commonly used values are checked first, letting the function exit quickly.
-: The function returns the human-readable label, based on searches in the code values and in the labelSecondary and label values.
-:
-: @param $node A mods element or attribute recording a role term value, in textual or coded form
-: @return The role term label string
-:)
-declare function mods:get-role-label-for-list-view($roleTerm as xs:string*) as xs:string* {
- let $roleLabel :=
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[upper-case(label) eq upper-case($roleTerm)]/labelSecondary
- (: Prefer labelSecondary, since it contains the form presented in the list view output, e.g. "edited by" instead of "editor". :)
- return
- if ($roleLabel)
- then $roleLabel
- else
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[value eq $roleTerm]/labelSecondary
- return
- if ($roleLabel)
- then $roleLabel
- else
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[upper-case(label) eq upper-case($roleTerm)]/label
- (: If there is no labelSecondary, take the label. :)
- return
- if ($roleLabel)
- then $roleLabel
- else
- let $roleLabel := doc(concat($config:edit-app-root, '/code-tables/role-codes.xml'))/code-table/items/item[value eq $roleTerm]/label
- return
- if ($roleLabel)
- then $roleLabel
- else $roleTerm
- (: Do not present default values in case of absence of $roleTerm, since primary roles are not displayed in list view. :)
- return ($roleLabel, ' ')
-};
-
-declare function mods:add-part($part, $sep as xs:string) {
- if (empty($part) or string-length($part[1]) eq 0)
- then ()
- else concat(string-join($part, ' '), $sep)
-};
-
-declare function mods:get-publisher($publishers as element(mods:publisher)*) as item()* {
- string-join(
- for $publisher in $publishers
- return
- (: NB: Using name here is an expansion of the MODS schema.:)
- if ($publisher/mods:name)
- then mods:retrieve-name($publisher/mods:name, 1, 'secondary', '')
- else $publisher
- ,
- (: If there is a transliterated publisher, probably only one publisher is referred to. :)
- if ($publishers[@transliteration] or $publishers[mods:name/@transliteration])
- then ' '
- else
- ' and ')
-};
-
-
-(: ### <subject> begins ### :)
-
-(: format subject :)
-declare function mods:format-subjects($entry as element(), $global-transliteration) {
- for $subject in ($entry/mods:subject)
- let $authority :=
- if ($subject/@authority/string())
- then concat('(', ($subject/@authority/string()), ')')
- else ()
- return
- <tr xmlns="http://www.w3.org/1999/xhtml">
- <td class="label subject">Subject {$authority}</td>
- <td class="record"><table class="subject">
- {
- for $item in ($subject/mods:*)
- let $authority :=
- if ($item/@authority/string())
- then concat('(', ($item/@authority/string()), ')')
- else ()
- let $encoding :=
- if ($item/@encoding/string())
- then concat('(', ($item/@encoding/string()), ')')
- else ()
- let $type :=
- if ($item/@type/string())
- then concat('(', ($item/@type/string()), ')')
- else ()
- return
- <tr><td class="sublabel">
- {
- replace(functx:capitalize-first(functx:capitalize-first(functx:camel-case-to-words(replace($item/name(), 'mods:',''), ' '))),'Info',''),
- $authority, $encoding, $type
- }
- </td><td class="subrecord">
- {
- (: If there is a child. :)
- if ($item/mods:*)
- then
- (: If it is a name. :)
- if ($item/name() eq 'name')
- then mods:format-name($item, 1, 'primary', $global-transliteration)
- else
- (: If it is a titleInfo. :)
- if ($item/name() eq 'titleInfo')
- (: NB: What if there is more than one titleInfo? Here one steps out of the iteration. :)
- then string-join(mods:get-short-title($item/..), '')
- else
- (: If it is something else, such as topic (caught by $subitem/name()). :)
- for $subitem in ($item/mods:*)
- let $authority :=
- if ($subitem/@authority/string())
- then concat('(', ($subitem/@authority/string()), ')')
- else ()
- let $encoding :=
- if ($subitem/@encoding/string())
- then concat('(', ($subitem/@encoding/string()), ')')
- else ()
- let $type :=
- if ($subitem/@type/string())
- then concat('(', ($subitem/@type/string()), ')')
- else ()
- return
- <table><tr><td class="sublabel">
- {functx:capitalize-first(functx:camel-case-to-words(replace($subitem/name(), 'mods:',''), ' ')),
- $authority, $encoding}
- </td><td><td class="subrecord">
- {$subitem/string()}
- </td></td></tr></table>
- else
- <table><tr><td class="subrecord" colspan="2">{$item/string()}</td></tr></table>
- }
- </td></tr>
- }
- </table></td>
- </tr>
-};
-
-(: ### <subject> ends ### :)
-
-(: ### <extent> begins ### :)
-
-(: <extent> belongs to <physicalDescription>, to <part> as a top level element and to <part> under <relatedItem>.
-Under <physicalDescription>, <extent> has no subelements.:)
-
-declare function mods:get-extent($extent as element(mods:extent)?) as xs:string? {
-let $unit := $extent/@unit
-let $start := $extent/mods:start
-let $end := $extent/mods:end
-let $total := $extent/mods:total
-let $list := $extent/mods:list
-return
- if ($start and $end)
- then
- (: Chicago does not note units :)
- (:
- concat(
- if ($unit)
- then concat($unit, ' ')
- else ()
- ,
- :)
- if ($start ne $end)
- then concat($start, '-', $end)
- else $start
- else
- if ($start or $end)
- then
- if ($start)
- then $start
- else $end
- else
- if ($total)
- then concat($total, ' ', $unit)
- else
- if ($list)
- then $list
- else string-join($extent/string(), ' ')
-};
-
-declare function mods:get-date($date as element()*) as xs:string* {
- (: contains no subelements. :)
- (: has: encoding; point; qualifier. :)
- (: NB: some dates have keyDate. :)
-
-let $start := $date[@point eq 'start']/text()
-let $end := $date[@point eq 'end']/text()
-let $qualifier := $date/@qualifier/text()
-
-let $encoding := $date/@encoding
-return
- (
- if ($start and $end)
- then
- if ($start ne $end)
- then concat($start, '-', $end)
- else $start
- else
- if ($start or $end)
- then
- if ($start)
- then concat($start, '-?')
- else concat('?-', $end)
- (: if neither $start nor $end. :)
- else $date
- ,
- if ($qualifier)
- then ('(', $qualifier, ')')
- else ()
- )
-};
-
-(: ### <originInfo> begins ### :)
-
-(: The DLF/Aquifer Implementation Guidelines for Shareable MODS Records require the use of at least one <originInfo> element with at least one date subelement in every record, one of which must be marked as a key date. <place>, <publisher>, and <edition> are recommended if applicable. These guidelines make no recommendation on the use of the elements <issuance> and <frequency>. This element is repeatable. :)
- (: Application: :)
- (: Problem: :)
-(: Attributes: lang, xml:lang, script, transliteration. :)
- (: Unaccounted for: :)
-(: Subelements: <place> [RECOMMENDED IF APPLICABLE], <publisher> [RECOMMENDED IF APPLICABLE], <dateIssued> [AT LEAST ONE DATE ELEMENT IS REQUIRED], <dateCreated> [AT LEAST ONE DATE ELEMENT IS REQUIRED], <dateCaptured> [NOT RECOMMENDED], <dateValid> [NOT RECOMMENDED], <dateModified> [NOT RECOMMENDED], <copyrightDate> [AT LEAST ONE DATE ELEMENT IS REQUIRED], <dateOther> [AT LEAST ONE DATE ELEMENT IS REQUIRED], <edition> [RECOMMENDED IF APPLICABLE], <issuance> [OPTIONAL], <frequency> [OPTIONAL]. :)
- (: Unaccounted for: . :)
- (: <place> :)
- (: Repeat <place> for recording multiple places. :)
- (: Attributes: type [RECOMMENDED IF APPLICABLE] authority [RECOMMENDED IF APPLICABLE]. :)
- (: @type :)
- (: Values: :)
- (: Unaccounted for: :)
- (: Subelements: <placeTerm> [REQUIRED]. :)
- (: Attributes: type [REQUIRED]. :)
- (: Values: text, code. :)
- (: <publisher> :)
- (: Attributes: none. :)
- (: dates [AT LEAST ONE DATE ELEMENT IS REQUIRED] :)
- (: The MODS schema includes several date elements intended to record different events that may be important in the life of a resource. :)
-
-declare function mods:get-place($places as element(mods:place)*) as xs:string? {
- string-join(
- for $place in $places
- let $placeTerms := $place/mods:placeTerm
- return
- string-join(
- for $placeTerm in $placeTerms
- let $order :=
- if ($placeTerm/@transliteration)
- then 0
- else 1
- order by $order
- return
- if ($placeTerm[@type eq 'text']/text())
- then concat
- (
- $placeTerm[@transliteration]/text()
- ,
- ' '
- ,
- $placeTerm[not(@transliteration)]/text()
- )
- else
- if ($placeTerm[@authority eq 'marccountry']/text())
- then doc(concat($config:edit-app-root, '/code-tables/marc-country-codes.xml'))/code-table/items/item[value eq $placeTerm]/label
- else
- if ($placeTerm[@authority eq 'iso3166']/text())
- then doc(concat($config:edit-app-root, '/code-tables/iso3166-country-codes.xml'))/code-table/items/item[value eq $placeTerm]/label
- else $place/mods:placeTerm[not(@type)]/text(),
- ' ')
- ,
- (: If there is a transliterated place term, probably only one place is referred to. :)
- if ($places[@transliteration] or $places[mods:placeTerm/@transliteration])
- then ' '
- else
- ' and ')
-};
-
-(: NB: This function should be split up in a part and an originInfo function.:)
-(: <part> is found both as a top level element and under <relatedItem>. $entry can be both mods and relatedItem. :)
-(: NB: where is the relatedItem type? :)
-(: Used in list view and display of related items in list and detail view. :)
-declare function mods:get-part-and-origin($entry as element()) {
- let $originInfo := $entry/mods:originInfo[1]
- (: contains: place, publisher, dateIssued, dateCreated, dateCaptured, dateValid,
- dateModified, copyrightDate, dateOther, edition, issuance, frequency. :)
- (: has: lang; xml:lang; script; transliteration. :)
- let $place := $originInfo/mods:place
- (: contains: placeTerm. :)
- (: has no attributes. :)
- (: handled by get-place(). :)
-
- let $publisher := $originInfo/mods:publisher
- (: contains no subelements. :)
- (: has no attributes. :)
- (: handled by get-publisher(). :)
-
- let $dateIssued := $originInfo/mods:dateIssued[1]
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $dateCreated := $originInfo/mods:dateCreated
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $dateCaptured := $originInfo/mods:dateCaptured
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $dateValid := $originInfo/mods:dateValid
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $dateModified := $originInfo/mods:dateModified
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $copyrightDate := $originInfo/mods:copyrightDate
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- let $dateOther := $originInfo/mods:dateOther
- (: contains no subelements. :)
- (: has: encoding; point; keyDate; qualifier. :)
- (: pick the "strongest" value for the hitlist. :)
- let $dateOriginInfo :=
- if ($dateIssued)
- then $dateIssued
- else
- if ($copyrightDate)
- then $copyrightDate
- else
- if ($dateCreated)
- then $dateCreated
- else
- if ($dateCaptured)
- then $dateCaptured
- else
- if ($dateModified)
- then $dateModified
- else
- if ($dateValid)
- then $dateValid
- else
- if ($dateOther)
- then $dateOther
- else ()
- let $dateOriginInfo := mods:get-date($dateOriginInfo)
-
- (: NB: this should iterate over part, since there are e.g. multi-part installments of articles. :)
- let $part := $entry/mods:part[1]
- (: contains: detail, extent, date, text. :)
- (: has: type, order, ID. :)
- let $detail := $part/mods:detail
- (: contains: number, caption, title. :)
- (: has: type, level. :)
- let $issue := $detail[@type=('issue', 'number')]/mods:number[1]/text()
- let $volume :=
- if ($detail[@type='volume']/mods:number/text())
- then $detail[@type='volume']/mods:number/text()
- (: NB: to accommodate erroneous Zotero export. Only number is valid. :)
- else $detail[@type='volume']/mods:text/text()
- (: NB: Does $page exist? :)
- let $page := $detail[@type='page']/mods:number/text()
- (: $page resembles list. :)
-
- let $extent := $part/mods:extent
- (: contains: start, end, total, list. :)
- (: has: unit. :)
- (: handled by mods:get-extent(). :)
-
- (: NB: If the date of a periodical issue is wrongly put in originInfo/dateIssued. Delete when MODS export is corrected.:)
- let $datePart :=
- if ($part/mods:date)
- then mods:get-date($part/mods:date)
- else $dateOriginInfo
- (: contains no subelements. :)
- (: has: encoding; point; qualifier. :)
-
- let $text := $part/mods:text
- (: contains no subelements. :)
- (: has no attributes. :)
-
- return
- (: If there is a part with issue information and a date, i.e. if the publication is an article in a periodical. :)
- (: NB: "not($place or $publisher" is a little risky since full entries of periodicals have these elements. :)
- if ($datePart and ($volume or $issue or $extent or $page) and not($place or $publisher))
- then
- concat(
- ' '
- ,
- if ($volume and $issue)
- then concat($volume, ', no. ', $issue
- ,
- concat(' (', $datePart, ')')
- )
- (: concat((if ($part/mods:detail/mods:caption) then $part/mods:detail/mods:caption/string() else '/'), $part/mods:detail[@type='issue']/mods:number) :)
- else
- if ($issue or $volume)
- then
- (: If the year is used as volume. :)
- if ($issue)
- then concat(
- concat(' ', $datePart)
- , ', no. ', $issue)
- else concat($volume, concat(' (', string-join($datePart, ', '), ')'))
- else
- if ($extent and $datePart)
- (: We have date and extent alone. :)
- then concat(' ', $datePart)
- else ()
- ,
- (: NB: We assume that there will not both be $page and $extent.:)
- if ($extent)
- then concat(': ', mods:get-extent($extent[1]), '.')
- else
- if ($page)
- then concat(': ', $page[1], '.')
- else '.'
- )
- else
- (: If there is a dateIssued (loaded in $datePart) and a place or a publisher, i.e. if the publication is an an edited volume. :)
- if ($datePart and ($place or $publisher))
- then
- (
- if ($volume)
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|