You are here

README.txt in Views OAI-PMH 7.3

Same filename and directory in other branches
  1. 6.2 README.txt
  2. 6 README.txt
  3. 7 README.txt
  4. 7.2 README.txt
CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Missing features
 * Requirements
 * Recommended modules
 * Installation
 * Upgrade
 * Configuration
 * Dealing with attributes
 * Dealing with multivalued fields
 * Default view
 * Theming and templating
 * Implementing new metadata formats
 * Altering existing metadata formats
 * Maintainers


INTRODUCTION
------------
The Views OAI-PMH module allows the creation of OAI-PMH endpoints, exposing any
data the Views module has access to.

The following metadata formats are supported:

 - Dublin Core (oai_dc)
 
 - IMS Learning Objects Exchange (oai_ilox)
 
 - Interoperability Metadata Standard for Electronic Theses and Dissertations
   (oai_etdms)
 
 - Learning Objects Metadata (oai_lom)
 
 - Learning Resource Exchange (oai_lre)
 
 - Metadata Object Description Schema (mods)
 
 - Érudit.

Other modules may provide their own metadata formats by implementing Drupal-
style hooks.

The 7.x-3.x branch was mainly motivated by the need to support a more complex
metadata format, namely the Metadata Object Description Schema (MODS)
http://www.loc.gov/standards/mods/ . While trying to implement the format, we 
encountered various issues which gradually led us to refactor/rewrite most of 
the module. The changes outlined below should give a good idea of the problems
we wanted to solve.

 * Changes:

   - Simpler architecture and less code. Just two Views plugins (instead of 10),
     a display plugin and a style plugin.

   - No more global variables. Lazy loading of metadata format definitions.

   - Proper hooks allow modules to provide their own metadata formats, and to
     alter the metadata formats provided by other modules.

   - Mapping now uses its own settings data structure instead of hijacking a
     view's field labels.

   - Attributes are no longer global to all elements. The same attribute may now
     appear with different values, on different tags within the same record.

   - More robust XML building, using PHP's DOMDocument class.

   - Logic out of the theming layer.

   - Now impossible to disable the oai_dc metadata format, which is required by
     the OAI-PMH standard.

   - New support for the Metadata Object Description Schema (MODS) format.

   - New support for the Interoperability Metadata Standard for Electronic
     Theses and Dissertations (ETD-MS) format.

   - Include the oai-identifier description container in response to "Identify"
     requests.

   - Metadata prefixes are now configurable.

   - Properly output the view's URL instead of the site's base URL in <request>
     tags.

   - All errors are now detected and reported in the response, as required by
     the OAI-PMH standard, instead of stopping short after the first error. Also
     removed duplicate error messages and made record identifier checks more
     strict.

 * For a full description of the module, visit the project page:
   https://www.drupal.org/project/views_oai_pmh

 * To submit bug reports and feature suggestions, or to track changes:
   https://www.drupal.org/project/issues/search/views_oai_pmh


MISSING FEATURES
----------------

There are missing from the actual version and should be included in
the future.

 * Mising features:

  - Live preview for metadata formats other than oai_dc.

  - Gzip compression.

  - Handling for deleted records.

  - Sets.


REQUIREMENTS
------------

This module requires the following modules:

 * Views (https://www.drupal.org/project/views)


RECOMMENDED MODULES
-------------------

 * Biblio (https://www.drupal.org/project/biblio):
   Improves the module help page showing information about the module drush
   commands.


INSTALLATION
------------

 * Install as you would normally install a contributed Drupal module.
   See: https://www.drupal.org/node/895232 for further information.


UPGRADE
-------

Any views created with the 7.x-1.x or 7.x-2.x module version will be 
incompatible. The mappings of the view fields to OAI-PMH elements will have to 
be manually redone in the views. Backup your data before upgrading!

The structure of the module's theming layer is completely different, so any
theme code (theme functions or template files) made for the original Views
OAI-PMH versions will have to be reworked.


CONFIGURATION
-------------

Anyone familiar with the Views module should quickly feel comfortable with
Views OAI-PMH. Outlined below are the steps required to create a new OAI-PMH
endpoint. Understanding Views concepts such as displays, fields and filters is
required.

 * Configure the module following these steps:

   - Add a new view, with neither a page nor a block display, i.e. with just a
     "Master" display, showing content unsorted (Views OAI-PMH handles the
     sorting). Continue & edit this view.
    
   - Add an "OAI-PMH" display to the view.

   - Edit the Repository name. By default it is filled with the site's name. 
     This name will appear in response to OAI-PMH "Identify" requests.
    
   - Add any desired filter criteria. These will limit what content is available
     from your new OAI-PMH endpoint.
    
   - Add any fields that provide the data that you wish to publish through
     OAI-PMH (for example, "Content: Title", "Content: Body", "Content: Post
     date"). Some things to consider when configuring a field:
  
   - You may uncheck the "Create a label" option, as labels will not be part of
     the OAI-PMH output and will simply be ignored. You may still want to use
     labels for documentation purposes though.
 
   - In the "No results behavior" section, the "Hide if empty" option must be
     checked to avoid empty XML tags or attributes in the output.
 
   - In the "Rewrite results" section, check the "Strip HTML tags" option. HTML
     markup is not allowed in OAI-PMH elements.
 
   - Title fields must have the "Link this field to the original piece of
     content" option disabled.
 
   - Text fields must use the "Plain text" formatter. Again, HTML markup is not
     allowed in OAI-PMH elements.
 
     * Date fields must be formatted according to the requirements of the
       metadata format, e.g. W3CDTF.

     * Link fields and Entity Reference fields must not output links, just plain
       text, e.g. an URL, a title.

   - In the "Format" section, click the "Settings" link. This will take you to
     the "OAI-PMH Style options", where you'll find the mapping interface.
   
   - Enable the desired metadata formats for your new OAI-PMH endpoint. The
     Dublin Core (oai_dc) format is mandatory.
   
   - If desired, edit the metadata prefixes that will be recognized by your OAI-
     PMH endpoint. Note that each prefix must be unique.
   
   - For each enabled format, a table is provided where you may associate each
     field that's been added to the display with an element in that metadata
     format. For example, in the "Field mappings for Dublin Core" table you
     could associate the "Content: Title" field with the "dc:title" element, the
     "Content: Body" with the "dc:description" element, and the "Content: Post
     date" with the "dc:date" element.

   - Configure a path for this display, such as "my-oai-pmh", in the "OAI-PMH
     Settings" section.
  
   - In the "Pager" section, make sure to use the "Full" pager. The specified
     number of items per page will control how many records will appear in an
     OAI-PMH response (harvesters will make multiple requests using resumption
     tokens to get more records).

   - Save the view.
   
   - Optionally, you can test your new endpoint by going to
     http://re.cs.uct.ac.za/ and entering the absolute URL for your display,
     e.g. http://example.com/my-oai-pmh, in the "Enter the OAI baseURL" box, and
     then clicking the "Test the specified/selected baseURL" link (on the right
     side of the page).


DEALING WITH ATTRIBUTES
-----------------------

Some metadata formats require that XML tags have specific attributes, such as a
"language" attribute. Views OAI-PMH allows you to map a field to an attribute:
Just select a target that's prefixed with "(Attribute)", e.g. "(Attribute)
Language".

Sometimes your content does not provide any data for those values, in which
case you can add to the view a "Global: Custom Text" field, which you'll be
able to map to an attribute.

A field that's mapped to an attribute must be positioned above the field that's
mapped to the element that uses the attribute. For example, to generate the
following MODS snippet:

  <language>
    <languageTerm authority="rfc3066">fr</languageTerm>
  </language>
  <name authority="local">
    <namePart>Smith, John</namePart>
  </name>

The view might use four fields (order is important):

 - "Global: Custom text", configured with text "rfc3066"

 - "Content: My language field", which will provide a language code, e.g. "fr"

 - "Global: Custom text", configured with text "local"

 - "Content: My author field", which will provide an author's name, e.g. "Smith,
   John".

Then the view would have the following MODS mappings:

  - "Global: Custom text" mapped to "(Attribute) authority"
  - "Content: My language field" mapped to "language (multiple) > languageTerm"
  - "Global: Custom text" mapped to "(Attribute) authority"
  - "Content: My author field" mapped to "name (multiple) > namePart"

If it wasn't for the second "Global: Custom text" field being mapped to
"(Attribute) authority", there would be no "authority" attribute on the
<name> tag because the first attribute gets consumed by the <languageTerm>
tag, which appears before <name>. Indeed, any field that's mapped to an
attribute is consumed by the first encountered element that allows that
attribute, making that attribute value unavailable to any other elements
further down the list of fields.

Moreover, attributes are assigned depth-first to the target element. For
example, when building the output for the "name (multiple) > namePart" element,
the system first checks if the MODS metadata format allows an authority
attribute on a <namePart> tag. That attribute not being allowed on this tag,
the system then tries with the parent tag, <name>, finds that it is allowed
there, and therefore lets the <name> tag that consume the attribute.


DEALING WITH MULTIVALUED FIELDS
-------------------------------

We usually need multivalued fields to generate multiple tags in the XML output,
one for each value. For example, a multivalued Entity Reference field might
generate the following oai_dc snippet:

  <dc:creator>Brooks, Kevin</dc:creator>
  <dc:creator>Nicci, French</dc:creator>
  <dc:creator>Mason, Matt</dc:creator>

For this to happen, the field must be configured appropriately in the view:

 - Formatter: Title (no link)

 - Multiple field settings > Display all values in the same row: Enabled.

 - Multiple field settings > Display type: Simple separator

 - Multiple field settings > Separator: Any character or character sequence that
   is unlikely to appear in a title.

 - Multiple field settings > Display "all" value(s) starting from "0".

 - No results behavior > Hide if empty: Enabled.

In the mapping interface, the field is then mapped to "dc:creator" (in the
Dublin Core table).

Unless noted otherwise in a mapping's target name, multiple values will
automatically generate multiple leaf nodes in the XML. For example, a
multivalued field that's mapped to "physicalDescription > form" in MODS will
generate a new <form> tag for each value, all under a common
<physicalDescription> parent, as in the following snippet:

    <physicalDescription>
        <form>text</form>
        <form>image</form>
        <form>video</form>
    </physicalDescription>

Some mappings, however, generate multiple nodes higher up in the XML tree. In
those cases, the label "(multiple)" indicates which tag will get repeated. The
following MODS snippet shows the output for a multivalued field that's mapped
to "name (multiple) > namePart":

    <name authority="local">
        <namePart>Brooks, Kevin</namePart>
    </name>
    <name authority="local">
        <namePart>Nicci, French</namePart>
    </name>
    <name authority="local">
        <namePart>Mason, Matt</namePart>
    </name>

In the above example, it is the <name> tag, rather than the leaf, that gets
repeated for each field value. Note that the "authority" attribute gets
repeated as well. As mentioned earlier, an attribute gets consumed by the first
encountered element that allows that attribute. When that element has multiple
values, the same attribute will apply to all of the values.

If a multivalued field is mapped to an attribute, however, the system will
instead try to assign each value to an element whose position with respect to
its siblings in the XML tree matches the value's index. It is thus possible to
output the following MODS snippet:

    <name authority="local" xlink:href="http://example.com/people/brooks-kevin">
        <namePart>Brooks, Kevin</namePart>
    </name>
    <name authority="local" xlink:href="http://example.com/people/nicci-french">
        <namePart>Nicci, French</namePart>
    </name>
    <name authority="local" xlink:href="http://example.com/people/mason-matt">
        <namePart>Mason, Matt</namePart>
    </name>

To generate the above output, the view might have the following three fields
(again, order is important):

 - "Global: Custom text", configured for text "local"

 - "Content: My author field", an Entity Reference field configured with the
   formatter "URL as plain text", and proper settings for a multivalued field.

 - "Content: My author field", another instance of the same Entity Reference
   field, this time configured with the formatter "Title (no link)". Also
   configured with proper settings for a multivalued field.

Then the view would have the following MODS mappings:

 - "Global: Custom text" mapped to "(Attribute) authority"

 - "Content: My author field" mapped to "(Attribute) xlink:href"

 - "Content: My author field" mapped to "name (multiple) > namePart"


DEFAULT VIEW
------------

After the Views OAI-PMH module has been enabled, a new view called "OAI-PMH
endpoint" becomes available. You may review and edit it using Views UI, at 
Administer » Structure » Views. That view provides a basic example for
mapping oai_dc elements to fields provided by the Biblio module 
https://www.drupal.org/project/biblio .

The oai_dc metadata format is mandatory for OAI-PMH compliance. How you map its
elements, however, will depend on your site's structure. If your site does not
use the Biblio module, for instance, you'll have to edit the view, or disable it
and create a new one, then add the required fields and configure the mappings.


THEMING AND TEMPLATING
----------------------

To manipulate the output before it gets rendered as XML, you may implement the
"views_oai_pmh_response" theme hook in your theme. This function receives,
among other arguments, a PHP DOMDocument object containing the XML tree of the
OAI-PMH response. For more details, see the default implementation of
theme_views_oai_pmh_response() in views_oai_pmh.theme.inc.

Field templates are not supported.


IMPLEMENTING NEW METADATA FORMATS
---------------------------------

Any module can provide additional metadata formats to Views OAI-PMH. This
requires implementing two hooks:

 * hook_views_oai_pmh_metadata_format_info()

   - This hook returns the OAI-PMH metadata formats supported by the module. It
     simply returns an array where each value is the identifier of a metadata
     format provided by the module, e.g. "oai_dc", "my_oai_format".

  * hook_views_oai_pmh_metadata_format()

   - This hook receives a metadata format identifier as argument and returns an
     instance of the metadata format object corresponding to that id. That
     object's class must be a subclass of the views_oai_pmh_format class, which
     you can find in includes/format.inc. Have a look at the includes/formats
     directory for implementation examples.

Views OAI-PMH itself implements those two hooks to provide its own formats. You
can find these implementations in the views_oai_pmh.module file.


ALTERING EXISTING METADATA FORMATS
----------------------------------

A module may implement the hook_views_oai_pmh_metadata_format_alter() hook to
alter any of the metadata formats provided by other modules. The function's sole
argument is an object of class views_oai_pmh_format. The implementor may
check that object's id attribute to identify the format.


MAINTAINERS
-----------

Current maintainers:
 * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid


This project has been sponsored by:

 * Consortium on Electronic Literature (CELL) http://eliterature.org/cell/
 * Minnesota Historical Society http://www.mnhs.org/index.htm
 * The Open University http://www.open.ac.uk
 * Support for metadata format EruditArticle (in the 7.x-3.x branch) has been
   developed has part of the CO.SHS project (co-shs.ca) and sponsored by the
   Canada Foundation for Innovation (Initiative sur la cyberinfrastructure –
   premier défi – premier concours). It was implemented by Laboratoire NT2
   (nt2.uqam.ca).

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Missing features
  5. * Requirements
  6. * Recommended modules
  7. * Installation
  8. * Upgrade
  9. * Configuration
  10. * Dealing with attributes
  11. * Dealing with multivalued fields
  12. * Default view
  13. * Theming and templating
  14. * Implementing new metadata formats
  15. * Altering existing metadata formats
  16. * Maintainers
  17. INTRODUCTION
  18. ------------
  19. The Views OAI-PMH module allows the creation of OAI-PMH endpoints, exposing any
  20. data the Views module has access to.
  21. The following metadata formats are supported:
  22. - Dublin Core (oai_dc)
  23. - IMS Learning Objects Exchange (oai_ilox)
  24. - Interoperability Metadata Standard for Electronic Theses and Dissertations
  25. (oai_etdms)
  26. - Learning Objects Metadata (oai_lom)
  27. - Learning Resource Exchange (oai_lre)
  28. - Metadata Object Description Schema (mods)
  29. - Érudit.
  30. Other modules may provide their own metadata formats by implementing Drupal-
  31. style hooks.
  32. The 7.x-3.x branch was mainly motivated by the need to support a more complex
  33. metadata format, namely the Metadata Object Description Schema (MODS)
  34. http://www.loc.gov/standards/mods/ . While trying to implement the format, we
  35. encountered various issues which gradually led us to refactor/rewrite most of
  36. the module. The changes outlined below should give a good idea of the problems
  37. we wanted to solve.
  38. * Changes:
  39. - Simpler architecture and less code. Just two Views plugins (instead of 10),
  40. a display plugin and a style plugin.
  41. - No more global variables. Lazy loading of metadata format definitions.
  42. - Proper hooks allow modules to provide their own metadata formats, and to
  43. alter the metadata formats provided by other modules.
  44. - Mapping now uses its own settings data structure instead of hijacking a
  45. view's field labels.
  46. - Attributes are no longer global to all elements. The same attribute may now
  47. appear with different values, on different tags within the same record.
  48. - More robust XML building, using PHP's DOMDocument class.
  49. - Logic out of the theming layer.
  50. - Now impossible to disable the oai_dc metadata format, which is required by
  51. the OAI-PMH standard.
  52. - New support for the Metadata Object Description Schema (MODS) format.
  53. - New support for the Interoperability Metadata Standard for Electronic
  54. Theses and Dissertations (ETD-MS) format.
  55. - Include the oai-identifier description container in response to "Identify"
  56. requests.
  57. - Metadata prefixes are now configurable.
  58. - Properly output the view's URL instead of the site's base URL in
  59. tags.
  60. - All errors are now detected and reported in the response, as required by
  61. the OAI-PMH standard, instead of stopping short after the first error. Also
  62. removed duplicate error messages and made record identifier checks more
  63. strict.
  64. * For a full description of the module, visit the project page:
  65. https://www.drupal.org/project/views_oai_pmh
  66. * To submit bug reports and feature suggestions, or to track changes:
  67. https://www.drupal.org/project/issues/search/views_oai_pmh
  68. MISSING FEATURES
  69. ----------------
  70. There are missing from the actual version and should be included in
  71. the future.
  72. * Mising features:
  73. - Live preview for metadata formats other than oai_dc.
  74. - Gzip compression.
  75. - Handling for deleted records.
  76. - Sets.
  77. REQUIREMENTS
  78. ------------
  79. This module requires the following modules:
  80. * Views (https://www.drupal.org/project/views)
  81. RECOMMENDED MODULES
  82. -------------------
  83. * Biblio (https://www.drupal.org/project/biblio):
  84. Improves the module help page showing information about the module drush
  85. commands.
  86. INSTALLATION
  87. ------------
  88. * Install as you would normally install a contributed Drupal module.
  89. See: https://www.drupal.org/node/895232 for further information.
  90. UPGRADE
  91. -------
  92. Any views created with the 7.x-1.x or 7.x-2.x module version will be
  93. incompatible. The mappings of the view fields to OAI-PMH elements will have to
  94. be manually redone in the views. Backup your data before upgrading!
  95. The structure of the module's theming layer is completely different, so any
  96. theme code (theme functions or template files) made for the original Views
  97. OAI-PMH versions will have to be reworked.
  98. CONFIGURATION
  99. -------------
  100. Anyone familiar with the Views module should quickly feel comfortable with
  101. Views OAI-PMH. Outlined below are the steps required to create a new OAI-PMH
  102. endpoint. Understanding Views concepts such as displays, fields and filters is
  103. required.
  104. * Configure the module following these steps:
  105. - Add a new view, with neither a page nor a block display, i.e. with just a
  106. "Master" display, showing content unsorted (Views OAI-PMH handles the
  107. sorting). Continue & edit this view.
  108. - Add an "OAI-PMH" display to the view.
  109. - Edit the Repository name. By default it is filled with the site's name.
  110. This name will appear in response to OAI-PMH "Identify" requests.
  111. - Add any desired filter criteria. These will limit what content is available
  112. from your new OAI-PMH endpoint.
  113. - Add any fields that provide the data that you wish to publish through
  114. OAI-PMH (for example, "Content: Title", "Content: Body", "Content: Post
  115. date"). Some things to consider when configuring a field:
  116. - You may uncheck the "Create a label" option, as labels will not be part of
  117. the OAI-PMH output and will simply be ignored. You may still want to use
  118. labels for documentation purposes though.
  119. - In the "No results behavior" section, the "Hide if empty" option must be
  120. checked to avoid empty XML tags or attributes in the output.
  121. - In the "Rewrite results" section, check the "Strip HTML tags" option. HTML
  122. markup is not allowed in OAI-PMH elements.
  123. - Title fields must have the "Link this field to the original piece of
  124. content" option disabled.
  125. - Text fields must use the "Plain text" formatter. Again, HTML markup is not
  126. allowed in OAI-PMH elements.
  127. * Date fields must be formatted according to the requirements of the
  128. metadata format, e.g. W3CDTF.
  129. * Link fields and Entity Reference fields must not output links, just plain
  130. text, e.g. an URL, a title.
  131. - In the "Format" section, click the "Settings" link. This will take you to
  132. the "OAI-PMH Style options", where you'll find the mapping interface.
  133. - Enable the desired metadata formats for your new OAI-PMH endpoint. The
  134. Dublin Core (oai_dc) format is mandatory.
  135. - If desired, edit the metadata prefixes that will be recognized by your OAI-
  136. PMH endpoint. Note that each prefix must be unique.
  137. - For each enabled format, a table is provided where you may associate each
  138. field that's been added to the display with an element in that metadata
  139. format. For example, in the "Field mappings for Dublin Core" table you
  140. could associate the "Content: Title" field with the "dc:title" element, the
  141. "Content: Body" with the "dc:description" element, and the "Content: Post
  142. date" with the "dc:date" element.
  143. - Configure a path for this display, such as "my-oai-pmh", in the "OAI-PMH
  144. Settings" section.
  145. - In the "Pager" section, make sure to use the "Full" pager. The specified
  146. number of items per page will control how many records will appear in an
  147. OAI-PMH response (harvesters will make multiple requests using resumption
  148. tokens to get more records).
  149. - Save the view.
  150. - Optionally, you can test your new endpoint by going to
  151. http://re.cs.uct.ac.za/ and entering the absolute URL for your display,
  152. e.g. http://example.com/my-oai-pmh, in the "Enter the OAI baseURL" box, and
  153. then clicking the "Test the specified/selected baseURL" link (on the right
  154. side of the page).
  155. DEALING WITH ATTRIBUTES
  156. -----------------------
  157. Some metadata formats require that XML tags have specific attributes, such as a
  158. "language" attribute. Views OAI-PMH allows you to map a field to an attribute:
  159. Just select a target that's prefixed with "(Attribute)", e.g. "(Attribute)
  160. Language".
  161. Sometimes your content does not provide any data for those values, in which
  162. case you can add to the view a "Global: Custom Text" field, which you'll be
  163. able to map to an attribute.
  164. A field that's mapped to an attribute must be positioned above the field that's
  165. mapped to the element that uses the attribute. For example, to generate the
  166. following MODS snippet:
  167. fr
  168. Smith, John
  169. The view might use four fields (order is important):
  170. - "Global: Custom text", configured with text "rfc3066"
  171. - "Content: My language field", which will provide a language code, e.g. "fr"
  172. - "Global: Custom text", configured with text "local"
  173. - "Content: My author field", which will provide an author's name, e.g. "Smith,
  174. John".
  175. Then the view would have the following MODS mappings:
  176. - "Global: Custom text" mapped to "(Attribute) authority"
  177. - "Content: My language field" mapped to "language (multiple) > languageTerm"
  178. - "Global: Custom text" mapped to "(Attribute) authority"
  179. - "Content: My author field" mapped to "name (multiple) > namePart"
  180. If it wasn't for the second "Global: Custom text" field being mapped to
  181. "(Attribute) authority", there would be no "authority" attribute on the
  182. tag because the first attribute gets consumed by the
  183. tag, which appears before . Indeed, any field that's mapped to an
  184. attribute is consumed by the first encountered element that allows that
  185. attribute, making that attribute value unavailable to any other elements
  186. further down the list of fields.
  187. Moreover, attributes are assigned depth-first to the target element. For
  188. example, when building the output for the "name (multiple) > namePart" element,
  189. the system first checks if the MODS metadata format allows an authority
  190. attribute on a tag. That attribute not being allowed on this tag,
  191. the system then tries with the parent tag, , finds that it is allowed
  192. there, and therefore lets the tag that consume the attribute.
  193. DEALING WITH MULTIVALUED FIELDS
  194. -------------------------------
  195. We usually need multivalued fields to generate multiple tags in the XML output,
  196. one for each value. For example, a multivalued Entity Reference field might
  197. generate the following oai_dc snippet:
  198. Brooks, Kevin
  199. Nicci, French
  200. Mason, Matt
  201. For this to happen, the field must be configured appropriately in the view:
  202. - Formatter: Title (no link)
  203. - Multiple field settings > Display all values in the same row: Enabled.
  204. - Multiple field settings > Display type: Simple separator
  205. - Multiple field settings > Separator: Any character or character sequence that
  206. is unlikely to appear in a title.
  207. - Multiple field settings > Display "all" value(s) starting from "0".
  208. - No results behavior > Hide if empty: Enabled.
  209. In the mapping interface, the field is then mapped to "dc:creator" (in the
  210. Dublin Core table).
  211. Unless noted otherwise in a mapping's target name, multiple values will
  212. automatically generate multiple leaf nodes in the XML. For example, a
  213. multivalued field that's mapped to "physicalDescription > form" in MODS will
  214. generate a new
    tag for each value, all under a common
  215. parent, as in the following snippet:
  216. text
  217. image
  218. video
  219. Some mappings, however, generate multiple nodes higher up in the XML tree. In
  220. those cases, the label "(multiple)" indicates which tag will get repeated. The
  221. following MODS snippet shows the output for a multivalued field that's mapped
  222. to "name (multiple) > namePart":
  223. Brooks, Kevin
  224. Nicci, French
  225. Mason, Matt
  226. In the above example, it is the tag, rather than the leaf, that gets
  227. repeated for each field value. Note that the "authority" attribute gets
  228. repeated as well. As mentioned earlier, an attribute gets consumed by the first
  229. encountered element that allows that attribute. When that element has multiple
  230. values, the same attribute will apply to all of the values.
  231. If a multivalued field is mapped to an attribute, however, the system will
  232. instead try to assign each value to an element whose position with respect to
  233. its siblings in the XML tree matches the value's index. It is thus possible to
  234. output the following MODS snippet:
  235. Brooks, Kevin
  236. Nicci, French
  237. Mason, Matt
  238. To generate the above output, the view might have the following three fields
  239. (again, order is important):
  240. - "Global: Custom text", configured for text "local"
  241. - "Content: My author field", an Entity Reference field configured with the
  242. formatter "URL as plain text", and proper settings for a multivalued field.
  243. - "Content: My author field", another instance of the same Entity Reference
  244. field, this time configured with the formatter "Title (no link)". Also
  245. configured with proper settings for a multivalued field.
  246. Then the view would have the following MODS mappings:
  247. - "Global: Custom text" mapped to "(Attribute) authority"
  248. - "Content: My author field" mapped to "(Attribute) xlink:href"
  249. - "Content: My author field" mapped to "name (multiple) > namePart"
  250. DEFAULT VIEW
  251. ------------
  252. After the Views OAI-PMH module has been enabled, a new view called "OAI-PMH
  253. endpoint" becomes available. You may review and edit it using Views UI, at
  254. Administer » Structure » Views. That view provides a basic example for
  255. mapping oai_dc elements to fields provided by the Biblio module
  256. https://www.drupal.org/project/biblio .
  257. The oai_dc metadata format is mandatory for OAI-PMH compliance. How you map its
  258. elements, however, will depend on your site's structure. If your site does not
  259. use the Biblio module, for instance, you'll have to edit the view, or disable it
  260. and create a new one, then add the required fields and configure the mappings.
  261. THEMING AND TEMPLATING
  262. ----------------------
  263. To manipulate the output before it gets rendered as XML, you may implement the
  264. "views_oai_pmh_response" theme hook in your theme. This function receives,
  265. among other arguments, a PHP DOMDocument object containing the XML tree of the
  266. OAI-PMH response. For more details, see the default implementation of
  267. theme_views_oai_pmh_response() in views_oai_pmh.theme.inc.
  268. Field templates are not supported.
  269. IMPLEMENTING NEW METADATA FORMATS
  270. ---------------------------------
  271. Any module can provide additional metadata formats to Views OAI-PMH. This
  272. requires implementing two hooks:
  273. * hook_views_oai_pmh_metadata_format_info()
  274. - This hook returns the OAI-PMH metadata formats supported by the module. It
  275. simply returns an array where each value is the identifier of a metadata
  276. format provided by the module, e.g. "oai_dc", "my_oai_format".
  277. * hook_views_oai_pmh_metadata_format()
  278. - This hook receives a metadata format identifier as argument and returns an
  279. instance of the metadata format object corresponding to that id. That
  280. object's class must be a subclass of the views_oai_pmh_format class, which
  281. you can find in includes/format.inc. Have a look at the includes/formats
  282. directory for implementation examples.
  283. Views OAI-PMH itself implements those two hooks to provide its own formats. You
  284. can find these implementations in the views_oai_pmh.module file.
  285. ALTERING EXISTING METADATA FORMATS
  286. ----------------------------------
  287. A module may implement the hook_views_oai_pmh_metadata_format_alter() hook to
  288. alter any of the metadata formats provided by other modules. The function's sole
  289. argument is an object of class views_oai_pmh_format. The implementor may
  290. check that object's id attribute to identify the format.
  291. MAINTAINERS
  292. -----------
  293. Current maintainers:
  294. * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid
  295. This project has been sponsored by:
  296. * Consortium on Electronic Literature (CELL) http://eliterature.org/cell/
  297. * Minnesota Historical Society http://www.mnhs.org/index.htm
  298. * The Open University http://www.open.ac.uk
  299. * Support for metadata format EruditArticle (in the 7.x-3.x branch) has been
  300. developed has part of the CO.SHS project (co-shs.ca) and sponsored by the
  301. Canada Foundation for Innovation (Initiative sur la cyberinfrastructure –
  302. premier défi – premier concours). It was implemented by Laboratoire NT2
  303. (nt2.uqam.ca).