Get category with all children
This service request, getCategoryWithAllChildren, returns all the child categories, catalog entries and the displays details of a category. The catalog group ID is used in the request.
Request
Request BOD GetCatalogGroup Access profile WC_CatalogGroupAllChildrenProfile Schema /Catalog-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/GetCatalogGroup.xsd Service data object GetCatalogGroupType
Sample request BOD
<_cat:GetCatalogGroup xmlns:_cat="http://www.ibm.com/xmlns/prod/commerce/9/catalog" xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation" xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <oa:ApplicationArea xsi:type="_wcf:ApplicationAreaType"> <oa:CreationDateTime> 2007-01-25T14:42:59.817Z </oa:CreationDateTime> <oa:BODID>429169a0-acac-11db-b8ca-832d45b90840</oa:BODID> <_wcf:BusinessContext> <_wcf:ContextData name="storeId">10001</_wcf:ContextData> <_wcf:ContextData name="catalogId">10001</_wcf:ContextData> </_wcf:BusinessContext> </oa:ApplicationArea> <_cat:DataArea> <oa:Get maxItems="5" recordSetReferenceId="" recordSetStartNumber="25"> <oa:Expression expressionLanguage="wcf:XPath"> {_wcf.ap=WC_CatalogGroupAllChildrenProfile}/CatalogGroup[CatalogGroupIdentifier[UniqueID='10008']] </oa:Expression> </oa:Get> </_cat:DataArea> </_cat:GetCatalogGroup>
Response
Response BOD ShowCategory Schema /Catalog-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ShowCatalogGroup.xsd Service data object ShowCatalogGroupType The response contains the following information:
/CatalogGroup/CatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier /CatalogGroup/Description/@language /CatalogGroup/Description/Name /CatalogGroup/Description/ThumbNail /CatalogGroup/Description/ShortDescription /CatalogGroup/Description/FullImage /CatalogGroup/Description/LongDescription /CatalogGroup/NavigationRelationship/@displaySequence /CatalogGroup/NavigationRelationship/CatalogGroupReference/displayName /CatalogGroup/NavigationRelationship/CatalogGroupReference/CatalogGroupIdentifier/UniqueID /CatalogGroup/NavigationRelationship/CatalogGroupReference/CatalogGroupIdentifier/ExternalIdentifier/@ownerID /CatalogGroup/NavigationRelationship/CatalogGroupReference/CatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier /CatalogGroup/NavigationRelationship/CatalogEntryReference/@catalogEntryTypeCode /CatalogGroup/NavigationRelationship/CatalogEntryReference/displayName /CatalogGroup/NavigationRelationship/CatalogEntryReference/CatalogEntryIdentifier/UniqueID /CatalogGroup/NavigationRelationship/CatalogEntryReference/CatalogEntryIdentifier/ExternalIdentifier/@ownerID /CatalogGroup/NavigationRelationship/CatalogEntryReference/CatalogEntryIdentifier/ExternalIdentifier/PartNumber
Sample response BOD
<_cat:ShowCatalogGroup xmlns:Oagis9="http://www.openapplications.org/oagis/9" xmlns:_cat="http://www.ibm.com/xmlns/prod/commerce/9/catalog" xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Oagis9:ApplicationArea xsi:type="_wcf:ApplicationAreaType"> <Oagis9:CreationDateTime> 2007-01-25T14:43:00.047Z </Oagis9:CreationDateTime> <Oagis9:BODID> 431873f0-acac-11db-83a9-832d45b8fe37 </Oagis9:BODID> </Oagis9:ApplicationArea> <_cat:DataArea> <Oagis9:Show recordSetCompleteIndicator="true" recordSetCount="4" recordSetStartNumber="25" recordSetTotal="29" /> <_cat:CatalogGroup> <_cat:CatalogGroupIdentifier> <_wcf:UniqueID>10008</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000002"> <_wcf:GroupIdentifier> Brake pads </_wcf:GroupIdentifier> </_wcf:ExternalIdentifier> </_cat:CatalogGroupIdentifier> <_cat:Description language="-1"> <_cat:Name>Brake pads</_cat:Name> <_cat:Thumbnail> images/brake_pad_sub_sm.jpg </_cat:Thumbnail> <_cat:FullImage> images/brake_pad_sub_150.jpg </_cat:FullImage> <_cat:ShortDescription> Brake pads </_cat:ShortDescription> <_cat:LongDescription>Brake pads</_cat:LongDescription> </_cat:Description> <_cat:NavigationRelationship displaySequence="1.0"> <_cat:CatalogEntryReference catalogEntryTypeCode="Product"> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10025</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000002"> <_wcf:PartNumber>A0000327</_wcf:PartNumber> </_wcf:ExternalIdentifier> </_cat:CatalogEntryIdentifier> <_cat:displayName> Ferro Carbon Brake Pads </_cat:displayName> </_cat:CatalogEntryReference> </_cat:NavigationRelationship> <_cat:NavigationRelationship displaySequence="1.0"> <_cat:CatalogEntryReference catalogEntryTypeCode="Product"> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10005</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000002"> <_wcf:PartNumber>A0000147</_wcf:PartNumber> </_wcf:ExternalIdentifier> </_cat:CatalogEntryIdentifier> <_cat:displayName> Titanium Brake Pads </_cat:displayName> </_cat:CatalogEntryReference> </_cat:NavigationRelationship> <_cat:NavigationRelationship displaySequence="2.0"> <_cat:CatalogEntryReference catalogEntryTypeCode="Product"> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10010</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000002"> <_wcf:PartNumber>A0000192</_wcf:PartNumber> </_wcf:ExternalIdentifier> </_cat:CatalogEntryIdentifier> <_cat:displayName> Ceramic Brake Pads </_cat:displayName> </_cat:CatalogEntryReference> </_cat:NavigationRelationship> <_cat:NavigationRelationship displaySequence="3.0"> <_cat:CatalogEntryReference catalogEntryTypeCode="Product"> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10015</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000002"> <_wcf:PartNumber>A0000237</_wcf:PartNumber> </_wcf:ExternalIdentifier> </_cat:CatalogEntryIdentifier> <_cat:displayName> Organic Brake Pads </_cat:displayName> </_cat:CatalogEntryReference> </_cat:NavigationRelationship> </_cat:CatalogGroup> </_cat:DataArea> </_cat:ShowCatalogGroup>
Usage
To use this service request on a JSP page use the expression-builder, getCategoryWithAllChildren, and pass the catGroupId parameter.
The expression-builder maps to the following XPath expression:
{_wcf.ap=$accessProfile$}/CatalogGroup[CatalogGroupIdentifier[UniqueID='$catGroupId$']]
The default is: accessProfile=WC_CatalogGroupAllChildrenProfile
This service request uses the
CatalogGroupDataBean data bean.
Exceptions
If there is an error the error is reported in the Response message. You can see the error details in the trace log, SystemOut.log.
Customization
The following extensions are supported:
- Create your own implementation of the interface ComposeCatalogGroupTaskCmd. By creating your own implementation of the ComposeCatalogGroupTaskCmd, and an access profile you can control the level of information returned by these services.
Related concepts
../../com.ibm.commerce.business_process.doc/concepts/processFind_product_(ConsumerDirect).htm
Design pattern for Get service implementation
Related Reference
WebSphere Commerce foundation tag library