Before you start
You can extend Social Commerce widgets and services to provide additional capabilities for your end users. This short tutorial will cover an extension scenario that modifies both a widget and its underlying service provider. The tutorial supplements the information described in the Information Center topic, Creating new service adapters.
The final objective is to extend the existing Review Widget to display the rating distribution using a Dojo dialog widget. The overall rating section listens to a mouse over event and opens up the dialog widget to display the rating distribution as shown in Figure 1. The underlying service provider implementation is extended to send the rating distribution data back to the widget to support this new feature. You can use this new extended Review Widget at the store front in the category or sub-category pages or product quick view widgets to display the rating distribution to the shopper. Actual reviews are then displayed in the detailed product pages.
Figure 1. Rating distribution
This tutorial is for Java programmers with skills and experience at a beginner level. You need to be familiar with the WebSphere Commerce development environment. Additionally, you also need to be familiar with using WebSphere sMash and the Dojo toolkit.
To create the examples in this tutorial, you need WebSphere Commerce Developer V7 installed and configured. To configure WebSphere Commerce Developer V7 with the Social Commerce feature, see Enabling and configuring Social Commerce.
This tutorial takes about one hour to complete.
The Social Commerce feature packaged with WebSphere commerce environment comes with a set of custom Dojo widgets to display blogs, photos, and reviews by connecting to different service providers. However, merchants might need to extend these widgets or connect to a different service provider to capture or display additional data at the store front. This tutorial shows you how to extend the existing Review Widget and the service provider implementations to display the rating distribution. With this extension, the Review Widget can display a breakup of users against each rating value (hereafter referred to as the rating distribution), along with the overall average rating.
Several steps are needed to extend the widget and service adapters and to publish the assets into the zero repository. At a high level, the steps are:
- Set up the development environment.
- Prepare Social Commerce applications to use the test adapters.
- Prepare Social Commerce applications to use the test application.
- Test Social Commerce applications with the test adapters.
- Extend and implement the service provider layer.
- Extend the Review Widget to display the rating distribution.
- Configure the soccom application to use the extended service adapter.
- Update SocApp to put dependencies on the new project.
- Publish the assets into the zero repository.
- Update the test application to test the new feature.
- Configure the Madisons store to use the new widget.