Fixed templates

This commit is contained in:
Luca Frosini 2024-04-05 16:27:56 +02:00
parent 32fab1ba37
commit 85571c6986
4 changed files with 29 additions and 27 deletions

View File

@ -15,11 +15,6 @@
"version" : "${version?string["0.0"]}",
"extras": [
<#-- START of Common Metadata -->
<#if source = "grsf">
<@metadata key="system:type" var=grsf_type?capitalize sep="" />
<#else>
<@metadata key="system:type" var="Legacy" sep="" />
</#if>
<@metadata key="GRSF Type" namespace=identity_namespace var=grsf_type?capitalize />
<@metadata key="Short Name" namespace=identity_namespace var=short_name />
<@metadata key="GRSF Semantic Identifier" namespace=identity_namespace var=grsf_semantic_identifier />
@ -73,6 +68,12 @@
<@metadatalist key="Management Body/Authority" namespace=identity_namespace list=management_body_authorities />
<@metadatalist key="Resources Exploited" namespace=identity_namespace list=resources_exploited />
<#-- END of Fishery Metadata -->
<#if source = "grsf">
<@metadata key="system:type" var=grsf_type?capitalize sep="" />
<#else>
<@metadata key="system:type" var="Legacy" sep="" />
</#if>
],
"organization": <@source_macro />
"groups": [

View File

@ -15,11 +15,6 @@
"version" : "${version?string["0.0"]}",
"extras": [
<#-- START of Common Metadata -->
<#if source = "grsf">
<@metadata key="system:type" var=grsf_type?capitalize sep="" />
<#else>
<@metadata key="system:type" var="Legacy" sep="" />
</#if>
<@metadata key="GRSF Type" namespace=identity_namespace var=grsf_type?capitalize />
<@metadata key="Short Name" namespace=identity_namespace var=short_name />
<@metadata key="GRSF Semantic Identifier" namespace=identity_namespace var=grsf_semantic_identifier />
@ -72,6 +67,12 @@
<@timeseries key="Scientific Advice" namespace=data_namespace timeseries="scientific_advice" groupname="scientific-advice-group" />
<@metadata key="Assessor" namespace=data_namespace var=assessor include=include_sensitive />
<#-- END of Stock Metadata -->
<#if source = "grsf">
<@metadata key="system:type" var=grsf_type?capitalize sep="" />
<#else>
<@metadata key="system:type" var="Legacy" sep="" />
</#if>
],
"organization": <@source_macro />
"groups": [

View File

@ -15,7 +15,6 @@
"version" : "${version?string["0.0"]}",
"extras": [
<#-- START of Common Metadata -->
<@metadata key="system:type" var="Traceability Unit" sep="" />
<@metadata key="GRSF Type" namespace=identity_namespace var="Traceability Unit" />
<@metadata key="Short Name" namespace=identity_namespace var=short_name />
<@metadata key="GRSF Semantic Identifier" namespace=identity_namespace var=grsf_semantic_identifier />
@ -45,6 +44,8 @@
<@metadatalist key="Fishing Gear" namespace=identity_namespace list=fishing_gear tagValues=true />
<@metadatalist key="Management Body/Authority" namespace=identity_namespace list=management_body_authorities />
<#-- END of Traceability Unit Metadata -->
<@metadata key="system:type" var="Traceability Unit" sep="" />
],
"organization": <@source_macro />
"groups": [

View File

@ -30,7 +30,7 @@
<#macro tags list include=true sep=",">
<#if list?? && include>
<#list list as tagname>
<@tagbyvalue value=tagname include=include sep=sep />
<@tagbyvalue value=tagname include=include sep=sep />
</#list>
</#if>
</#macro>
@ -38,7 +38,6 @@
<#macro tagbyvalue value include=true sep=",">
<#assign tagvalue=value?json_string?replace("[,:]\\s{0,1}", " ", "r") />
{
<#if tagvalue?length gt 100 >
"name": "${tagvalue[0..<99]}"
<#else>
@ -62,12 +61,12 @@
<#if tagValues>
<#assign tag_list += ["${elem?json_string}"]>
</#if>
<#if include>
{
"key": "<#if namespace?has_content>${namespace}:</#if>${key}",
"value": "${elem?json_string}"
}${sep}
</#if>
<#if include>
{
"key": "<#if namespace?has_content>${namespace}:</#if>${key}",
"value": "${elem?json_string}"
}${sep}
</#if>
</#list>
</#if>
</#macro>
@ -90,14 +89,14 @@
<#assign group_list += [{"name":"${groupname}", "title":"${key}"}] >
</#if>
<#if include>
<#local list = .data_model[timeseries] >
<#assign valueSep = "" >
<#list list[0..*5] as ts>
{
"key": "<#if namespace?has_content>${namespace}:</#if>${key}",
"value": "${ts.value?json_string} [<#if ts.unit?has_content>Unit: ${ts.unit?json_string}<#assign valueSep = " - " ></#if><#if ts.reporting_year_or_assessment_id?has_content>${valueSep}Rep. Year or Assessment ID: ${ts.reporting_year_or_assessment_id?json_string}<#assign valueSep = " - " ></#if><#if ts.reference_year?has_content>${valueSep}Ref. Year: ${ts.reference_year?json_string}<#assign valueSep = " - " ></#if><#if ts.data_owner?has_content>${valueSep}Data Owner: ${ts.data_owner?json_string}<#assign valueSep = " - " ></#if><#if ts.db_source?has_content>${valueSep}DB Source: ${ts.db_source?json_string}</#if>]"
}${sep}
</#list>
<#local list = .data_model[timeseries] >
<#assign valueSep = "" >
<#list list[0..*5] as ts>
{
"key": "<#if namespace?has_content>${namespace}:</#if>${key}",
"value": "${ts.value?json_string} [<#if ts.unit?has_content>Unit: ${ts.unit?json_string}<#assign valueSep = " - " ></#if><#if ts.reporting_year_or_assessment_id?has_content>${valueSep}Rep. Year or Assessment ID: ${ts.reporting_year_or_assessment_id?json_string}<#assign valueSep = " - " ></#if><#if ts.reference_year?has_content>${valueSep}Ref. Year: ${ts.reference_year?json_string}<#assign valueSep = " - " ></#if><#if ts.data_owner?has_content>${valueSep}Data Owner: ${ts.data_owner?json_string}<#assign valueSep = " - " ></#if><#if ts.db_source?has_content>${valueSep}DB Source: ${ts.db_source?json_string}</#if>]"
}${sep}
</#list>
</#if>
</#if>
</#macro>