You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2019/06/29 13:58:06 UTC

[sis] branch geoapi-4.0 updated (b778b4a -> 6ca3363)

This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a change to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git.


    from b778b4a  Update for GeoAPI change and simplification of an exception stack trace.
     new 24cf318  Revert erroneous removal of 2 methods.
     new 6ca3363  Update for GeoAPI change: missing methods added in DataFile interface and "featureType" UML identifier become plural for matching the XSD. https://github.com/opengeospatial/geoapi/issues/16

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../metadata/iso/distribution/DefaultDataFile.java | 30 ++++++++++++----------
 .../sis/test/xml/AnnotationConsistencyCheck.java   |  6 -----
 .../sis/internal/referencing/DeprecatedCode.java   | 11 ++++++++
 .../sis/internal/referencing/DeprecatedName.java   | 11 ++++++++
 4 files changed, 39 insertions(+), 19 deletions(-)


[sis] 02/02: Update for GeoAPI change: missing methods added in DataFile interface and "featureType" UML identifier become plural for matching the XSD. https://github.com/opengeospatial/geoapi/issues/16

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 6ca336333eec8bdfaee0c12497df0b227eebabcf
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sat Jun 29 15:56:24 2019 +0200

    Update for GeoAPI change: missing methods added in DataFile interface and "featureType" UML identifier become plural for matching the XSD.
    https://github.com/opengeospatial/geoapi/issues/16
---
 .../metadata/iso/distribution/DefaultDataFile.java | 30 ++++++++++++----------
 .../sis/test/xml/AnnotationConsistencyCheck.java   |  6 -----
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
index b46cd11..fc8f91c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.opengis.util.LocalName;
+import org.opengis.util.GenericName;
 import org.opengis.metadata.distribution.Format;
 import org.opengis.metadata.distribution.DataFile;
 import org.apache.sis.xml.Namespaces;
@@ -38,10 +38,9 @@ import org.opengis.util.InternationalString;
  * The following properties are mandatory in a well-formed metadata according ISO 19115:
  *
  * <div class="preformat">{@code MX_DataFile}
- * {@code   └─fileFormat……………………………………………………………} Defines the format of the transfer data file.
- * {@code       └─formatSpecificationCitation……} Citation/URL of the specification format.
- * {@code           ├─title……………………………………………………} Name by which the cited resource is known.
- * {@code           └─date………………………………………………………} Reference date for the cited resource.</div>
+ * {@code   ├─fileName……………………………………………………………} Name or path of the file.
+ * {@code   ├─fileDescription…………………………………………} Text description of the data.
+ * {@code   └─fileType……………………………………………………………} Format in which the data is encoded.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>
@@ -100,7 +99,7 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      * This attribute may be omitted when the dataset is composed of a single file and/or the
      * data does not relate to a feature catalogue.
      */
-    private Collection<LocalName> featureTypes;
+    private Collection<GenericName> featureTypes;
 
     /**
      * Defines the format of the transfer data file.
@@ -128,9 +127,11 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
     public DefaultDataFile(final DataFile object) {
         super(object);
         if (object != null) {
-            featureTypes = copyCollection(object.getFeatureTypes(), LocalName.class);
-            fileFormat   = object.getFileFormat();
-            // TODO: copy other properties.
+            fileName        = object.getFileName();
+            fileDescription = object.getFileDescription();
+            fileType        = object.getFileType();
+            featureTypes    = copyCollection(object.getFeatureTypes(), GenericName.class);
+            fileFormat      = object.getFileFormat();
         }
     }
 
@@ -167,6 +168,7 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileName()
      * @since 1.0
      */
+    @Override
     @XmlElement(name = "fileName", required = true)
     public URI getFileName() {
         return fileName;
@@ -192,6 +194,7 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileDescription()
      * @since 1.0
      */
+    @Override
     @XmlElement(name = "fileDescription", required = true)
     public InternationalString getFileDescription() {
         return fileDescription;
@@ -217,6 +220,7 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileType()
      * @since 1.0
      */
+    @Override
     @XmlElement(name = "fileType", required = true)
     @XmlJavaTypeAdapter(MimeFileTypeAdapter.class)
     public String getFileType() {
@@ -245,8 +249,8 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      */
     @Override
     @XmlElement(name = "featureTypes")
-    public Collection<LocalName> getFeatureTypes() {
-        return featureTypes = nonNullCollection(featureTypes, LocalName.class);
+    public Collection<GenericName> getFeatureTypes() {
+        return featureTypes = nonNullCollection(featureTypes, GenericName.class);
     }
 
     /**
@@ -254,8 +258,8 @@ public class DefaultDataFile extends ISOMetadata implements DataFile {
      *
      * @param newValues  the new feature type values.
      */
-    public void setFeatureTypes(final Collection<? extends LocalName> newValues) {
-        featureTypes = writeCollection(newValues, featureTypes, LocalName.class);
+    public void setFeatureTypes(final Collection<? extends GenericName> newValues) {
+        featureTypes = writeCollection(newValues, featureTypes, GenericName.class);
     }
 
     /**
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
index db16411..8e0b5db 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
@@ -424,12 +424,6 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
                 }
                 break;
             }
-            case "featureType": {
-                if (org.opengis.metadata.distribution.DataFile.class.isAssignableFrom(enclosing)) {
-                    name = "featureTypes";                  // Spelling change in XSD files
-                }
-                break;
-            }
             case "valueType": {
                 if (org.opengis.metadata.quality.Result.class.isAssignableFrom(enclosing)) {
                     return "valueRecordType";


[sis] 01/02: Revert erroneous removal of 2 methods.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 24cf3189c481577be3fd359086f87dfd37bc381b
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sat Jun 29 11:16:51 2019 +0200

    Revert erroneous removal of 2 methods.
---
 .../org/apache/sis/internal/referencing/DeprecatedCode.java   | 11 +++++++++++
 .../org/apache/sis/internal/referencing/DeprecatedName.java   | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
index e3be616..71f811c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
@@ -87,4 +87,15 @@ public final class DeprecatedCode extends ImmutableIdentifier implements Depreca
     public InternationalString getRemarks() {
         return super.getDescription();
     }
+
+    /**
+     * Returns {@code null}, since we used the description for the superseded information.
+     * See <cite>"Implementation note"</cite> in class javadoc.
+     *
+     * @return {@code null}.
+     */
+    @Override
+    public InternationalString getDescription() {
+        return null;
+    }
 }
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
index f7a338a..306b531 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
@@ -79,4 +79,15 @@ public final class DeprecatedName extends NamedIdentifier implements Deprecable
     public InternationalString getRemarks() {
         return super.getDescription();
     }
+
+    /**
+     * Returns {@code null}, since we used the description for the superseded information.
+     * See <cite>"Implementation note"</cite> in class javadoc.
+     *
+     * @return {@code null}.
+     */
+    @Override
+    public InternationalString getDescription() {
+        return null;
+    }
 }