Preparing 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
- Determine the unique member identifier of your store. Before
you create engraving attributes columns, determine the member identifier
for your store.
- Start the test environment.
- Open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp
- In the input box, enter the following SQL statement:
Make note of the value.select MEMBER_ID from STOREENT where IDENTIFIER ='Madisons';
- Creating the engraving rows in the PATTRIBUTE table.
To save engraving attributes for each orderItem to the PATTRVALUE table, you must first create the attribute types inside of the PATTRIBUTE table.
To create the Text, Size and Font attributes inside the PATTRIBUTE table:
- 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 NAME, PATTRIBUTE_ID FROM PATTRIBUTE WHERE NAME='engravingText' OR NAME='engravingFont' OR NAME='engravingSize';
- Note the three new Pattribute_id values.
- In the input box, enter the following SQL statement:
- Determine which catalog items are can be engraved. In this
example, the wine glasses are the only items that can be engraved.
- In the input box, enter the following SQL statement:
Where: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;
- Member_id
- is the member identifier that you recorded above.
- Under the Name column find the following catalog entries: Villagois Wineglasses and Hawthorne Wineglasses.
- Note the catentry_id values.
- In the input box, enter the following SQL statement:
- Determine the unique identifier of your 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 you want to keep track that your wine glass with catentry_id 10022 can have all three PATTRIBUTE values, text, size, and font:
- In the input box, enter the following SQL statement:
Where: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);
- 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.
- In the input box, enter the following SQL statement: