Functional flow for the in-context preview function

When you are working on some objects in the Management Center and these objects can be represented by a page in the storefront, you can preview the store pages directly. This feature is called in-context preview. If you want to customize store preview to support in-context preview for new objects, you should understand the functional flow.

Management Center objects can now define a preview service which will get called whenever the object is currently selected in the tool and the store preview icon is clicked. The preview service should return object-specific URLs so that business users can directly preview specific store pages. The following objects are supported by in-context preview:
  • Category, and catalog entry objects in the Catalogs tool
  • Category, catalog entry, and static page objects in the Page Layout tool
The following diagram illustrates the WebSphere Commerce in-context preview functional flow.
Functional flow of in-context preview.

The steps in the diagram are explained here:

  • 1 The in-context preview flow begins when a business user is working on an object and clicks Store preview in Management Center.
  • 2 How the Management Center framework populates the Store Preview Options window with store URLs depends if a GetPreviewURLService service is defined in the primary object definition.
    Customization point: Define the GetPreviewURLService in the object definition. The following example demonstrates the declaration of a Get Preview URL service for a category object:
    <GetPreviewURLService url="/cmc/GetPreviewURL">
    	<ServiceParam name="catgroupId" propertyName="catgroupId" />
    </GetPreviewURLService>
  • 3 If a GetPreviewURLService service call is not defined in the primary object definition, then the Store Preview Options window is populated with store home page URLs using the same functionality before WebSphere Commerce Version 7 Feature Pack 6.
  • 4 If a GetPreviewURLService service call is defined in the primary object definition, then retrieve the URL information for the object through service calls. Depending on the type of store, there are two methods to retrieve the URL for the object.
    4a URL for objects in a direct store or extended sites store
    The URL information is instantly retrieved through the proper service calls.
    4b URL for objects in an asset store
    The findByRelatedStoreUniqueID service is called to get all the extended sites stores that are related to the asset store. Then, for each extended site store, the URL information is retrieved through the proper service calls.
    The following sample demonstrates an expected format for a successful response to a service call in a direct store:
    <objects>
    	<object>
    		<alias>Aurora - table</alias>
    		<url>http://samplestore.com/shop/en/electronics</url>
    	</object>
    </objects>
    The following sample demonstrates an expected format for a successful response to a service call in an asset store:
    <objects>
    	<object>
    		<alias>AuroraEsite1 - table</alias>
    		<url>http://samplestore.com/shop/auroraesite1/en/electronics</url>
    	</object>
    <object>
    		<alias>AuroraEsite2 - table</alias>
    		<url>http://samplestore.com/shop/auroraesite2/en/electronics</url>
    	</object>
    <object>
    		<alias>AuroraEsite3 - table</alias>
    		<url>http://samplestore.com/shop/auroraesite3/en/electronics</url>
    	</object>
    </objects>
    The following service calls are already defined for business objects in your store:
    • If the object is a catalog group-related object, the getCatalogGroupSEObyID service is called.
    • If the object is a catalog entry-related object, the getCatalogEntrySEObyID service is called.
    • If the object is a static page-related object, the findAllSEOStaticPageURLKeywordSummaryByStoreID service is called.

    Customization point: You must create a JSP to retrieve the URL in the expected format.

  • 5 The Store Preview Options window is populated with the object page URL. For asset stores, the object page URLs are populated for each extended site that is related to the asset store.
  • 6 Store preview launches to the URL specified in the Store Preview Options window.