sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1820029 - in /sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis: internal/jaxb/metadata/CI_Responsibility.java metadata/iso/DefaultMetadata.java metadata/iso/package-info.java
Date Thu, 04 Jan 2018 00:57:08 GMT
Author: desruisseaux
Date: Thu Jan  4 00:57:08 2018
New Revision: 1820029

URL: http://svn.apache.org/viewvc?rev=1820029&view=rev
Log:
Skip commits 9684e4808fa6e0ea5275f6a9e025e71a8eb43c6d, 1ae0aa336bb614168d61e84afda78e8ce8dcad92
and 55c11421a4f6da5a5e07a4be0b481c0cd82dcf94.
Adaptation of commit 39baf8a2bda6e761b264032fa1fd9dec2d72f9ab from Image Matter
(fix some bugs with DefaultResponsibility and DefaultResponsibleParty. Also add the rest of
the elements in DefaultMetadata)

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/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java?rev=1820029&r1=1820028&r2=1820029&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java
[UTF-8] Thu Jan  4 00:57:08 2018
@@ -18,6 +18,7 @@ package org.apache.sis.internal.jaxb.met
 
 import javax.xml.bind.annotation.XmlElementRef;
 import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.ResponsibleParty;
 import org.apache.sis.metadata.iso.citation.DefaultResponsibility;
 import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
@@ -83,6 +84,10 @@ public final class CI_Responsibility ext
     @SuppressWarnings("deprecation")
     public DefaultResponsibility getElement() {
         if (FilterByVersion.CURRENT_METADATA.accept()) {
+            if (metadata instanceof ResponsibleParty) {
+                // Need to build new DefaultResponsibility object here — simply casting
doesn't work.
+                return new DefaultResponsibility(metadata);
+            }
             return DefaultResponsibility.castOrCopy(metadata);
         } else {
             return DefaultResponsibleParty.castOrCopy(metadata);

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1820029&r1=1820028&r2=1820029&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
[UTF-8] Thu Jan  4 00:57:08 2018
@@ -136,7 +136,6 @@ import org.apache.sis.xml.Namespaces;
     "metadataIdentifier",
     "defaultLocale",
     "parentMetadata",
-    "metadataScope",
 
     // Legacy ISO 19115:2003 attributes
     "fileIdentifier",
@@ -146,13 +145,16 @@ import org.apache.sis.xml.Namespaces;
     "hierarchyLevels",
     "hierarchyLevelNames",
 
-    // Common to both formats
+    // Common to both versions
     "contacts",
 
     // Attributes new in ISO 19115:2014
-    "dates",
+    "dates",                            // actually "dateInfo"
     "metadataStandard",
+    "metadataProfile",
+    "alternativeMetadataReference",
     "otherLocales",
+    "metadataLinkage",
 
     // Legacy ISO 19115:2003 attributes
     "dateStamp",
@@ -173,6 +175,12 @@ import org.apache.sis.xml.Namespaces;
     "metadataConstraints",
     "applicationSchemaInfo",
     "metadataMaintenance",
+    "resourceLineage",
+
+    // Attributes new in ISO 19115:2014
+    "metadataScope",
+
+    // GMI extension
     "acquisitionInformation"
 })
 @XmlRootElement(name = "MD_Metadata")
@@ -1005,6 +1013,7 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Citation> getMetadataProfiles() {
         return metadataProfiles = nonNullCollection(metadataProfiles, Citation.class);
     }
@@ -1029,6 +1038,7 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Citation> getAlternativeMetadataReferences() {
         return alternativeMetadataReferences = nonNullCollection(alternativeMetadataReferences,
Citation.class);
     }
@@ -1155,6 +1165,7 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<OnlineResource> getMetadataLinkages() {
         return metadataLinkages = nonNullCollection(metadataLinkages, OnlineResource.class);
     }
@@ -1506,6 +1517,7 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Lineage> getResourceLineages() {
         return resourceLineages = nonNullCollection(resourceLineages, Lineage.class);
     }
@@ -1590,11 +1602,6 @@ public class DefaultMetadata extends ISO
      * This attribute has been added by ISO 19115:2014 standard.
      * If (and only if) marshalling an older standard version, we omit this attribute.
      */
-    @XmlElement(name = "metadataScope")
-    private Collection<MetadataScope> getMetadataScope() {
-        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataScopes() : null;
-    }
-
     @XmlElement(name = "dateInfo", required = true)
     private Collection<CitationDate> getDates() {
         return FilterByVersion.CURRENT_METADATA.accept() ? getDateInfo() : null;
@@ -1604,4 +1611,29 @@ public class DefaultMetadata extends ISO
     private Collection<Citation> getMetadataStandard() {
         return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataStandards() : null;
     }
+
+    @XmlElement(name = "metadataProfile")
+    private Collection<Citation> getMetadataProfile() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataProfiles() : null;
+    }
+
+    @XmlElement(name = "alternativeMetadataReference")
+    private Collection<Citation> getAlternativeMetadataReference() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getAlternativeMetadataReferences()
: null;
+    }
+
+    @XmlElement(name = "metadataLinkage")
+    private Collection<OnlineResource> getMetadataLinkage() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataLinkages() : null;
+    }
+
+    @XmlElement(name = "resourceLineage")
+    private Collection<Lineage> getResourceLineage() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getResourceLineages() : null;
+    }
+
+    @XmlElement(name = "metadataScope")
+    private Collection<MetadataScope> getMetadataScope() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataScopes() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1820029&r1=1820028&r2=1820029&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] Thu Jan  4 00:57:08 2018
@@ -102,6 +102,7 @@
     @XmlJavaTypeAdapter(CI_OnlineResource.class),
     @XmlJavaTypeAdapter(CI_Responsibility.class),
     @XmlJavaTypeAdapter(DQ_DataQuality.class),
+    @XmlJavaTypeAdapter(LI_Lineage.class),
     @XmlJavaTypeAdapter(MD_ApplicationSchemaInformation.class),
     @XmlJavaTypeAdapter(MD_CharacterSetCode.class),
     @XmlJavaTypeAdapter(LegacyCharacterSet.class),



Mime
View raw message