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>