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"]}", "version" : "${version?string["0.0"]}",
"extras": [ "extras": [
<#-- START of Common Metadata --> <#-- 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="GRSF Type" namespace=identity_namespace var=grsf_type?capitalize />
<@metadata key="Short Name" namespace=identity_namespace var=short_name /> <@metadata key="Short Name" namespace=identity_namespace var=short_name />
<@metadata key="GRSF Semantic Identifier" namespace=identity_namespace var=grsf_semantic_identifier /> <@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="Management Body/Authority" namespace=identity_namespace list=management_body_authorities />
<@metadatalist key="Resources Exploited" namespace=identity_namespace list=resources_exploited /> <@metadatalist key="Resources Exploited" namespace=identity_namespace list=resources_exploited />
<#-- END of Fishery Metadata --> <#-- 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 /> "organization": <@source_macro />
"groups": [ "groups": [

View File

@ -15,11 +15,6 @@
"version" : "${version?string["0.0"]}", "version" : "${version?string["0.0"]}",
"extras": [ "extras": [
<#-- START of Common Metadata --> <#-- 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="GRSF Type" namespace=identity_namespace var=grsf_type?capitalize />
<@metadata key="Short Name" namespace=identity_namespace var=short_name /> <@metadata key="Short Name" namespace=identity_namespace var=short_name />
<@metadata key="GRSF Semantic Identifier" namespace=identity_namespace var=grsf_semantic_identifier /> <@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" /> <@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 /> <@metadata key="Assessor" namespace=data_namespace var=assessor include=include_sensitive />
<#-- END of Stock Metadata --> <#-- 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 /> "organization": <@source_macro />
"groups": [ "groups": [

View File

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

View File

@ -30,7 +30,7 @@
<#macro tags list include=true sep=","> <#macro tags list include=true sep=",">
<#if list?? && include> <#if list?? && include>
<#list list as tagname> <#list list as tagname>
<@tagbyvalue value=tagname include=include sep=sep /> <@tagbyvalue value=tagname include=include sep=sep />
</#list> </#list>
</#if> </#if>
</#macro> </#macro>
@ -38,7 +38,6 @@
<#macro tagbyvalue value include=true sep=","> <#macro tagbyvalue value include=true sep=",">
<#assign tagvalue=value?json_string?replace("[,:]\\s{0,1}", " ", "r") /> <#assign tagvalue=value?json_string?replace("[,:]\\s{0,1}", " ", "r") />
{ {
<#if tagvalue?length gt 100 > <#if tagvalue?length gt 100 >
"name": "${tagvalue[0..<99]}" "name": "${tagvalue[0..<99]}"
<#else> <#else>
@ -62,12 +61,12 @@
<#if tagValues> <#if tagValues>
<#assign tag_list += ["${elem?json_string}"]> <#assign tag_list += ["${elem?json_string}"]>
</#if> </#if>
<#if include> <#if include>
{ {
"key": "<#if namespace?has_content>${namespace}:</#if>${key}", "key": "<#if namespace?has_content>${namespace}:</#if>${key}",
"value": "${elem?json_string}" "value": "${elem?json_string}"
}${sep} }${sep}
</#if> </#if>
</#list> </#list>
</#if> </#if>
</#macro> </#macro>
@ -90,14 +89,14 @@
<#assign group_list += [{"name":"${groupname}", "title":"${key}"}] > <#assign group_list += [{"name":"${groupname}", "title":"${key}"}] >
</#if> </#if>
<#if include> <#if include>
<#local list = .data_model[timeseries] > <#local list = .data_model[timeseries] >
<#assign valueSep = "" > <#assign valueSep = "" >
<#list list[0..*5] as ts> <#list list[0..*5] as ts>
{ {
"key": "<#if namespace?has_content>${namespace}:</#if>${key}", "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>]" "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} }${sep}
</#list> </#list>
</#if> </#if>
</#if> </#if>
</#macro> </#macro>