Showing posts with label BOD Objects to Set in Custom Data Reader. Show all posts
Showing posts with label BOD Objects to Set in Custom Data Reader. Show all posts

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

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

// ----------------------------------- Adding Source Catalog Entry 
// Create PartNumberIdentifierType Object
PartNumberIdentifierType partNumberIdentifierType = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType.setPartNumber("Moto-G");

// Create CatalogEntryIdentifierType Object
CatalogEntryIdentifierType CatIdentifierType = CommerceFoundationFactory.eINSTANCE.createCatalogEntryIdentifierType();
CatIdentifierType.setExternalIdentifier(partNumberIdentifierType);

// Create Basic Details of Catentry Object
CatalogEntryType catEntryType = CatalogFactory.eINSTANCE.createCatalogEntryType();
catEntryType.setCatalogEntryIdentifier(CatIdentifierType);
List<AssociationType> catentryAssoTypeList = catEntryType.getAssociation();

// ----------------------------------- Adding Merchandising Association 1 
// Create PartNumberIdentifierType Object
PartNumberIdentifierType partNumberIdentifierType1 = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType1.setPartNumber("Moto-G-FlipCover");

// Create CatalogEntryIdentifierType Object
CatalogEntryIdentifierType CatIdentifierType1 = CommerceFoundationFactory.eINSTANCE.createCatalogEntryIdentifierType();
CatIdentifierType1.setExternalIdentifier(partNumberIdentifierType1);

CatalogEntryReferenceType catEntRefType1 = CatalogFactory.eINSTANCE.createCatalogEntryReferenceType();
catEntRefType1.setCatalogEntryIdentifier(catalogEntryIdentifierType);

// Association Type
AssociationType associationType1 = CatalogFactory.eINSTANCE.createAssociationType();
associationType1.setCatalogEntryReference(catEntRefType);
associationType1.setName("Accessory");
associationType1.setQuantity(Double.parseDouble("1"));
associationType1.setDisplaySequence("1");

// Adding created Merchandising Association to the list
catentryAssoTypeList.add(associationType1);

// ----------------------------------- Adding Merchandising Association 2
// Create PartNumberIdentifierType Object
PartNumberIdentifierType partNumberIdentifierType2 = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType2.setPartNumber("Moto-X");

// Create CatalogEntryIdentifierType Object
CatalogEntryIdentifierType CatIdentifierType2 = CommerceFoundationFactory.eINSTANCE.createCatalogEntryIdentifierType();
CatIdentifierType2.setExternalIdentifier(partNumberIdentifierType);

CatalogEntryReferenceType catEntRefType2 = CatalogFactory.eINSTANCE.createCatalogEntryReferenceType();
catEntRefType2.setCatalogEntryIdentifier(catalogEntryIdentifierType);

// Association Type
AssociationType associationType2 = CatalogFactory.eINSTANCE.createAssociationType();
associationType2.setCatalogEntryReference(catEntRefType);
associationType2.setName("UpSell");
associationType2.setQuantity(Double.parseDouble("1"));
associationType2.setDisplaySequence("1");

// Adding created Merchandising Association to the list
catentryAssoTypeList.add(associationType2);

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

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........

Salesforce | Administration | Email-to-Case | Create Cases using Email-to-Case

Email to Case Setup ·        Click on Email-to-Case ·         Enable the following flags, ·        Provide the Routing Addres...