Commit 20d294e1 authored by bourgesl's avatar bourgesl
Browse files

added specific data instructions for GNSS.products.Europe (download links)

parent 7bca39ab
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<body> <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> </body>
</html> </html>
<?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>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<body> <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> </body>
</html> </html>
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<xsl:param name="data_access_alt_html" select="''"/> <xsl:param name="data_access_alt_html" select="''"/>
<xsl:param name="data_access_alt_url" select="''"/> <xsl:param name="data_access_alt_url" select="''"/>
<xsl:param name="data_access_doi_html" select="''"/>
<!-- optional external landing page --> <!-- optional external landing page -->
<xsl:param name="landing_page_url" select="''"/> <xsl:param name="landing_page_url" select="''"/>
...@@ -54,7 +56,7 @@ ...@@ -54,7 +56,7 @@
<!-- base template --> <!-- base template -->
<xsl:template match="/"> <xsl:template match="/">
<xsl:call-template name="custom-style"> <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:with-param name="embedded" select="$embedded"/>
</xsl:call-template> </xsl:call-template>
</xsl:template> </xsl:template>
...@@ -86,7 +88,7 @@ ...@@ -86,7 +88,7 @@
<!-- DOI page header template --> <!-- DOI page header template -->
<xsl:template name="header"> <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" /> <xsl:call-template name="citation" />
...@@ -117,7 +119,6 @@ ...@@ -117,7 +119,6 @@
<xsl:otherwise> <xsl:otherwise>
<!-- load fragment --> <!-- load fragment -->
<xsl:variable name="fragment" select="document($data_access_html)"/> <xsl:variable name="fragment" select="document($data_access_html)"/>
<xsl:choose> <xsl:choose>
<xsl:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing instructions to access data or services !</xsl:when> <xsl:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing instructions to access data or services !</xsl:when>
<xsl:otherwise> <xsl:otherwise>
...@@ -139,7 +140,6 @@ ...@@ -139,7 +140,6 @@
<xsl:otherwise> <xsl:otherwise>
<!-- load fragment --> <!-- load fragment -->
<xsl:variable name="fragment" select="document($data_access_alt_html)"/> <xsl:variable name="fragment" select="document($data_access_alt_html)"/>
<xsl:choose> <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:when test="count($fragment/xhtml:html/xhtml:body/child::node()) = 0">Missing alternative instructions to access data or services !</xsl:when>
<xsl:otherwise> <xsl:otherwise>
...@@ -154,6 +154,16 @@ ...@@ -154,6 +154,16 @@
</a> </a>
</p> </p>
</xsl:if> </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>
</div> </div>
</xsl:template> </xsl:template>
......
...@@ -51,6 +51,7 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> ...@@ -51,6 +51,7 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData>
// xslt parameters (doi2landing): // xslt parameters (doi2landing):
private final static String XSLT_PARAM_DATA_ACCESS_HTML = "data_access_html"; 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_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_URL = "data_access_url";
private final static String XSLT_PARAM_DATA_ACCESS_ALT_URL = "data_access_alt_url"; private final static String XSLT_PARAM_DATA_ACCESS_ALT_URL = "data_access_alt_url";
private final static String XSLT_PARAM_EMBEDDED = "embedded"; private final static String XSLT_PARAM_EMBEDDED = "embedded";
...@@ -146,11 +147,12 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> ...@@ -146,11 +147,12 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData>
logger.info("Generating landing pages into {}", webDir); logger.info("Generating landing pages into {}", webDir);
// see ProcessUrlPipeline: // see ProcessUrlPipeline:
final File dataAccessFileLocation = new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS); final File dataAccessFile = FileUtils.getFile(
final File dataAccessFile = FileUtils.getFile(dataAccessFileLocation); new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS)
);
final File dataAccessAltFileLocation = new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS_ALT); final File dataAccessAltFile = FileUtils.getFile(
final File dataAccessAltFile = FileUtils.getFile(dataAccessAltFileLocation); new File(projectConfig.getProjectConf(), ProjectConfig.CONFIG_ACCESS_INSTRUCTIONS_ALT)
);
final Map<String, Object> xslParameters = new HashMap<String, Object>(8); final Map<String, Object> xslParameters = new HashMap<String, Object>(8);
xslParameters.put(XSLT_PARAM_DATE, pipeData.now.toString()); xslParameters.put(XSLT_PARAM_DATE, pipeData.now.toString());
...@@ -178,6 +180,18 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData> ...@@ -178,6 +180,18 @@ public final class GeneratePipeline extends AbstractPipeline<PipelineCommonData>
final String doiSuffix = d.getDoi().getIdentifier(); final String doiSuffix = d.getDoi().getIdentifier();
logger.info("processing {}", doiSuffix); 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: // Get specific data access URL:
final String dataAccessUrl = d.getDataAccessUrl(); final String dataAccessUrl = d.getDataAccessUrl();
......
...@@ -30,6 +30,8 @@ public final class ProjectConfig { ...@@ -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 = "access_instruction.html";
public final static String CONFIG_ACCESS_INSTRUCTIONS_ALT = "access_instruction_alt.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 = "doi_url_data_access.csv";
public final static String CONF_URL_MAP_DATA_ACCESS_ALT = "doi_url_data_access_alt.csv"; public final static String CONF_URL_MAP_DATA_ACCESS_ALT = "doi_url_data_access_alt.csv";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment