sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1613819 - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/ core/sis-metadata/src/test/java/org/apache/sis/metadata/ core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ core/sis-...
Date Sun, 27 Jul 2014 17:28:52 GMT
Author: desruisseaux
Date: Sun Jul 27 17:28:52 2014
New Revision: 1613819

URL: http://svn.apache.org/r1613819
Log:
Merge from the JDK7 branch.

Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAssociatedResource.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
    sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1611105-1613816
  Merged /sis/branches/JDK7:r1611109-1613817

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -21,20 +21,28 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.citation.Responsibility;
 import org.opengis.metadata.constraint.Constraints;
 import org.opengis.metadata.distribution.Format;
+import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.identification.AggregateInformation;
+import org.opengis.metadata.identification.AssociatedResource;
 import org.opengis.metadata.identification.Identification;
 import org.opengis.metadata.identification.DataIdentification;
 import org.opengis.metadata.identification.BrowseGraphic;
 import org.opengis.metadata.identification.Keywords;
 import org.opengis.metadata.identification.Progress;
+import org.opengis.metadata.identification.Resolution;
+import org.opengis.metadata.identification.TopicCategory;
 import org.opengis.metadata.identification.Usage;
 import org.opengis.metadata.service.ServiceIdentification;
 import org.opengis.metadata.maintenance.MaintenanceInformation;
+import org.opengis.metadata.spatial.SpatialRepresentationType;
+import org.opengis.temporal.Duration;
 import org.opengis.util.InternationalString;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 import org.apache.sis.metadata.iso.service.DefaultServiceIdentification;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
@@ -51,9 +59,21 @@ import org.apache.sis.util.iso.Types;
  * @module
  */
 @XmlType(name = "AbstractMD_Identification_Type", propOrder = {
-    "citation", "abstract", "purpose", "credits", "status", "pointOfContacts",
-    "resourceMaintenances", "graphicOverviews", "resourceFormats", "descriptiveKeywords",
-    "resourceSpecificUsages", "resourceConstraints", "aggregationInfo"
+    "citation",
+    "abstract",
+    "purpose",
+    "credits",
+    "status",
+    "pointOfContacts",
+    "resourceMaintenances",
+    "graphicOverviews",
+    "resourceFormats",
+    "descriptiveKeywords",
+    "resourceSpecificUsages",
+    "resourceConstraints",
+    "aggregationInfo",
+    "spatialRepresentationTypes", // After 'pointOfContact' according ISO 19115:2014, but here for ISO 19115:2003 compatibility.
+    "spatialResolutions"          // Shall be kept next to 'spatialRepresentationTypes'
 })
 @XmlRootElement(name = "MD_Identification")
 @XmlSeeAlso({
@@ -64,15 +84,15 @@ public class AbstractIdentification exte
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = -6512101909569333306L;
+    private static final long serialVersionUID = 157053637951213015L;
 
     /**
-     * Citation data for the resource(s).
+     * Citation for the resource(s).
      */
     private Citation citation;
 
     /**
-     * Brief narrative summary of the content of the resource(s).
+     * Brief narrative summary of the resource(s).
      */
     private InternationalString abstracts;
 
@@ -84,7 +104,7 @@ public class AbstractIdentification exte
     /**
      * Recognition of those who contributed to the resource(s).
      */
-    private Collection<String> credits;
+    private Collection<InternationalString> credits;
 
     /**
      * Status of the resource(s).
@@ -95,7 +115,42 @@ public class AbstractIdentification exte
      * Identification of, and means of communication with, person(s) and organizations(s)
      * associated with the resource(s).
      */
-    private Collection<ResponsibleParty> pointOfContacts;
+    private Collection<Responsibility> pointOfContacts;
+
+    /**
+     * Methods used to spatially represent geographic information.
+     */
+    private Collection<SpatialRepresentationType> spatialRepresentationTypes;
+
+    /**
+     * Factor which provides a general understanding of the density of spatial data in the resource(s).
+     */
+    private Collection<Resolution> spatialResolutions;
+
+    /**
+     * Smallest resolvable temporal period in a resource.
+     */
+    private Collection<Duration> temporalResolutions;
+
+    /**
+     * Main theme(s) of the resource.
+     */
+    private Collection<TopicCategory> topicCategories;
+
+    /**
+     * Spatial and temporal extent of the resource.
+     */
+    private Collection<Extent> extents;
+
+    /**
+     * Other documentation associated with the resource.
+     */
+    private Collection<Citation> additionalDocumentations;
+
+    /**
+     * Code that identifies the level of processing in the producers coding system of a resource.
+     */
+    private Identifier processingLevel;
 
     /**
      * Provides information about the frequency of resource updates, and the scope of those updates.
@@ -131,7 +186,7 @@ public class AbstractIdentification exte
     /**
      * Provides aggregate dataset information.
      */
-    private Collection<AggregateInformation> aggregationInfo;
+    private Collection<AssociatedResource> associatedResources;
 
     /**
      * Constructs an initially empty identification.
@@ -162,19 +217,26 @@ public class AbstractIdentification exte
     public AbstractIdentification(final Identification object) {
         super(object);
         if (object != null) {
-            citation               = object.getCitation();
-            abstracts              = object.getAbstract();
-            purpose                = object.getPurpose();
-            credits                = copyCollection(object.getCredits(), String.class);
-            status                 = copyCollection(object.getStatus(), Progress.class);
-            pointOfContacts        = copyCollection(object.getPointOfContacts(), ResponsibleParty.class);
-            resourceMaintenances   = copyCollection(object.getResourceMaintenances(), MaintenanceInformation.class);
-            graphicOverviews       = copyCollection(object.getGraphicOverviews(), BrowseGraphic.class);
-            resourceFormats        = copyCollection(object.getResourceFormats(), Format.class);
-            descriptiveKeywords    = copyCollection(object.getDescriptiveKeywords(), Keywords.class);
-            resourceSpecificUsages = copyCollection(object.getResourceSpecificUsages(), Usage.class);
-            resourceConstraints    = copyCollection(object.getResourceConstraints(), Constraints.class);
-            aggregationInfo        = copyCollection(object.getAggregationInfo(), AggregateInformation.class);
+            citation                   = object.getCitation();
+            abstracts                  = object.getAbstract();
+            purpose                    = object.getPurpose();
+            credits                    = copyCollection(object.getCredits(), InternationalString.class);
+            status                     = copyCollection(object.getStatus(), Progress.class);
+            pointOfContacts            = copyCollection(object.getPointOfContacts(), Responsibility.class);
+            spatialRepresentationTypes = copyCollection(object.getSpatialRepresentationTypes(), SpatialRepresentationType.class);
+            spatialResolutions         = copyCollection(object.getSpatialResolutions(), Resolution.class);
+            temporalResolutions        = copyCollection(object.getTemporalResolutions(), Duration.class);
+            topicCategories            = copyCollection(object.getTopicCategories(), TopicCategory.class);
+            extents                    = copyCollection(object.getExtents(), Extent.class);
+            additionalDocumentations   = copyCollection(object.getAdditionalDocumentations(), Citation.class);
+            processingLevel            = object.getProcessingLevel();
+            resourceMaintenances       = copyCollection(object.getResourceMaintenances(), MaintenanceInformation.class);
+            graphicOverviews           = copyCollection(object.getGraphicOverviews(), BrowseGraphic.class);
+            resourceFormats            = copyCollection(object.getResourceFormats(), Format.class);
+            descriptiveKeywords        = copyCollection(object.getDescriptiveKeywords(), Keywords.class);
+            resourceSpecificUsages     = copyCollection(object.getResourceSpecificUsages(), Usage.class);
+            resourceConstraints        = copyCollection(object.getResourceConstraints(), Constraints.class);
+            associatedResources        = copyCollection(object.getAssociatedResources(), AssociatedResource.class);
         }
     }
 
@@ -216,9 +278,9 @@ public class AbstractIdentification exte
     }
 
     /**
-     * Returns the citation data for the resource(s).
+     * Returns the citation for the resource(s).
      *
-     * @return Citation data for the resource(s), or {@code null}.
+     * @return Citation for the resource(s).
      */
     @Override
     @XmlElement(name = "citation", required = true)
@@ -227,7 +289,7 @@ public class AbstractIdentification exte
     }
 
     /**
-     * Sets the citation data for the resource(s).
+     * Sets the citation for the resource(s).
      *
      * @param newValue The new citation.
      */
@@ -237,9 +299,9 @@ public class AbstractIdentification exte
     }
 
     /**
-     * Returns a brief narrative summary of the content of the resource(s).
+     * Returns a brief narrative summary of the resource(s).
      *
-     * @return Brief narrative summary of the content, or {@code null}.
+     * @return Brief narrative summary of the resource(s).
      */
     @Override
     @XmlElement(name = "abstract", required = true)
@@ -248,9 +310,9 @@ public class AbstractIdentification exte
     }
 
     /**
-     * Sets a brief narrative summary of the content of the resource(s).
+     * Sets a brief narrative summary of the resource(s).
      *
-     * @param newValue The new abstract.
+     * @param newValue The new summary of resource(s).
      */
     public void setAbstract(final InternationalString newValue) {
         checkWritePermission();
@@ -271,7 +333,7 @@ public class AbstractIdentification exte
     /**
      * Sets a summary of the intentions with which the resource(s) was developed.
      *
-     * @param newValue The new purpose.
+     * @param newValue The new summary of intention.
      */
     public void setPurpose(final InternationalString newValue) {
         checkWritePermission();
@@ -285,8 +347,8 @@ public class AbstractIdentification exte
      */
     @Override
     @XmlElement(name = "credit")
-    public Collection<String> getCredits() {
-        return credits = nonNullCollection(credits, String.class);
+    public Collection<InternationalString> getCredits() {
+        return credits = nonNullCollection(credits, InternationalString.class);
     }
 
     /**
@@ -294,8 +356,8 @@ public class AbstractIdentification exte
      *
      * @param newValues The new credits.
      */
-    public void setCredits(final Collection<? extends String> newValues) {
-        credits = writeCollection(newValues, credits, String.class);
+    public void setCredits(final Collection<? extends InternationalString> newValues) {
+        credits = writeCollection(newValues, credits, InternationalString.class);
     }
 
     /**
@@ -323,20 +385,191 @@ public class AbstractIdentification exte
      * associated with the resource(s).
      *
      * @return Means of communication with person(s) and organizations(s) associated with the resource(s).
+     *
+     * @see org.apache.sis.metadata.iso.DefaultMetadata#getContacts()
      */
     @Override
     @XmlElement(name = "pointOfContact")
-    public Collection<ResponsibleParty> getPointOfContacts() {
-        return pointOfContacts = nonNullCollection(pointOfContacts, ResponsibleParty.class);
+    public Collection<Responsibility> getPointOfContacts() {
+        return pointOfContacts = nonNullCollection(pointOfContacts, Responsibility.class);
     }
 
     /**
-     * Sets the point of contacts.
+     * Sets the means of communication with persons(s) and organizations(s) associated with the resource(s).
      *
      * @param newValues The new points of contacts.
      */
-    public void setPointOfContacts(final Collection<? extends ResponsibleParty> newValues) {
-        pointOfContacts = writeCollection(newValues, pointOfContacts, ResponsibleParty.class);
+    public void setPointOfContacts(final Collection<? extends Responsibility> newValues) {
+        pointOfContacts = writeCollection(newValues, pointOfContacts, Responsibility.class);
+    }
+
+    /**
+     * Returns the methods used to spatially represent geographic information.
+     *
+     * @return Methods used to spatially represent geographic information.
+     *
+     * @since 0.5
+     */
+    @Override
+    @XmlElement(name = "spatialRepresentationType")
+    public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {
+        return spatialRepresentationTypes = nonNullCollection(spatialRepresentationTypes, SpatialRepresentationType.class);
+    }
+
+    /**
+     * Sets the method used to spatially represent geographic information.
+     *
+     * @param newValues The new spatial representation types.
+     *
+     * @since 0.5
+     */
+    public void setSpatialRepresentationTypes(final Collection<? extends SpatialRepresentationType> newValues) {
+        spatialRepresentationTypes = writeCollection(newValues, spatialRepresentationTypes, SpatialRepresentationType.class);
+    }
+
+    /**
+     * Returns the factor which provides a general understanding of the density of spatial data in the resource(s).
+     *
+     * @return Factor which provides a general understanding of the density of spatial data.
+     *
+     * @since 0.5
+     */
+    @Override
+    @XmlElement(name = "spatialResolution")
+    public Collection<Resolution> getSpatialResolutions() {
+        return spatialResolutions = nonNullCollection(spatialResolutions, Resolution.class);
+    }
+
+    /**
+     * Sets the factor which provides a general understanding of the density of spatial data in the resource(s).
+     *
+     * @param newValues The new spatial resolutions.
+     *
+     * @since 0.5
+     */
+    public void setSpatialResolutions(final Collection<? extends Resolution> newValues) {
+        spatialResolutions = writeCollection(newValues, spatialResolutions, Resolution.class);
+    }
+
+    /**
+     * Returns the smallest resolvable temporal period in a resource.
+     *
+     * @return Smallest resolvable temporal period in a resource.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "temporalResolution")
+    public Collection<Duration> getTemporalResolutions() {
+        return temporalResolutions = nonNullCollection(temporalResolutions, Duration.class);
+    }
+
+    /**
+     * Sets the smallest resolvable temporal period in a resource.
+     *
+     * @param newValues The new temporal resolutions.
+     *
+     * @since 0.5
+     */
+    public void setTemporalResolutions(final Collection<? extends Duration> newValues) {
+        temporalResolutions = writeCollection(newValues, temporalResolutions, Duration.class);
+    }
+
+    /**
+     * Returns the main theme(s) of the resource.
+     *
+     * @return Main theme(s).
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "topicCategory")
+    public Collection<TopicCategory> getTopicCategories()  {
+        return topicCategories = nonNullCollection(topicCategories, TopicCategory.class);
+    }
+
+    /**
+     * Sets the main theme(s) of the resource.
+     *
+     * @param newValues The new topic categories.
+     *
+     * @since 0.5
+     */
+    public void setTopicCategories(final Collection<? extends TopicCategory> newValues) {
+        topicCategories = writeCollection(newValues, topicCategories, TopicCategory.class);
+    }
+
+    /**
+     * Returns the spatial and temporal extent of the resource.
+     *
+     * @return Spatial and temporal extent of the resource.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "extent")
+    public Collection<Extent> getExtents() {
+        return extents = nonNullCollection(extents, Extent.class);
+    }
+
+    /**
+     * Sets the spatial and temporal extent of the resource.
+     *
+     * @param newValues The new extents
+     *
+     * @since 0.5
+     */
+    public void setExtents(final Collection<? extends Extent> newValues) {
+        extents = writeCollection(newValues, extents, Extent.class);
+    }
+
+    /**
+     * Returns other documentation associated with the resource.
+     *
+     * @return Other documentation associated with the resource.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "additionalDocumentation")
+    public Collection<Citation> getAdditionalDocumentations() {
+        return additionalDocumentations = nonNullCollection(additionalDocumentations, Citation.class);
+    }
+
+    /**
+     * Sets other documentation associated with the resource.
+     *
+     * @param newValues The documentation to associate with the resource.
+     *
+     * @since 0.5
+     */
+    public void setAdditionalDocumentations(final Collection<? extends Citation> newValues) {
+        additionalDocumentations = writeCollection(newValues, additionalDocumentations, Citation.class);
+    }
+
+    /**
+     * Returns code(s) that identifies the level of processing in the producers coding system of a resource.
+     *
+     * @return Code(s) that identifies the level of processing in the producers coding system of a resource.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "processingLevel")
+    public Identifier getProcessingLevel() {
+        return processingLevel;
+    }
+
+    /**
+     * Sets code that identifies the level of processing in the producers coding system of a resource.
+     *
+     * @param newValue New code that identifies the level of processing.
+     *
+     * @since 0.5
+     */
+    public void setProcessingLevel(final Identifier newValue) {
+        checkWritePermission();
+        processingLevel = newValue;
     }
 
     /**
@@ -462,22 +695,64 @@ public class AbstractIdentification exte
     }
 
     /**
+     * Provides associated resource information.
+     *
+     * @return Associated resource information.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @XmlElement(name = "associatedResource")
+    public Collection<AssociatedResource> getAssociatedResources() {
+        return associatedResources = nonNullCollection(associatedResources, AssociatedResource.class);
+    }
+
+    /**
+     * Sets associated resource information.
+     *
+     * @param newValues The new associated resources.
+     *
+     * @since 0.5
+     */
+    public void setAssociatedResources(final Collection<? extends AssociatedResource> newValues) {
+        associatedResources = writeCollection(newValues, associatedResources, AssociatedResource.class);
+    }
+
+    /**
      * Provides aggregate dataset information.
      *
      * @return Aggregate dataset information.
+     *
+     * @deprecated Replaced by {@link #getAssociatedResources()} as of ISO 19115:2014.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "aggregationInfo")
     public Collection<AggregateInformation> getAggregationInfo() {
-        return aggregationInfo = nonNullCollection(aggregationInfo, AggregateInformation.class);
+        return new LegacyPropertyAdapter<AggregateInformation,AssociatedResource>(getAssociatedResources()) {
+            @Override protected AssociatedResource wrap(final AggregateInformation value) {
+                return value;
+            }
+
+            @Override protected AggregateInformation unwrap(final AssociatedResource container) {
+                return DefaultAggregateInformation.castOrCopy(container);
+            }
+
+            @Override protected boolean update(final AssociatedResource container, final AggregateInformation value) {
+                return container == value;
+            }
+        }.validOrNull();
     }
 
     /**
      * Sets aggregate dataset information.
      *
      * @param newValues The new aggregation info.
+     *
+     * @deprecated Replaced by {@link #setAssociatedResources(Collection)} as of ISO 19115:2014.
      */
+    @Deprecated
     public void setAggregationInfo(final Collection<? extends AggregateInformation> newValues) {
-        aggregationInfo = writeCollection(newValues, aggregationInfo, AggregateInformation.class);
+        setAssociatedResources(newValues);
     }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -16,15 +16,18 @@
  */
 package org.apache.sis.metadata.iso.identification;
 
+import java.util.Iterator;
+import java.util.ArrayList;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.identification.AggregateInformation;
+import org.opengis.metadata.identification.AssociatedResource;
 import org.opengis.metadata.identification.AssociationType;
 import org.opengis.metadata.identification.InitiativeType;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.metadata.iso.citation.DefaultCitation;
 
 
 /**
@@ -38,9 +41,12 @@ import org.apache.sis.metadata.iso.ISOMe
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.5
  * @module
+ *
+ * @deprecated Replaced by {@link DefaultAssociatedResource} as of ISO 19115:2014.
  */
+@Deprecated
 @XmlType(name = "MD_AggregateInformation_Type", propOrder = {
     "aggregateDataSetName",
     "aggregateDataSetIdentifier",
@@ -48,31 +54,11 @@ import org.apache.sis.metadata.iso.ISOMe
     "initiativeType"
 })
 @XmlRootElement(name = "MD_AggregateInformation")
-public class DefaultAggregateInformation extends ISOMetadata implements AggregateInformation {
+public class DefaultAggregateInformation extends DefaultAssociatedResource implements AggregateInformation {
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 4183321601376092254L;
-
-    /**
-     * Citation information about the aggregate dataset.
-     */
-    private Citation aggregateDataSetName;
-
-    /**
-     * Identification information about aggregate dataset.
-     */
-    private Identifier aggregateDataSetIdentifier;
-
-    /**
-     * Association type of the aggregate dataset.
-     */
-    private  AssociationType associationType;
-
-    /**
-     * Type of initiative under which the aggregate dataset was produced.
-     */
-    private InitiativeType initiativeType;
+    private static final long serialVersionUID = -8769840909779188495L;
 
     /**
      * Constructs an initially empty Aggregate dataset information.
@@ -89,14 +75,8 @@ public class DefaultAggregateInformation
      *
      * @see #castOrCopy(AggregateInformation)
      */
-    public DefaultAggregateInformation(final AggregateInformation object) {
+    public DefaultAggregateInformation(final AssociatedResource object) {
         super(object);
-        if (object != null) {
-            aggregateDataSetName       = object.getAggregateDataSetName();
-            aggregateDataSetIdentifier = object.getAggregateDataSetIdentifier();
-            associationType            = object.getAssociationType();
-            initiativeType             = object.getInitiativeType();
-        }
     }
 
     /**
@@ -108,7 +88,7 @@ public class DefaultAggregateInformation
      *   <li>Otherwise if the given object is already an instance of
      *       {@code DefaultAggregateInformation}, then it is returned unchanged.</li>
      *   <li>Otherwise a new {@code DefaultAggregateInformation} instance is created using the
-     *       {@linkplain #DefaultAggregateInformation(AggregateInformation) copy constructor}
+     *       {@linkplain #DefaultAggregateInformation(AssociatedResource) copy constructor}
      *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
      *       metadata contained in the given object are not recursively copied.</li>
      * </ul>
@@ -117,7 +97,7 @@ public class DefaultAggregateInformation
      * @return A SIS implementation containing the values of the given object (may be the
      *         given object itself), or {@code null} if the argument was null.
      */
-    public static DefaultAggregateInformation castOrCopy(final AggregateInformation object) {
+    public static DefaultAggregateInformation castOrCopy(final AssociatedResource object) {
         if (object == null || object instanceof DefaultAggregateInformation) {
             return (DefaultAggregateInformation) object;
         }
@@ -128,42 +108,88 @@ public class DefaultAggregateInformation
      * Citation information about the aggregate dataset.
      *
      * @return Citation information about the aggregate dataset, or {@code null}.
+     *
+     * @deprecated Replaced by {@link #getName()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "aggregateDataSetName")
     public Citation getAggregateDataSetName() {
-        return aggregateDataSetName;
+        return getName();
     }
 
     /**
      * Sets the citation information about the aggregate dataset.
      *
      * @param newValue The new citation.
+     *
+     * @deprecated Replaced by {@link #setName(Citation)}.
      */
+    @Deprecated
     public void setAggregateDataSetName(final Citation newValue) {
-        checkWritePermission();
-        aggregateDataSetName = newValue;
+        setName(newValue);
     }
 
     /**
      * Identification information about aggregate dataset.
      *
      * @return Identification information about aggregate dataset, or {@code null}.
+     *
+     * @deprecated Replaced by the first identifier of {@link #getAggregateDataSetName()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "aggregateDataSetIdentifier")
     public Identifier getAggregateDataSetIdentifier() {
-        return aggregateDataSetIdentifier;
+        return getAggregateDataSetIdentifier(getAggregateDataSetName());
+    }
+
+    /**
+     * Returns the first identifier of the given citation.
+     */
+    static Identifier getAggregateDataSetIdentifier(final Citation name) {
+        if (name != null) {
+            final Iterator<? extends Identifier> it = name.getIdentifiers().iterator();
+            if (it.hasNext()) {
+                return it.next();
+            }
+        }
+        return null;
     }
 
     /**
      * Sets the identification information about aggregate dataset.
      *
      * @param newValue The new identifier.
+     *
+     * @deprecated Replaced by an identifier of {@link #getAggregateDataSetName()}.
      */
     public void setAggregateDataSetIdentifier(final Identifier newValue) {
         checkWritePermission();
-        aggregateDataSetIdentifier = newValue;
+        Citation name = getAggregateDataSetName();
+        if (newValue != null) {
+            if (!(name instanceof DefaultCitation)) {
+                name = new DefaultCitation(name);
+                setAggregateDataSetName(name);
+            }
+            /*
+             * If there is more than one value, replace only the first one and keep all other ones unchanged.
+             * The intend is to be consistent with the getter method, which returns the first element.
+             */
+            final ArrayList<Identifier> identifiers = new ArrayList<Identifier>(name.getIdentifiers());
+            if (identifiers.isEmpty()) {
+                identifiers.add(newValue);
+            } else {
+                identifiers.set(0, newValue);
+            }
+            ((DefaultCitation) name).setIdentifiers(identifiers);
+        } else if (name != null) {
+            final Iterator<? extends Identifier> it = name.getIdentifiers().iterator();
+            if (it.hasNext()) {
+                it.next();
+                it.remove();
+            }
+        }
     }
 
     /**
@@ -174,7 +200,7 @@ public class DefaultAggregateInformation
     @Override
     @XmlElement(name = "associationType", required = true)
     public AssociationType getAssociationType() {
-        return associationType;
+        return super.getAssociationType();
     }
 
     /**
@@ -182,9 +208,9 @@ public class DefaultAggregateInformation
      *
      * @param newValue The new association type.
      */
+    @Override
     public void setAssociationType(final AssociationType newValue) {
-        checkWritePermission();
-        associationType = newValue;
+        super.setAssociationType(newValue);
     }
 
     /**
@@ -195,7 +221,7 @@ public class DefaultAggregateInformation
     @Override
     @XmlElement(name = "initiativeType")
     public InitiativeType getInitiativeType() {
-        return initiativeType;
+        return super.getInitiativeType();
     }
 
     /**
@@ -203,8 +229,8 @@ public class DefaultAggregateInformation
      *
      * @param newValue The new initiative.
      */
+    @Override
     public void setInitiativeType(final InitiativeType newValue) {
-        checkWritePermission();
-        initiativeType = newValue;
+        super.setInitiativeType(newValue);
     }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAssociatedResource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAssociatedResource.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAssociatedResource.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAssociatedResource.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -29,18 +29,22 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Associated resource information.
  *
+ * {@section Relationship between properties}
+ * According ISO 19115, at least one of {@linkplain #getName() name} and
+ * {@linkplain #getMetadataReference() metadata reference} shall be provided.
+ *
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
  * @version 0.5
  * @module
  */
-@XmlType(name = "MD_AssociatedResource_Type", propOrder = {
+@XmlType(name = "MD_AssociatedResource_Type" /*, propOrder = {
     "name",
     "associationType",
     "initiativeType",
     "metadataReference"
-})
+}*/)
 @XmlRootElement(name = "MD_AssociatedResource")
 public class DefaultAssociatedResource extends ISOMetadata implements AssociatedResource {
     /**
@@ -134,7 +138,7 @@ public class DefaultAssociatedResource e
      * @return Citation information about the associated resource, or {@code null} if none.
      */
     @Override
-    @XmlElement(name = "name")
+/// @XmlElement(name = "name")
     public Citation getName() {
         return name;
     }
@@ -155,7 +159,7 @@ public class DefaultAssociatedResource e
      * @return Type of relation between the resources.
      */
     @Override
-    @XmlElement(name = "associationType", required = true)
+/// @XmlElement(name = "associationType", required = true)
     public AssociationType getAssociationType() {
         return associationType;
     }
@@ -176,7 +180,7 @@ public class DefaultAssociatedResource e
      * @return The type of initiative under which the associated resource was produced, or {@code null} if none.
      */
     @Override
-    @XmlElement(name = "initiativeType")
+/// @XmlElement(name = "initiativeType")
     public InitiativeType getInitiativeType() {
         return initiativeType;
     }
@@ -197,7 +201,7 @@ public class DefaultAssociatedResource e
      * @return Reference to the metadata of the associated resource, or {@code null} if none.
      */
     @Override
-    @XmlElement(name = "metadataReference")
+/// @XmlElement(name = "metadataReference")
     public Citation getMetadataReference() {
         return metadataReference;
     }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -23,13 +23,13 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.identification.Resolution;
 import org.opengis.metadata.identification.CharacterSet;
 import org.opengis.metadata.identification.TopicCategory;
 import org.opengis.metadata.identification.DataIdentification;
-import org.opengis.metadata.spatial.SpatialRepresentationType;
 import org.opengis.util.InternationalString;
 
+import static org.apache.sis.internal.jaxb.gco.PropertyType.LEGACY_XML;
+
 
 /**
  * Information required to identify a dataset.
@@ -38,17 +38,15 @@ import org.opengis.util.InternationalStr
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_DataIdentification_Type", propOrder = {
-    "spatialRepresentationTypes",
-    "spatialResolutions",
     "languages",
     "characterSets",
-    "topicCategories",
+    "legacy1", // topicCategories
     "environmentDescription",
-    "extents",
+    "legacy2", // extents
     "supplementalInformation"
 })
 @XmlRootElement(name = "MD_DataIdentification")
@@ -56,17 +54,7 @@ public class DefaultDataIdentification e
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 8586544979707643009L;
-
-    /**
-     * Method used to spatially represent geographic information.
-     */
-    private Collection<SpatialRepresentationType> spatialRepresentationTypes;
-
-    /**
-     * Factor which provides a general understanding of the density of spatial data in the dataset.
-     */
-    private Collection<Resolution> spatialResolutions;
+    private static final long serialVersionUID = 6104637930243499850L;
 
     /**
      * Language(s) used within the dataset.
@@ -79,23 +67,12 @@ public class DefaultDataIdentification e
     private Collection<CharacterSet> characterSets;
 
     /**
-     * Main theme(s) of the datset.
-     */
-    private Collection<TopicCategory> topicCategories;
-
-    /**
      * Description of the dataset in the producer’s processing environment, including items
      * such as the software, the computer operating system, file name, and the dataset size
      */
     private InternationalString environmentDescription;
 
     /**
-     * Additional extent information including the bounding polygon, vertical, and temporal
-     * extent of the dataset.
-     */
-    private Collection<Extent> extents;
-
-    /**
      * Any other descriptive information about the dataset.
      */
     private InternationalString supplementalInformation;
@@ -121,7 +98,7 @@ public class DefaultDataIdentification e
     {
         super(citation, abstracts);
         languages = singleton(language, Locale.class);
-        topicCategories = singleton(topicCategory, TopicCategory.class);
+        super.setTopicCategories(singleton(topicCategory, TopicCategory.class));
     }
 
     /**
@@ -136,13 +113,9 @@ public class DefaultDataIdentification e
     public DefaultDataIdentification(final DataIdentification object) {
         super(object);
         if (object != null) {
-            spatialRepresentationTypes = copyCollection(object.getSpatialRepresentationTypes(), SpatialRepresentationType.class);
-            spatialResolutions         = copyCollection(object.getSpatialResolutions(), Resolution.class);
             languages                  = copyCollection(object.getLanguages(), Locale.class);
             characterSets              = copyCollection(object.getCharacterSets(), CharacterSet.class);
-            topicCategories            = copyCollection(object.getTopicCategories(), TopicCategory.class);
             environmentDescription     = object.getEnvironmentDescription();
-            extents                    = copyCollection(object.getExtents(), Extent.class);
             supplementalInformation    = object.getSupplementalInformation();
         }
     }
@@ -173,46 +146,6 @@ public class DefaultDataIdentification e
     }
 
     /**
-     * Returns the method used to spatially represent geographic information.
-     *
-     * @return Method(s) used to spatially represent geographic information.
-     */
-    @Override
-    @XmlElement(name = "spatialRepresentationType")
-    public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {
-        return spatialRepresentationTypes = nonNullCollection(spatialRepresentationTypes, SpatialRepresentationType.class);
-    }
-
-    /**
-     * Sets the method used to spatially represent geographic information.
-     *
-     * @param newValues The new spatial representation types.
-     */
-    public void setSpatialRepresentationTypes(final Collection<? extends SpatialRepresentationType> newValues) {
-        spatialRepresentationTypes = writeCollection(newValues, spatialRepresentationTypes, SpatialRepresentationType.class);
-    }
-
-    /**
-     * Returns the factor which provides a general understanding of the density of spatial data in the dataset.
-     *
-     * @return Factor which provides a general understanding of the density of spatial data.
-     */
-    @Override
-    @XmlElement(name = "spatialResolution")
-    public Collection<Resolution> getSpatialResolutions() {
-        return spatialResolutions = nonNullCollection(spatialResolutions, Resolution.class);
-    }
-
-    /**
-     * Sets the factor which provides a general understanding of the density of spatial data in the dataset.
-     *
-     * @param newValues The new spatial resolutions.
-     */
-    public void setSpatialResolutions(final Collection<? extends Resolution> newValues) {
-        spatialResolutions = writeCollection(newValues, spatialResolutions, Resolution.class);
-    }
-
-    /**
      * Returns the language(s) used within the dataset.
      *
      * @return Language(s) used.
@@ -253,26 +186,6 @@ public class DefaultDataIdentification e
     }
 
     /**
-     * Returns the main theme(s) of the dataset.
-     *
-     * @return Main theme(s).
-     */
-    @Override
-    @XmlElement(name = "topicCategory")
-    public Collection<TopicCategory> getTopicCategories()  {
-        return topicCategories = nonNullCollection(topicCategories, TopicCategory.class);
-    }
-
-    /**
-     * Sets the main theme(s) of the dataset.
-     *
-     * @param newValues The new topic categories.
-     */
-    public void setTopicCategories(final Collection<? extends TopicCategory> newValues) {
-        topicCategories = writeCollection(newValues, topicCategories, TopicCategory.class);
-    }
-
-    /**
      * Returns a description of the dataset in the producer's processing environment. This includes
      * items such as the software, the computer operating system, file name, and the dataset size.
      *
@@ -295,27 +208,6 @@ public class DefaultDataIdentification e
     }
 
     /**
-     * Returns additional extent information including the bounding polygon, vertical, and temporal
-     * extent of the dataset.
-     *
-     * @return Additional extent information.
-     */
-    @Override
-    @XmlElement(name = "extent")
-    public Collection<Extent> getExtents() {
-        return extents = nonNullCollection(extents, Extent.class);
-    }
-
-    /**
-     * Sets additional extent information.
-     *
-     * @param newValues The new extents
-     */
-    public void setExtents(final Collection<? extends Extent> newValues) {
-        extents = writeCollection(newValues, extents, Extent.class);
-    }
-
-    /**
      * Any other descriptive information about the dataset.
      *
      * @return Other descriptive information, or {@code null}.
@@ -335,4 +227,38 @@ public class DefaultDataIdentification e
         checkWritePermission();
         supplementalInformation = newValue;
     }
+
+
+
+    // Bridges for elements from legacy ISO 19115:2003
+
+    /**
+     * For JAXB marhalling of ISO 19115:2003 document only.
+     */
+    @XmlElement(name = "topicCategory")
+    private Collection<TopicCategory> getLegacy1()  {
+        return LEGACY_XML ? getTopicCategories() : null;
+    }
+
+    /**
+     * For JAXB unmarhalling of ISO 19115:2003 document only.
+     */
+    private void setLegacy1(final Collection<? extends TopicCategory> newValues) {
+        setTopicCategories(newValues);
+    }
+
+    /**
+     * For JAXB marhalling of ISO 19115:2003 document only.
+     */
+    @XmlElement(name = "extent")
+    private Collection<Extent> getLegacy2() {
+        return LEGACY_XML ? getExtents() : null;
+    }
+
+    /**
+     * For JAXB unmarhalling of ISO 19115:2003 document only.
+     */
+    private void setLegacy2(final Collection<? extends Extent> newValues) {
+        setExtents(newValues);
+    }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -31,7 +31,6 @@ import org.opengis.metadata.citation.Cit
 import org.opengis.metadata.citation.CitationDate;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.citation.PresentationForm;
-import org.opengis.metadata.citation.ResponsibleParty;
 import org.opengis.metadata.citation.Responsibility;
 import org.opengis.metadata.distribution.Format;
 import org.opengis.metadata.constraint.Constraints;
@@ -50,6 +49,7 @@ import org.opengis.referencing.datum.Geo
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.util.InternationalString;
 import org.opengis.util.GenericName;
+import org.opengis.temporal.Duration;
 
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.iso.SimpleInternationalString;
@@ -191,6 +191,10 @@ public final strictfp class PropertyAcce
      * Tests the constructor with the {@link DefaultDataIdentification} implementation.
      * The purpose of this test is to ensure that the properties defined in the parent
      * class are sorted first.
+     *
+     * <div class="note"><b>Note:</b> if there is any element not declared as JAXB elements,
+     * those ones will be last in alphabetical order. Such situation is usually temporary
+     * until the JAXB annotations are completed.</div>
      */
     @Test
     @DependsOnMethod("testConstructor")
@@ -200,24 +204,27 @@ public final strictfp class PropertyAcce
             Identification.class, "getCitation",                   "citation",                   "citation",                  "Citation",                     Citation.class,
             Identification.class, "getAbstract",                   "abstract",                   "abstract",                  "Abstract",                     InternationalString.class,
             Identification.class, "getPurpose",                    "purpose",                    "purpose",                   "Purpose",                      InternationalString.class,
-            Identification.class, "getCredits",                    "credits",                    "credit",                    "Credits",                      String[].class,
+            Identification.class, "getCredits",                    "credits",                    "credit",                    "Credits",                      InternationalString[].class,
             Identification.class, "getStatus",                     "status",                     "status",                    "Status",                       Progress[].class,
-            Identification.class, "getPointOfContacts",            "pointOfContacts",            "pointOfContact",            "Point of contacts",            ResponsibleParty[].class,
+            Identification.class, "getPointOfContacts",            "pointOfContacts",            "pointOfContact",            "Point of contacts",            Responsibility[].class,
             Identification.class, "getResourceMaintenances",       "resourceMaintenances",       "resourceMaintenance",       "Resource maintenances",        MaintenanceInformation[].class,
             Identification.class, "getGraphicOverviews",           "graphicOverviews",           "graphicOverview",           "Graphic overviews",            BrowseGraphic[].class,
             Identification.class, "getResourceFormats",            "resourceFormats",            "resourceFormat",            "Resource formats",             Format[].class,
             Identification.class, "getDescriptiveKeywords",        "descriptiveKeywords",        "descriptiveKeywords",       "Descriptive keywords",         Keywords[].class,
             Identification.class, "getResourceSpecificUsages",     "resourceSpecificUsages",     "resourceSpecificUsage",     "Resource specific usages",     Usage[].class,
             Identification.class, "getResourceConstraints",        "resourceConstraints",        "resourceConstraints",       "Resource constraints",         Constraints[].class,
-            Identification.class, "getAggregationInfo",            "aggregationInfo",            "aggregationInfo",           "Aggregation info",             AggregateInformation[].class,
-        DataIdentification.class, "getSpatialRepresentationTypes", "spatialRepresentationTypes", "spatialRepresentationType", "Spatial representation types", SpatialRepresentationType[].class,
-        DataIdentification.class, "getSpatialResolutions",         "spatialResolutions",         "spatialResolution",         "Spatial resolutions",          Resolution[].class,
+            Identification.class, "getSpatialRepresentationTypes", "spatialRepresentationTypes", "spatialRepresentationType", "Spatial representation types", SpatialRepresentationType[].class,
+            Identification.class, "getSpatialResolutions",         "spatialResolutions",         "spatialResolution",         "Spatial resolutions",          Resolution[].class,
         DataIdentification.class, "getLanguages",                  "languages",                  "language",                  "Languages",                    Locale[].class,
         DataIdentification.class, "getCharacterSets",              "characterSets",              "characterSet",              "Character sets",               CharacterSet[].class,
-        DataIdentification.class, "getTopicCategories",            "topicCategories",            "topicCategory",             "Topic categories",             TopicCategory[].class,
         DataIdentification.class, "getEnvironmentDescription",     "environmentDescription",     "environmentDescription",    "Environment description",      InternationalString.class,
-        DataIdentification.class, "getExtents",                    "extents",                    "extent",                    "Extents",                      Extent[].class,
-        DataIdentification.class, "getSupplementalInformation",    "supplementalInformation",    "supplementalInformation",   "Supplemental information",     InternationalString.class);
+        DataIdentification.class, "getSupplementalInformation",    "supplementalInformation",    "supplementalInformation",   "Supplemental information",     InternationalString.class,
+            Identification.class, "getExtents",                    "extents",                    "extent",                    "Extents",                      Extent[].class,
+            Identification.class, "getTopicCategories",            "topicCategories",            "topicCategory",             "Topic categories",             TopicCategory[].class,
+            Identification.class, "getAdditionalDocumentations",   "additionalDocumentations",   "additionalDocumentation",   "Additional documentations",    Citation[].class,
+            Identification.class, "getAssociatedResources",        "associatedResources",        "associatedResource",        "Associated resources",         AssociatedResource[].class,
+            Identification.class, "getProcessingLevel",            "processingLevel",            "processingLevel",           "Processing level",             Identifier.class,
+            Identification.class, "getTemporalResolutions",        "temporalResolutions",        "temporalResolution",        "Temporal resolutions",         Duration[].class);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -25,15 +25,17 @@ import java.lang.reflect.Method;
 import java.lang.reflect.InvocationHandler;
 import javax.xml.bind.JAXBException;
 import org.opengis.metadata.Metadata;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.identification.*;
 import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.citation.Responsibility;
 import org.opengis.metadata.constraint.Constraints;
 import org.opengis.metadata.distribution.Format;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.maintenance.MaintenanceInformation;
 import org.opengis.metadata.spatial.SpatialRepresentationType;
 import org.opengis.util.InternationalString;
+import org.opengis.temporal.Duration;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.xml.XML;
@@ -50,7 +52,7 @@ import static org.junit.Assert.*;
  * @author  Damiano Albani (for code snippet on the mailing list)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.14)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class CustomMetadataTest extends XMLTestCase {
@@ -113,15 +115,17 @@ public final strictfp class CustomMetada
             @Override public InternationalString                   getSupplementalInformation()    {return null;}
             @Override public Citation                              getCitation()                   {return null;}
             @Override public InternationalString                   getPurpose()                    {return null;}
+            @Override public Identifier                            getProcessingLevel()            {return null;}
             @Override public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {return null;}
             @Override public Collection<Resolution>                getSpatialResolutions()         {return null;}
+            @Override public Collection<Duration>                  getTemporalResolutions()        {return null;}
             @Override public Collection<Locale>                    getLanguages()                  {return null;}
             @Override public Collection<CharacterSet>              getCharacterSets()              {return null;}
             @Override public Collection<TopicCategory>             getTopicCategories()            {return null;}
             @Override public Collection<Extent>                    getExtents()                    {return null;}
-            @Override public Collection<String>                    getCredits()                    {return null;}
+            @Override public Collection<InternationalString>       getCredits()                    {return null;}
             @Override public Collection<Progress>                  getStatus()                     {return null;}
-            @Override public Collection<ResponsibleParty>          getPointOfContacts()            {return null;}
+            @Override public Collection<Responsibility>            getPointOfContacts()            {return null;}
             @Override public Collection<MaintenanceInformation>    getResourceMaintenances()       {return null;}
             @Override public Collection<BrowseGraphic>             getGraphicOverviews()           {return null;}
             @Override public Collection<Format>                    getResourceFormats()            {return null;}
@@ -129,6 +133,8 @@ public final strictfp class CustomMetada
             @Override public Collection<Usage>                     getResourceSpecificUsages()     {return null;}
             @Override public Collection<Constraints>               getResourceConstraints()        {return null;}
             @Override public Collection<AggregateInformation>      getAggregationInfo()            {return null;}
+            @Override public Collection<AssociatedResource>        getAssociatedResources()        {return null;}
+            @Override public Collection<Citation>                  getAdditionalDocumentations()   {return null;}
         };
         final DefaultMetadata data = new DefaultMetadata();
         assertTrue(data.getIdentificationInfo().add(identification));

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -17,8 +17,10 @@
 package org.apache.sis.test.integration;
 
 import java.net.URI;
+import java.net.URL;
 import java.util.Arrays;
 import java.util.Locale;
+import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.JAXBException;
 import javax.measure.unit.SI;
 
@@ -48,6 +50,7 @@ import org.apache.sis.internal.jaxb.gmx.
 import org.apache.sis.referencing.NamedIdentifier;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.xml.MarshallerPool;
 import org.apache.sis.test.TestUtilities;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
@@ -82,6 +85,10 @@ public strictfp class DefaultMetadataTes
      * @param endTime   The end time in the {@code "yyy-mm-dd"} format.
      */
     protected void setTemporalBounds(final DefaultTemporalExtent extent, final String startTime, final String endTime) {
+        /*
+         * Note: if this DefaultMetadataTest class is made final and this method removed,
+         *       then testUnmarshalling() can be simplified.
+         */
     }
 
     /**
@@ -302,6 +309,13 @@ public strictfp class DefaultMetadataTes
     }
 
     /**
+     * Returns the URL to the {@code "Metadata.xml"} file to use for this test.
+     */
+    private URL getResource() {
+        return DefaultMetadataTest.class.getResource("Metadata.xml");
+    }
+
+    /**
      * Tests marshalling of a XML document.
      *
      * @throws JAXBException If an error occurred during marshalling.
@@ -310,7 +324,7 @@ public strictfp class DefaultMetadataTes
     @Ignore("Need to investigate why anchors are lost at marshalling time.")
     public void testMarshalling() throws JAXBException {
         final String xml = marshal(createHardCoded());
-        assertXmlEquals(DefaultMetadataTest.class.getResource("Metadata.xml"), xml, "xmlns:*", "xsi:schemaLocation");
+        assertXmlEquals(getResource(), xml, "xmlns:*", "xsi:schemaLocation");
     }
 
     /**
@@ -320,7 +334,14 @@ public strictfp class DefaultMetadataTes
      */
     @Test
     public void testUnmarshalling() throws JAXBException {
-        final DefaultMetadata metadata = unmarshalFile(DefaultMetadata.class, "Metadata.xml");
+        /*
+         * Note: if this DefaultMetadataTest class is made final, then all following lines
+         * until pool.recycle(…) can be replaced by a call to unmarshallFile("Metadata.xml").
+         */
+        final MarshallerPool pool = getMarshallerPool();
+        final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
+        final DefaultMetadata metadata = (DefaultMetadata) unmarshaller.unmarshal(getResource());
+        pool.recycle(unmarshaller);
         final DefaultMetadata expected = createHardCoded();
         assertTrue(metadata.equals(expected, ComparisonMode.DEBUG));
     }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -119,7 +119,7 @@ public abstract class PropertyType<Value
      * (ISO 19115:2014 model) is not yet supported, so we currently use this variable only as a way
      * to identify the code to revisit when we will want to support the new model.
      */
-    protected static final boolean LEGACY_XML = true;
+    public static final boolean LEGACY_XML = true;
 
     /**
      * The wrapped GeoAPI metadata instance, or {@code null} if the metadata shall not be marshalled.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -41,7 +41,7 @@ import org.apache.sis.internal.jdk7.Obje
  * By definition, all record members have a [1 … 1] cardinality
  * (for a more flexible construct, see {@linkplain org.apache.sis.feature features}).
  * Since all members are expected to be assigned a value, the initial values on {@code DefaultRecord}
- * instantiation are undetermined. Some may be null, or some may be zero.
+ * instantiation are unspecified. Some may be null, or some may be zero.
  *
  * {@section Limitations}
  * <ul>
@@ -80,7 +80,7 @@ public class DefaultRecord implements Re
 
     /**
      * Creates a new record for the given record type.
-     * The initial values are undetermined - they may be null or zero.
+     * The initial values are unspecified - they may be null or zero.
      * Callers can assign values by a call to {@link #setAll(Object[])}.
      *
      * @param type The type definition of the new record.

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1613819&r1=1613818&r2=1613819&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Sun Jul 27 17:28:52 2014
@@ -482,7 +482,7 @@ final class MetadataReader {
                 if (type     != null) addIfAbsent(identification.getSpatialRepresentationTypes(), Types.forCodeName(SpatialRepresentationType.class, type, true));
                 if (standard != null) addIfAbsent(identification.getDescriptiveKeywords(), standard);
                 if (keywords != null) addIfAbsent(identification.getDescriptiveKeywords(), keywords);
-                if (credits  != null) addIfAbsent(identification.getCredits(), credits);
+                if (credits  != null) addIfAbsent(identification.getCredits(), Types.toInternationalString(credits));
                 if (license  != null) addIfAbsent(identification.getResourceConstraints(), constraints = new DefaultLegalConstraints(license));
                 if (access   != null) {
                     for (String keyword : access.split(KEYWORD_SEPARATOR)) {



Mime
View raw message