Bruce, in this week's code sprint I implemented an improvement that makes the CQL Vocab function easier to use. I also updated the documentation to note the requirement for an absolute path as the second argument to Vocab.
[GEOT-5308] Support predefined app-schema interpolation properties for mapping file and parent directory https://osgeo-org.atlassian.net/browse/GEOT-5308 You can now use: <AttributeMapping> <targetAttribute>gml:name</targetAttribute> <sourceExpression> <OCQL>Vocab(ABBREVIATION, strconcat('${config.parent}', '/mapping.properties'))</OCQL> </sourceExpression> </AttributeMapping> In each mapping file, ${config.parent} is set automatically to the parent directory of that mapping file; this requires no configuration. For more details, see: http://docs.geoserver.org/stable/en/user/data/app-schema/cql-functions.html#vocab http://docs.geoserver.org/stable/en/user/data/app-schema/property-interpolation.html#predefined-properties This change has been applied to master and 2.9.x and will be included in 2.9.1. Kind regards, Ben. On 18/11/15 11:15, Ben Caradoc-Davies wrote: > Bruce, > > thanks for the confirmation. I have reported this bug in Jira: > > [GEOT-5308] app-schema Vocab function does not honour relative > vocabulary properties file path > https://osgeo-org.atlassian.net/browse/GEOT-5308 > > Kind regards, > Ben. > > On 18/11/15 10:59, [email protected] wrote: >> 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 >> E: [email protected] T: +61 3 9252 6514 M: +61 475 954 391 >> PO Box 56, Highett, Victoria, 3190 >> >> -----Original Message----- >> From: Ben Caradoc-Davies [mailto:[email protected]] >> Sent: Wednesday, 18 November 2015 5:41 AM >> To: Simons, Bruce (L&W, Clayton) <[email protected]> >> Cc: [email protected]; Jody Garnett >> <[email protected]> >> 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, [email protected] 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 >>> E: [email protected]<mailto:[email protected]> T: +61 3 9252 >>> 6514 M: +61 475 954 391 PO Box 56, Highett, Victoria, 3190 >>> >>> >>> >>> >>> ---------------------------------------------------------------------- >>> -------- >>> >>> >>> >>> _______________________________________________ >>> Geoserver-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >> >> -- >> Ben Caradoc-Davies <[email protected]> >> Director >> Transient Software Limited <http://transient.nz/> New Zealand >> > -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
