From 7799c3b263d42feb09dc3117f3e29777590ab8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Mas=C3=A1r?= Date: Fri, 25 May 2012 16:01:25 +0200 Subject: [PATCH 1/4] DS-1178: XSLT stylesheet for OAI-PMH --- .../src/main/webapp/WEB-INF/web.xml | 5 + .../src/main/webapp/oai2.xsl | 659 ++++++++++++++++++ dspace/config/oaicat.properties | 3 + 3 files changed, 667 insertions(+) create mode 100644 dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl diff --git a/dspace-oai/dspace-oai-webapp/src/main/webapp/WEB-INF/web.xml b/dspace-oai/dspace-oai-webapp/src/main/webapp/WEB-INF/web.xml index c161d40924..b0656b8134 100644 --- a/dspace-oai/dspace-oai-webapp/src/main/webapp/WEB-INF/web.xml +++ b/dspace-oai/dspace-oai-webapp/src/main/webapp/WEB-INF/web.xml @@ -62,6 +62,11 @@ ORG.oclc.oai.server.OAIHandler + + default + *.xsl + + oai-handler /request diff --git a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl new file mode 100644 index 0000000000..c231307dba --- /dev/null +++ b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl @@ -0,0 +1,659 @@ + + + + + + + + + + + + + + + +td.value { + vertical-align: top; + padding-left: 1em; + padding: 3px; +} +td.key { + background-color: #e0e0ff; + padding: 3px; + text-align: right; + border: 1px solid #c0c0c0; + white-space: nowrap; + font-weight: bold; + vertical-align: top; +} +.dcdata td.key { + background-color: #ffffe0; +} +body { + margin: 1em 2em 1em 2em; +} +h1, h2, h3 { + font-family: sans-serif; + clear: left; +} +h1 { + padding-bottom: 4px; + margin-bottom: 0px; +} +h2 { + margin-bottom: 0.5em; +} +h3 { + margin-bottom: 0.3em; + font-size: medium; +} +.link { + border: 1px outset #88f; + background-color: #c0c0ff; + padding: 1px 4px 1px 4px; + font-size: 80%; + text-decoration: none; + font-weight: bold; + font-family: sans-serif; + color: black; +} +.link:hover { + color: red; +} +.link:active { + color: red; + border: 1px inset #88f; + background-color: #a0a0df; +} +.oaiRecord, .oaiRecordTitle { + background-color: #f0f0ff; + border-style: solid; + border-color: #d0d0d0; +} +h2.oaiRecordTitle { + background-color: #e0e0ff; + font-size: medium; + font-weight: bold; + padding: 10px; + border-width: 2px 2px 0px 2px; + margin: 0px; +} +.oaiRecord { + margin-bottom: 3em; + border-width: 2px; + padding: 10px; +} + +.results { + margin-bottom: 1.5em; +} +ul.quicklinks { + margin-top: 2px; + padding: 4px; + text-align: left; + border-bottom: 2px solid #ccc; + border-top: 2px solid #ccc; + clear: left; +} +ul.quicklinks li { + font-size: 80%; + display: inline; + list-stlye: none; + font-family: sans-serif; +} +p.intro { + font-size: 80%; +} + + + + + + + + + OAI 2.0 Request Results + + + +

OAI 2.0 Request Results

+ +

You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the bottom of the page.

+ + +

About the XSLT

+

An XSLT file has converted the OAI-PMH 2.0 responses into XHTML which looks nice in a browser which supports XSLT such as Mozilla, Firebird and Internet Explorer. The XSLT file was created by Christopher Gutteridge at the University of Southampton as part of the GNU EPrints system, and is freely redistributable under the GPL.

If you want to use the XSL file on your own OAI interface you may but due to the way XSLT works you must install the XSL file on the same server as the OAI script, you can't just link to this copy.

For more information or to download the XSL file please see the OAI to XHTML XSLT homepage.

+ + + +
+ + + + + + + + + + + + +
Datestamp of response
Request URL
+ + + +

OAI Error(s)

+

The request could not be completed due to the following error or errors.

+
+ +
+
+ +

Request was of type .

+
+ + + + + + +
+
+
+
+ + + + + + + + +
Error Code
+

+
+ + + + + + + + + + + + + + + + + + +
Repository Name
Base URL
Protocol Version
Earliest Datestamp
Deleted Record Policy
Granularity
+ + +
+ + + Admin Email + + + + + + +

Unsupported Description Type

+

The XSL currently does not support this type of description.

+
+ +
+
+ + + + + +

OAI-Identifier

+ + + + + + + + + +
Scheme
Repository Identifier
Delimiter
Sample OAI Identifier
+
+ + + + + +

EPrints Description

+ +

Content

+ +
+ +

Submission Policy

+ +
+

Metadata Policy

+ +

Data Policy

+ + +
+ + + +

+
+ +
+
+
+ + +

Comment

+
+
+ + + + + +

Friends

+
    + +
+
+ + +
  • + +Identify
  • +
    + + + + + +

    Branding

    + + +
    + + +

    Icon

    + + + {br:title} + + + {br:title} + + +
    + + +

    Metadata Rendering Rule

    + + + + + + + +
    URL
    Namespace
    Mime Type
    +
    + + + + + + +

    Gateway Information

    + + + + + + + + + + + + + + +
    Source
    Description
    URL
    Notes
    +
    + + + Admin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Set

    + + + + +
    setName
    +
    + + + + + + +

    This is a list of metadata formats available for the record "". Use these links to view the metadata:

    +
    + +

    This is a list of metadata formats available from this archive.

    +
    +
    + +
    + + +

    Metadata Format

    + + + + + + + +
    metadataPrefix
    metadataNamespace
    schema
    +
    + + + + + + + + +

    OAI Record:

    +
    + + + +
    +
    + + +

    OAI Record Header

    + + + + + + +
    OAI Identifier + + oai_dc + formats +
    Datestamp
    + +

    This record has been deleted.

    +
    +
    + + + +

    "about" part of record container not supported by the XSL

    +
    + + +   + + + + + + + + + + setSpec + + Identifiers + Records + + + + + + + + +

    There are more results.

    + + + +
    resumptionToken: + +Resume
    +
    + + + + +

    Unknown Metadata Format

    +
    + +
    +
    + + + + +
    +

    Dublin Core Metadata (oai_dc)

    + + +
    +
    +
    + + +Title + + +Author or Creator + + +Subject and Keywords + + +Description + + +Publisher + + +Other Contributor + + +Date + + +Resource Type + + +Format + + +Resource Identifier + + +Source + + +Language + + +Relation + + + + + URL + URL not shown as it is very long. + + + + + + + + + + + + + +Coverage + + +Rights Management + + + + +
    + <></> +
    +
    + + + + + ="" + + + +.xmlSource { + font-size: 70%; + border: solid #c0c0a0 1px; + background-color: #ffffe0; + padding: 2em 2em 2em 0em; +} +.xmlBlock { + padding-left: 2em; +} +.xmlTagName { + color: #800000; + font-weight: bold; +} +.xmlAttrName { + font-weight: bold; +} +.xmlAttrValue { + color: #0000c0; +} + + +
    + diff --git a/dspace/config/oaicat.properties b/dspace/config/oaicat.properties index 61d34bd942..70b986f6d6 100644 --- a/dspace/config/oaicat.properties +++ b/dspace/config/oaicat.properties @@ -46,4 +46,7 @@ Crosswalks.ore=org.dspace.app.oai.PluginCrosswalk # Crosswalks.dim=org.dspace.app.oai.PluginCrosswalk # Crosswalks.marc=org.dspace.app.oai.PluginCrosswalk +# XSLT stylesheet to transform OAI-PMH XML results in web browser to +# human-readable and browsable HTML pages +OAIHandler.styleSheet=/oai/oai2.xsl From d8ead272361d817861311e1786275734006efacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Mas=C3=A1r?= Date: Fri, 25 May 2012 17:12:10 +0200 Subject: [PATCH 2/4] add OAI XSL style for Identify/description/toolkit --- .../src/main/webapp/oai2.xsl | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl index c231307dba..ad1316661b 100644 --- a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl +++ b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Not Done The 'about' section of 'record' - The 'compession' part of 'identify' + The 'compression' part of 'identify' The optional attributes of 'resumptionToken' The optional 'setDescription' container of 'set' @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oai="http://www.openarchives.org/OAI/2.0/" + xmlns:tk="http://oai.dlib.vt.edu/OAI/metadata/toolkit" > @@ -257,11 +258,31 @@ p.intro { --> -

    Unsupported Description Type

    -

    The XSL currently does not support this type of description.

    -
    - -
    + + + +

    Description: Toolkit

    + + + + + + + + + + + +
    Title
    Author
    Version
    URL
    Icon
    +
    + +

    Unsupported Description Type

    +

    The XSL currently does not support this type of description.

    +
    + +
    +
    +
    From b252987788494fbc3b9c69d8b93f669849868e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Mas=C3=A1r?= Date: Mon, 28 May 2012 14:04:33 +0200 Subject: [PATCH 3/4] OAI XSL: display a form on badAttributes error ListRecords or ListIdentifiers with wrong arguments can result in badAttributes error. This adds a form which suggests which attributes can be filled out and their possible combinations. --- .../src/main/webapp/oai2.xsl | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl index ad1316661b..c2083fd10a 100644 --- a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl +++ b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl @@ -150,6 +150,21 @@ ul.quicklinks li { p.intro { font-size: 80%; } +#form1, #form2 { + position: relative; +} +#form1div { + position: relative; + top: 7.5em; +} +#form2div { + position: relative; + top: 1.5em; +} +#form1table, #form2table { + position: relative; + top: -2em; +} @@ -170,6 +185,19 @@ p.intro {

    About the XSLT

    An XSLT file has converted the OAI-PMH 2.0 responses into XHTML which looks nice in a browser which supports XSLT such as Mozilla, Firebird and Internet Explorer. The XSLT file was created by Christopher Gutteridge at the University of Southampton as part of the GNU EPrints system, and is freely redistributable under the GPL.

    If you want to use the XSL file on your own OAI interface you may but due to the way XSLT works you must install the XSL file on the same server as the OAI script, you can't just link to this copy.

    For more information or to download the XSL file please see the OAI to XHTML XSLT homepage.

    + @@ -200,6 +228,31 @@ p.intro {
    + +

    For your convenience, here's a form with possible combinations of arguments (required arguments are in bold text):

    +
    +
    + + +
    + + + + + +
    metadataPrefix:
    set:
    from:(YYYY-MM-DD)
    until:(YYYY-MM-DD)
    +
    +

    Alternatively, you can provide only the resumptionToken:

    +
    +
    + + +
    + + +
    resumptionToken:
    +
    +

    Request was of type .

    From faec8909541c76d97b98b63dc06787176bd1afd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Mas=C3=A1r?= Date: Mon, 28 May 2012 14:17:47 +0200 Subject: [PATCH 4/4] OAI XSL: display result count --- .../dspace-oai-webapp/src/main/webapp/oai2.xsl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl index c2083fd10a..dad405782f 100644 --- a/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl +++ b/dspace-oai/dspace-oai-webapp/src/main/webapp/oai2.xsl @@ -72,6 +72,15 @@ td.key { font-weight: bold; vertical-align: top; } +.result-count { + margin-top:10px; + background-color: #e0e0ff; + padding: 3px; + border: 1px solid #c0c0c0; + white-space: nowrap; + font-weight: bold; + vertical-align: top; +} .dcdata td.key { background-color: #ffffe0; } @@ -486,6 +495,7 @@ document.getElementById('form1').onsubmit = function(){ +
    Results fetched:
    @@ -493,6 +503,7 @@ document.getElementById('form1').onsubmit = function(){ +
    Results fetched:
    @@ -500,6 +511,7 @@ document.getElementById('form1').onsubmit = function(){ +
    Results fetched: