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

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

// Create PartNumberIdentifierType Object
PartNumberIdentifierType partNumberIdentifierType = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType.setPartNumber("MotoG");

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

// Create CatalogEntryType Object
CatalogEntryType catEntryType = CatalogFactory.eINSTANCE.createCatalogEntryType();
catEntryType.setCatalogEntryIdentifier(catalogEntryIdentifierType);

// Get the List object which stores the attachment references from catEntry object
List<AttachmentReferenceType> catAtcmtRefTypList = catEntryType.getAttachmentReference();

// Create AttachmentUsageType Object
AttachmentUsageType attachmentUsageType = CommerceFoundationFactory.eINSTANCE.createAttachmentUsageType();
attachmentUsageType.setUsageName("Img_Center_180_135");

// Create AttachmentExternalIdentifierType Object
AttachmentExternalIdentifierType attachmentExternalIdentifierType = CommerceFoundationFactory.eINSTANCE.createAttachmentExternalIdentifierType();
attachmentExternalIdentifierType.setIdentifier("MyImage1");

// Create AttachmentIdentifierType Object
AttachmentIdentifierType identifierType = CommerceFoundationFactory.eINSTANCE.createAttachmentIdentifierType();
identifierType.setExternalIdentifier(attachmentExternalIdentifierType);

// Create AttachmentReferenceType Object
AttachmentReferenceType attachmentReferenceType = CommerceFoundationFactory.eINSTANCE.createAttachmentReferenceType();
attachmentReferenceType.setAttachmentUsage(attachmentUsageType);
attachmentReferenceType.setAttachmentIdentifier(identifierType);
atchmtRefTypList.add(attachmentReferenceType);

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 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 Attributes Dataload | BOD Objects to Set in Custom Data Reader

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

// Create CatalogEntryAttributesType
CatalogEntryAttributesType catentryAttrType = CatalogFactory.eINSTANCE.createCatalogEntryAttributesType();

// Create PartNumberIdentifierType
PartNumberIdentifierType partNumberIdentifierType = CommerceFoundationFactory.eINSTANCE.createPartNumberIdentifierType();
partNumberIdentifierType.setPartNumber("Reebok_1234");

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

// Get the attributes list from the Catalog entry
List<CatalogAttributeType> catattrTypeList =  catEntryType.getCatalogEntryAttributes().getAttributes();

// Create Basic Details of Catentry Object
CatalogEntryType catEntryType = CatalogFactory.eINSTANCE.createCatalogEntryType();
catEntryType.setCatalogEntryIdentifier(catalogEntryIdentifierType);
catEntryType.setCatalogEntryAttributes(catentryAttrType);

// ---------------------------------- Adding attributes 1 
// Create AttributeExternalIdentifierType
AttributeExternalIdentifierType attributeExternalIdentifierType1 = CommerceFoundationFactory.eINSTANCE.createAttributeExternalIdentifierType();
attributeExternalIdentifierType1.setIdentifier("Reebok_1234_Wash_Instruction");
AttributeIdentifierType attributeIdentifierType1 = CommerceFoundationFactory.eINSTANCE.createAttributeIdentifierType();
attributeIdentifierType1.setExternalIdentifier(attributeExternalIdentifierType);

// Create ValueType Object
ValueType valueType1 = CatalogFactory.eINSTANCE.createValueType();
valueType1.setValue("Don't wash to with hot water");
valueType1.setIdentifier("Reebok_1234_Wash_Instruction_Val");

// Catalog Attribute Type
CatalogAttributeType catalogAttributeType1 = CatalogFactory.eINSTANCE.createCatalogAttributeType();
catalogAttributeType1.setAttributeIdentifier(attributeIdentifierType);
catalogAttributeType1.setValue(valueType);
catalogAttributeType1.setUsage(DESCRIPTIVE);
catalogAttributeType1.setAttributeDataType("STRING");
catalogAttributeType1.setLanguage("en_US");

// Add this Attribute to catAttrTypeList Object
catAttrTypeList.add(catalogAttributeType1);

// ---------------------------------- Adding attributes 2 
AttributeExternalIdentifierType attributeExternalIdentifierType2 = CommerceFoundationFactory.eINSTANCE.createAttributeExternalIdentifierType();
attributeExternalIdentifierType2.setIdentifier("Reebok_1234_DryCleaning_Instruction");
AttributeIdentifierType attributeIdentifierType2 = CommerceFoundationFactory.eINSTANCE.createAttributeIdentifierType();
attributeIdentifierType2.setExternalIdentifier(attributeExternalIdentifierType);

ValueType valueType2 = CatalogFactory.eINSTANCE.createValueType();
valueType2.setValue("Don't do dry cleaning");
valueType2.setIdentifier("Reebok_1234_DryCleaning_Instruction_Val");

// Catalog Attribute Type
CatalogAttributeType catalogAttributeType2 = CatalogFactory.eINSTANCE.createCatalogAttributeType();
catalogAttributeType2.setAttributeIdentifier(attributeIdentifierType);
catalogAttributeType2.setValue(valueType);
catalogAttributeType2.setUsage(DESCRIPTIVE);
catalogAttributeType2.setAttributeDataType("STRING");
catalogAttributeType2setLanguage("en_US");

// Add this Attribute to catAttrTypeList Object
catAttrTypeList.add(catalogAttributeType2);

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

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

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