This discussion is archived
2 Replies Latest reply: Dec 26, 2012 11:36 AM by monotone RSS

Including sku attributes in product-sku-output-config.xml

monotone Newbie
Currently Being Moderated
Hello,

We have configured the product catalog integration between ATG and Endeca successfully and now I'm guessing how to expand/include other attributes of SKU into the Endeca Index, such as thumbnail and large Images which we are using as External Media Elements. I bet we'll have to customize product-sku-output-config.xml file, but how may this be accomplished?

Any tip or direction?

Thank you very much,

Rogerio Biondi
Discover Technology

Edited by: monotone on Dec 11, 2012 12:28 PM
  • 1. Re: Including sku attributes in product-sku-output-config.xml
    961399 Newbie
    Currently Being Moderated
    Hi, monotone!

    Yesterday I faced with this issue too and resolved it in such way.

    1. Create product-sku-output-config.xml file in config folder of your module: config/atg/endeca/index/commerce/product-sku-output-config.xml

    2. Extend it by adding needed properties. If property value is primitive type, you may just add property:

    >
    <item item-descriptor-name="product">
         <properties>
              <property name="displayName" output-name="product.displayName" type="string" />
         </properties>
    </item>
    >

    If property value is Object, you must create property accessor that use custom logic for determining the values of properties that you specify. For example, the value of mediumImage is RepositoryItem of Media type. If you want to get medium image url (mediumImage.url), you may write so property accessor:

    >
    public class MediumImagePropertyAccessor extends PropertyAccessorImpl {

         private String mediumImagePropertyName = "mediumImage";
         private String urlPropertyName = "url";
         
         protected Object getTextOrMetaPropertyValue(Context pContext, RepositoryItem pItem, String pPropertyName, PropertyTypeEnum pType) {
              RepositoryItem externalMediaItem = (RepositoryItem) pItem.getPropertyValue(mediumImagePropertyName);
              String imageUrl = externalMediaItem.getPropertyValue(urlPropertyName).toString();

              return imageUrl;
         }
    }
    >

    After that you must specify this accessor in property-accessor attribute of your property in product-sku-output-config.xml:

    >
    <item item-descriptor-name="product">
         <properties>
              <property name="mediumImage" output-name="product.mediumImage"
                   type="string" property-accessor="/com/something/endeca/index/accessor/MediumImagePropertyAccessor" />
         </properties>
    </item>
    >

    3. Do baseline index via ProductCatalogSimpleIndexingAdmin component.

    Refer to http://docs.oracle.com/cd/E35318_02/Platform.10-1-1/ATGEndecaIntegrationGuide/html/s0401configuringendecaindexingoutputc01.html for more information.
  • 2. Re: Including sku attributes in product-sku-output-config.xml
    monotone Newbie
    Currently Being Moderated
    Thank you very much for your help. I tried the actions described above and it worked fine!
    The only problem faced is that if the xml file is in the project it does not work. It has to be placed in production_server/localconfig instead.

    Best regards

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points