sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1820017 - in /sis/branches/ISO-19115-3: ./ core/sis-metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/ core/sis-utility/ core/sis-utility/sr...
Date Wed, 03 Jan 2018 22:21:02 GMT
Author: desruisseaux
Date: Wed Jan  3 22:21:02 2018
New Revision: 1820017

URL: http://svn.apache.org/viewvc?rev=1820017&view=rev
Log:
Adaptation of commit 969adb4a3949575c8913b4607c40d5f1601b9375 from Image Matter
(more Lineage upgrade; add Cullen to contributor list)

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

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/metadata/MD_Resolution.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
    sis/branches/ISO-19115-3/core/sis-utility/pom.xml
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
    sis/branches/ISO-19115-3/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=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/pom.xml (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/pom.xml Wed Jan  3 22:21:02 2018
@@ -84,6 +84,8 @@ Implementations of metadata derived from
     <contributor>
       <name>Cullen Rombach</name>
       <organization>Image Matters</organization>
+      <organizationUrl>http://www.imagemattersllc.com</organizationUrl>
+      <timezone>-5</timezone>
       <roles>
         <role>developer</role>
       </roles>

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.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_Resolution.java?rev=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java
[UTF-8] Wed Jan  3 22:21:02 2018
@@ -28,11 +28,11 @@ import org.apache.sis.internal.jaxb.gco.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
  * @since   0.3
  * @module
  */
-public final class MD_Resolution extends PropertyType<MD_Resolution, Resolution> {
+public class MD_Resolution extends PropertyType<MD_Resolution, Resolution> {
     /**
      * Empty constructor for JAXB only.
      */
@@ -47,7 +47,7 @@ public final class MD_Resolution extends
      * @return {@code Resolution.class}
      */
     @Override
-    protected Class<Resolution> getBoundType() {
+    protected final Class<Resolution> getBoundType() {
         return Resolution.class;
     }
 
@@ -78,7 +78,7 @@ public final class MD_Resolution extends
      * @return the metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultResolution getElement() {
+    public final DefaultResolution getElement() {
         return DefaultResolution.castOrCopy(metadata);
     }
 
@@ -87,7 +87,26 @@ public final class MD_Resolution extends
      *
      * @param  metadata  the unmarshalled metadata.
      */
-    public void setElement(final DefaultResolution metadata) {
+    public final void setElement(final DefaultResolution metadata) {
         this.metadata = metadata;
     }
+
+    /**
+     * Wraps the value only if marshalling an element from the ISO 19115:2003 metadata model.
+     * Otherwise (i.e. if marshalling according legacy ISO 19115:2014 model), omits the element.
+     */
+    public static final class Since2014 extends MD_Resolution {
+        /** Empty constructor used only by JAXB. */
+        public Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an
older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override protected MD_Resolution wrap(final Resolution value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
[UTF-8] Wed Jan  3 22:21:02 2018
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
@@ -37,6 +38,8 @@ import org.apache.sis.metadata.TitleProp
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.metadata.iso.maintenance.DefaultScope;
 import org.apache.sis.metadata.iso.identification.DefaultResolution;
+import org.apache.sis.internal.jaxb.metadata.MD_Resolution;
+import org.apache.sis.internal.jaxb.FilterByVersion;
 import org.apache.sis.internal.metadata.Dependencies;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.xml.Namespaces;
@@ -75,7 +78,8 @@ import org.apache.sis.xml.Namespaces;
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @author  Rémi Maréchal (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -83,10 +87,11 @@ import org.apache.sis.xml.Namespaces;
 @TitleProperty(name = "description")
 @XmlType(name = "LI_Source_Type", propOrder = {
     "description",
-    "scaleDenominator",
+    "scaleDenominator",             // Legacy ISO 19115:2003
     "sourceCitation",
     "sourceExtents",
     "sourceSteps",
+    "sourceSpatialResolution",      // New in ISO 19115:2014
     "processedLevel",
     "resolution"
 })
@@ -236,7 +241,8 @@ public class DefaultSource extends ISOMe
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "sourceSpatialResolution")
+    @XmlElement(name = "sourceSpatialResolution")
+    @XmlJavaTypeAdapter(MD_Resolution.Since2014.class)
     public Resolution getSourceSpatialResolution() {
         return sourceSpatialResolution;
     }
@@ -267,8 +273,13 @@ public class DefaultSource extends ISOMe
     @XmlElement(name = "scaleDenominator")
     @Dependencies("getSourceSpatialResolution")
     public RepresentativeFraction getScaleDenominator() {
-        final Resolution resolution = getSourceSpatialResolution();
-        return (resolution != null) ? resolution.getEquivalentScale() : null;
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            final Resolution resolution = getSourceSpatialResolution();
+            if (resolution != null) {
+                return resolution.getEquivalentScale();
+            }
+        }
+        return null;
     }
 
     /**

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=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/pom.xml (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/pom.xml Wed Jan  3 22:21:02 2018
@@ -89,6 +89,8 @@ Miscellaneous utilities.
     <contributor>
       <name>Cullen Rombach</name>
       <organization>Image Matters</organization>
+      <organizationUrl>http://www.imagemattersllc.com</organizationUrl>
+      <timezone>-5</timezone>
       <roles>
         <role>developer</role>
       </roles>

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java?rev=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
[UTF-8] Wed Jan  3 22:21:02 2018
@@ -115,7 +115,7 @@ public final class CodeListUID {
     /**
      * Default empty constructor for JAXB.
      */
-    private CodeListUID() {
+    public CodeListUID() {
     }
 
     /**

Modified: sis/branches/ISO-19115-3/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/pom.xml?rev=1820017&r1=1820016&r2=1820017&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/pom.xml (original)
+++ sis/branches/ISO-19115-3/pom.xml Wed Jan  3 22:21:02 2018
@@ -326,6 +326,15 @@ Apache SIS is a free software, Java lang
       </roles>
     </contributor>
     <contributor>
+      <name>Cullen Rombach</name>
+      <organization>Image Matters</organization>
+      <organizationUrl>http://www.imagemattersllc.com</organizationUrl>
+      <timezone>-5</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
+    <contributor>
       <name>Guilhem Legal</name>
       <email>guilhem.legal@geomatys.com</email>
       <organization>Geomatys</organization>



Mime
View raw message