Hi all,
I'm using GeoNetwork 2.10, creating customised templates based on
ISO-19139.
I having an issue in order to:
1. Add an element (gmd:MD_MetadataRestrictionCode) into the following XPath
gmd:MD_Metadata/gmd:metadataConstraints/gmd:MD_Constraints/
gmd:useLimitation/
2. Make the added element a mandatory field
I have added the following code into the* codelist.xml* to get specific
values for the new element, (it gets the values with no issues)
<codelist name="gmd:MD_MetadataRestrictionCode">
<entry>
<code>unrestricted</code>
<label>Unrestricted</label>
<description>This metadata will be accessable to public when it
is approved</description>
</entry>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - -->
<entry>
<code>restricted</code>
<label>Restricted</label>
<description>Withheld from general circulation or
disclosure</description>
</entry>
</codelist>
To customise the schema I changed the *schema.xsd* as bellow to avoid
getting warning about the new element.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.isotc211.org/2005/gmd"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:srv="http://www.isotc211.org/2005/srv">
<xs:include schemaLocation="schema/gmd/metadataApplication.xsd"/>
<xs:import namespace="http://www.isotc211.org/2005/srv"
schemaLocation="schema/srv/srv.xsd"/>
<xs:import namespace="http://www.isotc211.org/2005/gmx"
schemaLocation="schema/gmx/gmx.xsd"/>
<xs:element name="gmd:useLimitation"
type="gco:CharacterString_PropertyType"
substitutionGroup="gmd:useLimitation"/>
<xs:complexType name="gco:CharacterString_PropertyType">
<xs:annotation>
<xs:documentation>
Extends the metadata element to include MD_MetadataRestrictionCode
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="gmd:useLimitation">
<xs:sequence>
<xs:element name="gmd:MD_MetadataRestrictionCode"
type="gco:CodeListValue_Type"
minOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
I get the following error in the geonetwork
GeoNetwork Initialization Failed
Error Raised exception while starting appl handler. Skipped.
Exception OperationAbortedEx : Failed whilst adding the schema information.
Exception message if any is Namespace collision for :
gco:CharacterString_PropertyType
Message Failed whilst adding the schema information. Exception message if
any is Namespace collision for : gco:CharacterString_PropertyType
Handler org.fao.geonet.Geonetwork
Stack OperationAbortedEx : Failed whilst adding the schema information.
Exception message if any is Namespace collision for :
gco:CharacterString_PropertyType
at
org.fao.geonet.kernel.SchemaManager.processSchema(SchemaManager.java:1269)
at org.fao.geonet.kernel.SchemaManager.<init>(SchemaManager.java:148)
at org.fao.geonet.kernel.SchemaManager.getInstance(SchemaManager.java:173)
at org.fao.geonet.Geonetwork.start(Geonetwork.java:275)
at jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:600)
at jeeves.server.JeevesEngine.init(JeevesEngine.java:206)
at jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:91)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)
at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
I would appreciate it if someone can help me please.
Regards,
Sebastian Saeidi
Email: sebastian.saeidi@anonymised.com
Linkedin: http://www.linkedin.com/in/sebastiansaeidi