In my previous post, Integrating WebSphere Commerce and Lotus Connections – Part 1, I talked about getting started integrating WebSphere Commerce and Lotus Connections, specifically single sign on, branding, and product integration. In this part, I will address approaches for integrating a shopping cart and account services.
WebSphere Commerce has a url based API called controller commands which interact directly with web controllers which in turn return the name of a view task which is then executed. These controller commands can be used as is, extended, or new ones can be created. They also can be secured based on role. Controller commands serve as the interface to integrate our next integration point, the shopping cart.
Shopping Cart
In this scenario you could render a shopping cart inside of Connections so as you link back and forth, you could always render the shopping cart in the header. One approach is to use a controller command which returns a Javascript Object Notation (JSON) response containing shopping cart data. On the Connections side, an ajax call can be made from the header to Commerce and the response would be JSON which can then be used to render the contents of the cart. A JSON example response that could be used to render a cart is below:
{total:”$75.00″, count:”3″, message:”You qualify for FREE SHIPPING”}
Account Services
Another common integration point might be account services. In this case, there might be an action or event in Connections which requires updating an account specific attribute in Commerce. The built in UserRegistrationUpdate URL is often enough to update user related information. This can be as simple as calling a URL. The full documentation can be found here, but in this example you could update a commerce attribute for city and state via the following URL:
https://<hostname>/webapp/wcs/stores/servlet/UserRegistrationUpdate?storeId=10102&catalogId=30101&langId=-1&city=Austin&state=TX&URL=/webapp/wcs/stores/servlet/AjaxLogonForm?catalogId=90401&myAcctMain=1&langId=-1&storeId=20142
Updating Lotus Connections
Lastly, Lotus Connections provides public REST based APIs which may be used to implement virtually any capability available within Connections. So, in order to update Connections from Commerce, these APIs can be invoked directly from any page within Commerce and provided SSO has been implemented. So for example upon updating account information in Commerce, the Connections profile service could be simultaneously updated.
Pingback: Tweets that mention New blog post: Integrating WebSphere Commerce and Lotus Connections – Part 2 -- Topsy.com
Pingback: Overseer » Blog Archive » websphere commerce