diff --git a/conf/GNSS_products/access_instruction.html b/conf/GNSS_products/access_instruction.html index ca49f52615a735964692c1d32587f7ad4bc383c6..ce4d7cf9c5bf847ea44912d2c6db2a8acc6b2dbb 100644 --- a/conf/GNSS_products/access_instruction.html +++ b/conf/GNSS_products/access_instruction.html @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml"> <body> - The following web page describes the methodology, documentation and product visualization, and provides a link to data products: + The following web page describes the methodology, documentation and product visualization: </body> </html> diff --git a/conf/GNSS_products/access_instruction_GNSS.products.Europe.html b/conf/GNSS_products/access_instruction_GNSS.products.Europe.html new file mode 100644 index 0000000000000000000000000000000000000000..519951f65fee6e121ab149109e264608398dea58 --- /dev/null +++ b/conf/GNSS_products/access_instruction_GNSS.products.Europe.html @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<html xmlns="http://www.w3.org/1999/xhtml"> + <body> + <a class="label label-primary" href="http://doi.osug.fr/data/public/GNSS_products/Europe/POS_FILES.zip" target="_blank" role="button">download the time-series data</a> + <a class="label label-primary" href="http://doi.osug.fr/data/public/GNSS_products/Europe/european_velocities_isterre_cnrs.vel" target="_blank" role="button">download the velocity data</a> + </body> +</html> + diff --git a/conf/GNSS_products/access_instruction_alt.html b/conf/GNSS_products/access_instruction_alt.html index 4b80b230808f85b2143195855271191dc10fd439..71f4aaf4be20578895d33d9d1322b46a18351e04 100644 --- a/conf/GNSS_products/access_instruction_alt.html +++ b/conf/GNSS_products/access_instruction_alt.html @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml"> <body> - Time series and velocity products are directly accessible from the following archive: + Time series and velocity products are directly accessible from the OSUG data archive: </body> </html> diff --git a/resources/xsl/4.1/doi2landing.xsl b/resources/xsl/4.1/doi2landing.xsl index c5711f9ffcd6aa9010522d7e7f8b47ef7b47026e..d29d8e32601fcd41922de9e1cdd311a1fef56438 100644 --- a/resources/xsl/4.1/doi2landing.xsl +++ b/resources/xsl/4.1/doi2landing.xsl @@ -29,6 +29,8 @@ <xsl:param name="data_access_alt_html" select="''"/> <xsl:param name="data_access_alt_url" select="''"/> + <xsl:param name="data_access_doi_html" select="''"/> + <!-- optional external landing page --> <xsl:param name="landing_page_url" select="''"/> @@ -54,7 +56,7 @@ <!-- base template --> <xsl:template match="/"> <xsl:call-template name="custom-style"> - <xsl:with-param name="page_title">DOI Metadata for <xsl:call-template name="get_identifier" /></xsl:with-param> + <xsl:with-param name="page_title">DOI <xsl:call-template name="get_identifier" /></xsl:with-param> <xsl:with-param name="embedded" select="$embedded"/> </xsl:call-template> </xsl:template> @@ -86,7 +88,7 @@ <!-- DOI page header template --> <xsl:template name="header"> - <h3>DOI Metadata for <xsl:call-template name="get_identifier" /></h3> + <h3>DOI <xsl:call-template name="get_identifier" /></h3> <xsl:call-template name="citation" /> @@ -117,7 +119,6 @@ <xsl:otherwise> <!-- load fragment --> <xsl:variable name="fragment" select="document($data_access_html)"/> - <xsl:choose> <xsl:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing instructions to access data or services !</xsl:when> <xsl:otherwise> @@ -139,7 +140,6 @@ <xsl:otherwise> <!-- load fragment --> <xsl:variable name="fragment" select="document($data_access_alt_html)"/> - <xsl:choose> <xsl:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing alternative instructions to access data or services !</xsl:when> <xsl:otherwise> @@ -154,6 +154,16 @@ </a> </p> </xsl:if> + <xsl:if test="$data_access_doi_html"> + <!-- load fragment --> + <xsl:variable name="fragment" select="document($data_access_doi_html)"/> + <xsl:choose> + <xsl:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing DOI instructions to access data or services !</xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$fragment/xhtml:html/xhtml:body/child::node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> </div> </div> </xsl:template> diff --git a/src/main/java/fr/osug/doi/GeneratePipeline.java b/src/main/java/fr/osug/doi/GeneratePipeline.java index 66c1ab69666aa2683af455d3cf2650b7f9d18c6d..6a7fcd16de5d5aeabd9825c22914276f47ce5622 100644 --- a/src/main/java/fr/osug/doi/GeneratePipeline.java +++ b/src/main/java/fr/osug/doi/GeneratePipeline.java @@ -51,6 +51,7 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> // xslt parameters (doi2landing): private final static String XSLT_PARAM_DATA_ACCESS_HTML = "data_access_html"; private final static String XSLT_PARAM_DATA_ACCESS_ALT_HTML = "data_access_alt_html"; + private final static String XSLT_PARAM_DATA_ACCESS_DOI_HTML = "data_access_doi_html"; private final static String XSLT_PARAM_DATA_ACCESS_URL = "data_access_url"; private final static String XSLT_PARAM_DATA_ACCESS_ALT_URL = "data_access_alt_url"; private final static String XSLT_PARAM_EMBEDDED = "embedded"; @@ -146,11 +147,12 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> logger.info("Generating landing pages into {}", webDir); // see ProcessUrlPipeline: - final File dataAccessFileLocation = new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS); - final File dataAccessFile = FileUtils.getFile(dataAccessFileLocation); - - final File dataAccessAltFileLocation = new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS_ALT); - final File dataAccessAltFile = FileUtils.getFile(dataAccessAltFileLocation); + final File dataAccessFile = FileUtils.getFile( + new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS) + ); + final File dataAccessAltFile = FileUtils.getFile( + new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS_ALT) + ); final Map<String, Object> xslParameters = new HashMap<String, Object>(8); xslParameters.put(XSLT_PARAM_DATE, pipeData.now.toString()); @@ -178,6 +180,18 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> final String doiSuffix = d.getDoi().getIdentifier(); logger.info("processing {}", doiSuffix); + + // Get (optional) specific data access instructions to DOI: + final File dataAccessDoiFileLocation = new File(projectConfig.getProjectConf(), + ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS_DOI.replace(ProjectConfig.KEY_CONFIG_ACCESS_INSTRUCTIONS_DOI, doiSuffix)); + + final File dataAccessDoiFile = FileUtils.getFile(dataAccessDoiFileLocation); + if (dataAccessDoiFile != null) { + logger.debug("dataAccessDoiFileLocation: {}", dataAccessDoiFileLocation); + xslParameters.put(XSLT_PARAM_DATA_ACCESS_DOI_HTML, dataAccessDoiFile.toURI().toString()); + } else { + xslParameters.remove(XSLT_PARAM_DATA_ACCESS_DOI_HTML); + } // Get specific data access URL: final String dataAccessUrl = d.getDataAccessUrl(); diff --git a/src/main/java/fr/osug/doi/ProjectConfig.java b/src/main/java/fr/osug/doi/ProjectConfig.java index bbac3e8de20930c53eb83c85e404b11193a885e1..f9efeac29e4c6f980df43a22304560f71aa3faff 100644 --- a/src/main/java/fr/osug/doi/ProjectConfig.java +++ b/src/main/java/fr/osug/doi/ProjectConfig.java @@ -30,6 +30,8 @@ public final class ProjectConfig { public final static String CONFIG_ACCESS_INSTRUCTIONS = "access_instruction.html"; public final static String CONFIG_ACCESS_INSTRUCTIONS_ALT = "access_instruction_alt.html"; + public final static String CONFIG_ACCESS_INSTRUCTIONS_DOI = "access_instruction_$DOI.html"; + public final static String KEY_CONFIG_ACCESS_INSTRUCTIONS_DOI = "$DOI"; public final static String CONF_URL_MAP_DATA_ACCESS = "doi_url_data_access.csv"; public final static String CONF_URL_MAP_DATA_ACCESS_ALT = "doi_url_data_access_alt.csv";