sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1817940 - in /sis/branches/ISO-19115-3/core: sis-metadata/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/ sis-metadata/src/main/java/org/apache/sis/internal/ja...
Date Tue, 12 Dec 2017 18:02:48 GMT
Author: desruisseaux
Date: Tue Dec 12 18:02:47 2017
New Revision: 1817940

URL: http://svn.apache.org/viewvc?rev=1817940&view=rev
Log:
Upgrade metadata internal classes to ISO 19115-3.
This is part of commit e780d66b4d7d59368e742ba01777a151d8827ea8 from Image Matter.

The project at this revision can be built but is known to have test failure.
Tests will pass only after we completed the port of all ISO 19115-3 work.

Added:
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
  (with props)
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
  (with props)
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
  (with props)
Modified:
    sis/branches/ISO-19115-3/core/sis-metadata/pom.xml
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
    sis/branches/ISO-19115-3/core/sis-utility/pom.xml

Modified: sis/branches/ISO-19115-3/core/sis-metadata/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/pom.xml?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/pom.xml (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/pom.xml Tue Dec 12 18:02:47 2017
@@ -82,6 +82,13 @@ Implementations of metadata derived from
       </roles>
     </contributor>
     <contributor>
+      <name>Cullen Rombach</name>
+      <organization>Image Matters</organization>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
+    <contributor>
       <name>Guilhem Legal</name>
       <email>guilhem.legal@geomatys.com</email>
       <organization>Geomatys</organization>

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -25,15 +25,16 @@
  * will be substituted to that interface.</p>
  *
  * @author  Guilhem Legal (Geomatys)
- * @version 0.3
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  *
  * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
  *
  * @since 0.3
  * @module
  */
-@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GML, xmlns =
{
-    @XmlNs(prefix = "gml", namespaceURI = Namespaces.GML)
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GEX, xmlns =
{
+    @XmlNs(prefix = "gex", namespaceURI = Namespaces.GEX)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 package org.apache.sis.internal.jaxb.geometry;

Added: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java?rev=1817940&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
(added)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.gts;
+
+import javax.xml.bind.annotation.XmlElement;
+import org.opengis.temporal.Duration;
+import org.opengis.temporal.PeriodDuration;
+import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.Classes;
+
+
+/**
+ * Wraps a {@code gts:TM_Duration} element.
+ *
+ * @todo Current implementation supports only ISO 19108 {@code Duration} that are instance
of {@code DurationPeriod}.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
+ * @since   1.0
+ * @module
+ */
+public final class TM_Duration extends PropertyType<TM_Duration, Duration> {
+    /**
+     * Empty constructor for JAXB.
+     */
+    public TM_Duration() {
+    }
+
+    /**
+     * Wraps a Temporal Duration value at marshalling-time.
+     *
+     * @param metadata The metadata value to marshal.
+     */
+    private TM_Duration(final Duration metadata) {
+        super(metadata);
+    }
+
+    /**
+     * Returns the Duration value wrapped by a {@code gts:TM_Duration} element.
+     *
+     * @param value The value to marshal.
+     * @return The adapter which wraps the metadata value.
+     */
+    @Override
+    protected TM_Duration wrap(final Duration value) {
+        return new TM_Duration(value);
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     *
+     * @return {@code Duration.class}
+     */
+    @Override
+    protected Class<Duration> getBoundType() {
+        return Duration.class;
+    }
+
+    /**
+     * Returns the {@link Duration} generated from the metadata value.
+     * This method is systematically called at marshalling time by JAXB.
+     *
+     * @return The time period, or {@code null}.
+     */
+    @XmlElement(name = "TM_Duration")
+    public javax.xml.datatype.Duration getElement() {
+        if (metadata != null) {
+            if (metadata instanceof PeriodDuration) {
+                return TM_PeriodDuration.toXML((PeriodDuration) metadata);
+            }
+            Context.warningOccured(Context.current(), TM_Duration.class, "getElement", Errors.class,
+                    Errors.Keys.UnsupportedType_1, Classes.getClass(metadata));
+        }
+        return null;
+    }
+
+    /**
+     * Sets the value from the {@link Duration}.
+     * This method is called at unmarshalling time by JAXB.
+     *
+     * @param duration The adapter to set.
+     */
+    public void setElement(final javax.xml.datatype.Duration duration) {
+        metadata = TM_PeriodDuration.toISO(duration);
+    }
+}

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -40,7 +40,8 @@ import org.apache.sis.util.iso.SimpleInt
  *       API in geoapi-pending, which is not very clear... We prefer to hide this for now.
  *
  * @author  Guilhem Legal (Geomatys)
- * @version 0.3
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -89,7 +90,13 @@ public final class TM_PeriodDuration ext
      */
     @XmlElement(name = "TM_PeriodDuration")
     public Duration getElement() {
-        final PeriodDuration metadata = this.metadata;
+        return toXML(metadata);
+    }
+
+    /**
+     * Converts the given ISO 19108 duration into a Java XML duration.
+     */
+    static Duration toXML(final PeriodDuration metadata) {
         if (metadata != null) try {
             /*
              * Get the DatatypeFactory first because if not available, then we don't need
to parse
@@ -124,7 +131,7 @@ public final class TM_PeriodDuration ext
             }
             return factory.newDuration(true, years, months, days, hours, minutes, seconds);
         } catch (DatatypeConfigurationException e) {
-            warningOccured("getElement", e);
+            warningOccured("toXML", e);
         }
         return null;
     }
@@ -136,7 +143,13 @@ public final class TM_PeriodDuration ext
      * @param  duration  the adapter to set.
      */
     public void setElement(final Duration duration) {
-        metadata = null;                                        // Cleaned first in case
of failure.
+        metadata = toISO(duration);
+    }
+
+    /**
+     * Converts the given Java XML duration into an ISO 19108 duration.
+     */
+    static PeriodDuration toISO(final Duration duration) {
         if (duration != null) try {
             final TemporalFactory factory = TemporalUtilities.getTemporalFactory();
             InternationalString years = null;
@@ -165,10 +178,11 @@ public final class TM_PeriodDuration ext
             if ((value = duration.getSeconds()) != 0) {
                 seconds = new SimpleInternationalString(Integer.toString(value));
             }
-            metadata = factory.createPeriodDuration(years, months, weeks, days, hours, minutes,
seconds);
+            return factory.createPeriodDuration(years, months, weeks, days, hours, minutes,
seconds);
         } catch (UnsupportedOperationException e) {
-            warningOccured("setElement", e);
+            warningOccured("toISO", e);
         }
+        return null;
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -19,7 +19,9 @@
  * Temporary placeholder for the Temporal Schema JAXB adapters.
  *
  * @author  Guilhem Legal (Geomatys)
- * @version 0.3
+ * @author  Martin Desruisseaux (Geomatys)
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -19,8 +19,9 @@ package org.apache.sis.internal.jaxb.met
 import javax.xml.bind.annotation.XmlElementRef;
 import org.opengis.metadata.citation.Responsibility;
 import org.apache.sis.metadata.iso.citation.DefaultResponsibility;
-import org.apache.sis.internal.jaxb.gco.PropertyType;
 import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -28,7 +29,8 @@ import org.apache.sis.metadata.iso.citat
  * package documentation for more information about JAXB and interface.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @since   1.0
  * @since   0.5
  * @module
  */
@@ -80,10 +82,10 @@ public final class CI_Responsibility ext
     @XmlElementRef
     @SuppressWarnings("deprecation")
     public DefaultResponsibility getElement() {
-        if (LEGACY_XML) {
-            return DefaultResponsibleParty.castOrCopy(metadata);
-        } else {
+        if (Context.isLatestMetadata()) {
             return DefaultResponsibility.castOrCopy(metadata);
+        } else {
+            return DefaultResponsibleParty.castOrCopy(metadata);
         }
     }
 

Added: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java?rev=1817940&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
(added)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.Scope;
+import org.apache.sis.metadata.iso.quality.DefaultScope;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter in order to map implementing class with the GeoAPI interface.
+ * See package documentation for more information about JAXB and interface.
+ *
+ * @author  Cullen Rombach (Image Matters)
+ * @since   1.0
+ * @version 0.8
+ * @module
+ */
+@SuppressWarnings("deprecation")
+public final class DQ_Scope extends PropertyType<DQ_Scope, Scope> {
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public DQ_Scope() {
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     * This method is indirectly invoked by the private constructor
+     * below, so it shall not depend on the state of this object.
+     *
+     * @return {@code Scope.class}
+     */
+    @Override
+    protected Class<Scope> getBoundType() {
+        return Scope.class;
+    }
+
+    /**
+     * Constructor for the {@link #wrap} method only.
+     */
+    private DQ_Scope(final Scope metadata) {
+        super(metadata);
+    }
+
+    /**
+     * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata
value
+     * in a {@code <gmd:DQ_Scope>} XML element.
+     *
+     * @param  metadata  the metadata element to marshall.
+     * @return a {@code PropertyType} wrapping the given the metadata element.
+     */
+    @Override
+    protected DQ_Scope wrap(final Scope metadata) {
+        return new DQ_Scope(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at marshalling time for getting the actual metadata to write
+     * inside the {@code <gmd:DQ_Scope>} XML element.
+     * This is the value or a copy of the value given in argument to the {@code wrap} method.
+     *
+     * @return the metadata to be marshalled.
+     */
+    @XmlElementRef
+    public DefaultScope getElement() {
+        return DefaultScope.castOrCopy(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+     *
+     * @param  metadata  the unmarshalled metadata.
+     */
+    public void setElement(final DefaultScope metadata) {
+        this.metadata = metadata;
+    }
+}

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_Scope.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java?rev=1817940&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
(added)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.metadata.iso.constraint.DefaultReleasability;
+import org.opengis.metadata.constraint.Releasability;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface.
+ * See package documentation for more information about JAXB and interface.
+ *
+ * @author  Cullen Rombach (Image Matters)
+ * @since   1.0
+ * @version 1.0
+ * @module
+ */
+public final class MD_Releasability extends PropertyType<MD_Releasability, Releasability>
{
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public MD_Releasability() {
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     * This method is indirectly invoked by the private constructor
+     * below, so it shall not depend on the state of this object.
+     *
+     * @return {@code Releasability.class}
+     */
+    @Override
+    protected Class<Releasability> getBoundType() {
+        return Releasability.class;
+    }
+
+    /**
+     * Constructor for the {@link #wrap} method only.
+     */
+    private MD_Releasability(final Releasability metadata) {
+        super(metadata);
+    }
+
+    /**
+     * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata
value
+     * in a {@code <gmd:MD_Releasability>} XML element.
+     *
+     * @param  metadata  the metadata element to marshall.
+     * @return a {@code PropertyType} wrapping the given the metadata element.
+     */
+    @Override
+    protected MD_Releasability wrap(final Releasability metadata) {
+        return new MD_Releasability(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at marshalling time for getting the actual metadata to write
+     * inside the {@code <gmd:MD_Releasability>} XML element.
+     * This is the value or a copy of the value given in argument to the {@code wrap} method.
+     *
+     * @return the metadata to be marshalled.
+     */
+    @XmlElementRef
+    public DefaultReleasability getElement() {
+        return DefaultReleasability.castOrCopy(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+     *
+     * @param  metadata  the unmarshalled metadata.
+     */
+    public void setElement(final DefaultReleasability metadata) {
+        this.metadata = metadata;
+    }
+}

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -49,7 +49,8 @@
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @since   1.0
  *
  * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
  *

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -19,9 +19,13 @@ package org.apache.sis.internal.jaxb.met
 import java.util.Objects;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.metadata.Identifier;
 import org.opengis.referencing.ReferenceSystem;
+import org.apache.sis.internal.jaxb.metadata.MD_Identifier;
+import org.apache.sis.internal.jaxb.metadata.RS_Identifier;
 import org.apache.sis.internal.simple.SimpleIdentifiedObject;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.ComparisonMode;
 
 
@@ -37,7 +41,8 @@ import org.apache.sis.util.ComparisonMod
  *
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  *
  * @see org.apache.sis.referencing.AbstractReferenceSystem
  *
@@ -78,13 +83,15 @@ public class ReferenceSystemMetadata ext
 
     /**
      * Returns the primary name by which this object is identified.
+     * This method can be invoked during ISO 19115-3 marshalling.
      *
      * @return the identifier given at construction time.
      */
     @Override
     @XmlElement(name = "referenceSystemIdentifier")
+    @XmlJavaTypeAdapter(MD_Identifier.class)
     public final Identifier getName() {
-        return super.getName();
+        return Context.isLatestMetadata() ? super.getName() : null;
     }
 
     /**
@@ -96,6 +103,24 @@ public class ReferenceSystemMetadata ext
         this.name = name;
     }
 
+    /**
+     * Gets the name for this reference system metadata (used in ISO 19139 format).
+     * This method can be invoked during ISO 19139 marshalling.
+     */
+    @XmlElement(name = "referenceSystemIdentifier")
+    @XmlJavaTypeAdapter(RS_Identifier.class)
+    private Identifier getLegacyName() {
+        return Context.isLatestMetadata() ? null : getName();
+    }
+
+    /**
+     * Sets the name for this reference system metadata (used in ISO 19139 format).
+     */
+    @SuppressWarnings("unused")
+    private void setLegacyName(final Identifier name) {
+        this.name = name;
+    }
+
     /**
      * Compares this object with the given one for equality.
      *

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -29,12 +29,14 @@
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Rémi Maréchal (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @since   1.0
  * @since   0.5
  * @module
  */
-@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns =
{
-    @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.MRS, xmlns =
{
+    @XmlNs(prefix = "mrs", namespaceURI = Namespaces.MRS),
+    @XmlNs(prefix = "mdb", namespaceURI = Namespaces.MDB),
     @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV),
     @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
     @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -91,7 +91,7 @@ public final class OtherLocales extends
     @Override
     public Iterator<Locale> iterator() {
         final Iterator<Locale> it = languages.iterator();
-        if (it.hasNext()) it.next(); // Skip the first element.
+        if (it.hasNext()) it.next();                            // Skip the first element.
         return it;
     }
 
@@ -114,7 +114,7 @@ public final class OtherLocales extends
         if (languages.isEmpty()) {
             Locale defaultLocale = Locale.getDefault();
             if (defaultLocale.equals(locale)) {
-                defaultLocale = Locale.ROOT;  // Same default than merge(Locale, Collection).
+                defaultLocale = Locale.ROOT;                    // Same default than merge(Locale,
Collection).
             }
             languages.add(defaultLocale);
         }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -30,6 +30,8 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.metadata.TitleProperty;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.iso.Types;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.metadata.Dependencies;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
@@ -69,13 +71,14 @@ import static org.apache.sis.internal.me
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs
shallow clones.
 @TitleProperty(name = "name")
-@XmlType(name = "MD_ExtendedElementInformation_Type", propOrder = {
+@XmlType(name = "MD_ExtendedElementInformation_Type", namespace = Namespaces.MEX, propOrder
= {
     "name",
     "shortName",
     "domainCode",
@@ -90,7 +93,7 @@ import static org.apache.sis.internal.me
     "rationales",
     "sources"
 })
-@XmlRootElement(name = "MD_ExtendedElementInformation")
+@XmlRootElement(name = "MD_ExtendedElementInformation", namespace = Namespaces.MEX)
 public class DefaultExtendedElementInformation extends ISOMetadata implements ExtendedElementInformation
{
     /**
      * Serial number for inter-operability with different versions.
@@ -304,7 +307,7 @@ public class DefaultExtendedElementInfor
     @Deprecated
     @XmlElement(name = "shortName")
     public String getShortName()  {
-        return shortName;
+    	return Context.isLatestMetadata() ? null : shortName;
     }
 
     /**
@@ -333,7 +336,7 @@ public class DefaultExtendedElementInfor
     @Deprecated
     @XmlElement(name = "domainCode")
     public Integer getDomainCode() {
-        return domainCode;
+        return Context.isLatestMetadata() ? null : domainCode;
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -24,6 +24,7 @@ import org.opengis.metadata.citation.Cit
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.TitleProperty;
 import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.xml.Namespaces;
 
 
 /**
@@ -82,7 +83,8 @@ import org.apache.sis.metadata.iso.citat
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @version 0.7
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  *
  * @see ImmutableIdentifier
  * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier)
@@ -92,11 +94,14 @@ import org.apache.sis.metadata.iso.citat
  */
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs
shallow clones.
 @TitleProperty(name = "code")
-@XmlType(name = "MD_Identifier_Type", propOrder = {
+@XmlType(name = "MD_Identifier_Type", namespace = Namespaces.MCC, propOrder = {
     "authority",
-    "code"
+    "code",
+    "codeSpace",
+    "version",
+    "description"
 })
-@XmlRootElement(name = "MD_Identifier")
+@XmlRootElement(name = "MD_Identifier", namespace = Namespaces.MCC)
 public class DefaultIdentifier extends ISOMetadata implements Identifier {
     /**
      * Serial number for inter-operability with different versions.
@@ -290,6 +295,7 @@ public class DefaultIdentifier extends I
      * @since 0.5
      */
     @Override
+    @XmlElement(name = "codeSpace")
     public String getCodeSpace() {
         return codeSpace;
     }
@@ -316,6 +322,7 @@ public class DefaultIdentifier extends I
      * @return the version identifier for the namespace, or {@code null} if none.
      */
     @Override
+    @XmlElement(name = "version")
     public String getVersion() {
         return version;
     }
@@ -340,6 +347,7 @@ public class DefaultIdentifier extends I
      * @since 0.5
      */
     @Override
+    @XmlElement(name = "description")
     public InternationalString getDescription() {
         return description;
     }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlRoot
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.ExtendedElementInformation;
 import org.opengis.metadata.MetadataExtensionInformation;
+import org.apache.sis.xml.Namespaces;
 
 
 /**
@@ -40,16 +41,17 @@ import org.opengis.metadata.MetadataExte
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @version 0.3
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs
shallow clones.
-@XmlType(name = "MD_MetadataExtensionInformation_Type", propOrder = {
+@XmlType(name = "MD_MetadataExtensionInformation_Type", namespace = Namespaces.MEX, propOrder
= {
     "extensionOnLineResource",
     "extendedElementInformation"
 })
-@XmlRootElement(name = "MD_MetadataExtensionInformation")
+@XmlRootElement(name = "MD_MetadataExtensionInformation", namespace = Namespaces.MEX)
 public class DefaultMetadataExtensionInformation extends ISOMetadata implements MetadataExtensionInformation
{
     /**
      * Serial number for compatibility with different versions.

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] Tue Dec 12 18:02:47 2017
@@ -81,13 +81,16 @@
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */
-@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD,
xmlns = {
-    @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI),
-    @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
+@XmlSchema(location = Schemas.METADATA_XSD_BASE, elementFormDefault = XmlNsForm.QUALIFIED,
namespace = Namespaces.MDB, xmlns = {
+    @XmlNs(prefix = "mdb", namespaceURI = Namespaces.MDB),
+    @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),
+    @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN),
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),
     @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
     @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
 })

Modified: sis/branches/ISO-19115-3/core/sis-utility/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/pom.xml?rev=1817940&r1=1817939&r2=1817940&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/pom.xml (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/pom.xml Tue Dec 12 18:02:47 2017
@@ -87,6 +87,13 @@ Miscellaneous utilities.
       </roles>
     </contributor>
     <contributor>
+      <name>Cullen Rombach</name>
+      <organization>Image Matters</organization>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
+    <contributor>
       <name>Guilhem Legal</name>
       <email>guilhem.legal@geomatys.com</email>
       <organization>Geomatys</organization>



Mime
View raw message