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.

6 comments:

  1. Hi Sir,

    I am customizing data load to read from XML data source file.
    I am facing difficulties in loading Accessories.
    I am following your blog and doing alike to load accessories.
    The CatalogEntryType dataloadBusinessObject shows the references correctly, but nothing is getting updated in the database MASSOCCECE table.
    Data load logs shows only the following tables as updated:
    Amount of business objects processed: 2.
    Amount of business objects committed: 2.
    Data loader initialization time: 0 seconds.
    Data loader execution began: Mon Jun 01 03:05:52 EDT 2015
    Data loader execution ended: Mon Jun 01 03:05:54 EDT 2015
    Data loader completed in 2.594 seconds.
    Total flush time: 0.031 seconds.
    Total commit time: 0 seconds.
    Affected tables (7):
    Table name: BASEITEM, Affected number of rows: 2.
    Table name: BASEITMDSC, Affected number of rows: 2.
    Table name: STOREITEM, Affected number of rows: 2.
    Table name: ITEMVERSN, Affected number of rows: 2.
    Table name: DISTARRANG, Affected number of rows: 2.
    Table name: CATENTRY, Affected number of rows: 2.
    Table name: STORECENT, Affected number of rows: 2.

    Could you please help!

    ReplyDelete
    Replies
    1. Can you please share me your sample data XML as well as configuration files?

      Delete
    2. Sorry, I think the input XML file could not get posted.
      Posting again



      PIM159921
      WebCat_9259
      {4F0D9699-9612-4758-93F5-48F74E9D5AB5}
      10



      966730301
      10000


      967241901
      20000



      Delete
    3. I am not able to post the content of the files here. Is there any way I can send these as attachments ?

      Delete
    4. Send them to yashodkumar@gmail.com

      Delete
    5. You connect to the wrong Mediator.

      It should be "com.ibm.commerce.catalog.dataload.mediator.CatalogEntryAssociationMediator"

      Wrong: "com.ibm.commerce.catalog.dataload.mediator.CatalogEntryMediator"

      Delete

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

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