sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1747815 [1/2] - in /sis/branches/JDK8: application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ application/sis-openoffice/src/main/unopkg/ application/sis-openoffice/src/main/unopkg/META-INF/ application/sis-openoffice/src/main...
Date Fri, 10 Jun 2016 23:50:14 GMT
Author: desruisseaux
Date: Fri Jun 10 23:50:13 2016
New Revision: 1747815

URL: http://svn.apache.org/viewvc?rev=1747815&view=rev
Log:
Refactor the OpenOffice addins using a XCU file for function descriptions instead than hard-coded values in Java.
The hard-coded way was legacy from OpenOffice.org 2.0 days.

Added:
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java
      - copied, changed from r1747814, sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Referencing.java
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu   (with props)
    sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingFunctionsTest.java
      - copied, changed from r1747814, sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingTest.java
Removed:
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/MethodInfo.java
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Referencing.java
    sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingTest.java
Modified:
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/CalcAddins.java
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Transformer.java
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.idl
    sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.java
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/META-INF/manifest.xml
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/build-instruction.html
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/description.xml
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/org/apache/sis/openoffice/XReferencing.class
    sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/sis.rdb
    sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/TransformerTest.java
    sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/test/suite/OpenOfficeTestSuite.java
    sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/CalcAddins.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/CalcAddins.java?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/CalcAddins.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/CalcAddins.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -16,23 +16,16 @@
  */
 package org.apache.sis.openoffice;
 
-import java.util.Map;
 import java.util.Arrays;
-import java.util.HashMap;
-import java.util.TimeZone;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.logging.LogRecord;
 
-import com.sun.star.sheet.XAddIn;
-import com.sun.star.util.Date;
 import com.sun.star.lang.Locale;
+import com.sun.star.lang.XLocalizable;
 import com.sun.star.lang.XServiceInfo;
 import com.sun.star.lang.XServiceName;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.XComponentContext;
 import com.sun.star.lib.uno.helper.WeakBase;
 
 import org.apache.sis.util.Classes;
@@ -49,7 +42,7 @@ import org.apache.sis.util.collection.Ba
  * @version 0.8
  * @module
  */
-public abstract class CalcAddins extends WeakBase implements XAddIn, XServiceName, XServiceInfo {
+public abstract class CalcAddins extends WeakBase implements XServiceName, XServiceInfo, XLocalizable {
     /**
      * {@code true} for throwing an exception in case of failure, or {@code false} for returning {@code NaN} instead.
      * This apply only to numerical computations; formulas returning a text value will returns the exception message
@@ -58,21 +51,10 @@ public abstract class CalcAddins extends
     static final boolean THROW_EXCEPTION = true;
 
     /**
-     * Factor for conversions of days to milliseconds.
-     * Used for date conversions as in {@link #toDate(XPropertySet, double)}.
+     * Indirectly provides access to the service manager.
+     * For example {@code com.sun.star.sdb.DatabaseContext} holds databases registered with OpenOffice.
      */
-    static final long DAY_TO_MILLIS = 24*60*60*1000L;
-
-    /**
-     * The name of the provided service.
-     */
-    static final String ADDIN_SERVICE = "com.sun.star.sheet.AddIn";
-
-    /**
-     * Informations about exported methods.
-     * This map shall be populated at construction time and be unmodified after construction.
-     */
-    final Map<String,MethodInfo> methods;
+    protected final XComponentContext context;
 
     /**
      * Locale attribute required by {@code com.sun.star.lang.XLocalizable} interface.
@@ -86,71 +68,35 @@ public abstract class CalcAddins extends
     private transient java.util.Locale javaLocale;
 
     /**
-     * The calendar to uses for date conversions. Will be created only when first needed.
-     */
-    private transient Calendar calendar;
-
-    /**
      * The logger, fetched when first needed.
      */
-    private static Logger logger;
+    private transient Logger logger;
 
     /**
-     * Default constructor. Subclass constructors need to add entries in the {@link #methods} map.
-     */
-    CalcAddins() {
-        methods = new HashMap<>();
-    }
-
-    /**
-     * Sets the locale to be used by this object.
+     * Constructs add-ins for Calc.
      *
-     * @param locale the new locale.
+     * @param context  the value to assign to the {@link #context} field.
      */
-    @Override
-    public final synchronized void setLocale(final Locale locale) {
-        this.locale = locale;
-        javaLocale = null;
+    protected CalcAddins(final XComponentContext context) {
+        this.context = context;
     }
 
     /**
-     * Returns the current locale used by this instance.
+     * The service name that can be used to create such an object by a factory.
      *
-     * @return the current locale.
+     * @return the service name.
      */
     @Override
-    public final synchronized Locale getLocale() {
-        return locale;
-    }
-
-    /**
-     * Returns the locale as an object from the Java standard SDK.
-     *
-     * @return the current locale.
-     */
-    protected final synchronized java.util.Locale getJavaLocale() {
-        if (javaLocale == null) {
-            if (locale != null) {
-                String language = locale.Language; if (language == null) language = "";
-                String country  = locale.Country;  if (country  == null) country  = "";
-                String variant  = locale.Variant;  if (variant  == null) variant  = "";
-                javaLocale = new java.util.Locale(language, country, variant);
-            } else {
-                javaLocale = java.util.Locale.getDefault();
-            }
-        }
-        return javaLocale;
-    }
+    public abstract String getServiceName();
 
     /**
-     * Provides the supported service names of the implementation,
-     * including also indirect service names.
+     * Provides the supported service names of the implementation, including also indirect service names.
      *
      * @return sequence of service names that are supported.
      */
     @Override
     public final String[] getSupportedServiceNames() {
-        return new String[] {ADDIN_SERVICE, getServiceName()};
+        return new String[] {getServiceName()};
     }
 
     /**
@@ -161,227 +107,50 @@ public abstract class CalcAddins extends
      */
     @Override
     public final boolean supportsService(final String name) {
-        return name.equals(ADDIN_SERVICE) || name.equals(getServiceName());
-    }
-
-    /**
-     * The service name that can be used to create such an object by a factory.
-     * This is defined as a field in the subclass with exactly the following signature:
-     *
-     * {@preformat java
-     *     private static final String __serviceName;
-     * }
-     *
-     * @return the service name.
-     */
-    @Override
-    public abstract String getServiceName();
-
-    /**
-     * Provides the implementation name of the service implementation.
-     *
-     * @return unique name of the implementation.
-     */
-    @Override
-    public final String getImplementationName() {
-        return getClass().getName();
-    }
-
-    /**
-     * Returns the programmatic name of the category the function belongs to.
-     * The category name is used to group similar functions together.
-     * The programmatic category name should always be in English, it is never shown to the user.
-     * It is usually one of the names listed in {@code com.sun.star.sheet.XAddIn} interface.
-     *
-     * @param  function the exact name of a method within its interface.
-     * @return the category name the specified function belongs to.
-     */
-    @Override
-    public final String getProgrammaticCategoryName(final String function) {
-        final MethodInfo info = methods.get(function);
-        return (info != null) ? info.category : "Add-In";
+        return name.equals(getServiceName());
     }
 
     /**
-     * Returns the user-visible name of the category the function belongs to.
-     * This is used when category names are shown to the user.
-     *
-     * @param  function  the exact name of a method within its interface.
-     * @return the user-visible category name the specified function belongs to.
-     */
-    @Override
-    public final String getDisplayCategoryName(final String function) {
-        return getProgrammaticCategoryName(function);
-    }
-
-    /**
-     * Returns the internal function name for an user-visible name. The user-visible name of a function
-     * is the name shown to the user. It may be translated to the {@linkplain #getLocale() current locale},
-     * so it is never stored in files. It should be a single word and is used when entering or displaying formulas.
-     *
-     * <p>Attention: The method name contains a spelling error.
-     * Due to compatibility reasons the name cannot be changed.</p>
-     *
-     * @param  display the user-visible name of a function.
-     * @return the exact name of the method within its interface.
-     */
-    @Override
-    public final String getProgrammaticFuntionName(final String display) {
-        for (final Map.Entry<String,MethodInfo> entry : methods.entrySet()) {
-            if (display.equals(entry.getValue().display)) {
-                return entry.getKey();
-            }
-        }
-        return "";
-    }
-
-    /**
-     * Returns the user-visible function name for an internal name.
-     * The user-visible name of a function is the name shown to the user.
-     * It may be translated to the {@linkplain #getLocale() current locale}, so it is never stored in files.
-     * It should be a single word and is used when entering or displaying formulas.
-     *
-     * @param  function  the exact name of a method within its interface.
-     * @return the user-visible name of the specified function.
-     */
-    @Override
-    public final String getDisplayFunctionName(final String function) {
-        final MethodInfo info = methods.get(function);
-        return (info != null) ? info.display : "";
-    }
-
-    /**
-     * Returns the description of a function.
-     * The description is shown to the user when selecting functions.
-     * It may be translated to the {@linkplain #getLocale() current locale}.
-     *
-     * @param  function the exact name of a method within its interface.
-     * @return the description of the specified function.
-     */
-    @Override
-    public final String getFunctionDescription(final String function) {
-        final MethodInfo info = methods.get(function);
-        return (info != null) ? info.description : "";
-    }
-
-    /**
-     * Returns the user-visible name of the specified argument.
-     * The argument name is shown to the user when prompting for arguments.
-     * It should be a single word and may be translated to the {@linkplain #getLocale() current locale}.
+     * Sets the locale to be used by this object.
      *
-     * @param  function  the exact name of a method within its interface.
-     * @param  argument  the index of the argument (0-based).
-     * @return the user-visible name of the specified argument.
+     * @param locale the new locale.
      */
     @Override
-    public final String getDisplayArgumentName(final String function, int argument) {
-        final MethodInfo info = methods.get(function);
-        if (info != null) {
-            argument <<= 1;
-            final String[] arguments = info.arguments;
-            if (argument >= 0 && argument < arguments.length) {
-                return arguments[argument];
-            }
-        }
-        return "";
+    public final synchronized void setLocale(final Locale locale) {
+        this.locale = locale;
+        javaLocale = null;
     }
 
     /**
-     * Returns the description of the specified argument.
-     * The argument description is shown to the user when prompting for arguments.
-     * It may be translated to the {@linkplain #getLocale() current locale}.
+     * Returns the current locale used by this instance.
      *
-     * @param  function  the exact name of a method within its interface.
-     * @param  argument  the index of the argument (0-based).
-     * @return the description of the specified argument.
+     * @return the current locale.
      */
     @Override
-    public final String getArgumentDescription(final String function, int argument) {
-        final MethodInfo info = methods.get(function);
-        if (info != null) {
-            argument = (argument << 1) + 1;
-            final String[] arguments = info.arguments;
-            if (argument >= 0 && argument < arguments.length) {
-                return arguments[argument];
-            }
+    public final synchronized Locale getLocale() {
+        if (locale == null) {
+            locale = new Locale();
         }
-        return "";
+        return locale;
     }
 
     /**
-     * Sets the timezone for time values to be provided to {@link #toDate(XPropertySet, double)}.
-     * If this method is never invoked, then the default timezone is the locale one.
+     * Returns the locale as an object from the Java standard SDK.
      *
-     * @param timezone the new timezone.
+     * @return the current locale.
      */
-    protected final void setTimeZone(final String timezone) {
-        final TimeZone tz = TimeZone.getTimeZone(timezone);
-        synchronized (this) {
-            if (calendar == null) {
-                calendar = new GregorianCalendar(tz);
+    protected final synchronized java.util.Locale getJavaLocale() {
+        if (javaLocale == null) {
+            if (locale != null) {
+                String language = locale.Language; if (language == null) language = "";
+                String country  = locale.Country;  if (country  == null) country  = "";
+                String variant  = locale.Variant;  if (variant  == null) variant  = "";
+                javaLocale = new java.util.Locale(language, country, variant);
             } else {
-                calendar.setTimeZone(tz);
-            }
-        }
-    }
-
-    /**
-     * Returns the spreadsheet epoch.
-     * The timezone is the one specified during the last invocation of {@link #setTimeZone(String)}.
-     * The epoch is used for date conversions as in {@link #toDate(XPropertySet, double)}.
-     *
-     * @param  xOptions  provided by OpenOffice.
-     * @return the spreadsheet epoch as a new Java Date object, or {@code null}.
-     */
-    protected final java.util.Date getEpoch(final XPropertySet xOptions) {
-        final Date date;
-        try {
-            date = (Date) AnyConverter.toObject(Date.class, xOptions.getPropertyValue("NullDate"));
-        } catch (Exception e) {     // Too many possible exceptions for enumerating all of them.
-            reportException("getEpoch", e, THROW_EXCEPTION);
-            return null;
-        }
-        synchronized (this) {
-            if (calendar == null) {
-                calendar = new GregorianCalendar();
+                javaLocale = java.util.Locale.getDefault();
             }
-            calendar.clear();
-            calendar.set(date.Year, date.Month-1, date.Day);
-            return calendar.getTime();
-        }
-    }
-
-    /**
-     * Converts a date from a spreadsheet value to a Java {@link java.util.Date} object.
-     * The timezone is the one specified during the last invocation of {@link #setTimeZone(String)}.
-     *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  time      the spreadsheet numerical value for a date, by default in the local timezone.
-     * @return the date as a Java object.
-     */
-    protected final java.util.Date toDate(final XPropertySet xOptions, final double time) {
-        final java.util.Date date = getEpoch(xOptions);
-        if (date != null) {
-            date.setTime(date.getTime() + Math.round(time * DAY_TO_MILLIS));
-        }
-        return date;
-    }
-
-    /**
-     * Converts a date from a Java {@link java.util.Date} object to a spreadsheet value.
-     * The timezone is the one specified during the last invocation of {@link #setTimeZone(String)}.
-     *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  time      the date as a Java object.
-     * @return the spreadsheet numerical value for a date, by default in the local timezone.
-     */
-    protected final double toDouble(final XPropertySet xOptions, final java.util.Date time) {
-        final java.util.Date epoch = getEpoch(xOptions);
-        if (epoch != null) {
-            return (time.getTime() - epoch.getTime()) / (double) DAY_TO_MILLIS;
-        } else {
-            return Double.NaN;
         }
+        return javaLocale;
     }
 
     /**
@@ -470,7 +239,7 @@ public abstract class CalcAddins extends
      *
      * @return the logger to use.
      */
-    protected static synchronized Logger getLogger() {
+    protected final synchronized Logger getLogger() {
         if (logger == null) {
             logger = Logging.getLogger(Registration.LOGGER);
         }

Copied: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java (from r1747814, sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Referencing.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java?p2=sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java&p1=sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Referencing.java&r1=1747814&r2=1747815&rev=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Referencing.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -29,7 +29,8 @@ import org.opengis.referencing.cs.Coordi
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
-import com.sun.star.beans.XPropertySet;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.XComponentContext;
 import com.sun.star.lang.IllegalArgumentException;
 
 import org.apache.sis.metadata.iso.extent.Extents;
@@ -56,76 +57,44 @@ import org.apache.sis.storage.DataStoreE
  * @version 0.8
  * @module
  */
-public class Referencing extends CalcAddins implements XReferencing {
+public class ReferencingFunctions extends CalcAddins implements XReferencing {
     /**
      * The name for the registration of this component.
-     * <strong>NOTE:</strong> OpenOffice expects a field with exactly that name; do not rename!
      */
-    public static final String __serviceName = "org.apache.sis.openoffice.Referencing";
+    static final String SERVICE_NAME = "org.apache.sis.openoffice.Referencing";
 
     /**
-     * Constructs a default implementation of {@code XReferencing} interface.
+     * The implementation name, which shall be the {@link ReferencingFunctions} class name.
      */
-    public Referencing() {
-        methods.put("getName", new MethodInfo("Referencing", "CRS.NAME",
-            "Returns a description for an object identified by the given authority code.",
-            new String[] {
-                "xOptions",   "Provided by OpenOffice.",
-                "code",       "The code allocated by authority."
-        }));
-        methods.put("getGeographicArea", new MethodInfo("Referencing", "GEOGRAPHIC.AREA",
-            "Returns the valid area as a geographic bounding box for an identified object.",
-            new String[] {
-                "xOptions",   "Provided by OpenOffice.",
-                "code",       "The code allocated by authority."
-        }));
-        methods.put("getAxis", new MethodInfo("Referencing", "CRS.AXIS",
-            "Returns the axis name for the specified dimension in an identified object.",
-            new String[] {
-                "xOptions",   "Provided by OpenOffice.",
-                "code",       "The code allocated by authority.",
-                "dimension",  "The dimension (1, 2, …)."
-        }));
-        methods.put("getAccuracy", new MethodInfo("Referencing", "TRANSFORM.ACCURACY",
-            "Returns the accuracy of a transformation between two coordinate reference systems.",
-            new String[] {
-                "xOptions",    "Provided by OpenOffice.",
-                "source CRS",  "The source coordinate reference system.",
-                "target CRS",  "The target coordinate reference system.",
-                "coordinates", "The coordinate values to transform."
-        }));
-        methods.put("transform", new MethodInfo("Referencing", "TRANSFORM.POINTS",
-            "Transform coordinates from the given source CRS to the given target CRS.",
-            new String[] {
-                "xOptions",    "Provided by OpenOffice.",
-                "source CRS",  "The source coordinate reference system.",
-                "target CRS",  "The target coordinate reference system.",
-                "coordinates", "The coordinate values to transform."
-        }));
-        methods.put("parseAngle", new MethodInfo("Text", "VALUE.ANGLE",
-            "Converts text in degrees-minutes-seconds to an angle in decimal degrees.",
-            new String[] {
-                "xOptions",   "Provided by OpenOffice.",
-                "text",       "The text to be converted to an angle.",
-                "pattern",    "The text that describes the format (example: \"D°MM.m'\")."
-        }));
-        methods.put("formatAngle", new MethodInfo("Text", "TEXT.ANGLE",
-            "Converts an angle to text according to a given format.",
-            new String[] {
-                "xOptions",   "Provided by OpenOffice.",
-                "value",      "The angle value (in decimal degrees) to be converted.",
-                "pattern",    "The text that describes the format (example: \"D°MM.m'\")."
-        }));
+    static final String IMPLEMENTATION_NAME = "org.apache.sis.openoffice.ReferencingFunctions";
+
+    /**
+     * Constructs an implementation of {@code XReferencing} interface.
+     *
+     * @param context  the value to assign to the {@link #context} field.
+     */
+    public ReferencingFunctions(final XComponentContext context) {
+        super(context);
     }
 
     /**
      * The service name that can be used to create such an object by a factory.
      *
-     * @return value of {@code __serviceName}.
+     * @return unique name of the service.
      */
     @Override
     public String getServiceName() {
-        return __serviceName;
+        return SERVICE_NAME;
+    }
+
+    /**
+     * Provides the implementation name of the service.
+     *
+     * @return unique name of the implementation.
+     */
+    @Override
+    public String getImplementationName() {
+        return IMPLEMENTATION_NAME;
     }
 
     /**
@@ -190,12 +159,11 @@ public class Referencing extends CalcAdd
     /**
      * Returns the identified object name from an authority code.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @return the object name.
      */
     @Override
-    public String getName(final XPropertySet xOptions, final String codeOrPath) {
+    public String getName(final String codeOrPath) {
         final InternationalString name;
         try {
             final IdentifiedObject object;
@@ -221,13 +189,12 @@ public class Referencing extends CalcAdd
      * This method returns a short axis name as used in Well Known Text (WKT) format, for example <cite>"Latitude"</cite>
      * instead of <cite>"Geodetic latitude"</cite>.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @param  dimension   the dimension (1, 2, …).
      * @return the name of the requested axis.
      */
     @Override
-    public String getAxis(final XPropertySet xOptions, final String codeOrPath, final int dimension) {
+    public String getAxis(final String codeOrPath, final int dimension) {
         final CacheKey<String> key = new CacheKey<>(String.class, codeOrPath, dimension, null);
         String name = key.peek();
         if (name == null) {
@@ -286,12 +253,11 @@ public class Referencing extends CalcAdd
      * and the second row contains the latitude and longitude of bottom right corner.
      * Units are degrees.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @return the object bounding box.
      */
     @Override
-    public double[][] getGeographicArea(final XPropertySet xOptions, final String codeOrPath) {
+    public double[][] getGeographicArea(final String codeOrPath) {
         final CacheKey<GeographicBoundingBox> key = new CacheKey<>(GeographicBoundingBox.class, codeOrPath, null, null);
         GeographicBoundingBox area = key.peek();
         if (area == null) {
@@ -341,18 +307,37 @@ public class Referencing extends CalcAdd
     /**
      * Returns the accuracy of a transformation between two coordinate reference systems.
      *
-     * @param  xOptions   provided by OpenOffice.
      * @param  sourceCRS  the authority code for the source coordinate reference system.
      * @param  targetCRS  the authority code for the target coordinate reference system.
      * @param  points     the coordinates to transform (for computing area of interest).
+     * @throws IllegalArgumentException if {@code points} is not a {@code double[][]} value or void.
      * @return the operation accuracy.
      */
     @Override
-    public double getAccuracy(final XPropertySet xOptions,
-            final String sourceCRS, final String targetCRS, final double[][] points)
+    public double getAccuracy(final String sourceCRS, final String targetCRS, final Object points)
+            throws IllegalArgumentException
     {
+        final double[][] coordinates;
+        if (AnyConverter.isVoid(points)) {
+            coordinates = null;
+        } else if (points instanceof double[][]) {
+            coordinates = (double[][]) points;
+        } else if (points instanceof Object[][]) {
+            final Object[][] values = (Object[][]) points;
+            coordinates = new double[values.length][];
+            for (int j=0; j<values.length; j++) {
+                final Object[] row = values[j];
+                final double[] coord = new double[row.length];
+                for (int i=0; i<row.length; i++) {
+                    coord[i] = AnyConverter.toDouble(row[i]);
+                }
+                coordinates[j] = coord;
+            }
+        } else {
+            throw new IllegalArgumentException();
+        }
         try {
-            return new Transformer(this, getCRS(sourceCRS), targetCRS, points).getAccuracy();
+            return new Transformer(this, getCRS(sourceCRS), targetCRS, coordinates).getAccuracy();
         } catch (Exception exception) {
             reportException("getAccuracy", exception, THROW_EXCEPTION);
             return Double.NaN;
@@ -362,22 +347,19 @@ public class Referencing extends CalcAdd
     /**
      * Transforms coordinates from the specified source CRS to the specified target CRS.
      *
-     * @param  xOptions   provided by OpenOffice.
      * @param  sourceCRS  the authority code for the source coordinate reference system.
      * @param  targetCRS  the authority code for the target coordinate reference system.
      * @param  points     the coordinates to transform.
      * @return The transformed coordinates.
      */
     @Override
-    public double[][] transformCoordinates(final XPropertySet xOptions,
-            final String sourceCRS, final String targetCRS, final double[][] points)
-    {
+    public double[][] transformPoints(final String sourceCRS, final String targetCRS, final double[][] points) {
         if (points == null || points.length == 0) {
             return new double[][] {};
         } else try {
             return new Transformer(this, getCRS(sourceCRS), targetCRS, points).transform(points);
         } catch (Exception exception) {
-            reportException("transformCoordinates", exception, THROW_EXCEPTION);
+            reportException("transformPoints", exception, THROW_EXCEPTION);
             return getFailure(points.length, 2);
         }
     }
@@ -386,18 +368,13 @@ public class Referencing extends CalcAdd
      * Converts text in degrees-minutes-seconds to an angle in decimal degrees.
      * See {@link org.apache.sis.measure.AngleFormat} for pattern description.
      *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  text      the text to be converted to an angle.
-     * @param  pattern   an optional text that describes the format (example: "D°MM.m'").
+     * @param  text     the text to be converted to an angle.
+     * @param  pattern  an optional text that describes the format (example: "D°MM.m'").
      * @return the angle parsed as a number.
-     * @throws IllegalArgumentException if {@code pattern} is illegal.
+     * @throws IllegalArgumentException if {@code pattern} is not a string value or void.
      */
     @Override
-    public double parseAngle(final XPropertySet xOptions,
-                             final String       text,
-                             final Object       pattern)
-            throws IllegalArgumentException
-    {
+    public double parseAngle(final String text, final Object pattern) throws IllegalArgumentException {
         try {
             return new AnglePattern(pattern).parse(text, getJavaLocale());
         } catch (ParseException exception) {
@@ -415,18 +392,13 @@ public class Referencing extends CalcAdd
      *   <li>If the pattern ends with N or S, then the angle is formatted as a latitude.</li>
      * </ul>
      *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  value     the angle value (in decimal degrees) to be converted.
-     * @param  pattern   an optional text that describes the format (example: "D°MM.m'").
+     * @param  value    the angle value (in decimal degrees) to be converted.
+     * @param  pattern  an optional text that describes the format (example: "D°MM.m'").
      * @return the angle formatted as a string.
-     * @throws IllegalArgumentException if {@code pattern} is illegal.
+     * @throws IllegalArgumentException if {@code pattern} is not a string value or void.
      */
     @Override
-    public String formatAngle(final XPropertySet xOptions,
-                              final double       value,
-                              final Object       pattern)
-            throws IllegalArgumentException
-    {
+    public String formatAngle(final double value, final Object pattern) throws IllegalArgumentException {
         return new AnglePattern(pattern).format(value, getJavaLocale());
     }
 }

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -31,9 +31,8 @@ import java.util.logging.Logger;
 import java.util.logging.LogRecord;
 import java.lang.reflect.InvocationTargetException;
 
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.lib.uno.helper.Factory;
 import com.sun.star.registry.XRegistryKey;
 
 
@@ -63,6 +62,11 @@ public final class Registration implemen
     static final String LOGGER = "org.apache.sis.openoffice";
 
     /**
+     * Whether to force EPSG database startup early.
+     */
+    private static final boolean FORCE_EPSG_STARTUP = false;
+
+    /**
      * Do not allow instantiation of this class, except for internal use.
      */
     private Registration() {
@@ -103,43 +107,46 @@ public final class Registration implemen
             return false;
         }
         final String[] content = directory.list(new Registration());
-        if (content != null && content.length != 0) {
-            try {
-                final Pack200.Unpacker unpacker = Pack200.newUnpacker();
-                for (final String filename : content) {
-                    final File packFile = new File(directory, filename);
-                    final File jarFile  = new File(directory, filename.substring(0, filename.length() - PACK.length()) + "jar");
-                    try (JarOutputStream out = new JarOutputStream(new FileOutputStream(jarFile))) {
-                        unpacker.unpack(packFile, out);
-                    }
-                    packFile.delete();
+        if (content == null) {
+            fatalException(caller, "Directory " + directory + " not found.", null);
+            return false;
+        }
+        if (content.length != 0) try {
+            final Pack200.Unpacker unpacker = Pack200.newUnpacker();
+            for (final String filename : content) {
+                final File packFile = new File(directory, filename);
+                final File jarFile  = new File(directory, filename.substring(0, filename.length() - PACK.length()) + "jar");
+                try (JarOutputStream out = new JarOutputStream(new FileOutputStream(jarFile))) {
+                    unpacker.unpack(packFile, out);
                 }
-            } catch (IOException e) {
-                fatalException(caller, "Can not uncompress the JAR files.", e);
-                return false;
-            }
-            /*
-             * Ensures that the EPSG database is installed. We force the EPSG installation at add-in
-             * installation time rather than the first time a user ask for a referencing operations,
-             * because users may be less surprised by a delay at installation time than at use time.
-             * However if the EPSG database is deleted after the installation, it will be recreated
-             * when first needed.
-             *
-             * Note: do not reach this code before all Pack200 files have been unpacked.
-             * Remainder: no GeoAPI or Apache SIS classes in any method signature of this class!
-             */
-            try {
-                Class.forName("org.apache.sis.referencing.CRS")
-                     .getMethod("forCode", String.class)
-                     .invoke(null, "EPSG:4326");
-                return true;
-            } catch (InvocationTargetException e) {
-                fatalException(caller, "Failed to install EPSG geodetic dataset.", e.getTargetException());
-            } catch (ReflectiveOperationException | LinkageError e) {
-                classpathException(caller, e);
+                packFile.delete();
             }
+        } catch (IOException e) {
+            fatalException(caller, "Can not uncompress the JAR files.", e);
+            return false;
         }
-        return false;
+        /*
+         * Ensures that the EPSG database is installed. We force the EPSG installation at add-in
+         * installation time rather than the first time a user ask for a referencing operations,
+         * because users may be less surprised by a delay at installation time than at use time.
+         * However if the EPSG database is deleted after the installation, it will be recreated
+         * when first needed.
+         *
+         * Note: do not reach this code before all Pack200 files have been unpacked.
+         * Remainder: no GeoAPI or Apache SIS classes in any method signature of this class!
+         */
+        if (FORCE_EPSG_STARTUP) try {
+            Class.forName("org.apache.sis.referencing.CRS")
+                 .getMethod("forCode", String.class)
+                 .invoke(null, "EPSG:4326");
+        } catch (InvocationTargetException e) {
+            fatalException(caller, "Failed to install EPSG geodetic dataset.", e.getTargetException());
+            return false;
+        } catch (ReflectiveOperationException | LinkageError e) {
+            classpathException(caller, e);
+            return false;
+        }
+        return true;
     }
 
     /**
@@ -163,7 +170,7 @@ public final class Registration implemen
         final String lineSeparator = System.lineSeparator();
         final StringBuilder message = new StringBuilder("Can not find Apache SIS classes.").append(lineSeparator)
                 .append("Classpath = ").append(System.getProperty("java.class.path"));
-        final ClassLoader loader = Referencing.class.getClassLoader();
+        final ClassLoader loader = ReferencingFunctions.class.getClassLoader();
         if (loader instanceof URLClassLoader) {
             for (final URL url : ((URLClassLoader) loader).getURLs()) {
                 message.append(lineSeparator).append("  + ").append(url);
@@ -188,20 +195,15 @@ public final class Registration implemen
      * This method is called by the {@code com.sun.star.comp.loader.JavaLoader}; do not rename!
      *
      * @param   implementation the name of the implementation for which a service is desired.
-     * @param   factories the service manager to be used if needed.
-     * @param   registry the registry key
-     * @return  A factory for creating the component.
-     */
-    public static XSingleServiceFactory __getServiceFactory(
-            final String               implementation,
-            final XMultiServiceFactory factories,
-            final XRegistryKey         registry)
-    {
-        if (ensureInstalled("__getServiceFactory")) {
-            if (implementation.equals(Referencing.class.getName())) try {
-                return FactoryHelper.getServiceFactory(Referencing.class, Referencing.__serviceName, factories, registry);
+     * @return  a factory for creating the component.
+     */
+    public static XSingleComponentFactory __getComponentFactory(final String implementation) {
+        if (implementation.equals(ReferencingFunctions.IMPLEMENTATION_NAME)) {
+            if (ensureInstalled("__getComponentFactory")) try {
+                return Factory.createComponentFactory(ReferencingFunctions.class,
+                        new String[] {ReferencingFunctions.SERVICE_NAME});
             } catch (LinkageError e) {
-                classpathException("__getServiceFactory", e);
+                classpathException("__getComponentFactory", e);
                 throw e;
             }
         }
@@ -217,21 +219,11 @@ public final class Registration implemen
      */
     public static boolean __writeRegistryServiceInfo(final XRegistryKey registry) {
         if (ensureInstalled("__writeRegistryServiceInfo")) try {
-            return register(Referencing.class, Referencing.__serviceName, registry);
+            return Factory.writeRegistryServiceInfo(ReferencingFunctions.IMPLEMENTATION_NAME,
+                    new String[] {ReferencingFunctions.SERVICE_NAME}, registry);
         } catch (LinkageError e) {
             classpathException("__writeRegistryServiceInfo", e);
         }
         return false;
     }
-
-    /**
-     * Helper method for the above {@link #__writeRegistryServiceInfo} method.
-     */
-    private static boolean register(final Class<? extends CalcAddins> classe,
-            final String serviceName, final XRegistryKey registry)
-    {
-        final String cn = classe.getName();
-        return FactoryHelper.writeRegistryServiceInfo(cn, serviceName, registry) &&
-               FactoryHelper.writeRegistryServiceInfo(cn, CalcAddins.ADDIN_SERVICE, registry);
-    }
 }

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Transformer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Transformer.java?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Transformer.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Transformer.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -63,7 +63,7 @@ final class Transformer {
     /**
      * Creates a new transformer.
      */
-    Transformer(final Referencing caller, final CoordinateReferenceSystem sourceCRS,
+    Transformer(final ReferencingFunctions caller, final CoordinateReferenceSystem sourceCRS,
             final String targetCRS, final double[][] points) throws FactoryException, DataStoreException
     {
         /*

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.idl
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.idl?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.idl [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.idl [UTF-8] Fri Jun 10 23:50:13 2016
@@ -19,64 +19,67 @@
 #define _org_apache_sis_openoffice_XReferencing_
 
 #include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/XLocalizable.idl>
 #include <com/sun/star/beans/XPropertySet.idl>
-#include <com/sun/star/sheet/AddIn.idl>
 
 
+/*
+ * Define the methods to be invoked by OpenOffice.
+ * This IDL file is converted in both a .urd file (used by OpenOffice) and a .class file (used by Java).
+ */
 module org {
   module apache {
     module sis {
       module openoffice {
         /// Methods from the org.apache.sis.referencing package to make available to OpenOffice.
-        interface XReferencing : com::sun::star::uno::XInterface {
+        interface XReferencing {
+          interface ::com::sun::star::uno::XInterface;
+
+          /// used to set an add-in locale for formatting messages.
+          [optional] interface ::com::sun::star::lang::XLocalizable;
+
           /// Returns an identified object name from an authority code.
           string getName(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The authority code (e.g. "EPSG:4326").
-            [in] string authorityCode
+            [in] string codeOrPath
           );
 
           /// Returns the axis name for the specified dimension in an identified object.
           string getAxis(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The authority code (e.g. "EPSG:4326").
-            [in] string authorityCode,
+            [in] string codeOrPath,
             /// The dimension (1, 2, ...).
             [in] long dimension
           );
 
           /// Returns the domain of validity as a geographic bounding box for an identified object.
           sequence< sequence< double > > getGeographicArea(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The authority code (e.g. "EPSG:4326").
-            [in] string authorityCode
+            [in] string codeOrPath
           );
 
           /// Returns the accuracy of a transformation between two coordinate reference systems.
           double getAccuracy(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The source coordinates to transform.
             [in] string sourceCRS,
             /// Authority code of the target coordinate reference system.
             [in] string targetCRS,
             /// The source coordinates to transform.
-            [in] sequence< sequence< double > > coordinates
-          );
+            [in] any points
+          ) raises (com::sun::star::lang::IllegalArgumentException);
 
           /// Transforms a list of coordinates from source CRS to target CRS.
-          sequence< sequence< double > > transformCoordinates(
-            [in] com::sun::star::beans::XPropertySet xOptions,
+          sequence< sequence< double > > transformPoints(
             /// Authority code of the source coordinate reference system.
             [in] string sourceCRS,
             /// Authority code of the target coordinate reference system.
             [in] string targetCRS,
             /// The source coordinates to transform.
-            [in] sequence< sequence< double > > coordinates
+            [in] sequence< sequence< double > > points
           );
 
           /// Converts text in degrees-minutes-seconds to an angle in decimal degrees.
           double parseAngle(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The text to be converted to an angle.
             [in] string text,
             /// The text that describes the format (example: "D MM.m'").
@@ -85,7 +88,6 @@ module org {
 
           /// Converts an angle to text according to a given format.
           string formatAngle(
-            [in] com::sun::star::beans::XPropertySet xOptions,
             /// The angle value (in decimal degrees) to be converted.
             [in] double value,
             /// The text that describes the format (example: "D MM.m'").
@@ -94,17 +96,10 @@ module org {
         };
 
         /*
-         * Exported interfaces:
-         * This is where we put all interfaces that this service exports.
+         * All interfaces exported by the referencing service.
          */
         service Referencing {
           interface XReferencing;
-
-          /*
-           * Necessary base service.
-           * All add-ins must implement this service.
-           */
-          service com::sun::star::sheet::AddIn;
         };
       };
     };

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.java?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/XReferencing.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.openoffice;
 
 import com.sun.star.uno.XInterface;
-import com.sun.star.beans.XPropertySet;
 import com.sun.star.lang.IllegalArgumentException;
 
 
@@ -41,23 +40,21 @@ public interface XReferencing extends XI
     /**
      * Returns the identified object name from an authority code.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @return the object name.
      */
-    String getName(XPropertySet xOptions, String codeOrPath);
+    String getName(String codeOrPath);
 
     /**
      * Returns the axis name and units for the specified dimension in a coordinate reference system or coordinate system.
      * This method returns a short axis name as used in Well Known Text (WKT) format, for example <cite>"Latitude"</cite>
      * instead of <cite>"Geodetic latitude"</cite>.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @param  dimension   the dimension (1, 2, …).
      * @return the name of the requested axis.
      */
-    String getAxis(XPropertySet xOptions, String codeOrPath, int dimension);
+    String getAxis(String codeOrPath, int dimension);
 
     /**
      * Returns the domain of validity as a geographic bounding box for an identified object.
@@ -66,46 +63,42 @@ public interface XReferencing extends XI
      * and the second row contains the latitude and longitude of bottom right corner.
      * Units are degrees.
      *
-     * @param  xOptions    provided by OpenOffice.
      * @param  codeOrPath  the code allocated by an authority, or the path to a file.
      * @return the object bounding box.
      */
-    double[][] getGeographicArea(XPropertySet xOptions, String codeOrPath);
+    double[][] getGeographicArea(String codeOrPath);
 
     /**
      * Returns the accuracy of a transformation between two coordinate reference systems.
      *
-     * @param  xOptions   provided by OpenOffice.
      * @param  sourceCRS  the authority code for the source coordinate reference system.
      * @param  targetCRS  the authority code for the target coordinate reference system.
      * @param  points     the coordinates to transform (for computing area of interest).
      * @return the operation accuracy.
+     * @throws IllegalArgumentException if {@code points} is not a {@code double[][]} value or void.
      */
-    double getAccuracy(XPropertySet xOptions, String sourceCRS, String targetCRS, double[][] points);
+    double getAccuracy(String sourceCRS, String targetCRS, Object points) throws IllegalArgumentException;
 
     /**
      * Transforms coordinates from the specified source CRS to the specified target CRS.
      *
-     * @param  xOptions   provided by OpenOffice.
      * @param  sourceCRS  the authority code for the source coordinate reference system.
      * @param  targetCRS  the authority code for the target coordinate reference system.
      * @param  points     the coordinates to transform.
      * @return The transformed coordinates.
      */
-    double[][] transformCoordinates(XPropertySet xOptions, String sourceCRS, String targetCRS, double[][] points);
+    double[][] transformPoints(String sourceCRS, String targetCRS, double[][] points);
 
     /**
      * Converts text in degrees-minutes-seconds to an angle in decimal degrees.
      * See {@link org.apache.sis.measure.AngleFormat} for pattern description.
      *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  text      the text to be converted to an angle.
-     * @param  pattern   an optional text that describes the format (example: "D°MM.m'").
+     * @param  text       the text to be converted to an angle.
+     * @param  pattern    an optional text that describes the format (example: "D°MM.m'").
      * @return the angle parsed as a number.
-     * @throws IllegalArgumentException if {@code pattern} is illegal.
+     * @throws IllegalArgumentException if {@code pattern} is not a string value or void.
      */
-    double parseAngle(XPropertySet xOptions, String text, Object pattern)
-            throws IllegalArgumentException;
+    double parseAngle(String text, Object pattern) throws IllegalArgumentException;
 
     /**
      * Converts an angle to text according to a given format. This method uses the pattern
@@ -116,12 +109,10 @@ public interface XReferencing extends XI
      *   <li>If the pattern ends with N or S, then the angle is formatted as a latitude.</li>
      * </ul>
      *
-     * @param  xOptions  provided by OpenOffice.
-     * @param  value     the angle value (in decimal degrees) to be converted.
-     * @param  pattern   an optional text that describes the format (example: "D°MM.m'").
+     * @param  value      the angle value (in decimal degrees) to be converted.
+     * @param  pattern    an optional text that describes the format (example: "D°MM.m'").
      * @return the angle formatted as a string.
-     * @throws IllegalArgumentException if {@code pattern} is illegal.
+     * @throws IllegalArgumentException if {@code pattern} is not a string value or void.
      */
-    String formatAngle(XPropertySet xOptions, double value, Object pattern)
-            throws IllegalArgumentException;
+    String formatAngle(double value, Object pattern) throws IllegalArgumentException;
 }

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/META-INF/manifest.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/META-INF/manifest.xml?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/META-INF/manifest.xml (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/META-INF/manifest.xml Fri Jun 10 23:50:13 2016
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
 <manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
   <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-typelibrary;type=RDB"
                        manifest:full-path="sis.rdb"/>
   <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Java"
                        manifest:full-path="${project.build.finalName}.jar"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="Referencing.xcu"/>
 </manifest:manifest>

Added: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu?rev=1747815&view=auto
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu (added)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu Fri Jun 10 23:50:13 2016
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                    oor:name="CalcAddIns" oor:package="org.openoffice.Office">
+
+  <node oor:name="AddInInfo">
+    <node oor:name="org.apache.sis.openoffice.Referencing" oor:op="replace">
+      <node oor:name="AddInFunctions">
+        <node oor:name="getName" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">CRS.NAME</value>
+            <value xml:lang="fr">CRS.NOM</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Returns the name of an object identified by the given code.</value>
+            <value xml:lang="fr">Retourne le nom d’un objet identifié par le code donné.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="codeOrPath" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">identifier</value>
+                <value xml:lang="fr">identifiant</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The code allocated by authority or the path to a file.</value>
+                <value xml:lang="fr">Le code alloué par une autorité ou le chemin vers un fichier.</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="getAxis" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">CRS.AXIS</value>
+            <value xml:lang="fr">CRS.AXE</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Returns the axis name for the specified dimension in a system identified by the given code.</value>
+            <value xml:lang="fr">Retourne le nom de l’axe à la dimension spécifiée dans un système identifié par le code donné.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="codeOrPath" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">identifier</value>
+                <value xml:lang="fr">identifiant</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The code allocated by authority or the path to a file.</value>
+                <value xml:lang="fr">Le code alloué par une autorité ou le chemin vers un fichier.</value>
+              </prop>
+            </node>
+            <node oor:name="dimension" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">dimension</value>
+                <value xml:lang="fr">dimension</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The dimension (1, 2, …) of axis to describe.</value>
+                <value xml:lang="fr">La dimension (1, 2, …) de l’axe à décrire.</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="getGeographicArea" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">GEOGRAPHIC.AREA</value>
+            <value xml:lang="fr">REGION.GEOGRAPHIQUE</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Returns the domain as a geographic bounding box for an object identified by the given code.
+                                 The box is expressed by a 2×2 matrix with latitudes in the first column and longitudes in the second column.</value>
+            <value xml:lang="fr">Retourne sous forme de boîte englobante le domaine d’un objet identifié par le code donné.
+                                 La boîte est exprimée par une matrice 2×2 avec les latitudes dans la première colonne et les longitudes dans la seconde colonne.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="codeOrPath" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">code</value>
+                <value xml:lang="fr">code</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The code allocated by authority or the path to a file.</value>
+                <value xml:lang="fr">Le code alloué par une autorité ou le chemin vers un fichier.</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="getAccuracy" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">TRANSFORM.ACCURACY</value>
+            <value xml:lang="fr">PRECISION.TRANSFORM</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Returns the accuracy of a coordinate operation applied between two given reference systems.</value>
+            <value xml:lang="fr">Retourne la précision d’une opération sur les coordonnées effectuée entre les deux systèmes de référence donnés.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="sourceCRS" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">source</value>
+                <value xml:lang="fr">source</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Identifier of the source coordinate reference system.</value>
+                <value xml:lang="fr">Identifiant du système de référence des coordonnées sources.</value>
+              </prop>
+            </node>
+            <node oor:name="targetCRS" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">target</value>
+                <value xml:lang="fr">destination</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Identifier of the target coordinate reference system.</value>
+                <value xml:lang="fr">Identifiant du système de référence des coordonnées destinations.</value>
+              </prop>
+            </node>
+            <node oor:name="points" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">points</value>
+                <value xml:lang="fr">points</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Coordinates of points to transform (optional). This information may affect parameters of the selected coordinate transformation.</value>
+                <value xml:lang="fr">Coordonnées des points à transformer (optionnel). Cette information peut influer les paramètres de la transformation choisie.</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="transformPoints" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">TRANSFORM.POINTS</value>
+            <value xml:lang="fr">TRANSFORM.POINTS</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Transform coordinates from the given source CRS to the given target CRS.</value>
+            <value xml:lang="fr">Transforme des coordonnées à partir du CRS source donné vers le CRS destination donné.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="sourceCRS" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">source</value>
+                <value xml:lang="fr">source</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Identifier of the source coordinate reference system.</value>
+                <value xml:lang="fr">Identifiant du système de référence des coordonnées sources.</value>
+              </prop>
+            </node>
+            <node oor:name="targetCRS" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">target</value>
+                <value xml:lang="fr">destination</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Identifier of the target coordinate reference system.</value>
+                <value xml:lang="fr">Identifiant du système de référence des coordonnées destinations.</value>
+              </prop>
+            </node>
+            <node oor:name="points" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">points</value>
+                <value xml:lang="fr">points</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">Coordinates of points to transform.</value>
+                <value xml:lang="fr">Coordonnées des points à transformer.</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="parseAngle" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">VALUE.ANGLE</value>
+            <value xml:lang="fr">VALEUR.ANGLE</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Converts a text representing an angle in degrees-minutes-seconds to a numerical value in decimal degrees.</value>
+            <value xml:lang="fr">Convertit un texte représentant un angle en degrés-minutes-secondes vers une valeur numérique en degrés décimaux.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="text" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">text</value>
+                <value xml:lang="fr">texte</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The sexagesimal angle to be converted to a number.</value>
+                <value xml:lang="fr">L’angle sexagésimal à convertir en nombre.</value>
+              </prop>
+            </node>
+            <node oor:name="pattern" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">pattern</value>
+                <value xml:lang="fr">modèle</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">An optional text that gives the angle pattern (example: D°MM.m’).</value>
+                <value xml:lang="fr">Un texte optionnel donnant le modèle des angles (exemple: D°MM.m’).</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+
+        <node oor:name="formatAngle" oor:op="replace">
+          <prop oor:name="DisplayName">
+            <value xml:lang="en">TEXT.ANGLE</value>
+            <value xml:lang="fr">TEXTE.ANGLE</value>
+          </prop>
+          <prop oor:name="Description">
+            <value xml:lang="en">Converts a numerical value in decimal degrees to a text representing an angle in degrees-minutes-seconds.</value>
+            <value xml:lang="fr">Convertit une valeur numérique en degrés décimaux vers un texte représentant un angle en degrés-minutes-secondes.</value>
+          </prop>
+          <prop oor:name="Category">
+            <value>Add-In</value>
+          </prop>
+          <node oor:name="Parameters">
+            <node oor:name="value" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">value</value>
+                <value xml:lang="fr">valeur</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">The value to be converted to sexagesimal angle.</value>
+                <value xml:lang="fr">Le nombre à convertir en angle sexagésimal.</value>
+              </prop>
+            </node>
+            <node oor:name="pattern" oor:op="replace">
+              <prop oor:name="DisplayName">
+                <value xml:lang="en">pattern</value>
+                <value xml:lang="fr">modèle</value>
+              </prop>
+              <prop oor:name="Description">
+                <value xml:lang="en">An optional text that gives the angle pattern (example: D°MM.m’).</value>
+                <value xml:lang="fr">Un texte optionnel donnant le modèle des angles (exemple: D°MM.m’).</value>
+              </prop>
+            </node>
+          </node>
+        </node>
+      </node>
+    </node>
+  </node>
+</oor:component-data>

Propchange: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/Referencing.xcu
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/build-instruction.html
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/build-instruction.html?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/build-instruction.html (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/build-instruction.html Fri Jun 10 23:50:13 2016
@@ -50,11 +50,17 @@ export OO_SDK_HOME=$OFFICE_BASE_HOME/Ope
 export PATH=$OFFICE_BASE_HOME/program:$OO_SDK_HOME/bin:$PATH</pre></blockquote>
 
 
-<h2>Compiles the UNO <code>.urd</code> binary file:</h2>
+    <h2>Compiles the UNO <code>*.urd</code> binary file:</h2>
+    <p>
+      The following command generates <code>*.urd</code> files (to be deleted later).
+      The <code>-C</code> option is for including additional service information,
+      the <code>-cid</code> option is for checking if identifiers fulfill the UNO naming requirements, and
+      the <code>-w</code> option is for displaying warning messages.
+    </p>
 <blockquote><pre>cd application/sis-openoffice/src/main/java
 idlc -C -cid -w -I $OO_SDK_HOME/idl org/apache/sis/openoffice/*.idl</pre></blockquote>
 
-    <div><b>MacOS troubleshooting:</b>
+    <div style="font-size:smaller"><b>MacOS troubleshooting:</b>
       if the above command fails with a message like:
 
       <blockquote>“<code>dyld: Library not loaded: @executable_path/libreg.dylib.3</code>
@@ -66,18 +72,26 @@ idlc -C -cid -w -I $OO_SDK_HOME/idl org/
     </div>
 
 
-<h2>Compiles the UNO <code>.rdb</code> registry file:</h2>
+<h2>Compiles the UNO <code>*.rdb</code> registry file and the <code>*.class</code> file:</h2>
+<p>
+  The <code>*.rdb</code> and <code>*.class</code> files generated by the following commands
+  will need to be committed in the source code repository.
+  Committing compilation results is usually not recommended, but in this particular case
+  most users will not have the necessary installation for producing those files themselves
+  (including the <code>*.class</code> files, which is not the usual <code>javac</code> output).
+</p>
 <blockquote><pre>regmerge ../unopkg/sis.rdb /UCR org/apache/sis/openoffice/*.urd
 rm org/apache/sis/openoffice/*.urd
-cd ../unopkg</pre></blockquote>
+cd ../unopkg
+javamaker -BUCR sis.rdb $OFFICE_BASE_HOME/program/types.rdb -Torg.apache.sis.openoffice.XReferencing</pre></blockquote>
 
 
-<h2>Creates the <code>.class</code> file for Java interfaces:</h2>
-<blockquote><pre>javamaker -BUCR -nD sis.rdb $OFFICE_BASE_HOME/program/types.rdb \
-    -Torg.apache.sis.openoffice.XReferencing</pre></blockquote>
-
-
-<h2>Derives a <code>.java</code> source from the <code>.class</code> file:</h2>
+<h2>Derives a <code>*.java</code> source from the <code>*.class</code> file:</h2>
+<p>
+  Following command can be skipped if the API defined by <code>*.idl</code> files did not changed.
+  If this command is executed, the result will be sent to the console.
+  Developer need to bring any changes to the Java interface manually.
+</p>
 <blockquote><pre>javap org.apache.sis.openoffice.XReferencing</pre></blockquote>
 
 
@@ -88,7 +102,8 @@ mvn install</pre></blockquote>
 
 <h2>Test in Apache OpenOffice:</h2>
 <blockquote><pre>cd target
-unopkg add apache-sis-0.8-SNAPSHOT.oxt --log-file log.txt</pre></blockquote>
+unopkg add apache-sis-0.8-SNAPSHOT.oxt --log-file log.txt
+scalc -Xdebug -env:RTL_LOGFILE=log.txt</pre></blockquote>
 
   </body>
 </html>

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/description.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/description.xml?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/description.xml (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/description.xml Fri Jun 10 23:50:13 2016
@@ -1,10 +1,30 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
 <description xmlns="http://openoffice.org/extensions/description/2006"
            xmlns:d="http://openoffice.org/extensions/description/2006"
        xmlns:xlink="http://www.w3.org/1999/xlink">
 
   <identifier value="org.apache.sis.openoffice"/>
-  <version    value="4.00"/>
+  <version    value="0.8"/>
   <platform   value="all"/>
 
   <publisher>
@@ -24,8 +44,10 @@
     <src lang="en" xlink:href="http://sis.apache.org/openoffice/"/>
   </release-notes>
 
+<!--
   <update-information>
     <src xlink:href="http://sis.apache.org/openoffice/update.xml"/>
   </update-information>
+-->
 
 </description>

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/org/apache/sis/openoffice/XReferencing.class
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/org/apache/sis/openoffice/XReferencing.class?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
Binary files - no diff available.

Modified: sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/sis.rdb
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/sis.rdb?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
Binary files - no diff available.

Copied: sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingFunctionsTest.java (from r1747814, sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingFunctionsTest.java?p2=sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingFunctionsTest.java&p1=sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingTest.java&r1=1747814&r2=1747815&rev=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingTest.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/ReferencingFunctionsTest.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.openoffice;
 
-import com.sun.star.beans.XPropertySet;
 import com.sun.star.lang.IllegalArgumentException;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.referencing.PositionalAccuracyConstant;
@@ -31,7 +30,7 @@ import static org.junit.Assume.assumeFal
 
 
 /**
- * Tests {@link Referencing}.
+ * Tests {@link ReferencingFunctions}.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.8
@@ -39,30 +38,23 @@ import static org.junit.Assume.assumeFal
  * @module
  */
 @DependsOn(TransformerTest.class)
-public final strictfp class ReferencingTest extends TestCase {
-    /**
-     * A dummy {@code XPropertySet} instance for testing purpose.
-     * The current implementation sets the value to {@code null} since {@link Referencing} ignores the properties.
-     * But that value could be changed if the properties are not ignored anymore in a future SIS version.
-     */
-    private static final XPropertySet properties = null;
-
+public final strictfp class ReferencingFunctionsTest extends TestCase {
     /**
      * The instance to use for testing purpose.
      */
-    private static Referencing instance;
+    private static ReferencingFunctions instance;
 
     /**
-     * Creates a {@link Referencing} instance to use for all tests.
+     * Creates a {@link ReferencingFunctions} instance to use for all tests.
      */
     @BeforeClass
     public static void createReferencingInstance() {
-        instance = new Referencing();
+        instance = new ReferencingFunctions(null);
         instance.setLocale(new com.sun.star.lang.Locale("en", "US", null));
     }
 
     /**
-     * Disposes the {@link Referencing} instance after all tests completed.
+     * Disposes the {@link ReferencingFunctions} instance after all tests completed.
      */
     @AfterClass
     public static void disposeReferencingInstance() {
@@ -70,36 +62,45 @@ public final strictfp class ReferencingT
     }
 
     /**
-     * Tests {@link Referencing#getName(XPropertySet, String)}.
+     * Verifies the service and implementation names.
+     */
+    @Test
+    public void verifyNames() {
+        assertEquals("IMPLEMENTATION_NAME", ReferencingFunctions.class.getName(), ReferencingFunctions.IMPLEMENTATION_NAME);
+        assertTrue("SERVICE_NAME", ReferencingFunctions.IMPLEMENTATION_NAME.startsWith(ReferencingFunctions.SERVICE_NAME));
+    }
+
+    /**
+     * Tests {@link ReferencingFunctions#getName(String)}.
      */
     @Test
     public void testGetName() {
-        assertEquals("Using a simple code.", "WGS 84", instance.getName(properties, "EPSG:4326"));
-        assertEquals("Using a URN.",         "WGS 84", instance.getName(properties, "urn:ogc:def:crs:epsg::4326"));
-        assertEquals("Using a HTTP code.",   "WGS 84", instance.getName(properties, "http://www.opengis.net/gml/srs/epsg.xml#4326"));
-        assertEquals("Cached value.",        "WGS 84", instance.getName(properties, "EPSG:4326"));
+        assertEquals("Using a simple code.", "WGS 84", instance.getName("EPSG:4326"));
+        assertEquals("Using a URN.",         "WGS 84", instance.getName("urn:ogc:def:crs:epsg::4326"));
+        assertEquals("Using a HTTP code.",   "WGS 84", instance.getName("http://www.opengis.net/gml/srs/epsg.xml#4326"));
+        assertEquals("Cached value.",        "WGS 84", instance.getName("EPSG:4326"));
         assertEquals("URN for a datum.", "World Geodetic System 1984",
-                instance.getName(properties, "urn:ogc:def:datum:epsg::6326"));
+                instance.getName("urn:ogc:def:datum:epsg::6326"));
     }
 
     /**
-     * Tests {@link Referencing#getAxis(XPropertySet, String, int)}.
+     * Tests {@link ReferencingFunctions#getAxis(String, int)}.
      */
     @Test
     public void testGetAxis() {
-        assertEquals("Latitude (°)",              instance.getAxis(properties, "EPSG:4326", 1));
-        assertEquals("Longitude (°)",             instance.getAxis(properties, "EPSG:4326", 2));
-        assertEquals("Index 3 is out of bounds.", instance.getAxis(properties, "EPSG:4326", 3));
+        assertEquals("Latitude (°)",              instance.getAxis("EPSG:4326", 1));
+        assertEquals("Longitude (°)",             instance.getAxis("EPSG:4326", 2));
+        assertEquals("Index 3 is out of bounds.", instance.getAxis("EPSG:4326", 3));
         assertEquals("Expected “urn:ogc:def:datum:epsg::6326” to reference an instance of ‘CoordinateReferenceSystem’, " +
-                "but found an instance of ‘GeodeticDatum’.", instance.getAxis(properties, "urn:ogc:def:datum:epsg::6326", 1));
+                "but found an instance of ‘GeodeticDatum’.", instance.getAxis("urn:ogc:def:datum:epsg::6326", 1));
     }
 
     /**
-     * Tests {@link Referencing#getGeographicArea(XPropertySet, String)}.
+     * Tests {@link ReferencingFunctions#getGeographicArea(String)}.
      */
     @Test
     public void testGetGeographicArea() {
-        final double[][] bbox = instance.getGeographicArea(properties, "EPSG:32620");     // UTM zone 20
+        final double[][] bbox = instance.getGeographicArea("EPSG:32620");     // UTM zone 20
         assertEquals(2, bbox.length);
         assumeFalse(Double.isNaN(bbox[0][0]));    // NaN if EPSG dataset is not installed.
         assertArrayEquals("Upper left corner",  new double[] {84, -66}, bbox[0], STRICT);
@@ -107,12 +108,14 @@ public final strictfp class ReferencingT
     }
 
     /**
-     * Tests {@link Referencing#getAccuracy(XPropertySet, String, String, double[][])}.
+     * Tests {@link ReferencingFunctions#getAccuracy(String, String, double[][])}.
      * This test asks for a transformation from NAD83 to WGS84.
+     *
+     * @throws IllegalArgumentException if {@code points} is not a {@code double[][]} value or void.
      */
     @Test
-    public void testGetAccuracy() {
-        final double accuracy = instance.getAccuracy(properties, "EPSG:4269", "EPSG:4326", new double[][] {
+    public void testGetAccuracy() throws IllegalArgumentException {
+        final double accuracy = instance.getAccuracy("EPSG:4269", "EPSG:4326", new double[][] {
             {37.783, -122.417},     // San-Francisco
             {40.713,  -74.006},     // New-York
             {34.050, -118.250},     // Los Angeles
@@ -126,10 +129,10 @@ public final strictfp class ReferencingT
     }
 
     /**
-     * Tests {@link Referencing#transformCoordinates(XPropertySet, String, String, double[][])}.
+     * Tests {@link ReferencingFunctions#transformPoints(String, String, double[][])}.
      */
     @Test
-    public void testTransformCoordinates() {
+    public void testTransformPoints() {
         final double[][] points = {
             new double[] {30,  20,  4},
             new double[] {34,  17, -3},
@@ -143,30 +146,30 @@ public final strictfp class ReferencingT
             new double[] {32,  23}
         };
         TransformerTest.assertPointsEqual(result,
-                instance.transformCoordinates(properties, "EPSG:4979", "EPSG:4326", points), STRICT);
+                instance.transformPoints("EPSG:4979", "EPSG:4326", points), STRICT);
     }
 
     /**
-     * Tests {@link Referencing#parseAngle(XPropertySet, String, Object)}.
+     * Tests {@link ReferencingFunctions#parseAngle(String, Object)}.
      *
      * @throws IllegalArgumentException if the pattern used by the test is not a string or void.
      */
     @Test
     public void testParseAngle() throws IllegalArgumentException {
-        assertEquals(43.50, instance.parseAngle(properties, "43°30'", "D°MM.m'"), STRICT);
-        assertEquals(43.50, instance.parseAngle(properties, "4330",   "DMM"),     STRICT);
-        assertEquals(-3.25, instance.parseAngle(properties, "-3°15'", "D°MM.m'"), STRICT);
+        assertEquals(43.50, instance.parseAngle("43°30'", "D°MM.m'"), STRICT);
+        assertEquals(43.50, instance.parseAngle("4330",   "DMM"),     STRICT);
+        assertEquals(-3.25, instance.parseAngle("-3°15'", "D°MM.m'"), STRICT);
     }
 
     /**
-     * Tests {@link Referencing#formatAngle(XPropertySet, String, Object)}.
+     * Tests {@link ReferencingFunctions#formatAngle(String, Object)}.
      *
      * @throws IllegalArgumentException if the pattern used by the test is not a string or void.
      */
     @Test
     public void testFormatAngle() throws IllegalArgumentException {
-        assertEquals("43°30.0'", instance.formatAngle(properties, 43.50, "D°MM.m'"));
-        assertEquals("4330",     instance.formatAngle(properties, 43.50, "DMM"));
-        assertEquals("-3°15.0'", instance.formatAngle(properties, -3.25, "D°MM.m'"));
+        assertEquals("43°30.0'", instance.formatAngle(43.50, "D°MM.m'"));
+        assertEquals("4330",     instance.formatAngle(43.50, "DMM"));
+        assertEquals("-3°15.0'", instance.formatAngle(-3.25, "D°MM.m'"));
     }
 }

Modified: sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/TransformerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/TransformerTest.java?rev=1747815&r1=1747814&r2=1747815&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/TransformerTest.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-openoffice/src/test/java/org/apache/sis/openoffice/TransformerTest.java [UTF-8] Fri Jun 10 23:50:13 2016
@@ -42,19 +42,19 @@ public final strictfp class TransformerT
     /**
      * The instance to use for testing purpose.
      */
-    private static Referencing caller;
+    private static ReferencingFunctions caller;
 
     /**
-     * Creates a {@link Referencing} instance to use for all tests.
+     * Creates a {@link ReferencingFunctions} instance to use for all tests.
      */
     @BeforeClass
     public static void createReferencingInstance() {
-        caller = new Referencing();
+        caller = new ReferencingFunctions(null);
         caller.setLocale(new com.sun.star.lang.Locale("en", "US", null));
     }
 
     /**
-     * Disposes the {@link Referencing} instance after all tests completed.
+     * Disposes the {@link ReferencingFunctions} instance after all tests completed.
      */
     @AfterClass
     public static void disposeReferencingInstance() {




Mime
View raw message