Integrating with Hansen

There are now 3 versions of the Hansen integration, the older version supports a push/pull type operation but the newer versions have buttons available in Hansen and Weave to call each other directly.

Bundles with version 4.0.0 and later provide the newer integration options, versions earlier than this provide the older style integration.

Neither option requires specific software to be installed on the client PC.
There may need to be configuration performed for Hansen which is not covered by this documentation.

Interface between Weave and Infor Hansen applications.doc
URL Helper to Hansen Deployment Document.pdf

Server

The Weave server requires the addition of a single bundle to provide the linkage between Weave and Hansen.

The following two sections outline the installation and configuration of this bundle.

Installation

The newest 5.x version is available via the Weave 2.5 Interop installer and does not need to be manually installed.

The Weave server requires the installation of a single Hansen related bundle

Older: com.cohga.weave.hansen_2.0.2.jar
Newer: com.cohga.weave.hansen_4.1.0.jar

which should be copied to the ...\weave\platform\plugins directory and an entry added to the ...\weave\patform\configuration\config.ini file to ensure that the bundle is started automatically whenever the server is started.

An example of the addition of the Hansen bundle to config.ini is as follows:

...
com.cohga.client.details@4:start,\
com.cohga.weave.confirm@4:start,\ 
com.cohga.weave.hansen@4:start,\
...

Once this is done a restart of the server will make the Hansen functionality available on the server.

Configuration

The configuration of the Hansen bundle in Weave is a two part process. The first step is to configure the Hansen bundle itself, and then the buttons are added to the client.

Server

Both Hansen versions uses the namespace:

com.cohga.weave.hansen

So this should be added to your config.xml file, for example:

Hansen v2 and v4 Initial Setup
<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:com.cohga.server.config" xmlns:hansen="urn:com.cohga.weave.hansen">
...
</config>

Hansen v2 Server Configuration

The older Weave/Hansen integration supports the push/pull method of integration. Using this method, a transfer between the two systems is done in two steps. The first step pushes the transfer to a database from one application, and in the second step the user switches to the other application and pulls that transfer from the database.

The Hansen specific configuration involves defining the data source and table name that will be used to perform the transfer, and specifying which entities should be enabled for transferring between the two systems. Column names in the table can also be changed if they're different from the defaults.

A template hansen.xml file to configure the server components is shown as follows:

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

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:hansen="urn:com.cohga.weave.hansen#1.0">

    <hansen:config>
        <!-- Must have the following two -->
        <datasource>DATASOURCE_NAME</datasource>
        <table>HANSEN_TABLE_NAME</table>

        <!-- Must have at least one entity -->
        <entity>ENABLED_ENTITY</entity>
        <entity>ANOTHER_ENABLED_ENTITY</entity>
        <entity>AND_YET_ANOTHER_ENABLED_ENTITY</entity>
    </hansen:config>

</config>

It is also possible to specify the 'comp type' for each entity that will allow the Hansen bundle to perform an optimisation when transferring selections

Hansen v2 Alternate Configuration
<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:hansen="urn:com.cohga.weave.hansen#1.0">

    <hansen:config>
        <!-- Must have the follwoing two -->
        <datasource>DATASOURCE_NAME</datasource>
        <table>HANSEN_TABLE_NAME</table>

        <!-- Must have at least one entity -->
        <entity id="ENABLED_ENTITY" comptype="COMP_TYPE_1"/>
        <entity id="ANOTHER_ENABLED_ENTITY" comptype="COMP_TYPE_2"/>
        <entity id="AND_YET_ANOTHER_ENABLED_ENTITY" comptype="COMP_TYPE_3"/>
    </hansen:config>

</config>

Hansen v4 Server Configuration

If you're using the newer version of the Hansen integration bundle then the configuration is different from version 1.

The configuration maps the Hansen viewer types to Weave entities, you need to know what the viewer type codes are and which entities they correspond to. Currently more than one entity can map to a single Hansen viewer, but entities can only map to a single viewer type.

The link between the 2 systems is performed by opening a browser window with a URL containing the viewer type and the id's to transfer between them.

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

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:hansen="urn:com.cohga.weave.hansen#1.0">

    <hansen:config>
        <!-- Must have the following, the URL to open Hansen for asset display -->
        <url>http://server/InformationViewer.aspx</url>

        <!-- Must have the following, the URL to create an asset group in Hansen, available at version 4.1.0  -->
	<group>http://server/HansenInterface/CreateAssetGroup.aspx</group>

        <!-- And must have at least one viewer defined -->

        <!-- Mapping a Hansen viewer type to a single Weave entity -->
	<viewer id="HANSEN_VIEWER_TYPE">
		<entity id="WEAVE_ENTITY_ID"/>
	</viewer>

        <!-- Mapping a Hansen viewer type to a single Weave entity and filtering keys -->
	<viewer id="HANSEN_VIEWER_TYPE">
		<entity id="WEAVE_ENTITY_ID" filter="WEAVE_FILTER_ID"/>
	</viewer>

        <!-- Mapping a Hansen viewer type to multiple Weave entities -->
	<viewer id="HANSEN_VIEWER_TYPE">
		<entity id="WEAVE_ENTITY_ID"/>
		<entity id="ANOTHER_WEAVE_ENTITY_ID"/>
		<entity id="AND_ANOTHER_WEAVE_ENTITY_ID"/>
	</viewer>

        <!-- Mapping a Hansen viewer type to multiple Weave entities and filtering keys -->
	<viewer id="HANSEN_VIEWER_TYPE">
		<entity id="WEAVE_ENTITY_ID" filter="WEAVE_FILTER_ID"/>
		<entity id="ANOTHER_WEAVE_ENTITY_ID" filter="ANOTHER_WEAVE_FILTER_ID"/>
		<entity id="AND_ANOTHER_WEAVE_ENTITY_ID" filter="AND_ANOTHER_WEAVE_FILTER_ID"/>
	</viewer>

    </hansen:config>
</config>

The Hansen viewer types will be something like "WO" for Work Orders, "PRCL" for Parcel or "ASSET" for asset types.

If a filter is specified then the id's coming from Hansen will be passed through the filter before being applied to the entity, and when sending the Hansen the process will be reversed.

Filtering identifiers

If you need to filter the values then you can specify a filter when setting up the entities and add the definition for the filter. Note the addition of the new xmlns:filter="urn:com.cohga.selection.filter#1.0" namespace.

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

<config xmlns="urn:com.cohga.server.config" xmlns:hansen="urn:com.cohga.weave.hansen" xmlns:filter="urn:com.cohga.selection.filter">

  <hansen:config id="production">
    <url>http://server/InformationViewer.aspx</url>
    <viewer id="PROP">
      <entity id="property" filter="hansen.property"/>
    </viewer>
  </hansen:config>

  <filter:db id="hansen.property">
    <datasource>main</datasource>
    <table>GEMS_LINK</table>
    <keycolumn>PID</keycolumn> <!-- column used in spatial database -->
    <idcolumn>PRUPI</idcolumn> <!-- column required for trim -->
  </filter:db>

</config>

Hansen v5 Server Configuration

 The newest version provides more flexibility in the server configuration, note the updated version number 5.0 in the namespace urn:com.cohga.weave.hansen#5.0

Example Hansen 5.x configuration
<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:hansen="urn:com.cohga.weave.hansen#5.0">

    <hansen:config>
		<!-- Base URL for launching Hansen viewer -->
        <url>http://vhansen/hanseninterface/InformationViewer.aspx?viewertype=ASSET</url>

		<!--viewer is for Send to Hansen, mapping is for Send to Weave -->
		<viewer id="96">
			<entity>lyr_buildings</entity>
		</viewer>
		<mapping id="96">
			<entity>lyr_buildings</entity>
		</mapping>

		<viewer id="1000001">
			<entity>lyr_playspaces</entity>
		</viewer>
		<mapping id="1000001">
			<entity>lyr_playspaces</entity>
		</mapping>

		<viewer id="30">
			<entity>lyr_sw_pits</entity>
		</viewer>
		<mapping id="30">
			<entity>lyr_sw_pits</entity>
		</mapping>

		<viewer id="31">
			<entity>lyr_sw_pipes</entity>
		</viewer>
		<mapping id="31">
			<entity>lyr_sw_pipes</entity>
		</mapping>

		<viewer id="32">
			<entity>lyr_sw_nodes</entity>
		</viewer>
		<mapping id="32">
			<entity>lyr_sw_nodes</entity>
		</mapping>

		<viewer id="1000003">
			<entity>lyr_bbqs</entity>
		</viewer>
		<mapping id="1000003">
			<entity>lyr_bbqs</entity>
		</mapping>

		<viewer id="68">
			<entity>lyr_roadseg</entity>
		</viewer>
		<mapping id="68">
			<entity>lyr_roadseg</entity>
		</mapping>

		<viewer id="97">
			<entity>lyr_roadpath</entity>
		</viewer>
		<mapping id="97">
			<entity>lyr_roadpath</entity>
		</mapping>

		<!-- create asset group in Hansen -->
		<group url="http://vhansen/hanseninterface/CreateAssetGroup.aspx">
			<entity>lyr_buildings</entity>
			<entity>lyr_playspaces</entity>
			<entity>lyr_sw_pits</entity>
			<entity>lyr_sw_pipes</entity>
			<entity>lyr_sw_nodes</entity>
			<entity>lyr_bbqs</entity>
			<entity>lyr_roadseg</entity>
			<entity>lyr_roadpath</entity>
		</group>

		<!-- Setup a project link -->
		<project url="http://wrath:8080/InformationViewer.aspx">
			<entity>lyr_buildings</entity>
			<entity>lyr_playspaces</entity>
			<entity>lyr_bbqs</entity>
		</project>

		<!-- Setup a work order link -->
		<workorder url="http://wrath:8080/InformationViewer.aspx">
			<entity>lyr_buildings</entity>
			<entity>lyr_playspaces</entity>
			<entity>lyr_bbqs</entity>
		</workorder>

		<!-- Filter the bbq id's when sending/receiving -->
		<!-- The filter is defined the same as v4 -->
		<filter entity="lyr_bbqs" id="hansen.filter.bbq"/>

    </hansen:config>
</config>

 

Testing

It's possible to test the link from Hansen to Weave without having the Hansen side installed, you just need to open a Weave client with a couple of additional parameters, 'viewertype' and 'srcid', e.g.

http://server:8080/weave/hansen.html?viewertye=PROP&srcid=11000,11001,11002

This should open the 'hansen' client (which presumably you've configured with the Hansen button) and select and zoom to the entities that have been setup with the viewer type of 'PROP', performing any filtering required to map 11000, 11001 and 11002 to the appropriate values if filtering was configured for the viewer type in Weave.

Similarly testing the Hansen send button in Weave will open a new browser window with similar parameters but if the Hansen integration components aren't installed then the browser will not display the correct results but you can at least check that the URL parameters are what you'd expect to be passed.

Client

v2 Client

The two buttons available for integration between Weave and Hansen are:

Hansen v1 Client Button Configuration
<item action="com.cohga.hansen.Send"/>
<item action="com.cohga.hansen.Get"/>

These buttons should be added to a toolbar at the appropriate location to make them available to the user.

v4/5 Client

The one button available for integration between Weave and Hansen is:

Hansen v2 Client Display Button Configuration
<item action="com.cohga.hansen.Send"/>

This button should be added to a toolbar at the appropriate location to make it available to the user.

As of version 4.1.0 of the bundle there is another client button for creating groups in Hansen.

Hansen v2 Client Group Button Configuration
<item action="com.cohga.hansen.Group"/>

This button can also be added to a toolbar at the appropriate location to make it available to the user.
Or both buttons can be added to a menu in the toolbar instead.