Samples > Starter stores > Starter store enhancements > Social Commerce > WebSphere Commerce Dojo Enhancements API > Social Commerce services > Implement the Service Adapter API for new service providers


Configure service adapters

After you create a service adapter, configure the new adapter in the SocApp project.


Procedure

  1. In the Enterprise Explorer view, expand SocApp > config and right-click ivy.xml to open this file in the XML editor.

  2. Click the Dependencies tab and click the Add button in the upper right hand corner to open the Dependency Selection dialog.

  3. From the list of dependencies, click the new service adapter project to add a dependency on this project.

  4. From the Filter by list, click Latest major version.

  5. Save and close the file.

  6. Edit the SocApp/config/adapter.config file to configure the new service adapter in the SocApp project. The following code snippet shows the addition of code to identify the class that was created in the module as the implementation of the blog service adapter:

    /config/soccom/adapter/impl/myadapter =
    {
      "blog" :  "com.acme.BlogAdapterImpl"
    }
    

    Where:

    myadapter

    Identifies the name of the service adapter.

    blog

    Identifies the type of resource to implement. For example, blog, profile, review, or photoGallery.

    com.acme.BlogAdapterImpl

    Identifies the class associated with the implementation class for the resource. For example, the Blog resource. For more information about the Blog resource, see com.ibm.commerce.soccom.adapter.IBlogAdapter .
    You can combine the implementations of resources for a single service adapter:

    /config/soccom/adapter/impl/youradapter = {
      "profile" : "com.acme.YourProfileAdapterImpl",   "photoGallery" : "com.acme.YourPhotoGalleryAdapterImpl"
    }
    

    You can also identify the service adapter as the underlying service provider for a resource. For example:

    /config/soccom/adapter/blog = "myadapter"
    

  7. Save and close the adapter.config file.


Next topic: Test service adapters


+

Search Tips   |   Advanced Search