custom templates

This commit is contained in:
FabioISTI 2020-05-14 17:38:39 +02:00
parent aaaae1f9cc
commit 8b42470288
3 changed files with 89 additions and 12 deletions

44
log.txt
View File

@ -17023,3 +17023,47 @@ java.io.IOException: Server returned HTTP response code: 403 for URL: https://ww
382 [main] DEBUG freemarker.cache - Loading template for "Extent.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Extent.ftlx"
404 [main] DEBUG freemarker.beans - Key "temporalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), java.lang.Object@67b92f0a=freemarker.ext.beans.SimpleMethod@307f6b8c, setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), java.lang.Object@6d7b4f4c={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@7a187f14, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@6f195bc3, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@51e2adc7, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@1a8a8f7c, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@2353b3e6, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@631330c, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@42f93a98, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@c46bcd4, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@3234e239, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@3d921e20, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@36b4cef0, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@1a1d6a08, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@37d31475, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@27808f31}, equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}
405 [main] DEBUG freemarker.beans - Key "verticalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), java.lang.Object@67b92f0a=freemarker.ext.beans.SimpleMethod@307f6b8c, setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), java.lang.Object@6d7b4f4c={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@7a187f14, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@6f195bc3, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@51e2adc7, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@1a8a8f7c, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@2353b3e6, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@631330c, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@42f93a98, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@c46bcd4, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@3234e239, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@3d921e20, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@36b4cef0, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@1a1d6a08, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@37d31475, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@27808f31}, equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}
0 [main] DEBUG freemarker.cache - Couldn't find template in cache for "BaseTemplate.ftlx"("en_US", UTF-8, parsed); will try to load it.
3 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate_en_US.ftlx"): Not found
4 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate_en.ftlx"): Not found
6 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate.ftlx"): Found
6 [main] DEBUG freemarker.cache - Loading template for "BaseTemplate.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/BaseTemplate.ftlx"
228 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Macros.ftlx"("en_US", UTF-8, parsed); will try to load it.
228 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros_en_US.ftlx"): Not found
228 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros_en.ftlx"): Not found
228 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros.ftlx"): Found
229 [main] DEBUG freemarker.cache - Loading template for "Macros.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Macros.ftlx"
260 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Spatial.ftlx"("en_US", UTF-8, parsed); will try to load it.
260 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial_en_US.ftlx"): Not found
261 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial_en.ftlx"): Not found
261 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial.ftlx"): Found
261 [main] DEBUG freemarker.cache - Loading template for "Spatial.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Spatial.ftlx"
331 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Extent.ftlx"("en_US", UTF-8, parsed); will try to load it.
332 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent_en_US.ftlx"): Not found
332 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent_en.ftlx"): Not found
332 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent.ftlx"): Found
332 [main] DEBUG freemarker.cache - Loading template for "Extent.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Extent.ftlx"
358 [main] DEBUG freemarker.beans - Key "temporalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), java.lang.Object@61f8bee4=freemarker.ext.beans.SimpleMethod@1a8a8f7c, class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], java.lang.Object@370736d9={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@2353b3e6, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@631330c, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@42f93a98, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@c46bcd4, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@3234e239, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@3d921e20, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@36b4cef0, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@1a1d6a08, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@37d31475, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@27808f31, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@436e852b, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@32d2fa64, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@1d8d30f7, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@3e57cd70}, getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}
359 [main] DEBUG freemarker.beans - Key "verticalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), java.lang.Object@61f8bee4=freemarker.ext.beans.SimpleMethod@1a8a8f7c, class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], java.lang.Object@370736d9={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@2353b3e6, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@631330c, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@42f93a98, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@c46bcd4, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@3234e239, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@3d921e20, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@36b4cef0, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@1a1d6a08, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@37d31475, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@27808f31, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@436e852b, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@32d2fa64, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@1d8d30f7, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@3e57cd70}, getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}
0 [main] DEBUG freemarker.cache - Couldn't find template in cache for "BaseTemplate.ftlx"("en_US", UTF-8, parsed); will try to load it.
2 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate_en_US.ftlx"): Not found
3 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate_en.ftlx"): Not found
5 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("BaseTemplate.ftlx"): Found
5 [main] DEBUG freemarker.cache - Loading template for "BaseTemplate.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/BaseTemplate.ftlx"
229 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Macros.ftlx"("en_US", UTF-8, parsed); will try to load it.
229 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros_en_US.ftlx"): Not found
229 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros_en.ftlx"): Not found
229 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Macros.ftlx"): Found
229 [main] DEBUG freemarker.cache - Loading template for "Macros.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Macros.ftlx"
267 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Spatial.ftlx"("en_US", UTF-8, parsed); will try to load it.
267 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial_en_US.ftlx"): Not found
267 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial_en.ftlx"): Not found
267 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Spatial.ftlx"): Found
267 [main] DEBUG freemarker.cache - Loading template for "Spatial.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Spatial.ftlx"
351 [main] DEBUG freemarker.cache - Couldn't find template in cache for "Extent.ftlx"("en_US", UTF-8, parsed); will try to load it.
351 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent_en_US.ftlx"): Not found
351 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent_en.ftlx"): Not found
351 [main] DEBUG freemarker.cache - TemplateLoader.findTemplateSource("Extent.ftlx"): Found
351 [main] DEBUG freemarker.cache - Loading template for "Extent.ftlx"("en_US", UTF-8, parsed) from "file:/Users/FabioISTI/git/geonetwork/target/classes/xmlTemplates/Extent.ftlx"
369 [main] DEBUG freemarker.beans - Key "temporalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), java.lang.Object@61f8bee4=freemarker.ext.beans.SimpleMethod@1a8a8f7c, class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], java.lang.Object@370736d9={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@2353b3e6, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@631330c, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@42f93a98, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@c46bcd4, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@3234e239, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@3d921e20, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@36b4cef0, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@1a1d6a08, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@37d31475, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@27808f31, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@436e852b, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@32d2fa64, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@1d8d30f7, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@3e57cd70}, getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}
370 [main] DEBUG freemarker.beans - Key "verticalExtent" was not found on instance of org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), addTemporalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent), description=java.beans.PropertyDescriptor[name=description; propertyType=class java.lang.String; readMethod=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()], setVerticalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet), setDescription=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String), getGeographicExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents(), getDescription=public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription(), geographicExtents=java.beans.PropertyDescriptor[name=geographicExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()], getTemporalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents(), verticalExtents=java.beans.PropertyDescriptor[name=verticalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()], addGeographicExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent), setTemporalExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet), setGeographicExtents=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet), hashCode=public native int java.lang.Object.hashCode(), equals=public boolean java.lang.Object.equals(java.lang.Object), addVerticalExtent=public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent), temporalExtents=java.beans.PropertyDescriptor[name=temporalExtents; propertyType=class java.util.HashSet; readMethod=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()], toString=public java.lang.String java.lang.Object.toString(), java.lang.Object@61f8bee4=freemarker.ext.beans.SimpleMethod@1a8a8f7c, class=java.beans.PropertyDescriptor[name=class; propertyType=class java.lang.Class; readMethod=public final native java.lang.Class java.lang.Object.getClass()], java.lang.Object@370736d9={public java.lang.String java.lang.Object.toString()=[Ljava.lang.Class;@2353b3e6, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()=[Ljava.lang.Class;@631330c, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setGeographicExtents(java.util.HashSet)=[Ljava.lang.Class;@42f93a98, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addVerticalExtent(org.opengis.metadata.extent.VerticalExtent)=[Ljava.lang.Class;@c46bcd4, public native int java.lang.Object.hashCode()=[Ljava.lang.Class;@3234e239, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setTemporalExtents(java.util.HashSet)=[Ljava.lang.Class;@3d921e20, public boolean java.lang.Object.equals(java.lang.Object)=[Ljava.lang.Class;@36b4cef0, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getTemporalExtents()=[Ljava.lang.Class;@fad74ee, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addGeographicExtent(org.gcube.spatial.data.geonetwork.iso.tpl.extent.GeographicExtent)=[Ljava.lang.Class;@1a1d6a08, public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getGeographicExtents()=[Ljava.lang.Class;@37d31475, public java.lang.String org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getDescription()=[Ljava.lang.Class;@27808f31, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setVerticalExtents(java.util.HashSet)=[Ljava.lang.Class;@436e852b, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.setDescription(java.lang.String)=[Ljava.lang.Class;@32d2fa64, public void org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.addTemporalExtent(org.opengis.metadata.extent.TemporalExtent)=[Ljava.lang.Class;@1d8d30f7, public final native java.lang.Class java.lang.Object.getClass()=[Ljava.lang.Class;@3e57cd70}, getVerticalExtents=public java.util.HashSet org.gcube.spatial.data.geonetwork.iso.tpl.extent.Extent.getVerticalExtents()}

View File

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.spatial.data</groupId>
<artifactId>geonetwork</artifactId>
<version>3.4.2</version>
<version>3.4.3-SNAPSHOT</version>
<name>geonetwork</name>
<properties>

View File

@ -5,12 +5,15 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.IOUtils;
import freemarker.cache.ClassTemplateLoader;
import freemarker.cache.FileTemplateLoader;
import freemarker.cache.MultiTemplateLoader;
import freemarker.cache.TemplateLoader;
import freemarker.core.ParseException;
import freemarker.template.Configuration;
import freemarker.template.MalformedTemplateNameException;
@ -24,6 +27,9 @@ import lombok.extern.slf4j.Slf4j;
public class ISOMetadataByTemplate {
private static List<TemplateLoader> loaders=new ArrayList<TemplateLoader>();
private static Configuration cfg;
@ -37,12 +43,12 @@ public class ISOMetadataByTemplate {
// Specify the source where the template files come from. Here I set a
// plain directory for it, but non-file-system sources are possible too:
// cfg.setDirectoryForTemplateLoading(
// new File(ISOMetadataByTemplate.class.getResource("xmlTemplates").toURI()));
cfg.setClassForTemplateLoading(ISOMetadataByTemplate.class, "/xmlTemplates");
// cfg.setClassForTemplateLoading(ISOMetadataByTemplate.class, "/xmlTemplates");
// Set the preferred charset template files are stored in. UTF-8 is
// a good choice in most applications:
@ -54,28 +60,55 @@ public class ISOMetadataByTemplate {
// Don't log exceptions inside FreeMarker that it will thrown at you anyway:
cfg.setLogTemplateExceptions(false);
loaders.add(new ClassTemplateLoader(ISOMetadataByTemplate.class, "/xmlTemplates"));
reload();
}catch(Exception e){
throw new RuntimeException(e);
}
}
private static final void reload() {
MultiTemplateLoader loader=new MultiTemplateLoader(loaders.toArray(new TemplateLoader[loaders.size()]));
cfg.setTemplateLoader(loader);
}
public static final File createXML(MetadataDescriptor desc) throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException, TemplateException{
return custom(desc,"BaseTemplate.ftlx");
//
// Writer out=null;
// try{
// Template temp = cfg.getTemplate("BaseTemplate.ftlx");
// File output=File.createTempFile("ISO_", ".xml");
// out=new OutputStreamWriter(new FileOutputStream(output));
// temp.process(desc, out);
// return output;
// }finally{
// if(out!=null)
// IOUtils.closeQuietly(out);
// }
}
public static final File custom(Object descriptor, String template) throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException, TemplateException {
Writer out=null;
try{
Template temp = cfg.getTemplate("BaseTemplate.ftlx");
Template temp = cfg.getTemplate(template);
File output=File.createTempFile("ISO_", ".xml");
out=new OutputStreamWriter(new FileOutputStream(output));
temp.process(desc, out);
temp.process(descriptor, out);
return output;
}finally{
if(out!=null)
IOUtils.closeQuietly(out);
}
}
public static final void registerTemplateFolder(File baseDir) throws IOException {
loaders.add(new FileTemplateLoader(baseDir));
reload();;
}
}