Question

I'm trying to grasp the newer programming model (non Access Bean).

In WebSphere Commerce 7 FEP 5, how do I work out the structure of the object retrieved from the GetData tags?

For example in the snippet below, how would I know what the data structure of catalogEntryDetails is? Class Name, methods etc.?

Also could someone explain where the "metaData" field came from? Should that be in the noun definition, or is it something that's set in code at the mediator layer? I couldn't see a reference to it as an immediate field in the noun definition....

<c:forEach var="metadata" items="${catalogEntryDetails.metaData}" varStatus="status2">
    <c:if test="${metadata.key == 'ThumbnailPath'}">
        <c:set var="thumbNail" value="${env_imageContextPath}/${metadata.value}" />
    </c:if>         
    <c:if test="${metadata.key == 'FullImagePath'}">
        <c:set var="fullImage" value="${metadata.value}" />
    </c:if>
</c:forEach>

catalogEntryDetails object is set from this snippet:

<c:if test="${!empty productId}">
    <%-- Try to get it from our internal hashMap --%>
    <c:set var="key1" value="${productId}+getCatalogEntryViewAllByID"/>
    <c:set var="catalogEntryDetails" value="${cachedCatalogEntryDetailsMap[key1]}"/>
    <c:if test="${empty catalogEntryDetails}">
        <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView" 
            expressionBuilder="getCatalogEntryViewAllByID" varShowVerb="showCatalogNavigationView" maxItems="1" recordSetStartNumber="0">
            <wcf:param name="UniqueID" value="${productId}"/>
            <wcf:contextData name="storeId" data="${storeId}" />
            <wcf:contextData name="catalogId" data="${catalogId}" />
        </wcf:getData>
        <wcf:set target = "${cachedCatalogEntryDetailsMap}" key="${key1}" value="${catalogNavigationView.catalogEntryView[0]}"/>
    </c:if>
</c:if>

<c:if test="${empty productId && !empty WCParam.partNumber}">
        <c:set var="key1" value="${WCParam.partNumber}+getCatalogEntryViewAllByPartnumber"/>
        <c:set var="catalogEntryDetails" value="${cachedCatalogEntryDetailsMap[key1]}"/>
        <c:if test="${empty catalogEntryDetails}">
            <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView" 
                expressionBuilder="getCatalogEntryViewAllByPartnumber" varShowVerb="showCatalogNavigationView" maxItems="1" recordSetStartNumber="0">
                <wcf:param name="PartNumber" value="${WCParam.partNumber}" />
                <wcf:contextData name="storeId" data="${storeId}" />
                <wcf:contextData name="catalogId" data="${catalogId}" />
            </wcf:getData>
            <c:set var="catalogEntryDetails" value="${catalogNavigationView.catalogEntryView[0]}"/>
            <wcf:set target = "${cachedCatalogEntryDetailsMap}" key="${key1}" value="${catalogNavigationView.catalogEntryView[0]}"/>
        </c:if>
</c:if>
Was it helpful?

Solution

The best you can do - examine IBM Infocenter. wcf:GetData docs tell us that retrieved result is specified by "type" parameter. In your case it's "com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType". Once again open docs for CatalogNavigationViewType. Docs tell us that it's method getCatalogEntryView():

Returns the value of the 'Catalog Entry View' containment reference list. The list contents are of type CatalogEntryViewType. List of catalog entries within the given catalog navigation view scope.

So that's the answer to your question: catalogEntryDetails is an instance of CatalogEntryViewType. For some reason I could not find this interface in IBM docs. But you can still find it in com.ibm.commerce.catalog.facade.datatypes package (located in \WCDE_ENT70\workspace\WC\Catalog-DataObjects.jar)

Here it is:

public interface CatalogEntryViewType

{

public abstract String getUniqueID();

public abstract void setUniqueID(String s);

public abstract String getPartNumber();

public abstract void setPartNumber(String s);

public abstract String getName();

public abstract void setName(String s);

public abstract String getThumbnail();

public abstract void setThumbnail(String s);

public abstract String getFullImage();

public abstract void setFullImage(String s);

public abstract String getShortDescription();

public abstract void setShortDescription(String s);

public abstract String getLongDescription();

public abstract void setLongDescription(String s);

public abstract String getManufacturer();

public abstract void setManufacturer(String s);

public abstract String getKeyword();

public abstract void setKeyword(String s);

public abstract boolean isHasSingleSKU();

public abstract void setHasSingleSKU(boolean flag);

public abstract void unsetHasSingleSKU();

public abstract boolean isSetHasSingleSKU();

public abstract String getSingleSKUCatalogEntryID();

public abstract void setSingleSKUCatalogEntryID(String s);

public abstract String getStoreID();

public abstract void setStoreID(String s);

public abstract List getAttachments();

public abstract List getPrice();

public abstract String getParentCatalogGroupID();

public abstract void setParentCatalogGroupID(String s);

public abstract String getParentCatalogEntryID();

public abstract void setParentCatalogEntryID(String s);

public abstract Map getMetaData();

public abstract UserDataType getUserData();

public abstract void setUserData(UserDataType userdatatype);

public abstract String getNumberOfSKUs();

public abstract void setNumberOfSKUs(String s);

public abstract List getSKUs();

public abstract List getComponents();

public abstract List getMerchandisingAssociations();

public abstract List getAttributes();

public abstract String getSubscriptionTypeCode();

public abstract void setSubscriptionTypeCode(String s);

public abstract String getDynamicKitURL();

public abstract void setDynamicKitURL(String s);

public abstract String getDynamicKitDefaultConfiguration();

public abstract void setDynamicKitDefaultConfiguration(String s);

public abstract boolean isDynamicKitDefaultConfigurationComplete();

public abstract void setDynamicKitDefaultConfigurationComplete(boolean flag);

public abstract void unsetDynamicKitDefaultConfigurationComplete();

public abstract boolean isSetDynamicKitDefaultConfigurationComplete();

public abstract String getDynamicKitModelReference();

public abstract void setDynamicKitModelReference(String s);

public abstract String getTitle();

public abstract void setTitle(String s);

public abstract String getMetaDescription();

public abstract void setMetaDescription(String s);

public abstract String getMetaKeyword();

public abstract void setMetaKeyword(String s);

public abstract String getFullImageAltDescription();

public abstract void setFullImageAltDescription(String s);

public abstract boolean isBuyable();

public abstract void setBuyable(boolean flag);

public abstract void unsetBuyable();

public abstract boolean isSetBuyable();

public abstract Object getCatalogEntryTypeCode();

public abstract void setCatalogEntryTypeCode(Object obj);

public abstract boolean isDisallowRecurringOrder();

public abstract void setDisallowRecurringOrder(boolean flag);

public abstract void unsetDisallowRecurringOrder();

public abstract boolean isSetDisallowRecurringOrder();

}

The "metaData" field came from this string:

public abstract Map getMetaData();

OTHER TIPS

Yeah you are right it comes from the noun definition configured in the business object mediator config: WC\xml\config\com.ibm.commerce.catalog-fep\wc-business-object-mediator.xml. By default it's built up in by the SolrReadCatalogEntryViewPartMediator. It isn't clear from any documentation I could find I had to decompile to figure it out. FUN :-(

 <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectPartMediator">
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadCatalogEntryViewPartMediator" />
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadCatalogGroupViewPartMediator" />
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadAttachmentAssetViewPartMediator" />
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadSuggestionViewPartMediator" />
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadFacetViewPartMediator" />             
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadBreadCrumbTrailViewPartMediator" />
        <_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadWebContentViewPartMediator" />
        <!-- 
             Note: SolrReadCatalogNavigationViewPostMediator must be declared as the last entry.
        -->
<_config:part-mediator-implementation className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadCatalogNavigationViewPostMediator" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top