Commerce Reference Store includes cross-site links to ATG Home products on the ATG Store site, and links to ATG Store products on the ATG Home site. Cross-site product links appear in the following places:

Commerce Reference Store uses the servlet beans /atg/commerce/multisite/SiteIdForCatalogItem (of class atg.droplet.multisite.SiteIdForItemDroplet) and /atg/dynamo/droplet/multisite/SiteLinkDroplet (of class atg.droplet.multisite.SiteLinkDroplet) to create cross-site links. The following example is adapted from store.war/global/gadgets/crossSiteLinkGenerator.jsp:

<%-- Pass a product repository item to the SiteIdForCatalogItem droplet to
determine the best-matching site ID for the product. --%>
<dsp:droplet name="/atg/commerce/multisite/SiteIdForCatalogItem">
   <dsp:param name="item" param="product" />
   <dsp:oparam name="output">

      <%-- Store the site ID obtained by SiteIdForCatalogItem in a productSiteId
      variable. --%>
      <dsp:getvalueof var="productSiteId" param="siteId" />

      <%-- Pass the site ID and the product's template path to SiteLinkDroplet to
      get a site-specific URL to the product template. --%>
      <dsp:droplet name="/atg/dynamo/droplet/multisite/SiteLinkDroplet">
         <dsp:param name="siteId" value="${productSiteId}" />
         <dsp:param name="path" param="product.template.url" />
         <dsp:oparam name="output">

            <%-- Render the generated URL to the product template, appended with
            the product ID. --%>
            <dsp:getvaluof var="siteLinkUrl" param="url" />
            <dsp:a href="${siteLinkUrl}">
               <dsp:param name="productId" param="product.repositoryId" />
               <dsp:valueof param="product.displayName" />


This example generates the URL as follows:

The resulting URL looks similar to this:


For more information about the SiteLinkDroplet and SiteIdForItemDroplet servlet bean classes, see the ATG Page Developer's Guide.

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