Author: desruisseaux
Date: Fri Feb  2 11:05:23 2018
New Revision: 1822944

URL: http://svn.apache.org/viewvc?rev=1822944&view=rev
Log:
Last namespace fixes for metadata and code list adapters.
The case of data quality package is not yet resolved; see 
https://issues.apache.org/jira/browse/SIS-394

Modified:
    
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
    
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
    
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
    
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
    
sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java

Modified: 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: 
http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1822944&r1=1822943&r2=1822944&view=diff
==============================================================================
--- 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
 [UTF-8] (original)
+++ 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
 [UTF-8] Fri Feb  2 11:05:23 2018
@@ -39,6 +39,8 @@ import org.opengis.metadata.quality.Eval
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.internal.system.Semaphores;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.util.collection.CheckedContainer;
 import org.apache.sis.util.resources.Errors;
 
@@ -64,7 +66,7 @@ import static org.apache.sis.util.collec
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Guilhem Legal (Geomatys)
- * @version 0.3
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -390,10 +392,13 @@ public class AbstractElement extends ISO
      * Returns the name of the test applied to the data.
      *
      * @return name of the test applied to the data.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "nameOfMeasure")
+    @XmlElement(name = "nameOfMeasure", namespace = LegacyNamespaces.GMD)
     public Collection<InternationalString> getNamesOfMeasure() {
+        if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
         return namesOfMeasure = nonNullCollection(namesOfMeasure, 
InternationalString.class);
     }
 
@@ -410,11 +415,13 @@ public class AbstractElement extends ISO
      * Returns the code identifying a registered standard procedure, or {@code 
null} if none.
      *
      * @return code identifying a registered standard procedure, or {@code 
null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "measureIdentification")
+    @XmlElement(name = "measureIdentification", namespace = 
LegacyNamespaces.GMD)
     public Identifier getMeasureIdentification() {
-        return measureIdentification;
+        return FilterByVersion.LEGACY_METADATA.accept() ? 
measureIdentification : null;
     }
 
     /**
@@ -431,11 +438,13 @@ public class AbstractElement extends ISO
      * Returns the description of the measure being determined.
      *
      * @return description of the measure being determined, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "measureDescription")
+    @XmlElement(name = "measureDescription", namespace = LegacyNamespaces.GMD)
     public InternationalString getMeasureDescription() {
-        return measureDescription;
+        return FilterByVersion.LEGACY_METADATA.accept() ? measureDescription : 
null;
     }
 
     /**
@@ -452,11 +461,13 @@ public class AbstractElement extends ISO
      * Returns the type of method used to evaluate quality of the dataset.
      *
      * @return type of method used to evaluate quality, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "evaluationMethodType")
+    @XmlElement(name = "evaluationMethodType", namespace = 
LegacyNamespaces.GMD)
     public EvaluationMethodType getEvaluationMethodType() {
-        return evaluationMethodType;
+        return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodType 
: null;
     }
 
     /**
@@ -473,11 +484,13 @@ public class AbstractElement extends ISO
      * Returns the description of the evaluation method.
      *
      * @return description of the evaluation method, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "evaluationMethodDescription")
+    @XmlElement(name = "evaluationMethodDescription", namespace = 
LegacyNamespaces.GMD)
     public InternationalString getEvaluationMethodDescription() {
-        return evaluationMethodDescription;
+        return FilterByVersion.LEGACY_METADATA.accept() ? 
evaluationMethodDescription : null;
     }
 
     /**
@@ -494,11 +507,13 @@ public class AbstractElement extends ISO
      * Returns the reference to the procedure information, or {@code null} if 
none.
      *
      * @return reference to the procedure information, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "evaluationProcedure")
+    @XmlElement(name = "evaluationProcedure", namespace = LegacyNamespaces.GMD)
     public Citation getEvaluationProcedure() {
-        return evaluationProcedure;
+        return FilterByVersion.LEGACY_METADATA.accept() ? evaluationProcedure 
: null;
     }
 
     /**

Modified: 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
URL: 
http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java?rev=1822944&r1=1822943&r2=1822944&view=diff
==============================================================================
--- 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
 [UTF-8] (original)
+++ 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
 [UTF-8] Fri Feb  2 11:05:23 2018
@@ -27,6 +27,8 @@ import org.opengis.metadata.maintenance.
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.metadata.iso.maintenance.DefaultScope;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 
 
 /**
@@ -52,7 +54,7 @@ import org.apache.sis.metadata.iso.maint
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
- * @version 0.3
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -205,11 +207,13 @@ public class DefaultDataQuality extends
      * Returns non-quantitative quality information about the lineage of the 
data specified by the scope.
      *
      * @return non-quantitative quality information about the lineage of the 
data specified, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "lineage")
+    @XmlElement(name = "lineage", namespace = LegacyNamespaces.GMD)
     public Lineage getLineage() {
-        return lineage;
+        return FilterByVersion.LEGACY_METADATA.accept() ? lineage : null;
     }
 
     /**

Modified: 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: 
http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1822944&r1=1822943&r2=1822944&view=diff
==============================================================================
--- 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
 [UTF-8] (original)
+++ 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
 [UTF-8] Fri Feb  2 11:05:23 2018
@@ -25,6 +25,8 @@ import org.opengis.metadata.quality.Quan
 import org.opengis.util.InternationalString;
 import org.opengis.util.Record;
 import org.opengis.util.RecordType;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 
 
 /**
@@ -165,7 +167,7 @@ public class DefaultQuantitativeResult e
      * @return value type for reporting a data quality result, or {@code null}.
      */
     @Override
-    @XmlElement(name = "valueType")
+    @XmlElement(name = "valueRecordType")
     public RecordType getValueType()  {
         RecordType type = valueType;
         if (type == null && values != null) {
@@ -221,11 +223,13 @@ public class DefaultQuantitativeResult e
      * Returns the statistical method used to determine the value.
      *
      * @return statistical method used to determine the value, or {@code null}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-394";>Issue 
SIS-394</a>
      */
     @Override
-    @XmlElement(name = "errorStatistic")
+    @XmlElement(name = "errorStatistic", namespace = LegacyNamespaces.GMD)
     public InternationalString getErrorStatistic()  {
-        return errorStatistic;
+        return FilterByVersion.LEGACY_METADATA.accept() ? errorStatistic : 
null;
     }
 
     /**

Modified: 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: 
http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1822944&r1=1822943&r2=1822944&view=diff
==============================================================================
--- 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
 [UTF-8] (original)
+++ 
sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
 [UTF-8] Fri Feb  2 11:05:23 2018
@@ -29,7 +29,6 @@ import org.opengis.geometry.primitive.Po
 import org.opengis.util.InternationalString;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.resources.Messages;
-import org.apache.sis.xml.Namespaces;
 
 
 /**
@@ -299,7 +298,7 @@ public class DefaultGeorectified extends
      * @return the center point, or {@code null}.
      */
     @Override
-    @XmlElement(name = "centerPoint")
+    @XmlElement(name = "centrePoint")
     public Point getCenterPoint() {
         return centerPoint;
     }
@@ -383,7 +382,7 @@ public class DefaultGeorectified extends
      * @return geographic references used to validate georectification.
      */
     @Override
-    @XmlElement(name = "checkPoint", namespace = Namespaces.GMI)
+    @XmlElement(name = "checkPoint")
     public Collection<GCP> getCheckPoints() {
         return checkPoints = nonNullCollection(checkPoints, GCP.class);
     }

Modified: 
sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
URL: 
http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java?rev=1822944&r1=1822943&r2=1822944&view=diff
==============================================================================
--- 
sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
 [UTF-8] (original)
+++ 
sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
 [UTF-8] Fri Feb  2 11:05:23 2018
@@ -93,10 +93,14 @@ public final strictfp class SchemaCompli
     private static final Map<String,String> TYPES_TO_MERGE;
     static {
         final Map<String,String> m = new HashMap<>();
-        m.put("LE_ProcessStep_Type",         "LI_ProcessStep_Type");
-        m.put("MI_Band_Type",                "MD_Band_Type");
-        m.put("MI_CoverageDescription_Type", "MD_CoverageDescription_Type");
-        m.put("AbstractMX_File_Type",        "MX_DataFile_Type");
+        // ………Merge what…………………………………………………………Into……………………………………………
+        m.put("MI_Band_Type",                 "MD_Band_Type");
+        m.put("MI_CoverageDescription_Type",  "MD_CoverageDescription_Type");
+        m.put("MI_Georectified_Type",         "MD_Georectified_Type");
+        m.put("LE_ProcessStep_Type",          "LI_ProcessStep_Type");
+        m.put("AbstractMX_File_Type",         "MX_DataFile_Type");
+        m.put("Abstract_DataQuality_Type",    "DQ_DataQuality_Type");
+        m.put("Abstract_QualityElement_Type", "AbstractDQ_Element_Type");
         TYPES_TO_MERGE = Collections.unmodifiableMap(m);
     }
 
@@ -349,7 +353,11 @@ public final strictfp class SchemaCompli
                     final String name = getMandatoryAttribute(node, "name");
                     final String type = getMandatoryAttribute(node, "type");
                     if (CODELIST_TYPE.equals(type)) {
-                        if (typeDefinitions.put(name, 
Collections.singletonMap(null, new Info(null, targetNamespace, false, false))) 
!= null) {
+                        final Map<String,Info> properties = new HashMap<>(4);
+                        final Info info = new Info(null, targetNamespace, 
false, false);
+                        properties.put(null, info);     // Remember namespace 
of the code list.
+                        properties.put(name, info);     // Pseudo-property 
used in our CodeList adapters.
+                        if (typeDefinitions.put(name, properties) != null) {
                             throw new SchemaException("Code list " + name + " 
defined twice.");
                         }
                     } else {


Reply via email to