sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1726717 [1/4] - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/s...
Date Tue, 26 Jan 2016 00:12:36 GMT
Author: desruisseaux
Date: Tue Jan 26 00:12:35 2016
New Revision: 1726717

URL: http://svn.apache.org/viewvc?rev=1726717&view=rev
Log:
Merge MultiAuthoritiesFactory from the JDK8 branch.

Added:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryIdentifier.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryIdentifier.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
      - copied, changed from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/NoSuchAuthorityFactoryException.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/NoSuchAuthorityFactoryException.java
    sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/GeodeticDatumMock.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/GeodeticDatumMock.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/PrimeMeridianMock.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/PrimeMeridianMock.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
      - copied, changed from r1726714, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
      - copied, changed from r1726714, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySynchronizedIterator.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySynchronizedIterator.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/xml/ReferenceResolverMock.java
      - copied unchanged from r1726714, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/xml/ReferenceResolverMock.java
Removed:
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/mock/
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java
    sis/branches/JDK7/ide-project/NetBeans/build.xml
    sis/branches/JDK7/src/main/javadoc/stylesheet.css

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 26 00:12:35 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1725532
+/sis/branches/JDK8:1584960-1726714
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -20,9 +20,9 @@ import java.util.AbstractCollection;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.NoSuchElementException;
 import org.apache.sis.metadata.AbstractMetadata;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.util.AbstractIterator;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.ArgumentChecks;
 
@@ -257,18 +257,13 @@ public abstract class LegacyPropertyAdap
     @Override
     public final Iterator<L> iterator() {
         final Iterator<N> it = elements.iterator();
-        return new Iterator<L>() {
+        return new AbstractIterator<L>() {
             /**
              * The container of the next value to return.
              */
             private N container;
 
             /**
-             * The next value to return, or {@code null} if not yet verified.
-             */
-            private L next;
-
-            /**
              * Returns {@code true} if there is more elements to iterate.
              * This method prefetches and stores the next value.
              */
@@ -289,22 +284,6 @@ public abstract class LegacyPropertyAdap
             }
 
             /**
-             * Returns the next element.
-             */
-            @Override
-            public final L next() {
-                L value = next;
-                if (value == null) {
-                    if (!hasNext()) {
-                        throw new NoSuchElementException();
-                    }
-                    value = next;
-                }
-                next = null;
-                return value;
-            }
-
-            /**
              * Removes the last element returned by {@link #next()}.
              */
             @Override

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -19,14 +19,19 @@ package org.apache.sis.internal.metadata
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Locale;
+import javax.measure.unit.Unit;
 import org.opengis.parameter.*;
 import org.opengis.referencing.*;
 import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;
 import org.opengis.referencing.operation.*;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
 import org.apache.sis.util.Static;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.internal.util.DefinitionURI;
+import org.apache.sis.metadata.iso.citation.Citations;
 
 
 /**
@@ -59,12 +64,21 @@ public final class NameMeaning extends S
         CoordinateOperation.class,
         OperationMethod.class,
         ParameterDescriptor.class,
-        ReferenceSystem.class
+        ReferenceSystem.class,
+        Unit.class
     };
 
     /**
      * The object types for instances of {@link #CLASSES}.
      * See {@link org.apache.sis.internal.util.DefinitionURI} javadoc for a list of object types in URN.
+     *
+     * <p>Types not yet listed (waiting to see if there is a use for them):</p>
+     *
+     * "group"              for  ParameterValueGroup.class;
+     * "verticalDatumType"  for  VerticalDatumType.class;
+     * "pixelInCell"        for  PixelInCell.class;
+     * "rangeMeaning"       for  RangeMeaning.class;
+     * "axisDirection"      for  AxisDirection.class;
      */
     private static final String[] TYPES = {
         "crs",
@@ -76,16 +90,26 @@ public final class NameMeaning extends S
         "coordinateOperation",
         "method",
         "parameter",
-        "referenceSystem"
+        "referenceSystem",
+        "uom"
     };
 
     /**
      * Naming authorities allowed to appear in {@code "urn:ogc:def:"}.
+     * This map serves two purposes:
      *
-     * <p><b>Note on the case:</b> The <cite>"Name type specification — definitions"</cite> document (OGC 09-048) writes
-     * authorities in upper cases, while <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a>
-     * use lower cases. Apache SIS uses upper cases for now.</p>
+     * <ul>
+     *   <li>Tell if a given authority is one of the authorities allowed by the OGC namespace.</li>
+     *   <li>Opportunistically fix the letter case.</li>
+     * </ul>
+     *
+     * <b>Note on the case:</b>
+     * <cite>"Name type specification — definitions"</cite> (OGC 09-048) writes authorities in upper cases,
+     * while <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a> uses lower cases.
+     * Apache SIS uses upper cases for now. The lower/upper case policy should be kept consistent with the policy
+     * used by {@link org.apache.sis.referencing.factory.MultiAuthoritiesFactory} for its keys.
      *
+     * @see org.apache.sis.referencing.factory.MultiAuthoritiesFactory
      * @see <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a>
      *
      * @since 0.7
@@ -116,20 +140,54 @@ public final class NameMeaning extends S
     }
 
     /**
-     * Returns the authority to format for the given code space, or {@code null} if there is no known authority
-     * in URN syntax for the given code space. The return value is used for fixing the Apache SIS policy regarding
-     * lower or upper cases (both conventions are used in different OGC resources).
-     *
-     * @param  codeSpace The code space (can be {@code null}).
-     * @return The authority to format in the URN, or {@code null} if none.
+     * Formats the given identifier using the {@code "ogc:urn:def:"} syntax with possible heuristic changes to
+     * the given values. This method delegates to {@link DefinitionURI#format(String, String, String, String)}
+     * after "fixing" the given values using some heuristic knowledge about the meaning of URN.
+     *
+     * @param  type      The object type.
+     * @param  authority The authority as one of the values documented in {@link DefinitionURI} javadoc.
+     * @param  version   The code version, or {@code null}. This is the only optional information.
+     * @param  code      The code.
+     * @return An identifier using the URN syntax, or {@code null} if a mandatory information is missing.
      *
      * @since 0.7
+     *
+     * @see DefinitionURI#format(String, String, String, String)
      */
-    public static String authority(String codeSpace) {
-        if (codeSpace != null) {
-            codeSpace = AUTHORITIES.get(codeSpace.toUpperCase(Locale.US));
+    public static String toURN(final Class<?> type, final String authority, String version, String code) {
+        if (type != null && authority != null && code != null) {
+            final String key = authority.toUpperCase(Locale.US);
+            String codeSpace = AUTHORITIES.get(key);
+            if (codeSpace == null) {
+                /*
+                 * If the given authority is not one of the authorities that we expected for the OGC namespace,
+                 * verify if we can related it to one of the specifications enumerated in the Citations class.
+                 * For example if the user gave us "OGP" as the authority, we will replace that by "IOGP" (the
+                 * new name for that organization).
+                 */
+                final Citation c = Citations.fromName(key);
+                codeSpace = org.apache.sis.internal.util.Citations.getCodeSpace(c);
+                if (AUTHORITIES.get(codeSpace) == null) {
+                    return null;            // Not an authority that we recognize for the OGC namespace.
+                }
+                version = getVersion(c);    // Unconditionally overwrite the user-specified version.
+                /*
+                 * If the above lines resulted in a chance of codespace, we may need to concatenate the authority
+                 * with the code for preserving information. The main use case is WMS codes like "CRS:84":
+                 *
+                 *   1) Citations.fromName("CRS") gave us Citations.WMS (version 1.3) as the authority.
+                 *   2) getCodeSpace(Citations.WMS) gave us "OGC", which is indeed the codespace used in URN.
+                 *   3) OGC Naming Authority – Procedures (OGC-09-046r2) said that "CRS:84" should be formatted
+                 *      as "urn:ogc:def:crs:OGC:1.3:CRS84". We already got the "OGC" and "1.3" parts with above
+                 *      steps, the last part is to replace "84" by "CRS84".
+                 */
+                if (!authority.equals(codeSpace) && !code.startsWith(authority)) {
+                    code = authority + code;    // Intentionally no ':' separator.
+                }
+            }
+            return DefinitionURI.format(toObjectType(type), codeSpace, version, code);
         }
-        return codeSpace;
+        return null;
     }
 
     /**
@@ -146,5 +204,26 @@ public final class NameMeaning extends S
             }
         }
         return null;
+    }
+
+    /**
+     * Returns the version of the namespace managed by the given authority.
+     * Current Apache SIS implementation searches this information in the {@link Citation#getEdition()} property.
+     * This approach is based on the assumption that the authority is some specification document or reference to
+     * a database, not an organization. However this policy may be revisited in any future SIS version.
+     *
+     * @param authority The authority from which to get a version, or {@code null}.
+     * @return The version, or {@code null} if none.
+     *
+     * @since 0.7
+     */
+    public static String getVersion(final Citation authority) {
+        if (authority != null) {
+            final InternationalString i18n = authority.getEdition();
+            if (i18n != null) {
+                return i18n.toString(Locale.US);
+            }
+        }
+        return null;
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -16,12 +16,14 @@
  */
 package org.apache.sis.internal.metadata;
 
+import java.util.Arrays;
 import java.util.Collection;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.PresentationForm;
 import org.opengis.metadata.citation.Responsibility;
-import org.apache.sis.internal.simple.SimpleCitation;
+import org.apache.sis.internal.simple.CitationConstant;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.MetadataServices;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
@@ -39,7 +41,7 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class ServicesForUtility extends MetadataServices {
@@ -56,15 +58,9 @@ public final class ServicesForUtility ex
      * @return The requested citation, or {@code null} if there is no constant for the given name.
      */
     @Override
-    public Citation getCitationConstant(final String name) {
+    public CitationConstant getCitationConstant(final String name) {
         final Citation c = Citations.fromName(name);
-        /*
-         * The fact that the following line uses the citation class as a non-public criterion for identifying
-         * when the Citations.fromName(String) method found no match is documented in that Citations.fromName
-         * method body. If we do not rely anymore on this criterion, please update the Citations.fromName(…)
-         * comment accordingly.
-         */
-        return (c.getClass() != SimpleCitation.class) ? c : null;
+        return (c instanceof CitationConstant) ? (CitationConstant) c : null;
     }
 
     /**
@@ -86,9 +82,10 @@ public final class ServicesForUtility ex
         String           code                  = null;
         String           codeSpace             = null;
         String           version               = null;
+        Identifier[]     alternateIdentifiers  = null;
         CharSequence     citedResponsibleParty = null;
         PresentationForm presentationForm      = null;
-        Citation         copyFrom              = null;  // Copy citedResponsibleParty from that citation.
+        Citation[]       copyFrom              = null;      // Copy citedResponsibleParty from those citations.
         switch (key) {
             case "ISO 19115-1": {
                 title     = "Geographic Information — Metadata Part 1: Fundamentals";
@@ -106,17 +103,38 @@ public final class ServicesForUtility ex
                 code      = "19115-2";
                 codeSpace = "ISO";
                 version   = "2009(E)";
-                copyFrom  = Citations.ISO_19115.get(0);
+                copyFrom  = new Citation[] {Citations.ISO_19115.get(0)};
+                presentationForm = PresentationForm.DOCUMENT_DIGITAL;
+                break;
+            }
+            case "WMS": {
+                title                = "Web Map Server";                                      // OGC title
+                alternateTitle       = "Geographic Information — Web map server interface";   // ISO title
+                alternateIdentifiers = new Identifier[] {
+                    new ImmutableIdentifier(null, "OGC", "06-042",  null, null),
+                    new ImmutableIdentifier(null, "ISO", "19128", "2005", null)
+                };
+                edition          = "1.3";
+                code             = "WMS";
+                codeSpace        = "OGC";
+                copyFrom         = new Citation[] {Citations.OGC, Citations.ISO_19115.get(0)};
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
                 break;
             }
             case Constants.OGC: {
-                title     = "Identifier in OGC namespace";
-                code      = "OGC";
+                title = "Identifiers in OGC namespace";
+                code = Constants.OGC;
                 citedResponsibleParty = "Open Geospatial Consortium";
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
                 break;
             }
+            case Constants.IOGP: {                                      // Not in public API (see Citations.IOGP javadoc)
+                title = "Using the EPSG Geodetic Parameter Dataset";    // Geomatics Guidance Note number 7, part 1
+                code = Constants.IOGP;
+                copyFrom = new Citation[] {Citations.EPSG};
+                presentationForm = PresentationForm.DOCUMENT_DIGITAL;
+                break;
+            }
             case Constants.EPSG: {
                 title     = "EPSG Geodetic Parameter Dataset";
                 code      = Constants.EPSG;
@@ -126,6 +144,9 @@ public final class ServicesForUtility ex
                 /*
                  * More complete information is provided as an ISO 19115 structure
                  * in EPSG Surveying and Positioning Guidance Note Number 7, part 1.
+                 * EPSGDataAccess.getAuthority() also add more information.
+                 * After we moved the content of this citation in a database,
+                 * EPSGDataAccess.getAuthority() should use this citation as a template.
                  */
                 break;
             }
@@ -163,19 +184,26 @@ public final class ServicesForUtility ex
         if (alternateTitle        != null) c.setAlternateTitles(singleton(Types.toInternationalString(alternateTitle)));
         if (edition               != null) c.setEdition(Types.toInternationalString(edition));
         if (code                  != null) c.setIdentifiers(singleton(new ImmutableIdentifier(null, codeSpace, code, version, null)));
-        if (copyFrom              != null) c.setCitedResponsibleParties(copyFrom.getCitedResponsibleParties());
         if (presentationForm      != null) c.setPresentationForms(singleton(presentationForm));
         if (citedResponsibleParty != null) {
-            final DefaultOrganisation organisation = new DefaultOrganisation();
-            organisation.setName(Types.toInternationalString(citedResponsibleParty));
-            final DefaultResponsibility r = new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR, null, organisation);
-            final Collection<Responsibility> parties = c.getCitedResponsibleParties();
-            if (parties != null) {
-                parties.add(r);
-            } else {
-                c.setCitedResponsibleParties(singleton(r));
+            c.setCitedResponsibleParties(singleton(new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR, null,
+                    new DefaultOrganisation(citedResponsibleParty, null, null, null))));
+        }
+        if (copyFrom != null) {
+            for (final Citation other : copyFrom) {
+                final Collection<? extends Responsibility> parties = other.getCitedResponsibleParties();
+                final Collection<Responsibility> current = c.getCitedResponsibleParties();
+                if (current != null) {
+                    current.addAll(parties);
+                } else {
+                    c.setCitedResponsibleParties(parties);
+                }
             }
         }
+        if (alternateIdentifiers != null) {
+            // getIdentifiers() should not return null at this point.
+            c.getIdentifiers().addAll(Arrays.asList(alternateIdentifiers));
+        }
         c.freeze();
         return c;
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -29,7 +29,7 @@
  * The method Javadoc describes the steps for fetching that data source.
  * When used in a JavaEE container, the data source can be configured as below:
  *
- * <ol>
+ * <ol class="verbose">
  *   <li><p>Make the JDBC driver available to the web container and its applications. On Tomcat, this
  *     is accomplished by installing the driver's JAR files into the {@code $CATALINA_HOME/lib} directory
  *     (<a href="https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html">source</a>).</p></li>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -150,14 +150,15 @@ final class Element implements Serializa
     /**
      * Constructs a new {@code Element}.
      * The {@code sharedValues} argument have two meanings:
-     * <ul>
-     *   <li><p>If {@code null}, then the caller is parsing a WKT string. The {@code Element}
-     *     must be mutable because its content will be emptied as the parsing progress.</p></li>
      *
-     *   <li><p>If non-null, then the caller is storing a WKT fragment. We create the elements but the caller will
+     * <ul class="verbose">
+     *   <li>If {@code null}, then the caller is parsing a WKT string. The {@code Element}
+     *     must be mutable because its content will be emptied as the parsing progress.</li>
+     *
+     *   <li>If non-null, then the caller is storing a WKT fragment. We create the elements but the caller will
      *     not parse them immediately. The {@code Element} should be immutable because the fragment will potentially
      *     be reused many time. Since the fragment may be stored for a long time, the {@code sharedValues} map will
-     *     be used for sharing unique instance of each value if possible.</p></li>
+     *     be used for sharing unique instance of each value if possible.</li>
      * </ul>
      *
      * @param text         The text to parse.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -50,7 +50,10 @@ import org.apache.sis.internal.util.Cita
  * one except for the {@code "MD_"} prefix. Example:
  *
  * {@preformat xml
- *   <gmd:MD_Identifier>
+ *   <gmd:MD_Identifier
+ *     <gmd:code>
+ *       <gco:CharacterString>4326</gco:CharacterString>
+ *     </gmd:code>
  *     <gmd:authority>
  *       <gmd:CI_Citation>
  *         <gmd:title>
@@ -58,9 +61,6 @@ import org.apache.sis.internal.util.Cita
  *         </gmd:title>
  *       </gmd:CI_Citation>
  *     </gmd:authority>
- *     <gmd:code>
- *       <gco:CharacterString>4326</gco:CharacterString>
- *     </gmd:code>
  *   </gmd:MD_Identifier>
  * }
  *
@@ -94,35 +94,43 @@ public class DefaultIdentifier extends I
     private static final long serialVersionUID = -23375776954553866L;
 
     /**
+     * Person or party responsible for maintenance of the namespace.
+     *
+     * @see #getAuthority()
+     */
+    private Citation authority;
+
+    /**
      * Alphanumeric value identifying an instance in the namespace.
+     *
+     * @see #getCode()
      */
     private String code;
 
     /**
      * Identifier or namespace in which the code is valid.
+     *
+     * @see #getCodeSpace()
      */
     private String codeSpace;
 
     /**
-     * Identifier of the version of the associated code space or code, as specified
-     * by the code space or code authority. This version is included only when the
-     * {@linkplain #getCode code} uses versions. When appropriate, the edition is
-     * identified by the effective date, coded using ISO 8601 date format.
+     * Version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
+     *
+     * @see #getVersion()
      */
     private String version;
 
     /**
      * Natural language description of the meaning of the code value.
+     *
+     * @see #getDescription()
      */
     private InternationalString description;
 
     /**
-     * Organization or party responsible for definition and maintenance of the
-     * {@linkplain #getCode code}.
-     */
-    private Citation authority;
-
-    /**
      * Construct an initially empty identifier.
      */
     public DefaultIdentifier() {
@@ -155,10 +163,8 @@ public class DefaultIdentifier extends I
      *       {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier(CharSequence) unicode identifier}.</li>
      * </ol>
      *
-     * @param authority The organization or party responsible for definition and maintenance
-     *                  of the code, or {@code null} if none.
-     * @param code      The alphanumeric value identifying an instance in the namespace,
-     *                  or {@code null} if none.
+     * @param authority The the person or party responsible for maintenance of the namespace, or {@code null} if none.
+     * @param code      The alphanumeric value identifying an instance in the namespace, or {@code null} if none.
      *
      * @see org.apache.sis.metadata.iso.citation.Citations#getUnicodeIdentifier(Citation)
      */
@@ -214,6 +220,29 @@ public class DefaultIdentifier extends I
     }
 
     /**
+     * Returns the person or party responsible for maintenance of the namespace.
+     * The organization's abbreviation is often the same than this identifier
+     * {@linkplain #getCodeSpace() code space}, but not necessarily.
+     *
+     * @return Person or party responsible for maintenance of the namespace, or {@code null} if not available.
+     */
+    @Override
+    @XmlElement(name = "authority")
+    public Citation getAuthority() {
+        return authority;
+    }
+
+    /**
+     * Sets the person or party responsible for maintenance of the namespace.
+     *
+     * @param newValue The new authority.
+     */
+    public void setAuthority(final Citation newValue) {
+        checkWritePermission();
+        authority = newValue;
+    }
+
+    /**
      * Returns the alphanumeric value identifying an instance in the namespace.
      * The code is optionally from a controlled list or pattern.
      *
@@ -232,6 +261,7 @@ public class DefaultIdentifier extends I
 
     /**
      * Sets the alphanumeric value identifying an instance in the namespace.
+     * Should avoid characters that are not legal in URLs.
      *
      * @param newValue The new code, or {@code null}.
      */
@@ -246,7 +276,7 @@ public class DefaultIdentifier extends I
      *
      * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
      *
-     * @return The identifier code space, or {@code null} if none.
+     * @return The identifier or namespace in which the code is valid, or {@code null} if none.
      *
      * @since 0.5
      */
@@ -268,14 +298,13 @@ public class DefaultIdentifier extends I
     }
 
     /**
-     * Identifier of the version of the associated code, as specified by the code space or
-     * code authority. This version is included only when the {@linkplain #getCode() code}
-     * uses versions. When appropriate, the edition is identified by the effective date,
-     * coded using ISO 8601 date format.
+     * Returns the version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode() code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * <div class="note"><b>Example:</b> the version of the underlying EPSG database.</div>
      *
-     * @return The version, or {@code null} if not available.
+     * @return The version identifier for the namespace, or {@code null} if none.
      */
     @Override
     public String getVersion() {
@@ -283,9 +312,9 @@ public class DefaultIdentifier extends I
     }
 
     /**
-     * Sets an identifier of the version of the associated code.
+     * Sets the version identifier for the namespace.
      *
-     * @param newValue The new version.
+     * @param newValue The new version, or {@code null} if none.
      */
     public void setVersion(final String newValue) {
         checkWritePermission();
@@ -317,27 +346,4 @@ public class DefaultIdentifier extends I
         checkWritePermission();
         description = newValue;
     }
-
-    /**
-     * Organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
-     * but not necessarily.
-     *
-     * @return The authority, or {@code null} if not available.
-     */
-    @Override
-    @XmlElement(name = "authority")
-    public Citation getAuthority() {
-        return authority;
-    }
-
-    /**
-     * Sets the organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     *
-     * @param newValue The new authority.
-     */
-    public void setAuthority(final Citation newValue) {
-        checkWritePermission();
-        authority = newValue;
-    }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -29,7 +29,6 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.internal.util.DefinitionURI;
 import org.apache.sis.internal.metadata.NameMeaning;
 import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
@@ -107,9 +106,6 @@ import java.util.Objects;
  *
  * {@preformat xml
  *   <gmd:RS_Identifier>
- *     <gmd:code>
- *       <gco:CharacterString>4326</gco:CharacterString>
- *     </gmd:code>
  *     <gmd:authority>
  *       <gmd:CI_Citation>
  *         <gmd:title>
@@ -117,6 +113,9 @@ import java.util.Objects;
  *         </gmd:title>
  *       </gmd:CI_Citation>
  *     </gmd:authority>
+ *     <gmd:code>
+ *       <gco:CharacterString>4326</gco:CharacterString>
+ *     </gmd:code>
  *   </gmd:RS_Identifier>
  * }
  * </li></ul>
@@ -142,37 +141,34 @@ public class ImmutableIdentifier extends
     private static final long serialVersionUID = -7681717592582493409L;
 
     /**
-     * Identifier code or name, optionally from a controlled list or pattern defined by a code space.
+     * The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      *
-     * @see #getCode()
+     * @see #getAuthority()
      */
     @XmlElement(required = true)
-    private final String code;
+    private final Citation authority;
 
     /**
-     * Name or identifier of the person or organization responsible for namespace, or
-     * {@code null} if not available. This is often an abbreviation of the authority name.
+     * Alphanumeric value identifying an instance in the namespace.
      *
-     * @see #getCodeSpace()
+     * @see #getCode()
      */
     @XmlElement(required = true)
-    private final String codeSpace;
+    private final String code;
 
     /**
-     * Organization or party responsible for definition and maintenance of the code space or code,
-     * or {@code null} if not available.
+     * Identifier or namespace in which the code is valid, or {@code null} if not available.
+     * This is often an abbreviation of the authority name.
      *
-     * @see #getAuthority()
+     * @see #getCodeSpace()
      */
     @XmlElement(required = true)
-    private final Citation authority;
+    private final String codeSpace;
 
     /**
-     * Identifier of the version of the associated code space or code as specified
-     * by the code space or code authority, or {@code null} if not available. This
-     * version is included only when the {@linkplain #getCode() code} uses versions.
-     * When appropriate, the edition is identified by the effective date, coded using
-     * ISO 8601 date format.
+     * Version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * @see #getVersion()
      */
@@ -204,14 +200,12 @@ public class ImmutableIdentifier extends
      * Creates a new identifier from the specified code and authority.
      *
      * @param authority
-     *          Organization or party responsible for definition and maintenance of the code
-     *          space or code, or {@code null} if not available.
+     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      * @param codeSpace
-     *          Name or identifier of the person or organization responsible for namespace, or
-     *          {@code null} if not available. This is often an abbreviation of the authority name.
+     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
+     *          This is often an abbreviation of the authority name.
      * @param code
-     *          Identifier code or name, optionally from a controlled list or pattern defined by
-     *          a code space. The code can not be null.
+     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
      */
     public ImmutableIdentifier(final Citation authority, final String codeSpace, final String code) {
         this(authority, codeSpace, code, null, null);
@@ -222,17 +216,14 @@ public class ImmutableIdentifier extends
      * with an optional version number and description.
      *
      * @param authority
-     *          Organization or party responsible for definition and maintenance of the code
-     *          space or code, or {@code null} if not available.
+     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      * @param codeSpace
-     *          Name or identifier of the person or organization responsible for namespace, or
-     *          {@code null} if not available. This is often an abbreviation of the authority name.
+     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
+     *          This is often an abbreviation of the authority name.
      * @param code
-     *          Identifier code or name, optionally from a controlled list or pattern defined by
-     *          a code space. The code can not be null.
+     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
      * @param version
-     *          The version of the associated code space or code as specified by the code authority,
-     *          or {@code null} if none.
+     *          The version identifier for the namespace as specified by the code authority, or {@code null} if none.
      * @param description
      *          Natural language description of the meaning of the code value, or {@code null} if none.
      */
@@ -330,8 +321,8 @@ public class ImmutableIdentifier extends
         value = properties.get(CODESPACE_KEY);
         if (value == null) {
             codeSpace = org.apache.sis.internal.util.Citations.getCodeSpace(authority);
-        } else if (value instanceof CharSequence) {
-            codeSpace = trimWhitespaces((CharSequence) value).toString();
+        } else if (value instanceof String) {
+            codeSpace = trimWhitespaces((String) value);
         } else {
             throw illegalPropertyType(properties, CODESPACE_KEY, value);
         }
@@ -385,11 +376,23 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Identifier code or name, optionally from a controlled list or pattern.
+     * The person or party responsible for maintenance of the namespace.
+     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
+     * but not necessarily.
+     *
+     * @return The authority, or {@code null} if not available.
+     */
+    @Override
+    public Citation getAuthority() {
+        return authority;
+    }
+
+    /**
+     * Alphanumeric value identifying an instance in the namespace.
      *
      * <div class="note"><b>Example:</b> {@code "4326"}.</div>
      *
-     * @return The code, never {@code null}.
+     * @return Value identifying an instance in the namespace (never {@code null}).
      *
      * @see org.apache.sis.referencing.NamedIdentifier#tip()
      */
@@ -399,12 +402,12 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Name or identifier of the person or organization responsible for namespace.
+     * Identifier or namespace in which the code is valid.
      * This is often the {@linkplain #getAuthority() authority}'s abbreviation, but not necessarily.
      *
      * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
      *
-     * @return The code space, or {@code null} if not available.
+     * @return Identifier or namespace in which the code is valid, or {@code null} if not available.
      *
      * @see org.apache.sis.referencing.NamedIdentifier#head()
      * @see org.apache.sis.referencing.NamedIdentifier#scope()
@@ -415,25 +418,13 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
-     * but not necessarily.
-     *
-     * @return The authority, or {@code null} if not available.
-     */
-    @Override
-    public Citation getAuthority() {
-        return authority;
-    }
-
-    /**
-     * Identifier of the version of the associated code space or code, as specified by the code authority.
-     * This version is included only when the {@linkplain #getCode() code} uses versions. When appropriate,
-     * the edition is identified by the effective date, coded using ISO 8601 date format.
+     * The version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode() code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * <div class="note"><b>Example:</b> the version of the underlying EPSG database.</div>
      *
-     * @return The version, or {@code null} if not available.
+     * @return The version identifier for the namespace, or {@code null} if none.
      */
     @Override
     public String getVersion() {
@@ -557,12 +548,14 @@ public class ImmutableIdentifier extends
                      * Other conventions format only for the ID[…] of root element.
                      */
                     if (isRoot && enclosing != null && convention != Convention.INTERNAL) {
-                        final String auth = NameMeaning.authority(cs);
-                        if (auth != null) {
-                            final String type = NameMeaning.toObjectType(enclosing.getClass());
-                            if (type != null) {
-                                formatter.append(new URI(type, auth, version, code));
-                            }
+                        final String urn = NameMeaning.toURN(enclosing.getClass(), cs, version, code);
+                        if (urn != null) {
+                            formatter.append(new FormattableObject() {
+                                @Override protected String formatTo(final Formatter formatter) {
+                                    formatter.append(urn, null);
+                                    return WKTKeywords.URI;
+                                }
+                            });
                         }
                     }
                 }
@@ -611,37 +604,6 @@ public class ImmutableIdentifier extends
         }
     }
 
-    /**
-     * The {@code URI[…]} element inside an {@code ID[…]}.
-     */
-    private static final class URI extends FormattableObject {
-        /** The components of the URI to format. */
-        private final String type, codeSpace, version, code;
-
-        /** Creates a new URI with the given components. */
-        URI(final String type, final String codeSpace, final String version, final String code) {
-            this.type      = type;
-            this.codeSpace = codeSpace;
-            this.version   = version;
-            this.code      = code;
-        }
-
-        /** Formats the URI. */
-        @Override
-        protected String formatTo(final Formatter formatter) {
-            final StringBuilder buffer = new StringBuilder(DefinitionURI.PREFIX)
-                    .append(DefinitionURI.SEPARATOR).append(type)
-                    .append(DefinitionURI.SEPARATOR).append(codeSpace)
-                    .append(DefinitionURI.SEPARATOR);
-            if (version != null) {
-                buffer.append(version);
-            }
-            buffer.append(DefinitionURI.SEPARATOR).append(code);
-            formatter.append(buffer.toString(), null);
-            return WKTKeywords.URI;
-        }
-    }
-
 
 
 

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -70,7 +70,7 @@ import static org.apache.sis.internal.ut
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class Citations extends Static {
@@ -115,11 +115,19 @@ public final class Citations extends Sta
      * This organization is responsible for maintainance of {@link #EPSG} database.
      *
      * <p>We do not expose this citation in public API because it is an organization rather than a reference
-     * to a document or a database (see SIS-200). However we need it as the authority of {@link #EPSG}.</p>
+     * to a document or a database (see SIS-200). For now we keep this citation mostly for resolving the legacy
+     * "OGP" identifier as "IOGP" (see the special case in fromName(String) method). This is also a way to share
+     * the same citation instance in GML like below:</p>
      *
+     * {@preformat xml
+     *   <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
+     * }
+     *
+     * @see #fromName(String)
+     * @see org.apache.sis.internal.jaxb.referencing.Code#getIdentifier()
      * @see <a href="http://issues.apache.org/jira/browse/SIS-200">SIS-200</a>
      */
-    static final Citation IOGP = new SimpleCitation("IOGP");
+    static final Citation IOGP = new CitationConstant(Constants.IOGP);
 
     /**
      * The authority for identifiers of objects defined by the
@@ -168,6 +176,8 @@ public final class Citations extends Sta
      * This value can be returned by:
      * <ul>
      *   <li>{@link org.apache.sis.metadata.iso.ImmutableIdentifier#getAuthority()}</li>
+     *   <li>{@link org.apache.sis.referencing.factory.sql.EPSGFactory#getAuthority()}
+     *       with the addition of version information.</li>
      * </ul>
      *
      * @since 0.4
@@ -175,6 +185,43 @@ public final class Citations extends Sta
     public static final IdentifierSpace<Integer> EPSG = new CitationConstant.Authority<>(Constants.EPSG);
 
     /**
+     * The authority for identifiers of objects defined by the
+     * <a href="http://www.opengeospatial.org/standards/wms">Web Map Service</a> (WMS) specification.
+     * The WMS 1.3 specifications is also known as ISO 19128
+     * <cite>Geographic Information — Web map server interface</cite> standard.
+     *
+     * <p>The citation {@linkplain DefaultCitation#getCitedResponsibleParties() responsible parties}
+     * are the OGC and ISO organizations.
+     * The {@linkplain IdentifierSpace#getName() namespace} declared by this constant is {@code "OGC"},
+     * but the {@code "CRS"}, {@code "AUTO"} and {@code "AUTO2"} namespaces are also commonly found in practice.</p>
+     *
+     * <div class="section">Main usage</div>
+     * This value can be returned by:
+     * <ul>
+     *   <li>{@link org.apache.sis.referencing.factory.CommonAuthorityFactory#getAuthority()}</li>
+     * </ul>
+     *
+     * @since 0.7
+     */
+    public static final IdentifierSpace<Integer> WMS = new WMS();
+
+    /**
+     * Special case for the {@link Citations#WMS} constant
+     * since it uses the same codespace than {@link Citations#OGC}.
+     */
+    private static final class WMS extends CitationConstant.Authority<Integer> {
+        private static final long serialVersionUID = -8490156477724003085L;
+
+        WMS() {
+            super("WMS");
+        }
+
+        @Override public String getName() {
+            return Constants.OGC;
+        }
+    }
+
+    /**
      * The authority for identifiers found in specifications from the
      * <a href="http://www.opengeospatial.org">Open Geospatial Consortium</a>.
      * The {@linkplain IdentifierSpace#getName() name} of this identifier space is fixed to {@code "OGC"}.
@@ -390,21 +437,22 @@ public final class Citations extends Sta
      * List of citations declared in this class.
      * Most frequently used citations (at least in SIS) should be first.
      */
-    private static final SimpleCitation[] CITATIONS = {
-        (SimpleCitation) EPSG,
-        (SimpleCitation) OGC,
-        (SimpleCitation) ESRI,
-        (SimpleCitation) NETCDF,
-        (SimpleCitation) GEOTIFF,
-        (SimpleCitation) PROJ4,
-        (SimpleCitation) MAP_INFO,
-        (SimpleCitation) S57,
-        (SimpleCitation) ISBN,
-        (SimpleCitation) ISSN,
-        (SimpleCitation) SIS,
-        (SimpleCitation) ISO_19115.get(0),
-        (SimpleCitation) ISO_19115.get(1),
-        (SimpleCitation) IOGP
+    private static final CitationConstant[] CITATIONS = {
+        (CitationConstant) EPSG,
+        (CitationConstant) WMS,
+        (CitationConstant) OGC,
+        (CitationConstant) ESRI,
+        (CitationConstant) NETCDF,
+        (CitationConstant) GEOTIFF,
+        (CitationConstant) PROJ4,
+        (CitationConstant) MAP_INFO,
+        (CitationConstant) S57,
+        (CitationConstant) ISBN,
+        (CitationConstant) ISSN,
+        (CitationConstant) SIS,
+        (CitationConstant) ISO_19115.get(0),
+        (CitationConstant) ISO_19115.get(1),
+        (CitationConstant) IOGP
     };
 
     static {  // Must be after CITATIONS array construction.
@@ -425,10 +473,8 @@ public final class Citations extends Sta
      * may have changed. This method notifies all citations that they will need to refresh their content.
      */
     static void refresh() {
-        for (final SimpleCitation citation : CITATIONS) {
-            if (citation instanceof CitationConstant) {
-                ((CitationConstant) citation).refresh();
-            }
+        for (final CitationConstant citation : CITATIONS) {
+            citation.refresh();
         }
     }
 
@@ -449,7 +495,7 @@ public final class Citations extends Sta
         if (identifier == null || ((identifier = CharSequences.trimWhitespaces(identifier)).isEmpty())) {
             return null;
         }
-        for (final SimpleCitation citation : CITATIONS) {
+        for (final CitationConstant citation : CITATIONS) {
             if (equalsFiltered(identifier, citation.title)) {
                 return citation;
             }
@@ -457,10 +503,12 @@ public final class Citations extends Sta
         if (equalsFiltered(identifier, "OGP")) {    // Old name of "IOGP" organization.
             return IOGP;
         }
+        if (equalsFiltered(identifier, Constants.CRS)) {
+            return WMS;
+        }
         /*
-         * If we found no match, org.apache.sis.internal.metadata.ServicesForUtility expects the default citation
-         * to be of this exact class: SimpleCitation (not a subclass). If the type of citation created below is
-         * modified, then we need to review ServicesForUtility.getCitationConstant(String) method body.
+         * If we found no match, org.apache.sis.internal.metadata.ServicesForUtility expects
+         * that we return anything that is not an instance of CitationConstant.
          */
         return new SimpleCitation(identifier);
     }
@@ -542,17 +590,26 @@ public final class Citations extends Sta
      * This method is useful for extracting a short designation of an authority (e.g. {@code "EPSG"})
      * for display purpose. This method performs the following choices:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li>If the given citation is {@code null}, then this method returns {@code null}.</li>
      *   <li>Otherwise if the collection of {@linkplain DefaultCitation#getIdentifiers() citation identifiers}
      *       contains at least one non-{@linkplain org.apache.sis.util.Deprecable#isDeprecated() deprecated}
      *       identifier, then:
      *     <ul>
-     *       <li>If the code and codespace of at least one non-deprecated identifier are
-     *           {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier unicode identifiers}, then
-     *           the <strong>first</strong> of those identifiers is returned in a {@code "[codespace:]code"} format.
-     *           Only the first character of the resulting string needs to be an
-     *           {@linkplain Character#isUnicodeIdentifierStart(int) identifier start character}.</li>
+     *       <li>If the <var>codespace</var> (if any) and the <var>code</var> of at least one non-deprecated identifier
+     *           are {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier valid Unicode identifiers}
+     *           (with relaxed rules regarding the code), then the <strong>first</strong> of those identifiers
+     *           is returned in a {@code "[codespace:]code"} format. If a <var>codespace</var> exists,
+     *           then the above restriction about the <var>code</var> is relaxed in two ways:
+     *         <ul>
+     *           <li>The code is allowed to start with a
+     *               Unicode identifier {@linkplain Character#isUnicodeIdentifierPart(int) part}
+     *               (not necessarily {@linkplain Character#isUnicodeIdentifierStart(int) start})
+     *               since the <var>codespace</var> already provides the start character.</li>
+     *           <li>The code is allowed to contain some other characters (currently {@code '.'} and {@code '-'})
+     *               commonly found in identifiers in the codespace managed by various authorities.</li>
+     *         </ul>
+     *       </li>
      *       <li>Otherwise the first non-empty and non-deprecated identifier is returned in a
      *           {@code "[codespace:]code"} format, despite not being a valid Unicode identifier.</li>
      *     </ul>
@@ -594,7 +651,7 @@ public final class Citations extends Sta
      * This method is useful for extracting a short designation of an authority (e.g. {@code "EPSG"})
      * for processing purpose. This method performs the following actions:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li>First, performs the same work than {@link #getIdentifier(Citation)} except that {@code '_'}
      *       is used instead of {@link org.apache.sis.util.iso.DefaultNameSpace#DEFAULT_SEPARATOR ':'}
      *       as the separator between the codespace and the code.</li>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -144,7 +144,7 @@ public final class Extents extends Stati
      * If the given {@code Extent} object contains more than one vertical extent, then this method
      * performs a choice based on the vertical datum and the unit of measurement:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li><p><b>Choice based on vertical datum</b><br>
      *   Only the extents associated (indirectly, through their CRS) to the same non-null {@link VerticalDatumType}
      *   will be taken in account. If all datum types are null, then this method conservatively uses only the first

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -20,6 +20,7 @@ import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;
 import org.opengis.referencing.ReferenceSystem;
+import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -31,7 +32,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5 (derived from 0.4)
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final strictfp class NameMeaningTest extends TestCase {
@@ -54,4 +55,16 @@ public final strictfp class NameMeaningT
         assertEquals("axis",            NameMeaning.toObjectType(CoordinateSystemAxis.class));
         assertEquals("referenceSystem", NameMeaning.toObjectType(ReferenceSystem     .class));
     }
+
+    /**
+     * Tests {@link NameMeaning#toURN(Class, String, String, String)}.
+     *
+     * @since 0.7
+     */
+    @Test
+    @DependsOnMethod("testToObjectType")
+    public void testToURN() {
+        assertEquals("urn:ogc:def:crs:OGC:1.3:CRS84", NameMeaning.toURN(GeographicCRS.class, "CRS",  null,   "84"));
+        assertEquals("urn:ogc:def:datum:EPSG::6326",  NameMeaning.toURN(GeodeticDatum.class, "EPSG", null, "6326"));
+    }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -25,6 +25,8 @@ import org.apache.sis.metadata.iso.exten
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
 import org.apache.sis.measure.Units;
 import org.apache.sis.internal.util.X364;
+
+// Test imports
 import org.apache.sis.test.mock.VerticalCRSMock;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -21,6 +21,8 @@ import org.opengis.referencing.cs.Spheri
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.apache.sis.internal.metadata.AxisNames;
+
+// Test imports
 import org.apache.sis.test.mock.CoordinateSystemAxisMock;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.metadata.iso.citation;
 
+import java.util.List;
 import java.util.Locale;
 import java.lang.reflect.Field;
 import org.opengis.metadata.Identifier;
@@ -36,7 +37,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final strictfp class CitationsTest extends TestCase {
@@ -64,6 +65,8 @@ public final strictfp class CitationsTes
         assertSame(ISSN,             fromName("ISSN"));
         assertSame(ISO_19115.get(0), fromName("ISO 19115-1"));
         assertSame(ISO_19115.get(1), fromName("ISO 19115-2"));
+        assertSame(WMS,              fromName("WMS"));
+        assertSame(WMS,              fromName(Constants.CRS));
         /*
          * Verify again, but using reflection for making sure that the field names
          * are consistent and that we did not forgot any citation constant.
@@ -84,6 +87,7 @@ public final strictfp class CitationsTes
     public void testGetIdentifier() {
         assertEquals("SIS",         getIdentifier(SIS));
         assertEquals("OGC",         getIdentifier(OGC));
+        assertEquals("IOGP",        getIdentifier(IOGP));
         assertEquals("EPSG",        getIdentifier(EPSG));
         assertEquals("ESRI",        getIdentifier(ESRI));
         assertEquals("NetCDF",      getIdentifier(NETCDF));
@@ -95,6 +99,11 @@ public final strictfp class CitationsTes
         assertEquals("S-57",        getIdentifier(S57));    // Not a valid Unicode identifier.
         assertEquals("ISO:19115-1", getIdentifier(ISO_19115.get(0)));  // The ':' separator is not usual in ISO references
         assertEquals("ISO:19115-2", getIdentifier(ISO_19115.get(1)));  // and could be changed in future SIS versions.
+        assertEquals("OGC:WMS",     getIdentifier(WMS));
+        assertIdentifierEquals("OGC:06-042", null, "OGC", null, "06-042",
+                ((List<? extends Identifier>) WMS.getIdentifiers()).get(1));
+        assertIdentifierEquals("ISO:19128", null, "ISO", "2005", "19128",
+                ((List<? extends Identifier>) WMS.getIdentifiers()).get(2));
     }
 
     /**
@@ -106,6 +115,7 @@ public final strictfp class CitationsTes
     public void testGetUnicodeIdentifier() {
         assertEquals("SIS",         getUnicodeIdentifier(SIS));
         assertEquals("OGC",         getUnicodeIdentifier(OGC));
+        assertEquals("IOGP",        getUnicodeIdentifier(IOGP));
         assertEquals("EPSG",        getUnicodeIdentifier(EPSG));
         assertEquals("ESRI",        getUnicodeIdentifier(ESRI));
         assertEquals("NetCDF",      getUnicodeIdentifier(NETCDF));
@@ -115,6 +125,7 @@ public final strictfp class CitationsTes
         assertEquals("ISSN",        getUnicodeIdentifier(ISSN));
         assertNull  ("Proj4",       getUnicodeIdentifier(PROJ4));      // Not yet publicly declared as an identifier.
         assertNull  ("S57",         getUnicodeIdentifier(S57));        // Not yet publicly declared as an identifier.
+        assertEquals("OGC_WMS",     getUnicodeIdentifier(WMS));
         assertNull  ("ISO_19115-1", getUnicodeIdentifier(ISO_19115.get(0)));  // Not a valid Unicode identifier.
         assertNull  ("ISO_19115-2", getUnicodeIdentifier(ISO_19115.get(1)));
     }
@@ -127,7 +138,9 @@ public final strictfp class CitationsTes
     @DependsOnMethod("testGetUnicodeIdentifier")
     public void testGetCodeSpace() {
         assertEquals("SIS",         org.apache.sis.internal.util.Citations.getCodeSpace(SIS));
+        assertEquals("OGC",         org.apache.sis.internal.util.Citations.getCodeSpace(WMS));
         assertEquals("OGC",         org.apache.sis.internal.util.Citations.getCodeSpace(OGC));
+        assertEquals("IOGP",        org.apache.sis.internal.util.Citations.getCodeSpace(IOGP));
         assertEquals("EPSG",        org.apache.sis.internal.util.Citations.getCodeSpace(EPSG));
         assertEquals("ESRI",        org.apache.sis.internal.util.Citations.getCodeSpace(ESRI));
         assertEquals("NetCDF",      org.apache.sis.internal.util.Citations.getCodeSpace(NETCDF));
@@ -147,7 +160,8 @@ public final strictfp class CitationsTes
     @Test
     public void testGetTitles() {
         assertTitleEquals("SIS",     "Apache Spatial Information System",    SIS);
-        assertTitleEquals("OGC",     "Identifier in OGC namespace",          OGC);
+        assertTitleEquals("WMS",     "Web Map Server",                       WMS);
+        assertTitleEquals("OGC",     "Identifiers in OGC namespace",         OGC);
         assertTitleEquals("EPSG",    "EPSG Geodetic Parameter Dataset",      EPSG);
         assertTitleEquals("ISBN",    "International Standard Book Number",   ISBN);
         assertTitleEquals("ISSN",    "International Standard Serial Number", ISSN);
@@ -157,6 +171,7 @@ public final strictfp class CitationsTes
         assertTitleEquals("S57",     "S-57",                                 S57);
         assertTitleEquals("ISO_19115", "Geographic Information — Metadata Part 1: Fundamentals", ISO_19115.get(0));
         assertTitleEquals("ISO_19115", "Geographic Information — Metadata Part 2: Extensions for imagery and gridded data", ISO_19115.get(1));
+        assertEquals     ("ISO_19128", "Geographic Information — Web map server interface", getSingleton(WMS.getAlternateTitles()).toString());
     }
 
     /**
@@ -168,6 +183,7 @@ public final strictfp class CitationsTes
         assertEquals("International Organization for Standardization",   getCitedResponsibleParty(ISO_19115.get(0)));
         assertEquals("International Organization for Standardization",   getCitedResponsibleParty(ISO_19115.get(1)));
         assertEquals("International Association of Oil & Gas producers", getCitedResponsibleParty(EPSG));
+        assertEquals("International Association of Oil & Gas producers", getCitedResponsibleParty(IOGP));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -103,7 +103,7 @@ public final class Code {
         Citation authority = null;
         String version = null, cs = codeSpace;
         final DefinitionURI parsed = DefinitionURI.parse(c);
-        if (parsed != null) {
+        if (parsed != null && parsed.code != null) {
             /*
              * Case where the URN has been successfully parsed. The OGC's URN contains an "authority" component,
              * which we take as the Identifier.codeSpace value (not Identifier.authority despite what the names
@@ -193,9 +193,7 @@ public final class Code {
              */
             if (fallback != null) {
                 if (!isHTTP) {
-                    final String urn = DefinitionURI.format(NameMeaning.toObjectType(type),
-                                                            NameMeaning.authority(fallback.getCodeSpace()),
-                                                            fallback.getVersion(), fallback.getCode());
+                    final String urn = NameMeaning.toURN(type, fallback.getCodeSpace(), fallback.getVersion(), fallback.getCode());
                     if (urn != null) {
                         final Code code = new Code();
                         /*

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1726717&r1=1726716&r2=1726717&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] Tue Jan 26 00:12:35 2016
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import javax.measure.unit.NonSI;
 import org.opengis.util.FactoryException;
-import org.opengis.util.NoSuchIdentifierException;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.AxisDirection;
@@ -41,11 +40,9 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.crs.EngineeringCRS;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.extent.GeographicBoundingBox;
-import org.apache.sis.internal.util.DefinitionURI;
 import org.apache.sis.internal.metadata.AxisDirections;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.referencing.cs.DefaultVerticalCS;
 import org.apache.sis.referencing.cs.DefaultEllipsoidalCS;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
@@ -53,9 +50,6 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.crs.DefaultCompoundCRS;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.util.ArgumentChecks;
-import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.Static;
 
@@ -146,40 +140,7 @@ public final class CRS extends Static {
             throws NoSuchAuthorityCodeException, FactoryException
     {
         ArgumentChecks.ensureNonNull("code", code);
-        final String authority;
-        final String value;
-        final DefinitionURI uri = DefinitionURI.parse(code);
-        if (uri != null) {
-            final String type = uri.type;
-            if (type != null && !type.equalsIgnoreCase("crs")) {
-                throw new NoSuchIdentifierException(Errors.format(Errors.Keys.UnknownType_1, type), type);
-            }
-            authority = uri.authority;
-            value = uri.code;
-        } else {
-            final int s = code.indexOf(DefinitionURI.SEPARATOR);
-            authority = CharSequences.trimWhitespaces(code.substring(0, Math.max(0, s)));
-            value = CharSequences.trimWhitespaces(code.substring(s + 1));
-        }
-        if (authority == null || authority.isEmpty()) {
-            throw new NoSuchIdentifierException(Errors.format(Errors.Keys.MissingAuthority_1, code), code);
-        }
-        /*
-         * Delegate to the factory for the code space of the given code. If no authority factory
-         * is available, or if the factory failed to create the CRS, delegate to CommonCRS. Note
-         * that CommonCRS is not expected to succeed if the real EPSG factory threw an exception,
-         * so we will log a message at the warning level in such case.
-         */
-        final CRSAuthorityFactory factory = DefaultFactories.forClass(CRSAuthorityFactory.class);
-        if (factory != null) try {
-            return factory.createCoordinateReferenceSystem(value);
-        } catch (FactoryException failure) {
-            final CoordinateReferenceSystem crs = CommonCRS.forCode(authority, value, failure);
-            Logging.unexpectedException(Logging.getLogger(Loggers.CRS_FACTORY), CRS.class, "forCode", failure); // See above comment.
-            return crs;
-        } else {
-            return CommonCRS.forCode(authority, value, null);
-        }
+        return AuthorityFactories.ALL.createCoordinateReferenceSystem(code);
     }
 
     /**
@@ -291,6 +252,7 @@ public final class CRS extends Static {
          */
         final boolean isGeodetic = (crs instanceof GeodeticCRS);
         if (isGeodetic || crs instanceof ProjectedCRS || crs instanceof EngineeringCRS) {
+            @SuppressWarnings("null")
             final CoordinateSystem cs = crs.getCoordinateSystem();
             if (cs.getDimension() == 2) {
                 return !isGeodetic || (cs instanceof EllipsoidalCS);



Mime
View raw message