Skip to content
Snippets Groups Projects
Commit 2e0ee012 authored by Jan van Zadelhoff's avatar Jan van Zadelhoff
Browse files

add configuration flag to toggle the sorting of the results

parent 6ebd58c2
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ The available parameters in the camel-oai-pmh.properties file are:
* oai-pmh.dcatde.contributorID: [dcatde:contributorID](https://www.dcat-ap.de/def/contributors/) which is to be inserted in all DCAT datasets
* oai-pmh.db.item.csw.TYPE: should be one of inspire, inspireSoap11 or inspireSoap11, depending on the protocol of the Geoportal
* oai-pmh.db.item.csw.URL: GetRecords URL of the geoportal to be harvested
* oai-pmh.db.item.csw.sortResults: toggle whether the results should be sorted or not. Possible values are `true` and `false`. Defaults to `false`.
* oai-pmh.db.item.ckan.TYPE: currently only ckan is supported
* oai-pmh.db.item.ckan.URL: CKAN catalog URL to be harvested
......
......@@ -246,6 +246,7 @@
<oai-pmh.base.url.external>http://localhost:8080/omdf</oai-pmh.base.url.external>
<oai-pmh.db.item.csw.TYPE>inspire</oai-pmh.db.item.csw.TYPE>
<oai-pmh.db.item.csw.URL>https://localhost:8080/soapServices/CSWStartup</oai-pmh.db.item.csw.URL>
<oai-pmh.db.item.csw.sortResults>false</oai-pmh.db.item.csw.sortResults>
<oai-pmh.db.item.ckan.TYPE>ckan</oai-pmh.db.item.ckan.TYPE>
<oai-pmh.db.item.ckan.URL>https://localhost:9090</oai-pmh.db.item.ckan.URL>
<oai-pmh.dcatde.contributorID>http://dcat-ap.de/def/contributors/gdiDE</oai-pmh.dcatde.contributorID>
......
......@@ -2,6 +2,7 @@ harvester.base.url=${oai-pmh.base.url.external}/harvesters/
rdf.catalog.base.url=${oai-pmh.base.url.external}/gp-csw/catalog.rdf
db.item.csw.TYPE=${oai-pmh.db.item.csw.TYPE}
db.item.csw.URL=${oai-pmh.db.item.csw.URL}
db.item.csw.sortResults=${oai-pmh.db.item.csw.sortResults}
db.item.ckan.TYPE=${oai-pmh.db.item.ckan.TYPE}
db.item.ckan.URL=${oai-pmh.db.item.ckan.URL}
dcatde.contributorID=${oai-pmh.dcatde.contributorID}
......@@ -93,6 +93,9 @@
<setHeader headerName="contributorID">
<simple>{{dcatde.contributorID}}</simple>
</setHeader>
<setHeader headerName="sortResults">
<simple>{{db.item.csw.sortResults}}</simple>
</setHeader>
<removeHeader headerName="page"/>
<removeHeader headerName="cookie"/>
<!-- we need some element for xsl input, but the result only depends on header (request) parameters -->
......
......@@ -19,6 +19,7 @@
<xsl:param name="resumptionToken"/>
<xsl:param name="page"/>
<xsl:param name="soapVersion"/>
<xsl:param name="sortResults"/>
<xsl:param name="response_date"/>
......@@ -193,12 +194,14 @@
</xsl:choose>
</ogc:Filter>
</csw:Constraint>
<xsl:if test="$sortResults = 'true'">
<ogc:SortBy>
<ogc:SortProperty>
<ogc:PropertyName>apiso:Identifier</ogc:PropertyName>
<ogc:SortOrder>ASC</ogc:SortOrder>
</ogc:SortProperty>
</ogc:SortBy>
</xsl:if>
</csw:Query>
</csw:GetRecords>
</xsl:template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment