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 ATG 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>
 
loading table of contents...