From 044f1e74df2f431677deee966d793bd3018de720 Mon Sep 17 00:00:00 2001 From: einspanier Date: Mon, 19 Nov 2018 13:38:18 +0100 Subject: [PATCH] changes for version 1.0.0, added support for dcat -> iso19139 harvesting --- pom.xml | 13 +- .../eu/odp/harvest/geo/oai/Harvester.java | 131 ----- .../odp/harvest/geo/oai/HarvesterManager.java | 127 ----- .../eu/odp/harvest/geo/oai/Harvesters.java | 44 -- .../geo/oai/JsonPackageRequestProcessor.java | 24 + .../odp/harvest/geo/oai/ManagerException.java | 28 - .../harvest/geo/oai/OsParameterProcessor.java | 47 -- .../geo/oai/xslt/HttpAwareUriResolver.java | 80 +++ .../oai/xslt/HttpAwareUriResolverFactory.java | 14 + src/main/resources/camel-oai-pmh.xml | 70 +-- src/main/resources/ckanRequest.xsl | 2 +- src/main/resources/ckanResponse.xsl | 2 +- src/main/resources/dcat2iso.xsl | 503 +++++++++--------- .../eu/odp/harvest/geo/oai/jaxb.index | 2 - src/main/resources/inspireRequest.xsl | 4 +- src/main/resources/inspireResponse.xsl | 2 +- src/main/resources/iso2dcat.xsl | 230 ++++---- src/main/resources/jsonPackageRequest.xsl | 174 ++++++ src/main/resources/jsonPackageResponse.xsl | 113 ++++ src/main/resources/log4j.xml | 2 +- src/main/resources/oai-pmhUtil.xsl | 2 +- 21 files changed, 795 insertions(+), 819 deletions(-) delete mode 100644 src/main/java/eu/odp/harvest/geo/oai/Harvester.java delete mode 100644 src/main/java/eu/odp/harvest/geo/oai/HarvesterManager.java delete mode 100644 src/main/java/eu/odp/harvest/geo/oai/Harvesters.java create mode 100644 src/main/java/eu/odp/harvest/geo/oai/JsonPackageRequestProcessor.java delete mode 100644 src/main/java/eu/odp/harvest/geo/oai/ManagerException.java delete mode 100644 src/main/java/eu/odp/harvest/geo/oai/OsParameterProcessor.java create mode 100644 src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolver.java create mode 100644 src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolverFactory.java delete mode 100644 src/main/resources/eu/odp/harvest/geo/oai/jaxb.index create mode 100644 src/main/resources/jsonPackageRequest.xsl create mode 100644 src/main/resources/jsonPackageResponse.xsl diff --git a/pom.xml b/pom.xml index af0bda4..4d90d0a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ oai-pmh-geo-harvest war EU ODP Geo-Harvesting via OAI-PMH - 0.9.0-SNAPSHOT + 1.0.0-SNAPSHOT This is the web application of the harvest service @@ -22,7 +22,7 @@ junit junit - 4.10 + 4.12 test @@ -60,10 +60,9 @@ camel-jaxb ${camel.version} - org.apache.camel - camel-http4 + camel-http ${camel.version} @@ -72,9 +71,9 @@ ${spring.version} - xalan - xalan - 2.7.1 + net.sf.saxon + Saxon-HE + 9.8.0-14 diff --git a/src/main/java/eu/odp/harvest/geo/oai/Harvester.java b/src/main/java/eu/odp/harvest/geo/oai/Harvester.java deleted file mode 100644 index 5182dcf..0000000 --- a/src/main/java/eu/odp/harvest/geo/oai/Harvester.java +++ /dev/null @@ -1,131 +0,0 @@ -package eu.odp.harvest.geo.oai; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - * Business class that represents a harvester and can be marshalled to XML. - */ -@XmlRootElement -@XmlType(propOrder={"id","endpoint","type","name","description","url","selective"}) -public class Harvester { - String id; - String endpoint; - String type; - String name; - String description; - String url; - boolean selective; - - /** - * Gets the ID. - * @return id - */ - public String getId() { - return id; - } - - /** - * Sets the ID. - * @param id id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets the HTTP endpoint where this harvester is available. - * @return enpoint URL - */ - public String getEndpoint() { - return endpoint; - } - - /** - * Sets the HTTP endpoint where this harvester is available. - * @param endpoint endpoint URL - */ - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - - /** - * Gets the type of the harvester, e.g inspire. - * @return type - */ - public String getType() { - return type; - } - - /** - * Sets the type of the harvester, e.g. inspire. - * @param type type - */ - public void setType(String type) { - this.type = type; - } - - /** - * Gets the URL of the target catalog - * @return URL of the target catalog - */ - public String getUrl() { - return url; - } - - /** - * Sets the URL of the target catalog. - * @param url URL of the target catalog - */ - public void setUrl(String url) { - this.url = url; - } - - /** - * Gets the description. - * @return description - */ - public String getDescription() { - return description; - } - - /** - * Sets the description - * @param description description - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * Gets the name. - * @return name - */ - public String getName() { - return name; - } - - /** - * Sets the name - * @param name name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Gets flag if the catalog supports selective harvesting. - * @return true, if selective harvesting is supported - */ - public boolean isSelective() { - return selective; - } - - /** - * Sets flag if the catalog supports selective harvesting. - * @param selective flag - */ - public void setSelective(boolean selective) { - this.selective = selective; - } -} diff --git a/src/main/java/eu/odp/harvest/geo/oai/HarvesterManager.java b/src/main/java/eu/odp/harvest/geo/oai/HarvesterManager.java deleted file mode 100644 index 6ced795..0000000 --- a/src/main/java/eu/odp/harvest/geo/oai/HarvesterManager.java +++ /dev/null @@ -1,127 +0,0 @@ -package eu.odp.harvest.geo.oai; - -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.Route; -import org.apache.camel.model.ModelCamelContext; -import org.apache.camel.model.RoutesDefinition; -import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import java.io.*; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Management class for new harvesters. - * This class provides methods to create a list of harvesters from a list of parameter maps and - * to validate parameters for new or updated harvesters. - */ -public class HarvesterManager implements CamelContextAware { - - // Logger - private final static Logger LOG = Logger.getLogger(HarvesterManager.class); - - // Camel context to deploy harvester routes to - private ModelCamelContext camelContext; - - // Regular expression that harvester IDs must match, can also be set via Spring config - private String idRegex = "^[a-zA-Z0-9\\-]*$"; - - private String harvesterBaseUrl; - - /** - * Creates the list of harvesters from a list of parameter maps. - * @param mapList list of parameter maps - * @return harvesters - */ - public Harvesters createHarvesters(List mapList) { - ArrayList harvesters = new ArrayList(mapList.size()); - for (Map map : mapList) { - harvesters.add(createHarvester(map)); - } - return new Harvesters(harvesters); - } - - /** - * Creates a single harvester instance. - * @param mapList the list of results. Must be of size 1. - * @return a harvester instance - */ - public Harvester createHarvester(List mapList) { - if (mapList.size() == 0) { - throw new ManagerException("No such harvester", 404); - } - if (mapList.size() > 1) { - throw new ManagerException("The request resulted in ambiguous response", 500); - } - return createHarvester(mapList.get(0)); - } - - private Harvester createHarvester(Map map) { - Harvester harvester = new Harvester(); - harvester.setId((String) map.get("id")); - harvester.setEndpoint(harvesterBaseUrl + harvester.getId()); - harvester.setType((String) map.get("type")); - harvester.setUrl((String) map.get("url")); - harvester.setDescription((String) map.get("description")); - harvester.setName((String) map.get("name")); - harvester.setSelective(((Number) map.get("selective")).intValue() != 0); - return harvester; - } - - /** - * Validates parameters for a new or updated harvester. - * @param id id of the harvester, will be part of the URL path - * @param type type of the harvester, must be a known Camel route - * @param url URL of the target catalog - */ - public void validateParams(String id, String type, String url) { - if (id == null || id.isEmpty() || ! id.matches(idRegex)) { - throw new ManagerException("Please specify a valid ID that matches the regular expression " + - idRegex, 400); - } - if (camelContext.getEndpoint(type) == null) { - throw new ManagerException("No such harvester type: " + type, 400); - } - try { - URL tmp = new URL(url); - } catch (MalformedURLException e) { - throw new ManagerException("The URL is invalid: " + e.getMessage(), 400); - } - } - - @Override - public void setCamelContext(CamelContext camelContext) { - if (LOG.isDebugEnabled()) { - LOG.debug("Setting camel context to " + camelContext); - } - this.camelContext = (ModelCamelContext) camelContext; - } - - @Override - public CamelContext getCamelContext() { - return camelContext; - } - - /** - * Sets the regular expression that checks if a new harvester ID is valid - * @param idRegex regular expression - */ - public void setIdRegex(String idRegex) { - this.idRegex = idRegex; - } - - public void setHarvesterBaseUrl(String harvesterBaseUrl) { - if (! harvesterBaseUrl.endsWith("/")) { - harvesterBaseUrl = harvesterBaseUrl + "/"; - } - this.harvesterBaseUrl = harvesterBaseUrl; - } -} diff --git a/src/main/java/eu/odp/harvest/geo/oai/Harvesters.java b/src/main/java/eu/odp/harvest/geo/oai/Harvesters.java deleted file mode 100644 index f28f4b3..0000000 --- a/src/main/java/eu/odp/harvest/geo/oai/Harvesters.java +++ /dev/null @@ -1,44 +0,0 @@ -package eu.odp.harvest.geo.oai; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.util.ArrayList; - -/** - * Business class that represents a list of harvesters and can be marshalled to XML. - */ -@XmlRootElement -public class Harvesters { - private ArrayList harvesters; - - /** - * Default constructor. - */ - public Harvesters() { - } - - /** - * Constructor. - * @param harvesters list of harvesters - */ - public Harvesters(ArrayList harvesters) { - setHarvesters(harvesters); - } - - /** - * Gets the harvesters. - * @return harvesters - */ - @XmlElement(name = "harvester") - public ArrayList getHarvesters() { - return harvesters; - } - - /** - * Sets the harvesters. - * @param harvesters harvesters - */ - public void setHarvesters(ArrayList harvesters) { - this.harvesters = harvesters; - } -} diff --git a/src/main/java/eu/odp/harvest/geo/oai/JsonPackageRequestProcessor.java b/src/main/java/eu/odp/harvest/geo/oai/JsonPackageRequestProcessor.java new file mode 100644 index 0000000..3dedf40 --- /dev/null +++ b/src/main/java/eu/odp/harvest/geo/oai/JsonPackageRequestProcessor.java @@ -0,0 +1,24 @@ +package eu.odp.harvest.geo.oai; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; + +public class JsonPackageRequestProcessor implements Processor { + @Override + public void process(Exchange exchange) throws Exception { + Message in = exchange.getIn(); + String verb = in.getHeader("verb", String.class); + if ("ListRecords".equals(verb)) { + + } + else if ("GetRecord".equals(verb)) { + + } + else if ("ListIdentifiers".equals(verb)) { + + } + else { + } + } +} diff --git a/src/main/java/eu/odp/harvest/geo/oai/ManagerException.java b/src/main/java/eu/odp/harvest/geo/oai/ManagerException.java deleted file mode 100644 index 3d73696..0000000 --- a/src/main/java/eu/odp/harvest/geo/oai/ManagerException.java +++ /dev/null @@ -1,28 +0,0 @@ -package eu.odp.harvest.geo.oai; - -/** - * Exception thrown by the HarvesterManager. - */ -public class ManagerException extends RuntimeException { - - // used in the response as HTTP status code - private final int statusCode; - - /** - * Constructor - * @param msg exception message - * @param statusCode status code - */ - public ManagerException(String msg, int statusCode) { - super(msg); - this.statusCode = statusCode; - } - - /** - * Returns the status code - * @return status code - */ - public int getStatusCode() { - return statusCode; - } -} diff --git a/src/main/java/eu/odp/harvest/geo/oai/OsParameterProcessor.java b/src/main/java/eu/odp/harvest/geo/oai/OsParameterProcessor.java deleted file mode 100644 index cf6015d..0000000 --- a/src/main/java/eu/odp/harvest/geo/oai/OsParameterProcessor.java +++ /dev/null @@ -1,47 +0,0 @@ -package eu.odp.harvest.geo.oai; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.apache.log4j.Logger; - -import java.util.Map; - -/** - * Creates the OpenSearch URL by instantiating the template URL. - */ -public class OsParameterProcessor implements Processor { - - private final static String START_INDEX_TEMPLATE = "{startIndex?}"; - private final static String START_PAGE_TEMPLATE = "{startPage?}"; - - // Logger - private final static Logger LOG = Logger.getLogger(OsParameterProcessor.class); - - @Override - public void process(Exchange exchange) throws Exception { - Message in = exchange.getIn(); - Map headers = in.getHeaders(); - String urlTemplate = (String) headers.get(Exchange.HTTP_URI); - if (urlTemplate == null) { - LOG.warn("No CamelHttpUri set on message"); - return; - } - int index = urlTemplate.indexOf('?'); - if (index < 0) { - LOG.warn("No query parameters in template URL"); - return; - } - headers.put(Exchange.HTTP_URI, urlTemplate.substring(0, index)); - String httpQuery = urlTemplate.substring(index + 1); - if (httpQuery.contains(START_INDEX_TEMPLATE)) { - headers.put(Exchange.HTTP_QUERY, httpQuery.replace(START_INDEX_TEMPLATE, in.getBody().toString())); - } - else if (httpQuery.contains(START_PAGE_TEMPLATE)) { - headers.put(Exchange.HTTP_QUERY, httpQuery.replace(START_PAGE_TEMPLATE, in.getBody().toString())); - } - else { - LOG.warn("No template parameters to replace"); - } - } -} diff --git a/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolver.java b/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolver.java new file mode 100644 index 0000000..a05b768 --- /dev/null +++ b/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolver.java @@ -0,0 +1,80 @@ +package eu.odp.harvest.geo.oai.xslt; + +import org.apache.camel.CamelContext; +import org.apache.camel.builder.xml.XsltUriResolver; +import org.apache.camel.spi.ClassResolver; +import org.apache.camel.util.FileUtil; +import org.apache.camel.util.ObjectHelper; +import org.apache.camel.util.ResourceHelper; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; + +import javax.xml.transform.Source; +import javax.xml.transform.TransformerException; +import javax.xml.transform.URIResolver; +import javax.xml.transform.stream.StreamSource; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * Resolves a document reference for protcols "http" or "https" in an XSL document with HTTP client. + * For all other URIs uses the default rsolver base don classpath. + */ +public class HttpAwareUriResolver implements URIResolver { + + private final static Logger LOG = Logger.getLogger(HttpAwareUriResolver.class); + + private static HttpClient httpClient = new HttpClient(new MultiThreadedHttpConnectionManager()); + + @Override + public Source resolve(String href, String base) throws TransformerException { + if (ObjectHelper.isEmpty(href)) { + throw new TransformerException("include href is empty"); + } else { + LOG.debug("Resolving URI with href: " + href); + if (href.startsWith("http:") || href.startsWith("https:")) { + try { + return resolveHttp(href); + } catch (Exception e) { + throw new TransformerException(e); + } + } else { + String scheme = ResourceHelper.getScheme(href); + href = href.startsWith("/") ? href : "/" + href; + return new StreamSource(getClass().getResourceAsStream(href)); + } + } + } +/* + public Source resolve(String href, String base) throws TransformerException { + if (href.startsWith("http:") || href.startsWith("https:")) { + try { + return resolveHttp(href); + } + catch (Exception e) { + LOG.error("Error resolving resource " + href, e); + throw new TransformerException("Error resolving resource " + href, e); + } + } + else { + return super.resolve(href, base); + } + } +*/ + + private Source resolveHttp(String href) throws Exception { + GetMethod method = new GetMethod(href); + try { + httpClient.executeMethod(method); + byte[] bytes = method.getResponseBody(); + return new StreamSource(new ByteArrayInputStream(bytes)); +// return new StreamSource(method.getResponseBodyAsStream()); + } + finally { + method.releaseConnection(); + } + } +} diff --git a/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolverFactory.java b/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolverFactory.java new file mode 100644 index 0000000..303a7cc --- /dev/null +++ b/src/main/java/eu/odp/harvest/geo/oai/xslt/HttpAwareUriResolverFactory.java @@ -0,0 +1,14 @@ +package eu.odp.harvest.geo.oai.xslt; + +import org.apache.camel.CamelContext; +//import org.apache.camel.builder.xml.XsltUriResolver; +//import org.apache.camel.component.xslt.DefaultXsltUriResolverFactory; + +import javax.xml.transform.URIResolver; + +public class HttpAwareUriResolverFactory { + public URIResolver createUriResolver(CamelContext camelContext, String resourceUri) { +// return new HttpAwareUriResolver(camelContext, resourceUri); + return null; + } +} diff --git a/src/main/resources/camel-oai-pmh.xml b/src/main/resources/camel-oai-pmh.xml index 5145a93..6cd5bd2 100644 --- a/src/main/resources/camel-oai-pmh.xml +++ b/src/main/resources/camel-oai-pmh.xml @@ -11,18 +11,14 @@ - - - - - - - - + + + + @@ -51,10 +47,6 @@ - - - - java.lang.Exception @@ -64,6 +56,7 @@ <error>Internal error, please check the log files</error> + 500 @@ -213,7 +206,6 @@ - @@ -223,14 +215,14 @@ ${header.metadataPrefix} == null - euro_dcat_ap + iso19139 <dummy/> - + @@ -249,9 +241,6 @@ /parameters/parameter[name='httpQuery']/value/text() - - <dummy/> - @@ -263,18 +252,22 @@ + + + ${body} + + + <dummy/> + - ${header.out} == null - - - - ${header.out} != 'dcat' - + ${header.out} == null || ${header.out} != 'dcat' + + text/xml @@ -309,34 +302,5 @@ - - - - - ${date:now:yyyy-MM-dd'T'HH:mm:ss'Z'} - - - - ${db.item.ckan.URL}/catalog.xml - - - - text/xml - - - - - - - ${date:now:yyyy-MM-dd'T'HH:mm:ss'Z'} - - - ${db.item.ckan.URL}/dataset/d04a7b1e-3e60-4591-b04c-94912ac54afe.xml - - - - text/xml - - \ No newline at end of file diff --git a/src/main/resources/ckanRequest.xsl b/src/main/resources/ckanRequest.xsl index ae4d689..8f4f69d 100644 --- a/src/main/resources/ckanRequest.xsl +++ b/src/main/resources/ckanRequest.xsl @@ -1,6 +1,6 @@ - diff --git a/src/main/resources/ckanResponse.xsl b/src/main/resources/ckanResponse.xsl index 0aa31ed..61e64e8 100644 --- a/src/main/resources/ckanResponse.xsl +++ b/src/main/resources/ckanResponse.xsl @@ -1,6 +1,6 @@ - - + exclude-result-prefixes="dcat dcatde dct foaf gml locn rdf rdfs vcard" + expand-text="true"> @@ -28,14 +29,34 @@ xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd"> - + + utf8 + + + + dataset + + + + unknown + + + + + + ISO19115 + + + 2003/Cor.1:2006 + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + - - - - - - - + + + + + + + + + unknown + + + @@ -113,17 +113,7 @@ - - - - - - - - - - - + @@ -141,91 +131,120 @@ - - + + + + + + + + + + - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + codeListValue="{$function}">{$function} - - - - - - - - - - - - - - - - - - - true - - - - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + @@ -258,67 +277,57 @@ - + {$code} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + unknown + + + + + + + - + + + + + + + + + + + + @@ -384,7 +393,7 @@ - + @@ -404,11 +413,6 @@ - - - - - @@ -419,11 +423,6 @@ - - - - - @@ -438,11 +437,6 @@ - - - - - @@ -450,7 +444,7 @@ - + @@ -500,14 +494,18 @@ - + + + + openDataLicense + - + @@ -521,7 +519,7 @@ - + @@ -628,7 +626,7 @@ - + @@ -665,7 +663,7 @@ - + @@ -696,9 +694,6 @@ - - - @@ -872,24 +867,51 @@ - - - - - true - - - - - - - - - - - + + + + + + + true + + + + + + + + + + + + + + @@ -897,29 +919,16 @@ - - - - - - - - - - - - - - - - - - - pointOfContact - - - + + + + + + + pointOfContact + + @@ -1088,27 +1097,35 @@ - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + @@ -1118,9 +1135,11 @@ - - - + + + + + @@ -1233,6 +1252,12 @@ + + + + + + @@ -1260,4 +1285,6 @@ + + diff --git a/src/main/resources/eu/odp/harvest/geo/oai/jaxb.index b/src/main/resources/eu/odp/harvest/geo/oai/jaxb.index deleted file mode 100644 index 6bcd97b..0000000 --- a/src/main/resources/eu/odp/harvest/geo/oai/jaxb.index +++ /dev/null @@ -1,2 +0,0 @@ -Harvesters -Harvester \ No newline at end of file diff --git a/src/main/resources/inspireRequest.xsl b/src/main/resources/inspireRequest.xsl index ad257e5..3be9b22 100644 --- a/src/main/resources/inspireRequest.xsl +++ b/src/main/resources/inspireRequest.xsl @@ -1,6 +1,6 @@ - @@ -76,7 +76,7 @@ - + badArgument Bad argument: metadataPrefix diff --git a/src/main/resources/inspireResponse.xsl b/src/main/resources/inspireResponse.xsl index dc2dde9..1904197 100644 --- a/src/main/resources/inspireResponse.xsl +++ b/src/main/resources/inspireResponse.xsl @@ -1,6 +1,6 @@ - - @@ -116,7 +117,7 @@ - + @@ -339,8 +340,9 @@ - + match="gmd:dateStamp/*[text() castable as xs:date or text() castable as xs:dateTime]"> + + @@ -461,11 +463,11 @@ - + - + @@ -577,73 +579,92 @@ - + match="gml:beginPosition[text() castable as xs:date or text() castable as xs:dateTime]"> + + - + match="gml:endPosition[text() castable as xs:date or text() castable as xs:dateTime]"> + + - + match="gmd:date/*[gmd:dateType/*/@codeListValue='publication']/gmd:date/*[text() castable as xs:date or text() castable as xs:dateTime]"> + + - + match="gmd:date/*[gmd:dateType/*/@codeListValue='revision']/gmd:date/*[text() castable as xs:date or text() castable as xs:dateTime]"> + + - + match="gmd:date/*[gmd:dateType/*/@codeListValue='creation']/gmd:date/*[text() castable as xs:date or text() castable as xs:dateTime]"> + + - + + + + http://www.w3.org/2001/XMLSchema#date + + + http://www.w3.org/2001/XMLSchema#dateTime + + + - + + - + + - + + - + + - + + @@ -934,23 +955,21 @@ - - - + + + + + + + + + Resource - - - - - - - - - - - + + + @@ -984,28 +1003,6 @@ - @@ -1041,11 +1038,11 @@ - + - + @@ -1128,32 +1125,7 @@ - @@ -1456,55 +1428,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/src/main/resources/jsonPackageRequest.xsl b/src/main/resources/jsonPackageRequest.xsl new file mode 100644 index 0000000..d974569 --- /dev/null +++ b/src/main/resources/jsonPackageRequest.xsl @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + ${db.item.ckan.URL} + + + + + + + + + + + + + + + + + + + + + Bad or missing verb + badVerb + + + + + + + + + + badArgument + Bad argument: metadataPrefix + + + + + badArgument + Missing argument: identifier + + + + + + + + + + + + + cannotDisseminateFormat + Cannot disseminate format specified by metadataPrefix + + + + + noSetHierarchy + Sets not supported + + + + + noSetHierarchy + Until not supported + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + httpUri + + + + + + httpQuery + + + + + + + + + + diff --git a/src/main/resources/jsonPackageResponse.xsl b/src/main/resources/jsonPackageResponse.xsl new file mode 100644 index 0000000..f6666a5 --- /dev/null +++ b/src/main/resources/jsonPackageResponse.xsl @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + {current-dateTime()} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {j:string[@key='id']} + {j:string[@key='metadata_modified']} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml index 2d9ee69..00495e4 100644 --- a/src/main/resources/log4j.xml +++ b/src/main/resources/log4j.xml @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/oai-pmhUtil.xsl b/src/main/resources/oai-pmhUtil.xsl index a590d7e..a7ca711 100644 --- a/src/main/resources/oai-pmhUtil.xsl +++ b/src/main/resources/oai-pmhUtil.xsl @@ -1,5 +1,5 @@ -