The following examples show some ways to configure three of the alternatives described in the Integration Approaches section:

Configuring the Remote-Only Model

The Remote Only model is sketched in the Integration Approaches section. In this use case model, the data is maintained only on the remote system. Each time that the Oracle Commerce Platform application needs to access the data, a command is issued to the remote system.

To configure this integration model, configure your Integration Repository with transient properties. None of the repository item properties will be stored in the local repository database, so there are no table tags defined in the local repository definition file. In addition, the local-value-timeout attribute in the item descriptors of the Integration Repository is set to a small value. For example, the local repository definition might look like this:

localRepositoryDefinition.xml

<gsa-template>
 <item-descriptor name="contact" display-property="lastName">
 <property name="id" data-type="string"/>
 <property name="firstName" data-type="string" display-name="First Name"/>
 <property name="lastName" data-type="string" display-name="Last Name"/>
 <property name="email" data-type="string" display-name="Email Address"/>
 </item-descriptor>
</gsa-template>

You can define a mapping file that specifies the names of these properties on the remote system:

mapping.xml

<item-descriptor
 repository-path="/atg/integrations/remotex/RemoteXIntegrationRepository"
 name="contact">
 <property name="id" targetName="Id" include="true"/>
 <property name="firstName" targetName="First Name" include="true"/>
 <property name="lastName" targetName="Last Name" include="true"/>
 <property name="email" targetName="Email Address" include="true"/>
</item-descriptor>

The Integration Repository definition file would then look like this:

integrationRepository.xml

<integration-repository-template>
 <item-descriptor name="contact"
 external-id-property="id" use-external-id="true"
 mapping-file="/atg/integrations/remotex/mapping.xml"
 local-value-timeout="1000">
 <query command="/atg/integrations/remotex/GetContacts"
 view-class="atg.integrations.remotex.RemoteXQueryView"/>
 <get-item command="/atg/integrations/remotex/GetContacts"
 use-local-on-failure="false"/>
 <update-item command="/atg/integrations/remotex/UpdateContacts"/>
 </item-descriptor>
</integration-repository-template>

This configuration means that queries and getItem operations use the GetContacts command. Users cannot remove or create contacts in the remote system, since no Command has been defined for these operations, but can update existing ones. If the remote system is unavailable in a getItem operation, then no data is available, since the use-local-on-failure attribute is set to false.

Note that you could change this to provide the Oracle Commerce Platform with read-only access to the remote system by omitting the updateItem Command, leaving only the GetContacts Command to query and get items.

Configuring the Remote-then-Local Model

The Remote then Local model is sketched in the Integration Approaches section. In this case, the primary source for the data is the remote system. A local copy of the data is maintained in the local repository. Each time that the Oracle Commerce Platform application needs to access the data, a command is issued to the remote system. If the command fails to return, then the command is issued to the local repository.

To configure this integration model, use persistent properties that are stored through the local repository in a database on the local system. These persistent properties are defined within table tags in the local repository item descriptors. For example:

localRepositoryDefinition.xml

<gsa-template>
 <item-descriptor name="contact" display-property="lastName">
 <table name="contact" ... >
 <property name="id" data-type="string"/>
 <property name="firstName" data-type="string" display-name="First Name"/>
 <property name="lastName" data-type="string" display-name="Last Name"/>
 <property name="email" data-type="string" display-name="Email Address"/>
 </table>
 </item-descriptor>
</gsa-template>

integrationRepository.xml

The Integration Repository definition file uses the local-value-timeout attribute with a small value, so that subsequent attempts to access an item will continue to try the remote system before resorting to the local repository. In addition, the use-local-on-failure attribute for the getItem command is set to true.

<integration-repository-template>
 <item-descriptor name="contact"
 external-id-property="id" use-external-id="true"
 local-value-timeout="1000">
 <query command="/atg/integrations/remotex/GetContacts"
 view-class="atg.integrations.remotex.RemoteXQueryView"/>
 <get-item command="/atg/integrations/remotex/GetContacts"
 use-local-on-failure="true"/>
 <update-item command="/atg/integrations/remotex/UpdateContacts"/>
 </item-descriptor>
</integration-repository-template>
Configuring the Local-then-Remote Model

The Local then Remote model is sketched in the Integration Approaches section. In this case, a version of the data is maintained in a local repository. Only if the data is not available locally, or if the local copy has expired or otherwise been marked invalid, do we query the remote system for the data.

To configure this integration model, use persistent properties that are stored through the local repository in a database on the local system. The local repository is defined pretty much the same way as in the Configuring the Remote-then-Local Model.

The Integration Repository definition is a bit different. It uses the local-value-timeout attribute with a large value, so that items will remain valid in the local repository for a reasonable length of time.

integrationRepository.xml

<integration-repository-template>
 <item-descriptor name="contact"
 external-id-property="id" use-external-id="true"
 local-value-timeout="3600000">
 <query command="/atg/integrations/remotex/GetContacts"
 view-class="atg.integrations.remotex.RemoteXQueryView"/>
 <get-item command="/atg/integrations/remotex/GetContacts"
 use-local-on-failure="true"/>
 <update-item command="/atg/integrations/remotex/UpdateContacts"
 timeout-response="UNKNOWN"/>
 <add-item command="/atg/integrations/remotex/AddContacts"
 timeout-response="INVALID"/>
 <remove-item command="/atg/integrations/remotex/RemoveContacts"/>
 </item-descriptor>
</integration-repository-template>

Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices