Tutorial: Supporting extended sites in the Recipes tool
This is the third tutorial in the Recipes tool scenario. The objective of this tutorial is to support extended site features for the Recipes tool that you created in Tutorial: "Adding a Recipes tool to the Management Center".
WebSphere Commerce supports the extended sites business model, where a seller can have many sites aimed at different audiences. For example, a seller may create sites based on geographical regions, whereas some customized sites are created for individual large merchants. All these different sites can share assets such as the catalog, whereby each site selects the subset of the catalog that are represented, and adjusts the prices or other features as necessary. The extended sites business model supports businesses using multiple strategies to make its products available. Each site appears unique to the users that access it, and each site can implement business rules unique to that site.
For more details about extended sites, the following resources are available to you:
- Extended sites
- Extended sites information model
- A WebSphere Support Technical Exchange presentation: Extended Sites Business Model in WebSphere Commerce
In this tutorial, we will remodel the Recipes tool with support for extended sites. The customizations in this tutorial are usually performed in conjunction with the work you completed in the previous tutorial; however, the Recipes scenario introduces these concepts separately. The sample extended site store that you created will be used in the recipe customization. Due to the scope of this effort, you perform only the key steps and points in each lesson.
The following diagram shows the user interface changes that we will make in this tutorial. On the left side of the diagram, the user interface for Usage Association , which are the associations between Recipes and Catalog Entries, is shown, when you have completed Tutorial: Adding a Recipes tool to the Management Center. On the right side of the diagram, the extended site representation of the same interface is shown. The Usage Association table is split into two tables; the one on top displays the usage associations that are inherited from and owned by the asset store and the one at the bottom displays the usage associations that are owned by the current store (local usage associations).
Before customization With extended sites
Learning objectives
After completing this tutorial you should be able to:
- Change Management Center definitions to support extended sites store
- Change Management Center view definitions, such as the properties views and list views to support extended sites store.
- Change JSPs files to support extended sites store.
Time required
Expect this tutorial to take 4-5 hours to complete.
Skill level
Advanced
Audience
This tutorial is intended for WebSphere Commerce developers that are responsible for creating and customizing the Management Center user interface in an extended sites model.
System requirements
Before beginning this tutorial, ensure that you have fulfilled the following prerequisites:
- Installed WebSphere Commerce version 7.
- Installed WebSphere Commerce Developer version 7.
- Downloaded the completed tutorial code for this tutorial for the reference, placing it in a temporary file folder, such as TutorialEsiteSourceCode. During the lessons, you are instructed to copy code from TutorialEsiteSourceCode into the newly created directory, where TutorialEsiteSourceCode is the location where you unzipped the sample source code.
- Download the completed tutorial code for WebSphere Commerce v7 and Feature Pack 1.
- Download the completed tutorial code for WebSphere Commerce v7 Feature Pack 2.
Prerequisites
This tutorial is the third tutorial in the Recipes scenario. Complete the following tutorials before proceeding with this one:
- Tutorial: Creating the Recipe BOD services module
- Tutorial: Adding a Recipes tool for the Management Center
To complete this tutorial you should also be familiar with the following terms and concepts:
- Extended sites
- WebSphere Commerce services
- Management Center framework
- Web services
- Access control
- XML
- SQL
- OpenLaszlo
- Rational Application Developer
- JSP files
Lessons in this tutorial
- Create a new relationship for the RecipeTutorial sample store
To inherit shared Recipes from an asset store in an extended site store, it is necessary to create a relationship between the extended site store and the asset store. In this tutorial, the name of the new RecipeTutorial store relation type is com.mycompary.commerce.recipe.
- Model Management Center object definitions
In the Management Center, a business object represents an entity that is stored on the WebSphere Commerce Server. The objects created to build the Recipe tool were defined in the previous tutorial. For extended sites, the inherited object concept is introduced, and the object definitions need to change to support it. In this lesson, we will remodel the Recipes tool objects for extended sites.
- Changing Management Center views to display the new objects
For each Management Center object, you work with its information using one of three views: a list view, a properties view, or a calendar view. In this tutorial, you use the list view and the properties view. In this lesson, the view definitions are changed according to the change in the object definitions. For example, add a new view for inherited objects, otherwise inherited objects are not displayed.
- Modify JSP files to display the Management Center objects.
JSP files are responsible for retrieving Management Center objects by transforming nouns into XML. The Management Center uses this XML to create objects. The new objects have already been defined, now we will change the JSP files to provide corresponding XML for the objects. Serialization JSP files need to be created, to add the section to compare the object storeId with the current storeId in order to dynamically set the object type.
- Test the Recipes tool extended sites customization
This lesson will guide you through creating users with different roles and test the Recipes tool extended sites customization.
Related reference
Management Center modeling guidelines for extended sites