WebSphere Commerce 7 | Custom Dataload | Catalog Entry Dataload | BOD Objects to Set in Custom Data Reader

If you are writing custom datareader for Catalog Entry Dataload, here is the sample snippet for different BOD Objects to set,

// Create object for partnumber
PartNumberIdentifierType partNumberIdentifierType = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType.setPartNumber("Reebok_765687");

CatalogEntryIdentifierType identifier = CommerceFoundationFactory.eINSTANCE.createCatalogEntryIdentifierType();
identifier.setExternalIdentifier(partNumberIdentifierType);
       
// Create object for parent catgroup

CatalogGroupExternalIdentifierType catGroupExternalIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupExternalIdentifierType();
catGroupExternalIdentifierType.setGroupIdentifier("reebokShoes");

CatalogGroupIdentifierType catGroupIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupIdentifierType();
catGroupIdentifierType.setExternalIdentifier(catGroupExternalIdentifierType);

// Create object for catalog description
CatalogDescriptionType catalogDescType = CatalogFactory.eINSTANCE.createCatalogDescriptionType();
catalogDescType.setLanguage("-1");
catalogDescType.setName("Reebok Express Fancy Shoes");
catalogDescType.setShortDescription("Reebok Express Fancy Shoes sold in India");
catalogDescType.setLongDescription("Reebok Express Fancy Shoes - For comfort and styling");
catalogDescType.getAttributes().put(AVAILABLE, "1");
catalogDescType.getAttributes().put(PUBLISHED, "1");       

// Create Catentry Attributes       
CatalogEntryAttributesType catalogEntryAttributesType = CatalogFactory.eINSTANCE.createCatalogEntryAttributesType();

// Manufacturer Partnumber

StringValueType stringMFPartNumberType = CatalogFactory.eINSTANCE.createStringValueType();
stringMFPartNumberType.setValue("reebokManufacturesIndia");
CatalogAttributeType catalogMFPartNumberAttrType = CatalogFactory.eINSTANCE.createCatalogAttributeType();
catalogMFPartNumberAttrType.setName("ManufacturerPartNumber");
catalogMFPartNumberAttrType.setStringValue(stringMFPartNumberType);
catalogEntryAttributesType.getAttributes().add(catalogMFPartNumberAttrType);
       
// Manufacturer Name

StringValueType stringMFNameType = CatalogFactory.eINSTANCE.createStringValueType();
stringMFNameType.setValue("Reebok Manufacturers India");
CatalogAttributeType catalogMFNameAttrType = CatalogFactory.eINSTANCE.createCatalogAttributeType();
catalogMFNameAttrType.setName("Manufacturer");
catalogMFNameAttrType.setStringValue(stringMFNameType);       
catalogEntryAttributesType.getAttributes().add(catalogMFNameAttrType);
       
// Buyable Flag
StringValueType stringBuyableValType = CatalogFactory.eINSTANCE.createStringValueType();
stringBuyableValType.setValue("1");
CatalogAttributeType catalogBuyableAttrType = CatalogFactory.eINSTANCE.createCatalogAttributeType();
catalogBuyableAttrType.setName("buyable");
catalogBuyableAttrType.setStringValue(stringBuyableValType);
catalogEntryAttributesType.getAttributes().add(catalogBuyableAttrType);       
// Create Basic Details of Catentry Object
CatalogEntryType catentry = CatalogFactory.eINSTANCE.createCatalogEntryType();

// Setting all the constructed objects to Catentry Object

catentry.setCatalogEntryIdentifier(catEntIdType);           
catentry.setParentCatalogGroupIdentifier(catalogGroupIdentifierType);
catentry.getDescription().add(catalogDescType);
catentry.setCatalogEntryAttributes(catalogAttributesType);
catentry.setCatalogEntryTypeCode("ProductBean");   

Set this prepared CatalogEntryType to DataLoadBusinessObject and return the same in next() method for the Custom Data Reader.

Refer WCS | Dataload Utility | Writing Custom Dataload link to know more details of custom data readers

WCS | Custom Dataload | Attribute Dictionary Dataload | BOD Objects to Set in Custom Data Reader

If you are writing custom datareader for Attribute Dictionary Dataload, here is the sample snippet for different BOD Objects to set,

// AttributeDictionary External Identifier Type
AttributeExternalIdentifierType attributeExternalIdentifierType = CommerceFoundationFactory.eINSTANCE.createAttributeExternalIdentifierType();
attributeExternalIdentifierType.setIdentifier("OSInstalled");

// Attribute Dictionary Identifier Type
AttributeIdentifierType attributeIdentifierType = CommerceFoundationFactory.eINSTANCE.createAttributeIdentifierType();
attributeIdentifierType.setExternalIdentifier(attributeExternalIdentifierType);

// Attribute Dictionary Attribute Type
AttributeDictionaryAttributeType attrDictAttrType = CatalogFactory.eINSTANCE.createAttributeDictionaryAttributeType();

// Basic Details of the Attribute Dictionary Attribute
attrDictAttrType.setAttributeIdentifier(attributeIdentifierType);
attrDictAttrType.setName("Operating System Installed");
attrDictAttrType.setAttributeType("AssignedValues");
attrDictAttrType.setAttributeDataType("STRING");
attrDictAttrType.setLanguage("-1");
attrDictAttrType.setDescription("Default Operating System Installed in the Laptop");

// Flags for Attribute Dictionary Attribute
attrDictAttrType.setDisplayable(true);
attrDictAttrType.setSearchable(true);
attrDictAttrType.setComparable(true);
attrDictAttrType.setFacetable(true);
attrDictAttrType.setMerchandisable(true);
attrDictAttrType.setDisplaySequence(Double.valueOf("1"));

Set this prepared AttributeDictionaryAttributeType to DataLoadBusinessObject and return the same in next() method for the Custom Data Reader.

Refer WCS | Dataload Utility | Writing Custom Dataload link to know more details of custom data readers

WCS | Custom Dataload | Catalog Group Dataload | BOD Objects to Set in Custom Data Reader

If you are writing custom datareader for Catgroup Dataload, here is the sample snippet for different BOD Objects to set,

// Catalog Group Details
CatalogGroupExternalIdentifierType catGroupExternalIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupExternalIdentifierType();
catGroupExternalIdentifierType.setGroupIdentifier("shoes")

CatalogGroupIdentifierType catGroupIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupIdentifierType();
catGroupIdentifierType.setExternalIdentifier(catGroupExternalIdentifierType);
       
// Catalog Group Parent Details
CatalogGroupExternalIdentifierType catGroupParentExternalIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupExternalIdentifierType();
catGroupParentExternalIdentifierType.setGroupIdentifier("footwear")

CatalogGroupIdentifierType catGroupParentIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogGroupIdentifierType();
catGroupParentIdentifierType.setExternalIdentifier(catGroupParentExternalIdentifierType);
       
// Catalog Group Description Details       
CatalogDescriptionType catalogDescType = CatalogFactory.eINSTANCE.createCatalogDescriptionType();
catalogDescType.setLanguage("-1");
catalogDescType.setName("Shoes");       

// Setting Details to CatalogGroupType
CatalogGroupType catGroupType = CatalogFactory.eINSTANCE.createCatalogGroupType();
catGroupType.setCatalogGroupIdentifier(catalogGroupIdentifierType);
catGroupType.setParentCatalogGroupIdentifier(catGroupParentIdentifierType);               
catGroupType.getDescription().add(catalogDescriptionType);
catGroupType.setTopCatalogGroup(false);

Set this prepared CatalogGroupType to  DataLoadBusinessObject and return the same in next() method for the Custom Data Reader.

Refer http://yashodtechtalk.blogspot.in/2013/11/wcs-dataload-utility-writing-custom.html link to know more details of custom data readers

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

  Local Store Remote Store Project Type Migrated (Lift & Shift) - Newly Imp...