Launching Weave using URL parameters
Search
You can load the Weave client and ask it to perform a search immediately using the search
URL parameter.
The value of the parameter should be the id of the search to execute, and the rest of the URL parameters are the values that should be passed to the search.
For example, given the following search definition
Example search configuration
<search:attribute id="property.pid"> <entity>property</entity> <label>By PID</label> <datasource>datasource</datasource> <table>PROPERTY</table> <key>PID</key> <parameter id="property_id"> <promptText>Property ID</promptText> <column>PID</column> </parameter> </search:attribute>
The following URL will open the Weave client (using the client configured with the id 'main') and execute the property.pid
search to locate the property with a PID
of 1234
Example URL
http://server:8080/weave/main.html?search=property.pid&property_id=1234
This would operate exactly as if the user had started the client, switched to the By PID
query, typed in 1234 for the Property ID
and clicked the New
button.
Note that if the search had more parameters defined then the URL could contain more parameters. The search would be executed by Weave in exactly the same way as if they user entered (or didn't enter) a value for each corresponding parameter when clicking New
.
Additionally, you can include a minScale
parameter, to ensure that the client does not zoom in past the minimum scale you specify as the parameter.
Mapping
You can set the initial map extent, either by specifying an x
and y
location and a scale
, or by specifying minx
, miny
, maxx
and maxy
values.
Additionally, by specifying a crs
parameter these values can be in a different coordinate system from the default projection of the client.
Also, it's possible with the x
and y
version to set a parameter, marker=true
, to specify that a marker should be placed at the x, y location.
Finally, with the minx
, miny
, maxx
and maxy
version you can also specify a minScale
to ensure that the map extent is not zoomed in too far.
Example x, y URL
http://server:8080/weave/main.html?x=339690&y=5818946&scale=5000&marker=true
Example extent URL
http://server:8080/weave/main.html?minx=339680&maxx=339700&miny=5818936&maxy=5818956&minScale=5000
The mapping URL parameters are only available in Weave 2.5 and later
Filtering Id's
Some of the application integration modules allow the translation of identifiers being sent between Weave and the third party application which can be done by setting up a "filter" and then directing the application integration module to use that filter when sending or receiving a list of identifiers (see the documentation for the application integration module for details on how to link the filter).
To define a new filter you need to add the com.cohga.selection.filter
namespace to your config file, e.g.
Adding the filter namespace
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> ... </config>
Then you can create a filter that will convert id's from one value to another. e.g.
Example database filter
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> <filter:db id="property.filter"> <datasource>main</datasource> <table>GEMS_LINK</table> <keycolumn>PID</keycolumn> <!-- column used in spatial database --> <idcolumn>PRUPI</idcolumn> <!-- column required for third party application --> </filter:db> </config>
When configured to use the above filter Weave will translate PID values to PRUPI when sending to the third party application and will do the reverse, translate PRUPI values to PID, when coming from the third party application into Weave.
You can further extend the filter by adding additional from
and where
clauses to include additional tables in the translation.
In addition to a db
(database) filter you can also create a format
filter or a chain
filter. A format
filter can alter the formatting of the id's, for example, if they need to be padded with spaces, and the chain
filter can combine other db
and format
filters, since you can only specify a single filter and you may want to translate and format the id's.
Format filter
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> <filter:format id="property.format"> <idtrimin>true</idtrimin> <keylpadout>8</keylpadout> </filter:format> </config>
The format
filter has 12 values that can be set, to determine if the id/key is left or right padded, or if it's trimmed of extra spaces. (id or key) x (lpad, rpad or trim) x (in or out) = 12.
For left or right padding the property should be set to the number of characters the final value should be padded out to, for trim the property should be set to true
or false
.
e.g. <idlpadout>20</idlpadout>, <keyrpadin>5</keyrpadin>, <keytrimin>true</keytrimin>
Chain filter
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.selection.filter#1.0"> <filter:chain id="property.chain"> <filter>property.filter</filter> <filter>property.format</filter> </filter:chain> </config>