Tutorial: Adding new fields in the Catalogs tool
This tutorial continues the Warranty scenario introduced in the tutorial "Adding new properties to a WebSphere Commerce service using the data service layer", where you extended the Catalog schema with warranty and care instruction information. In this tutorial, you extend the Management Center Catalogs tool to manage the warranty and care instruction information, as well as adding logic to show the information about store product pages.
The tutorial is divided into two parts:
- Part 1: Adding a language insensitive property in the Catalogs tool
You customize the Catalogs tool to provide a mechanism to select Warranty information for products in the catalog. You also update the storefront to display the Warranty information to shoppers.
The CatalogEntry noun uses the UserData element as a data extension point to add new data for Warranty without changing the logical model. In this tutorial, Warranty information is added to the CatalogEntry noun UserData element to demonstrate the addition of language independent properties. A Warranty applies to a specific catalog entry and consists of a term or the number of days the Warranty applies and a type, either limited or comprehensive. Warranty information is not translated since it only contains the term and type of Warranty.
After completing part one of this tutorial:
- The WarrantyTerm column is displayed on the product list table in the Catalogs tool.
- The Category Manager can open the property view, browse Warranty information, select values for Warranty term and Warranty type, and save the values to the database.
- The consumer direct store product display pages show warranty information.
- Part 2: Adding language sensitive property in Catalogs tool
You add product care instructions to the CatalogEntryDescription noun. The part attributes element shows the addition of language dependent properties. In this tutorial, a care instruction applies to a specific catalog entry and language. The care instruction consists of a text description of the instruction.
After completing the part two of this tutorial:
- The Category Manager can open the property view to browse the information for the product's care instruction in the Catalogs tool.
- The consumer direct store product display pages show product care instructions and warranty information.
If you are using a workspace environment, some additional work is required to content manage custom data. Complete the instructions in the following tutorial: Tutorial: Adding content managed resources to the Catalog service module.
Learning objectives
After completing this tutorial you should be able to:
- Extend WebSphere Commerce query templates to include new data.
- Update an object definition to include new userdata or attribute property.
- Update a Properties view to include new widget for new property.
- Update a list view to include new widget for new property.
- Create a new JSP file that displays information using the get data tag.
- Update the product display JSP file to link to the new JSP page.
Time required
Expect this tutorial to take 2-3 hours to complete.You can load the completed tutorial code for this tutorial for the reference. However, in order to fully attain the learning objectives, it is recommended that you perform the tutorial step by step.
Skill level
Advanced
Audience
This tutorial is intended for WebSphere Commerce developers responsible for creating and customizing WebSphere Commerce services and customizing OpenLaszlo Client GUI.
System requirements
Before beginning this tutorial ensure that you have fulfilled the following prerequisites:
- Installed WebSphere Commerce Developer version 7.
- The ConsumerDirect store archive must be published.
- Created a category manager .
- Completed the following tutorial: Tutorial: Adding new properties to a WebSphere Commerce service using the data service layer
Prerequisites
To complete this tutorial you should be familiar with the following terms and concepts:
- Web services
- XML
- WebSphere Commerce services
- Relational databases
- SQL
- OpenLaszlo
- Rational Application Developer
- Management Center framework
- JSP
- Access control
- Data service layer
Lessons in this tutorial
- Part 1: Adding language insensitive properties in the Catalogs tool
In this step, you customize the Catalogs tool to support warranty information to the CatalogEntry noun. Follow the same procedure for any language insensitive properties of a noun.
- Extend the resource bundle and properties files
In this lesson, you create a properties file that contains text for the WarrantyTerm column. A properties file is a resource bundle that contains translatable text that displays in the user interface. Resource bundles contain locale-specific objects. By using resource bundle files, the text can be translated into different languages.
- Add a new column to the product list view
In this lesson, you customize the product list table by adding new property warranty information for catalog entries. You update the list view to include new widgets for the new property.
- Create a new tab for warranty information
In this lesson, you customize the product property list view by adding a new tab for warranty information.
- Define combo box values
In this lesson, you define the values for the Warranty term and Warranty type combo boxes. A combo box is a commonly-used GUI widget that contains a drop-down list of values that the user can select.
- Test the customization
In this lesson, you verify that the customization is successful. You can do this either by testing in the Management Center, or by viewing the contents of a BOD message.
- Customize store UI using the getData tag
In this lesson, you create a JSP file that displays warranty information using the getData tag. You update the ProductDisplay.jsp to link to this JSP file for warranty information. After completing the customization, shoppers see a link to "Warranty information" from the Product Display page. When shoppers click this link, the warranty JSP page displays.
- Test the customization in the store
In the lesson, you test the changes in the storefront.
- Part 2: Adding a language-sensitive property in the Catalogs tool
In this lesson, you add care instructions for a product to the Warranty tab. You test the change by viewing the care instruction in the Catalogs tool.
- Add product care instructions to the warranty page
In this lesson, you add code to the warrantyDisplay.jsp file to display language-sensitive care instructions. Then, you reword the name of the warranty link in the ProductDisplay.jsp file. You test the customization by viewing pages in the consumer direct store.
- Deploy the customized code
In this lesson, you deploy the custom code to a target WebSphere Commerce Server. Deploying to the server involves exporting code from WebSphere Commerce development environment and deploying code into target WebSphere Commerce Server.
- Create custom versions of the configuration files
In this step of the tutorial, you create custom versions of the data load order and business object configuration files.
- Test the customization
In this step of the tutorial, you add the warranty information and care instruction data as part of the catalog entry comma-separated value (CSV) file. You then load the categories CSV file and catalog entry CSV file using the Catalog Upload feature.