sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1832204 - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/ core/sis-metadata/src/main/java/org/apache/sis/util/iso/ core/sis-metadata/src...
Date Thu, 24 May 2018 21:19:30 GMT
Author: desruisseaux
Date: Thu May 24 21:19:29 2018
New Revision: 1832204

URL: http://svn.apache.org/viewvc?rev=1832204&view=rev
Log:
Add "http://www.isotc211.org/2005/gmi" as a synonymous of "http://standards.iso.org/iso/19115/-2/gmi/1.0"
namespace at unmarshalling time.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -66,6 +66,12 @@ public final class LegacyNamespaces {
     public static final String GMD = "http://www.isotc211.org/2005/gmd";
 
     /**
+     * The <code>{@value}</code> URL as an alias for {@link #GMI}.
+     * Was used in some XML files before a more official URL was set.
+     */
+    public static final String GMI_ALIAS = "http://www.isotc211.org/2005/gmi";
+
+    /**
      * The <code>{@value}</code> URL.
      * The usual prefix for this namespace is {@code "gmi"}.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -86,7 +86,9 @@ public class GO_RecordType extends Prope
      * @param  metadata  the unmarshalled metadata.
      */
     public final void setElement(final DefaultRecordType metadata) {
-        this.metadata = metadata;
+        if (!metadata.getMembers().isEmpty()) {
+            this.metadata = metadata;
+        }
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -411,7 +411,8 @@ public class DefaultRecord implements Re
     //////////////////////////////////////////////////////////////////////////////////////////////////
 
     /**
-     * Constructs an initially empty record. Used by JAXB.
+     * Constructs an initially empty record expecting exactly one value as a string.
+     * See {@link #setValue(String)} for a description of the supported XML content.
      */
     private DefaultRecord() {
         definition = RecordSchemaSIS.STRING;
@@ -433,7 +434,20 @@ public class DefaultRecord implements Re
     }
 
     /**
-     * Sets the record value as a string.
+     * Sets the record value as a string. This method is invoked at unmarshalling time.
+     * A record can be anything, but usages that we have seen so far write a character
+     * sequence or a code list. Examples:
+     *
+     * {@preformat xml
+     *    <gco:Record>Alphanumeric values: Product is alphanumeric.</gco:Record>
+     *    <gco:Record>Alphanumeric Text: Message contains alphanumeric text.</gco:Record>
+     *    <gco:Record>Part A: Reflectivity presented as a tabular listing of alphanumerics.</gco:Record>
+     *    <gco:Record>
+     *      <gmd:CodeListValue codelist="someURL#DataQualityAssessment" codeListValue="intermediate">intermediate</gmd:CodeListValue>
+     *    </gco:Record>
+     * }
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-419">SIS-419</a>
      */
     private void setValue(String value) {
         if (value != null && !(value = value.trim()).isEmpty()) {

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -447,7 +447,8 @@ public class DefaultRecordType extends R
     //////////////////////////////////////////////////////////////////////////////////////////////////
 
     /**
-     * Empty constructor only used by JAXB.
+     * Constructs an initially empty type describing exactly one value as a string.
+     * See {@link #setValue(String)} for a description of the supported XML content.
      */
     @SuppressWarnings("unused")
     private DefaultRecordType() {
@@ -471,6 +472,17 @@ public class DefaultRecordType extends R
 
     /**
      * Sets the record type value as a string. Current implementation expect one member per
line.
+     * A record can be anything, but usages that we have seen so far write a character sequence
+     * of what seems <var>key</var>-<var>description</var> pairs.
Examples:
+     *
+     * {@preformat xml
+     *   <gco:RecordType>
+     *     General Meteorological Products: General products include the baseline reflectivity
and velocity,
+     *     and also algorithmic graphic products spectrum width, vertical integrated liquid,
and VAD wind profile.
+     *   </gco:RecordType>
+     * }
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-419">SIS-419</a>
      */
     private void setValue(final String value) {
         if (value != null) {

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -77,9 +77,10 @@ final class TransformVersion {
          * this rule is the "gco" namespace, because our reader renames only element namespaces
while we need to
          * rename also attributes in "gco" namespace (e.g. "gco:nilReason").
          */
-        ISO19139.addSurjective(Namespaces.SRV, LegacyNamespaces.SRV);
-        ISO19139.addSurjective(Namespaces.GCX, LegacyNamespaces.GMX);
-        ISO19139.addBijective (Namespaces.GCO, LegacyNamespaces.GCO);
+        ISO19139.addSurjective (Namespaces.SRV, LegacyNamespaces.SRV);
+        ISO19139.addSurjective (Namespaces.GCX, LegacyNamespaces.GMX);
+        ISO19139.addBijective  (Namespaces.GCO, LegacyNamespaces.GCO);
+        ISO19139.addAlias(LegacyNamespaces.GMI, LegacyNamespaces.GMI_ALIAS);
     }
 
     /**
@@ -141,6 +142,14 @@ final class TransformVersion {
     }
 
     /**
+     * Adds a namespace to be considered as an alias of another namespace.
+     * The aliases are usually non-official URL and should not be used in exports.
+     */
+    private void addAlias(final String standard, final String alias) {
+        imports.put(alias, standard);
+    }
+
+    /**
      * Adds a two-directional association between a namespace used in JAXB annotation and
a namespace
      * used in XML document. A bijective association means that the renaming is reversible.
      */

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java?rev=1832204&r1=1832203&r2=1832204&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
[UTF-8] Thu May 24 21:19:29 2018
@@ -47,11 +47,13 @@ public final class StoreProvider extends
      */
     public StoreProvider() {
         super(null);
-        mimeForNameSpaces.put(Namespaces.GML, "application/gml+xml");
-        mimeForNameSpaces.put(Namespaces.CSW, "application/vnd.ogc.csw_xml");
-        mimeForNameSpaces.put(LegacyNamespaces.GMD, "application/vnd.iso.19139+xml");
+        mimeForNameSpaces.put(      Namespaces.GML,       "application/gml+xml");
+        mimeForNameSpaces.put(      Namespaces.CSW,       "application/vnd.ogc.csw_xml");
+        mimeForNameSpaces.put(LegacyNamespaces.GMD,       "application/vnd.iso.19139+xml");
+        mimeForNameSpaces.put(LegacyNamespaces.GMI,       "application/vnd.iso.19139+xml");
+        mimeForNameSpaces.put(LegacyNamespaces.GMI_ALIAS, "application/vnd.iso.19139+xml");
+        mimeForRootElements.put("MD_Metadata",            "application/vnd.iso.19139+xml");
         // More types to be added in future versions.
-        mimeForRootElements.put("MD_Metadata", "application/vnd.iso.19139+xml");
     }
 
     /**



Mime
View raw message