Client Actions Transfer
These actions provide support to allow selections to be transferred between Weave and other systems.
This bundle provides the server side API and the client side components to use it, as well as a database transfer implementation.
The included database transfer implementation support transferring selection via database tables.
The database transfer implementation will write, at least, a userid and key value to an administrator specified table, where, by default, the userid column will be named 'userid' but the key column must be specified in the config.
The configuration requires at least a 'datasource', 'table' and 'column'. 'usercolumn' can be used to change the userid column name.
id's can be altered when being send/retrieved from the other system by using the 'get' and 'put' tags, which take one of 'lpad', 'rpad' or 'trim' setting to alter their behaviour.
- trim='true' will strip leading/training spaced from the keys.
- lpad='[width]' will left pad the id's with [width] spaces.
- rpad='[width]' will right pad the id's with [width] spaces.
The 'get' option is performed after retrieving the id's from the other system, and the 'put' option is performed before sending the id's to the other system.
The database transfer implementation also requires a list of the entities that it can transfer, which can optionally specify a different column than the default key by setting the 'key' attribute.
Also, it can specify a list of additional values that can should be sent to the other system along with the userid and key value by adding a 'value' tag with the name of the column and the value to set. Finally, if the userid column is not required you can set nouser
to false
in the transfer config and it will not include the user (this can be combined with Get to select everything).
You can also specify when the transfer table should be cleared, by setting the 'cleanwhen' value to 'before', 'after' or 'both' which correspond to clearing the table before sending to the other system, after getting from the other system or both. The default is never.
Additionally, all of the settings can be set at the top level, where they'll provide defaults, or can be set within each entity where they'll overwrite the defaults.
The Get and Put actions require a 'system' property to tell the button what system to transfer the selection to/from, the system property should be set to the id of a transfer service that's previously been configured (currently only a database transfer service is available).
The GetMenu and PutMenu action create a menu of all of the systems available, and therefore don't require the system property to be set for the item in the client configuration. Obviously GetMenu and PutMenu are only useful if you have more than one system registered and want to save screen real estate by not having multiple buttons.
The database transfer service can be registered multiple times with different configurations, for example if you wanted to setup a transfer between a Pathway test and production servers then you can register two externaldb services with different datasources pointing to the different databases.
Then the Get and Put actions can be added multiple times, maybe with an ACL attached, that use the different id's for the test and production Pathways.
ID
com.cohga.selection.Get
com.cohga.selection.Put
com.cohga.selection.GetMenu
com.cohga.selection.PutMenu
Sub-tags
Name | type | cardinality | description |
system | String | 1..1 | The id of the provider to use |
Example
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:externaldb="urn:com.cohga.selection.transfer.db#1.0" xmlns:client="urn:com.cohga.html.client#1.0"> <externaldb:transfer id="pathway"> <name>Pathway</name> <datasource>datasource.pathway</datasource> <table>PTH_GIST</table> <column>GISREF</column> <put lpad="15"/> <get trim="true"/> <clearwhen>both</clearwhen> <entity id="property"> <key>PRUPIX</key> </entity> </externaldb:transfer> <externaldb:transfer id="pathway.test"> <name>Pathway</name> <datasource>datasource.pathway.test</datasource> <table>PTH_GIST</table> <column>GISREF</column> <put lpad="15"/> <get trim="true"/> <clearwhen>both</clearwhen> <entity id="property"> <key>PRUPIX</key> </entity> </externaldb:transfer> <externaldb:transfer id="hansen"> <acl>acl.hansen</acl> <name>Hansen</name> <datasource>datasource.hansen</datasource> <table>HANSEN</table> <column>COMPKEY</column> <key>COMPKEY</key> <clearwhen>before</clearwhen> <entity id="council_buildings"> <value name="COMPTYPE">BLDG</value> </entity> <entity id="council_carparks"> <value name="COMPTYPE">CARP</value> </entity> </externaldb:transfer> <externaldb:transfer id="all.properties"> <name>All Properties</name> <datasource>datasource.main</datasource> <nouser>true</nouser> <entity id="property"> <table>PROPERTY</table> <column>PID</column> </entity> </externaldb:transfer> <client:config id="test"> ... <item action="com.cohga.selection.Get" system="pathway"> <tooltip title="Pathway" text="Get from Pathway"/> </item> <item action="com.cohga.selection.Get" system="all.properties"> <tooltip title="All Properties" text="Select all Properties"/> </item> ... </client:config> </config>
com.cohga.selection.Get
com.cohga.selection.Put