Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

Code Block
xml
xml
linenumberstrue

<?xml version="1.0" encoding="UTF-8"?>

<config xml:lang="en-AU" 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