Samples > Starter stores > Starter store enhancements > Social Commerce > WebSphere Commerce Dojo Enhancements API > Social Commerce services
Create new service adapters
Social Commerce is delivered as a set of WebSphere sMash modules that provide a REST API interface which is called by the social content widgets. An adapter is a WebSphere sMash module that implements the Social Commerce Service Adapter API.
To develop a new adapter for a service provider, create a new WebSphere sMash module.
Before you begin
Set up the development environment for WebSphere Commerce sMash:
- Install the sMash Eclipse plug-in. For more information about installing this plug-in, see the IBM WebSphere Commerce sMash Getting Started Guide.
- Start WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Select Window > Preferences to open the Preferences window.
- In the left pane, click WebSphere sMash to open the WebSphere Commerce sMash preference page.
- In the Zero home field, type the full path of the location where the sMash application runtime SocCore project is stored. For example, workspace directory/SocCore.
Procedure
- In the Enterprise Explorer view, select New > Other > WebSphere sMash > WebSphere sMash Application from the File menu.
- Specify a name for the project to add the new service provider adapter code to. For example, specify com.acme.FSBlogAdapter for a project that contains the code for a new Blog Service Adapter.
- Expand project name > config and open the ivy.xml file.
- In the ivy.xml file, use the organization field to specify the organization that owns the adapter. For example, com.acme.
- Save and close the file.
- Click the Dependencies tab and click the Add button in the upper right hand corner to open the Dependency Selection dialog.
- From the list of dependencies, click com.ibm.commerce.soccom.adapter to add a dependency on this project that includes the service adapter interfaces.
- Add the Java classes and code to implement the service adapter interface in the java folder of the new project. For example, SocApp/java. Since the class path for the added dependency is automatically set, you can automatically reference the Java interface or helper classes from the dependencies.
Related tasks
Implement the Service Adapter API for new service providers
Related reference