Tutorials > Program model > Web services > Customize Web 2.0 and Web services to support personalization

< Previous | Next >


Prepare the database for new engraving attributes

In this step, you create engraving attributes.

These attributes are defined in the PATTRIBUTE table. You can create custom personalization attributes for products. Each personalization attribute has an attribute type.


Procedure

  1. Determine the unique member identifier of the store. Before creating engraving attributes columns, determine the member identifier for your store.

    1. Start the test environment.

    2. Open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp

    3. In the input box, enter the following SQL statement:

      select MEMBER_ID from STOREENT where IDENTIFIER ='Madisons';
      

      Make note of the value.

  2. Create the engraving rows in the PATTRIBUTE table.

    To save engraving attributes for each orderItem to the PATTRVALUE table, first create the attribute types inside of the PATTRIBUTE table.

    To create the Text, Size and Font attributes inside the PATTRIBUTE table:

    1. In the input box, enter the following SQL statement:

      INSERT INTO PATTRIBUTE(PATTRIBUTE_ID, ATTRTYPE_ID, NAME, ENCRYPTFLAG, ACCESSBEANNAME)
              SELECT counter+1,'STRING','engravingText',         0,'com.ibm.commerce.utf.objects.PAttrStringValueAccessBean'
      from keys where tablename='pattribute'; 
              update keys set counter=counter+1 where tablename=
      'pattribute'; 
      
      INSERT INTO PATTRIBUTE(PATTRIBUTE_ID, ATTRTYPE_ID, NAME, ENCRYPTFLAG, ACCESSBEANNAME)
        SELECT counter+1,'STRING','engravingFont',   0,'com.ibm.commerce.utf.objects.PAttrStringValueAccessBean'
      from keys where tablename='pattribute'; 
              update keys set counter=counter+1 where tablename=
      'pattribute'; 
      
      INSERT INTO PATTRIBUTE(PATTRIBUTE_ID, ATTRTYPE_ID, NAME, ENCRYPTFLAG, ACCESSBEANNAME)
        SELECT counter+1,'STRING','engravingSize',   0,'com.ibm.commerce.utf.objects.PAttrStringValueAccessBean'
      from keys where tablename='pattribute'; 
              update keys set counter=counter+1 where tablename=
      'pattribute'; 
      
      SELECT PATTRIBUTE_ID FROM PATTRIBUTE WHERE NAME='engravingText' OR
      NAME='engravingFont' 
              OR NAME='engravingSize';
      

    2. Note the three new Pattribute_id values.

  3. Determine which catalog items are can be engraved. In this example, the wine glasses are the only items that can be engraved.

    1. In the input box, enter the following SQL statement:

      select catentry.catentry_id, catentdesc.name, catentdesc.shortdescription from catentry, catentdesc 
              where catentry.member_id=
      Member_id and catentry.catenttype_id='ItemBean' 
              and catentry.catentry_id = catentdesc.catentry_id and
      catentdesc.language_id=-1;
      

      Where:

      Member_id

      is the member identifier that you recorded above.

    2. Under the Name column find the following catalog entries: Villagois Wineglasses and Hawthorne Wineglasses.

    3. Note the catentry_id values.

  4. Determine the unique identifier of the store

    You must associate all of the catentry_id with each pattribute_id inside of the PATTRPROD table

    Each catalog item now must be associated the PATTRIBUTE, for example to keep track that the wine glass with catentry_id 10022 can have all three PATTRIBUTE values, text, size and font:

    1. In the input box, enter the following SQL statement:

              INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID) VALUES (
      Pattribute_id_text, Catentry_id_Villagois);
            INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID)
      VALUES ('
      Pattribute_id_size', Catentry_id_Villagois);
            INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID)
      VALUES ('
      Pattribute_id_font', Catentry_id_Villagois);
            INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID)
      VALUES (
      Pattribute_id_text,'
      Catentry_id_Hawthorne');
            INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID)
      VALUES ('
      Pattribute_id_size','
      Catentry_id_Hawthorne');
            INSERT INTO PATTRPROD(PATTRIBUTE_ID, CATENTRY_ID)
      VALUES ('
      Pattribute_id_font','
      Catentry_id_Hawthorne');
      

      Where:

      Pattribute_id_text, Pattribute_id_size and Pattribute_id_font

      Are the three Pattribute_id values.

      Catentry_id

      Is a value that you recorded in the preceding step.

< Previous | Next >


+

Search Tips   |   Advanced Search