Launching Weave
It’s possible to open the Weave client with additional URL parameters to customise its startup.
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
Note that the coordinates are assumed to be in the same projection as the map display, if they are different a crs
parameter can also be included that specifies the EPSG projection code that the coordinates are provided in.