Uploaded image for project: 'GeoTools'
  1. GeoTools
  2. GEOT-5308

Support predefined app-schema interpolation properties for mapping file and parent directory

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 13.3, 14.0, 15-M0
    • Fix Version/s: 15.1, 16-M0
    • Component/s: app-schema plugin
    • Labels:
      None

      Description

      The app-schema Vocab CQL function is documented as supporting a vocabulary properties file "URI" that can be absolute or relative to the mapping file, but only an absolute file path works. See:
      http://docs.geoserver.org/latest/en/user/data/app-schema/cql-functions.html

      Vocabulary properties file paths relative to the containing mapping file should be supported if possible. In any case, the documentation must match the implementation.

      ------- Forwarded Message --------
      Subject: RE: [Geoserver-users] app-schema mapping.properties file location
      Date: Tue, 17 Nov 2015 21:59:22 +0000
      From: Bruce Simons
      To: Ben Caradoc-Davies
      CC: geoserver-users@lists.sourceforge.net, Jody Garnett

      Thanks Ben,
      Putting the absolute path worked without the chmod:
      <AttributeMapping>
      <targetAttribute>om:observedProperty</targetAttribute>
      <ClientProperty>
      <name>xlink:href</name>
      <value>Vocab(METHOD, 'C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\geoserver\data\workspaces\om\OM_Observation\mapping.properties')</value>
      </ClientProperty>
      </AttributeMapping>

      Can you report this as a bug change request for me?

      Cheers
      Bruce Simons
      Information Modeller
      CSIRO Land and Water/ Environmental Information Infrastructures
      T: +61 3 9252 6514 M: +61 475 954 391
      PO Box 56, Highett, Victoria, 3190

      ----Original Message----
      From: Ben Caradoc-Davies
      Sent: Wednesday, 18 November 2015 5:41 AM
      To: Simons, Bruce
      Cc: geoserver-users@lists.sourceforge.net; Jody Garnett
      Subject: Re: [Geoserver-users] app-schema mapping.properties file location

      Bruce,

      in a nutshell: ugly and not as documented, but it should work if you use an absolute path.

      The documentation claims that the properties file can be an absolute path or relative to the mapping file, but I had a look in the implementation and I see no evidence of handling of paths relative to the mapping file:
      http://docs.geoserver.org/latest/en/user/data/app-schema/cql-functions.html

      Even the test coverage is relative to the home directory of the GeoTools module. Whatever you pass as the properties file "URI" (and it is not a
      URI) is used raw as a path; if relative it is relative to the current working directory of the process (not useful), and if absolute it is the absolute path on the filesystem (ugly but workable).

      For example, if GeoServer is running in Tomcat 7 on Debian and you put the mapping file in the root of the data directory, you might have something like this:

      <OCQL>Vocab(ABBREVIATION,
      '/var/lib/tomcat7/webapps/geoserver/data/mapping.properties')</OCQL>

      You may also need to change the permissions to make sure Tomcat can read the file:

      chmod 644 /var/lib/tomcat7/webapps/geoserver/data/mapping.properties

      Kind regards,
      Ben.

      On 17/11/15 16:50, Bruce Simons wrote:
      > The Geoserver app-schema documentation (http://docs.geoserver.org/latest/en/user/data/app-schema/cql-functions.html) has the example:
      > <OCQL>Vocab(ABBREVIATION, '/test-data/mapping.properties')</OCQL>
      >
      > Where does this mapping.properties file go in the geoserver/data directory structure?
      > Wherever I put it I get the error:
      > "Error applying mapping with targetAttribute om:observedProperty Argument "value" should not be null"
      >
      > Cheers
      > Bruce Simons
      > Information Modeller
      > CSIRO Land and Water/ Environmental Information Infrastructures
      > T: +61 3 9252 6514 M: +61 475 954 391 PO Box 56, Highett, Victoria, 3190

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bencaradocdavies Ben Caradoc-Davies
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: