Question

[WCS 7, FixPack 7, Feature Pack 6]

I need to generate a feed with certain catalog entry (product) information such as name, image(s), category, price, seo-url, descriptive attributes and so on.

To generate this feed i will use the scheduler framework and created a controller command which will be invoked after a certain time has passed. Now i need to receive the catalog entry data of each item in a specific store/catalog.

As far as i know there are several ways to achieve this:

  1. Access Beans
  2. SOA (new Access Profile with specific SQL)

I tried to use Access Beans to get all necessary information but I got stuck with seo-url, price etc.

Are there more ways and what is the best practice to get a specific set of catalog entry attributes?

Was it helpful?

Solution

I suggest you study/investigate in your WCS Development environment how site map generation schedule command is implemented (SitemapGenerateCmd) and how it is calling the JSP template file (sitemap.jsp)

you need to modify a bit in your command to create a jsp template for your feed and call that template from your scheduler command you've created . calling template command for messaging system, make sure to use following properties in ActionForward tag to register the JSP for messaging from back-end: example:

<forward className="com.ibm.commerce.struts.ECActionForward"
        name="SitemapIndexView" path="/SitemapIndex.jsp">
        <set-property property="direct" value="true"/>
        <set-property property="resourceClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
        <set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>
        <set-property property="properties" value="storeDir=no"/>
        <set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
    </forward>

then the logic for extracting data from your product/catalog beans will be handled inside the JSP and you can easily form the output data as you want (XML, CSV, JSON .. etc)

the advantages and benefits of using this way are you can leverage Commerce Server OOTB JSTL tags , WCF tags for retrieving all information and using wcf:url for SEO URLS OOTB even you can call BOD/SOA commands using <wcf:getData tag and finally your will get more structured design that can easily maintain and reuse in future .

sitemap.jsp is a good resource for you how to iterate through catalog and sub-catalog to extract product info.

hope that those help you find your solution. need some search and understanding of existing sitemap generation utility .

Thanks.

Abed

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top