sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1819856 - in /sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis: internal/jaxb/gmd/CodeListUID.java xml/FilterVersion.java
Date Tue, 02 Jan 2018 17:07:52 GMT
Author: desruisseaux
Date: Tue Jan  2 17:07:52 2018
New Revision: 1819856

URL: http://svn.apache.org/viewvc?rev=1819856&view=rev
Log:
Fix the replacement of namespaces when marshalling legacy ISO 19139:2007.

Modified:
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java

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=1819856&r1=1819855&r2=1819856&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] Tue Jan  2 17:07:52 2018
@@ -57,6 +57,7 @@ public final class CodeListUID {
      * Some examples of strings returned by this method are:
      *
      * <ul>
+     *   <li>{@code "http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"}</li>
      *   <li>{@code "http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"}</li>
      *   <li>{@code "http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"}</li>
      *   <li>{@code "http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode"}</li>
@@ -67,16 +68,17 @@ public final class CodeListUID {
      * @return the URL to the given code list in the given schema.
      */
     private static String schema(final Context context, final String identifier) {
-        final String prefix, path;
+        final String prefix, root, path;
         if (Context.isFlagSet(context, Context.LEGACY_METADATA)) {
             prefix = "gmd";
+            root = Schemas.METADATA_ROOT_LEGACY;
             path = Schemas.CODELISTS_PATH_LEGACY;   // Future SIS version may switch between
localized/unlocalized file.
         } else {
             prefix = "mdb";
+            root = Schemas.METADATA_ROOT;
             path = Schemas.CODELISTS_PATH;
         }
-        return Context.schema(context, prefix, Schemas.METADATA_ROOT)
-                .append(path).append('#').append(identifier).toString();
+        return Context.schema(context, prefix, root).append(path).append('#').append(identifier).toString();
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java?rev=1819856&r1=1819855&r2=1819856&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java
[UTF-8] Tue Jan  2 17:07:52 2018
@@ -126,7 +126,7 @@ enum FilterVersion {
      * This constructor is used when the legacy schema (the "view") was one large monolithic
schema,
      * and the new schema (the "impl") has been separated in many smaller modules.
      *
-     * @param  impl        the namespaces used in JAXB annotations (should be latest schema).
+     * @param  impl        the namespaces used in JAXB annotations (should be most recent
schema).
      * @param  view        the single namespace used in the XML file to (un)marshall (older
schema).
      * @param  additional  additional (<var>impl</var>, <var>view</var>)
mapping for a few namespaces
      *                     having different {@code view} values.
@@ -135,7 +135,7 @@ enum FilterVersion {
         toView = new HashMap<>(Containers.hashMapCapacity(impl.length));
         toImpl = new HashMap<>();
         for (final String e : impl) {
-            toImpl.put(e, view);
+            toView.put(e, view);
         }
         for (int i=0; i<additional.length;) {
             final String p = additional[i++];



Mime
View raw message