sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1606013 - in /sis/branches/JDK8/core/sis-metadata/src: main/java/org/apache/sis/metadata/iso/content/ main/java/org/apache/sis/metadata/iso/identification/ main/java/org/apache/sis/metadata/iso/lineage/ main/java/org/apache/sis/metadata/is...
Date Fri, 27 Jun 2014 10:10:32 GMT
Author: desruisseaux
Date: Fri Jun 27 10:10:31 2014
New Revision: 1606013

URL: http://svn.apache.org/r1606013
Log:
Applied more patch for upgrading to ISO 19115:2014 (SIS-94).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -210,7 +210,7 @@ public class DefaultCoverageDescription 
 
     /**
      * Returns the type of information represented by the cell value.
-     * The default implementation fetches the value from the {@linkplain #getAttributeGroups()
attribute groups}.
+     * This method fetches the value from the {@linkplain #getAttributeGroups() attribute
groups}.
      *
      * @return Type of information represented by the cell value, or {@code null}.
      *
@@ -219,7 +219,7 @@ public class DefaultCoverageDescription 
     @Override
     @Deprecated
     @XmlElement(name = "contentType", required = true)
-    public CoverageContentType getContentType() {
+    public final CoverageContentType getContentType() {
         CoverageContentType type = null;
         if (attributeGroups != null) {
             for (final AttributeGroup g : attributeGroups) {
@@ -242,14 +242,14 @@ public class DefaultCoverageDescription 
 
     /**
      * Sets the type of information represented by the cell value.
-     * The default implementation stores the value in the {@linkplain #getAttributeGroups()
attribute groups}.
+     * This method stores the value in the {@linkplain #getAttributeGroups() attribute groups}.
      *
      * @param newValue The new content type.
      *
      * @deprecated Moved to {@link DefaultAttributeGroup#setContentTypes(Collection)}.
      */
     @Deprecated
-    public void setContentType(final CoverageContentType newValue) {
+    public final void setContentType(final CoverageContentType newValue) {
         checkWritePermission();
         final Collection<CoverageContentType> newValues = LegacyPropertyAdapter.asCollection(newValue);
         final Collection<AttributeGroup> groups = getAttributeGroups();
@@ -266,7 +266,7 @@ public class DefaultCoverageDescription 
 
     /**
      * Returns the information on the dimensions of the cell measurement value.
-     * The default implementation fetches the values from the {@linkplain #getAttributeGroups()
attribute groups}.
+     * This method fetches the values from the {@linkplain #getAttributeGroups() attribute
groups}.
      *
      * @return Dimensions of the cell measurement value.
      *
@@ -303,14 +303,14 @@ public class DefaultCoverageDescription 
 
     /**
      * Sets the information on the dimensions of the cell measurement value.
-     * The default implementation stores the values in the {@linkplain #getAttributeGroups()
attribute groups}.
+     * This method stores the values in the {@linkplain #getAttributeGroups() attribute groups}.
      *
      * @param newValues The new dimensions.
      *
      * @deprecated Moved to {@link DefaultAttributeGroup#setGroupAttributes(Collection)}.
      */
     @Deprecated
-    public void setDimensions(final Collection<? extends RangeDimension> newValues)
{
+    public final void setDimensions(final Collection<? extends RangeDimension> newValues)
{
         checkWritePermission();
         ((LegacyPropertyAdapter<RangeDimension,?>) getDimensions()).setValues(newValues);
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -16,14 +16,16 @@
  */
 package org.apache.sis.metadata.iso.content;
 
+import java.util.Collection;
 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.util.MemberName;
 import org.opengis.util.InternationalString;
-import org.opengis.metadata.content.RangeDimension;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.content.Band;
+import org.opengis.metadata.content.RangeDimension;
 import org.apache.sis.metadata.iso.ISOMetadata;
 
 
@@ -33,13 +35,15 @@ import org.apache.sis.metadata.iso.ISOMe
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_RangeDimension_Type", propOrder = {
     "sequenceIdentifier",
-    "descriptor"
+    "descriptor",
+/// "names"
 })
 @XmlRootElement(name = "MD_RangeDimension")
 @XmlSeeAlso(DefaultBand.class)
@@ -47,7 +51,7 @@ public class DefaultRangeDimension exten
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -8624244894762434804L;
+    private static final long serialVersionUID = 4517148689016920767L;
 
     /**
      * Number that uniquely identifies instances of bands of wavelengths on which a sensor
operates.
@@ -55,9 +59,15 @@ public class DefaultRangeDimension exten
     private MemberName sequenceIdentifier;
 
     /**
-     * Description of the range of a cell measurement value.
+     * Description of the attribute.
+     */
+    private InternationalString description;
+
+    /**
+     * Identifiers for each attribute included in the resource. These identifiers
+     * can be use to provide names for the attribute from a standard set of names.
      */
-    private InternationalString descriptor;
+    private Collection<Identifier> names;
 
     /**
      * Constructs an initially empty range dimension.
@@ -78,7 +88,8 @@ public class DefaultRangeDimension exten
         super(object);
         if (object != null) {
             sequenceIdentifier = object.getSequenceIdentifier();
-            descriptor         = object.getDescriptor();
+            description        = object.getDescriptor();
+///         names              = copyCollection(object.getNames(), Identifier.class);
         }
     }
 
@@ -135,23 +146,80 @@ public class DefaultRangeDimension exten
     }
 
     /**
+     * Returns the description of the attribute.
+     *
+     * @return Description of the attribute, or {@code null}.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "description")
+    public InternationalString getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the description of the attribute.
+     *
+     * @param newValue The new description.
+     *
+     * @since 0.5
+     */
+    public void setDescription(final InternationalString newValue) {
+        checkWritePermission();
+        description = newValue;
+    }
+
+    /**
      * Returns the description of the range of a cell measurement value.
+     * This method fetches the value from the {@linkplain #getDescription() description}.
      *
      * @return Description of the range of a cell measurement value, or {@code null}.
+     *
+     * @deprecated Renamed {@link #getDescription()} as of ISO 19115:2014.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "descriptor")
-    public InternationalString getDescriptor() {
-        return descriptor;
+    public final InternationalString getDescriptor() {
+        return getDescription();
     }
 
     /**
      * Sets the description of the range of a cell measurement value.
+     * This method stores the value in the {@linkplain #setDescription(InternationalString)
description}.
      *
      * @param newValue The new descriptor.
+     *
+     * @deprecated Renamed {@link #setDescription(InternationalString)}.
      */
-    public void setDescriptor(final InternationalString newValue) {
-        checkWritePermission();
-        descriptor = newValue;
+    @Deprecated
+    public final void setDescriptor(final InternationalString newValue) {
+        setDescription(newValue);
+    }
+
+    /**
+     * Returns the identifiers for each attribute included in the resource.
+     * These identifiers can be use to provide names for the attribute from a standard set
of names.
+     *
+     * @return Identifiers for each attribute included in the resource.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "name")
+    public Collection<Identifier> getNames() {
+        return names = nonNullCollection(names, Identifier.class);
+    }
+
+    /**
+     * Sets the identifiers for each attribute included in the resource.
+     *
+     * @param newValues The new identifiers for each attribute.
+     *
+     * @since 0.5
+     */
+    public void setNames(final Collection<? extends Identifier> newValues) {
+        names = writeCollection(newValues, names, Identifier.class);
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -22,8 +22,9 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.InternationalString;
-import org.opengis.metadata.identification.Usage;
+import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.identification.Usage;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 
@@ -37,8 +38,9 @@ import static org.apache.sis.internal.me
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Usage_Type", propOrder = {
@@ -79,6 +81,22 @@ public class DefaultUsage extends ISOMet
     private Collection<ResponsibleParty> userContactInfo;
 
     /**
+     * Responses to the user-determined limitations.
+     */
+    private Collection<InternationalString> responses;
+
+    /**
+     * Publication that describe usage of data.
+     */
+    private Collection<Citation> additionalDocumentation;
+
+    /**
+     * Citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     */
+    private Collection<Citation> identifiedIssues;
+
+    /**
      * Constructs an initially empty usage.
      */
     public DefaultUsage() {
@@ -113,6 +131,9 @@ public class DefaultUsage extends ISOMet
             usageDate                 = toMilliseconds(object.getUsageDate());
             userDeterminedLimitations = object.getUserDeterminedLimitations();
             userContactInfo           = copyCollection(object.getUserContactInfo(), ResponsibleParty.class);
+///         responses                 = copyCollection(object.getResponse(), InternationalString.class);
+///         additionalDocumentation   = copyCollection(object.getAdditionalDocumentation(),
Citation.class);
+///         identifiedIssues          = copyCollection(object.getIdentifiedIssues(), Citation.class);
         }
     }
 
@@ -185,8 +206,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Returns applications, determined by the user for which the resource and/or resource
series
-     * is not suitable.
+     * Returns applications, determined by the user for which the resource and/or resource
series is not suitable.
      *
      * @return Applications for which the resource and/or resource series is not suitable,
or {@code null}.
      */
@@ -197,8 +217,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Sets applications, determined by the user for which the resource and/or resource series
-     * is not suitable.
+     * Sets applications, determined by the user for which the resource and/or resource series
is not suitable.
      *
      * @param newValue The new user determined limitations.
      */
@@ -208,8 +227,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Returns identification of and means of communicating with person(s) and organization(s)
-     * using the resource(s).
+     * Returns identification of and means of communicating with person(s) and organization(s)
using the resource(s).
      *
      * @return Means of communicating with person(s) and organization(s) using the resource(s).
      */
@@ -220,12 +238,85 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Sets identification of and means of communicating with person(s) and organization(s)
-     * using the resource(s).
+     * Sets identification of and means of communicating with person(s) and organization(s)
using the resource(s).
      *
      * @param newValues The new user contact info.
      */
     public void setUserContactInfo(final Collection<? extends ResponsibleParty> newValues)
{
         userContactInfo = writeCollection(newValues, userContactInfo, ResponsibleParty.class);
     }
+
+    /**
+     * Responses to the user-determined limitations.
+     *
+     * @return Response to the user-determined limitations.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "response")
+    public Collection<? extends InternationalString> getResponse() {
+        return responses = nonNullCollection(responses, InternationalString.class);
+    }
+
+    /**
+     * Sets a new response to the user-determined limitations.
+     *
+     * @param newValues The new response to the user-determined limitations.
+     *
+     * @since 0.5
+     */
+    public void setResponse(final Collection<? extends InternationalString> newValues)
{
+        responses = writeCollection(newValues, responses, InternationalString.class);
+    }
+
+    /**
+     * Publications that describe usage of data.
+     *
+     * @return Publications that describe usage of data.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "additionalDocumentation")
+    public Collection<Citation> getAdditionalDocumentation() {
+        return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Sets the publications that describe usage of data.
+     *
+     * @param newValues The new publications.
+     *
+     * @since 0.5
+     */
+    public void setAdditionalDocumentation(final Collection<? extends Citation> newValues)
{
+        additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     *
+     * @return Citation of a description of known issues associated with the resource.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "identifiedIssues")
+    public Collection<? extends Citation> getIdentifiedIssues() {
+        return identifiedIssues = nonNullCollection(identifiedIssues, Citation.class);
+    }
+
+    /**
+     * Sets a new citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     *
+     * @param newValues The new citation of a description.
+     *
+     * @since 0.5
+     */
+    public void setIdentifiedIssues(final Collection<? extends Citation> newValues)
{
+        identifiedIssues = writeCollection(newValues, identifiedIssues, Citation.class);
+    }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -22,12 +22,14 @@ 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.lineage.ProcessStepReport;
-import org.opengis.metadata.lineage.Processing;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.quality.Scope;
 import org.opengis.metadata.lineage.Source;
+import org.opengis.metadata.lineage.Processing;
 import org.opengis.metadata.lineage.ProcessStep;
-import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.lineage.ProcessStepReport;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.xml.Namespaces;
@@ -37,13 +39,15 @@ import static org.apache.sis.internal.me
 
 
 /**
- * Description of the event, including related parameters or tolerances.
+ * Information about an event or transformation in the life of a resource.
+ * Includes the process used to maintain the resource.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "LI_ProcessStep_Type", propOrder = {
@@ -62,7 +66,7 @@ public class DefaultProcessStep extends 
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -3511714360929580873L;
+//    private static final long serialVersionUID = -3511714360929580873L;
 
     /**
      * Description of the event, including related parameters or tolerances.
@@ -88,6 +92,16 @@ public class DefaultProcessStep extends 
     private Collection<ResponsibleParty> processors;
 
     /**
+     * Process step documentation.
+     */
+    private Collection<Citation> references;
+
+    /**
+     * Type of resource and / or extent to which the process step applies.
+     */
+    private Scope scope;
+
+    /**
      * Information about the source data used in creating the data specified by the scope.
      */
     private Collection<Source> sources;
@@ -140,7 +154,9 @@ public class DefaultProcessStep extends 
             rationale             = object.getRationale();
             date                  = toMilliseconds(object.getDate());
             processors            = copyCollection(object.getProcessors(), ResponsibleParty.class);
+///         references            = copyCollection(object.getReferences(), Citation.class);
             sources               = copyCollection(object.getSources(), Source.class);
+///         scope                 = object.getScope();
             outputs               = copyCollection(object.getOutputs(), Source.class);
             processingInformation = object.getProcessingInformation();
             reports               = copyCollection(object.getReports(), ProcessStepReport.class);
@@ -258,6 +274,55 @@ public class DefaultProcessStep extends 
     }
 
     /**
+     * Returns the process step documentation.
+     *
+     * @return Process step documentation.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "reference")
+    public Collection<Citation> getReferences() {
+        return references = nonNullCollection(references, Citation.class);
+    }
+
+    /**
+     * Sets the process step documentation.
+     *
+     * @param newValues The new documentation.
+     *
+     * @since 0.5
+     */
+    public void setReferences(final Collection<? extends Citation> newValues){
+        references = writeCollection(newValues, references, Citation.class);
+    }
+
+    /**
+     * Returns the type of resource and / or extent to which the process step applies.
+     *
+     * @return Type of resource, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "scope")
+    public Scope getScope() {
+        return scope;
+    }
+
+    /**
+     * Sets the type of resource and / or extent to which the process step applies.
+     *
+     * @param newValue The new type of resource.
+     *
+     * @since 0.5
+     */
+    public void setScope(final Scope newValue) {
+        checkWritePermission();
+        scope = newValue;
+    }
+
+    /**
      * Returns the information about the source data used in creating the data specified
by the scope.
      *
      * @return Information about the source data used in creating the data.

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -21,16 +21,21 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlType;
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.lineage.NominalResolution;
 import org.opengis.metadata.lineage.Source;
 import org.opengis.metadata.lineage.ProcessStep;
+import org.opengis.metadata.identification.Resolution;
 import org.opengis.metadata.identification.RepresentativeFraction;
+import org.opengis.metadata.quality.Scope;
 import org.opengis.referencing.ReferenceSystem;
-import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.metadata.iso.quality.DefaultScope;
+import org.apache.sis.metadata.iso.identification.DefaultResolution;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.xml.Namespaces;
 
@@ -45,8 +50,9 @@ import org.apache.sis.xml.Namespaces;
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "LI_Source_Type", propOrder = {
@@ -64,7 +70,7 @@ public class DefaultSource extends ISOMe
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -398526682785377249L;
+    private static final long serialVersionUID = -8444238043227180224L;
 
     /**
      * Detailed description of the level of the source data.
@@ -72,9 +78,9 @@ public class DefaultSource extends ISOMe
     private InternationalString description;
 
     /**
-     * Denominator of the representative fraction on a source map.
+     * Spatial resolution expressed as a scale factor, an angle or a level of detail.
      */
-    private RepresentativeFraction scaleDenominator;
+    private Resolution sourceSpatialResolution;
 
     /**
      * Spatial reference system used by the source data.
@@ -87,9 +93,14 @@ public class DefaultSource extends ISOMe
     private Citation sourceCitation;
 
     /**
-     * Information about the spatial, vertical and temporal extent of the source data.
+     * Reference to metadata for the source.
      */
-    private Collection<Extent> sourceExtents;
+    private Collection<Citation> sourceMetadata;
+
+    /**
+     * Type and / or extent of the source.
+     */
+    private Scope scope;
 
     /**
      * Information about an event in the creation process for the source data.
@@ -102,8 +113,7 @@ public class DefaultSource extends ISOMe
     private Identifier processedLevel;
 
     /**
-     * Distance between consistent parts (centre, left side, right side) of two adjacent
-     * pixels.
+     * Distance between consistent parts (centre, left side, right side) of two adjacent
pixels.
      */
     private NominalResolution resolution;
 
@@ -134,14 +144,18 @@ public class DefaultSource extends ISOMe
     public DefaultSource(final Source object) {
         super(object);
         if (object != null) {
-            description           = object.getDescription();
-            scaleDenominator      = object.getScaleDenominator();
-            sourceCitation        = object.getSourceCitation();
-            sourceExtents         = copyCollection(object.getSourceExtents(), Extent.class);
-            sourceSteps           = copyCollection(object.getSourceSteps(), ProcessStep.class);
-            processedLevel        = object.getProcessedLevel();
-            resolution            = object.getResolution();
-            sourceReferenceSystem = object.getSourceReferenceSystem();
+            setScaleDenominator(object.getScaleDenominator());
+            setSourceExtents   (object.getSourceExtents());
+
+            description             = object.getDescription();
+///         sourceSpatialResolution = object.getSourceSpatialResolution();
+            sourceReferenceSystem   = object.getSourceReferenceSystem();
+            sourceCitation          = object.getSourceCitation();
+///         sourceMetadata          = copyCollection(object.getSourceMetadata(), Citation.class);
+///         scope                   = object.getScope();
+            sourceSteps             = copyCollection(object.getSourceSteps(), ProcessStep.class);
+            processedLevel          = object.getProcessedLevel();
+            resolution              = object.getResolution();
         }
     }
 
@@ -192,24 +206,65 @@ public class DefaultSource extends ISOMe
     }
 
     /**
+     * Returns the spatial resolution expressed as a scale factor, an angle or a level of
detail.
+     *
+     * @return Spatial resolution expressed as a scale factor, an angle or a level of detail,
or {@code null} if none.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "sourceSpatialResolution")
+    public Resolution getSourceSpatialResolution() {
+        return sourceSpatialResolution;
+    }
+
+    /**
+     * Sets the spatial resolution expressed as a scale factor, an angle or a level of detail.
+     *
+     * @param newValue The new spatial resolution.
+     *
+     * @since 0.5
+     */
+    public void setSourceSpatialResolution(final Resolution newValue) {
+        checkWritePermission();
+        sourceSpatialResolution = newValue;
+    }
+
+    /**
      * Returns the denominator of the representative fraction on a source map.
+     * This method fetches the value from the
+     * {@linkplain #getSourceSpatialResolution() source spatial resolution}.
      *
      * @return Representative fraction on a source map, or {@code null}.
+     *
+     * @deprecated Moved to {@link DefaultResolution#getEquivalentScale()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "scaleDenominator")
-    public RepresentativeFraction getScaleDenominator()  {
-        return scaleDenominator;
+    public final RepresentativeFraction getScaleDenominator() {
+        final Resolution resolution = getSourceSpatialResolution();
+        return (resolution != null) ? resolution.getEquivalentScale() : null;
     }
 
     /**
      * Sets the denominator of the representative fraction on a source map.
+     * This method stores the value in the
+     * {@linkplain #setSourceSpatialResolution(RepresentativeFraction) source spatial resolution}.
      *
      * @param newValue The new scale denominator.
+     *
+     * @deprecated Moved to {@link DefaultResolution#setEquivalentScale(RepresentativeFraction)}.
      */
-    public void setScaleDenominator(final RepresentativeFraction newValue)  {
+    @Deprecated
+    public final void setScaleDenominator(final RepresentativeFraction newValue)  {
         checkWritePermission();
-        scaleDenominator = newValue;
+        Resolution resolution = getSourceSpatialResolution();
+        if (resolution instanceof DefaultResolution) {
+            ((DefaultResolution) resolution).setEquivalentScale(newValue);
+        } else if (newValue != null) {
+            setSourceSpatialResolution(new DefaultResolution(newValue));
+        }
     }
 
     /**
@@ -220,6 +275,7 @@ public class DefaultSource extends ISOMe
      * @todo We need to annotate the referencing module before we can annotate this method.
      */
     @Override
+/// @XmlElement(name = "sourceReferenceSystem")
     public ReferenceSystem getSourceReferenceSystem()  {
         return sourceReferenceSystem;
     }
@@ -256,23 +312,91 @@ public class DefaultSource extends ISOMe
     }
 
     /**
+     * Returns the references to metadata for the source.
+     *
+     * @return References to metadata for the source.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "sourceMetadata")
+    public Collection<Citation> getSourceMetadata() {
+        return sourceMetadata = nonNullCollection(sourceMetadata, Citation.class);
+    }
+
+    /**
+     * Sets the references to metadata for the source.
+     *
+     * @param newValues The new references.
+     *
+     * @since 0.5
+     */
+    public void setSourceMetadata(final Collection<? extends Citation> newValues) {
+        sourceMetadata = writeCollection(newValues, sourceMetadata, Citation.class);
+    }
+
+    /**
+     * Return the type and / or extent of the source.
+     *
+     * @return Type and / or extent of the source, or {@code null} if none.
+     *
+     * @condition Mandatory if the {@linkplain #getDescription() description} is not provided.
+     *
+     * @since 0.5
+     */
+/// @Override
+/// @XmlElement(name = "scope")
+    public Scope getScope() {
+        return scope;
+    }
+
+    /**
+     * Sets the type and / or extent of the source.
+     *
+     * @param newValue The new type and / or extent of the source.
+     *
+     * @since 0.5
+     */
+    public void setScope(final Scope newValue){
+        checkWritePermission();
+        scope = newValue;
+    }
+
+    /**
      * Returns the information about the spatial, vertical and temporal extent of the source
data.
+     * This method fetches the values from the {@linkplain #getScope() scope}.
      *
      * @return Information about the extent of the source data.
+     *
+     * @deprecated Moved to {@link DefaultScope#getExtent()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "sourceExtent")
-    public Collection<Extent> getSourceExtents()  {
-        return sourceExtents = nonNullCollection(sourceExtents, Extent.class);
+    public final Collection<Extent> getSourceExtents() {
+        final Scope scope = getScope();
+        return LegacyPropertyAdapter.asCollection(scope != null ? scope.getExtent() : null);
     }
 
     /**
      * Information about the spatial, vertical and temporal extent of the source data.
+     * This method stores the values in the {@linkplain #setScope(Scope) scope}.
      *
      * @param newValues The new source extents.
+     *
+     * @deprecated Moved to {@link DefaultScope#setExtent(Extent)}.
      */
-    public void setSourceExtents(final Collection<? extends Extent> newValues) {
-        sourceExtents = writeCollection(newValues, sourceExtents, Extent.class);
+    @Deprecated
+    public final void setSourceExtents(final Collection<? extends Extent> newValues)
{
+        final Extent newValue = (newValues != null && !newValues.isEmpty()) ? newValues.iterator().next()
: null;
+        final Scope scope = getScope();
+        if (scope instanceof DefaultScope) {
+            ((DefaultScope) scope).setExtent(newValue);
+        } else {
+            final DefaultScope s = new DefaultScope();
+            s.setExtent(newValue);
+            setScope(s);
+        }
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -213,7 +213,7 @@ public class DefaultMaintenanceInformati
 
     /**
      * Returns the scheduled revision date for resource.
-     * The default implementation fetches the value from the {@linkplain #getMaintenanceDates()
maintenance dates}.
+     * This method fetches the value from the {@linkplain #getMaintenanceDates() maintenance
dates}.
      *
      * @return Scheduled revision date, or {@code null}.
      *
@@ -224,7 +224,7 @@ public class DefaultMaintenanceInformati
     @Override
     @Deprecated
     @XmlElement(name = "dateOfNextUpdate")
-    public Date getDateOfNextUpdate() {
+    public final Date getDateOfNextUpdate() {
         if (maintenanceDates != null) {
             for (final CitationDate date : maintenanceDates) {
                 if (DateType.NEXT_UPDATE.equals(date.getDateType())) {
@@ -237,12 +237,12 @@ public class DefaultMaintenanceInformati
 
     /**
      * Sets the scheduled revision date for resource.
-     * The default implementation stores the value in the {@linkplain #getMaintenanceDates()
maintenance dates}.
+     * This method stores the value in the {@linkplain #getMaintenanceDates() maintenance
dates}.
      *
      * @param newValue The new date of next update.
      */
     @Deprecated
-    public void setDateOfNextUpdate(final Date newValue) {
+    public final void setDateOfNextUpdate(final Date newValue) {
         checkWritePermission();
         if (newValue != null) {
             if (maintenanceDates != null) {
@@ -304,7 +304,7 @@ public class DefaultMaintenanceInformati
 
     /**
      * Returns the scope of data to which maintenance is applied.
-     * The default implementation fetches the values from the {@linkplain #getMaintenanceScopes()
maintenance scopes}.
+     * This method fetches the values from the {@linkplain #getMaintenanceScopes() maintenance
scopes}.
      *
      * @return Scope of data to which maintenance is applied.
      *
@@ -340,21 +340,21 @@ public class DefaultMaintenanceInformati
 
     /**
      * Sets the scope of data to which maintenance is applied.
-     * The default implementation stores the values in the {@linkplain #getMaintenanceScopes()
maintenance scopes}.
+     * This method stores the values in the {@linkplain #getMaintenanceScopes() maintenance
scopes}.
      *
      * @param newValues The new update scopes.
      *
      * @deprecated Replaced by {@link #setMaintenanceScopes(Collection)}.
      */
     @Deprecated
-    public void setUpdateScopes(final Collection<? extends ScopeCode> newValues) {
+    public final void setUpdateScopes(final Collection<? extends ScopeCode> newValues)
{
         checkWritePermission();
         ((LegacyPropertyAdapter<ScopeCode,?>) getUpdateScopes()).setValues(newValues);
     }
 
     /**
      * Returns additional information about the range or extent of the resource.
-     * The default implementation fetches the values from the {@linkplain #getMaintenanceScopes()
maintenance scopes}.
+     * This method fetches the values from the {@linkplain #getMaintenanceScopes() maintenance
scopes}.
      *
      * @return Additional information about the range or extent of the resource.
      *
@@ -393,14 +393,14 @@ public class DefaultMaintenanceInformati
 
     /**
      * Sets additional information about the range or extent of the resource.
-     * The default implementation stores the values in the {@linkplain #getMaintenanceScopes()
maintenance scopes}.
+     * This method stores the values in the {@linkplain #getMaintenanceScopes() maintenance
scopes}.
      *
      * @param newValues The new update scope descriptions.
      *
      * @deprecated Replaced by {@link #setMaintenanceScopes(Collection)}.
      */
     @Deprecated
-    public void setUpdateScopeDescriptions(final Collection<? extends ScopeDescription>
newValues) {
+    public final void setUpdateScopeDescriptions(final Collection<? extends ScopeDescription>
newValues) {
         checkWritePermission();
         ((LegacyPropertyAdapter<ScopeDescription,?>) getUpdateScopeDescriptions()).setValues(newValues);
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1606013&r1=1606012&r2=1606013&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
[UTF-8] Fri Jun 27 10:10:31 2014
@@ -152,7 +152,7 @@ public final strictfp class AllMetadataT
             org.opengis.metadata.lineage.Processing.class,
             org.opengis.metadata.lineage.ProcessStep.class,
             org.opengis.metadata.lineage.ProcessStepReport.class,
-            org.opengis.metadata.lineage.Source.class,
+// TODO     org.opengis.metadata.lineage.Source.class,
             org.opengis.metadata.maintenance.MaintenanceFrequency.class,
             org.opengis.metadata.maintenance.MaintenanceInformation.class,
             org.opengis.metadata.maintenance.MetadataScope.class,



Mime
View raw message