Enabling and configuring the SMS transport
Enabling the Short Message Service (SMS) transport
extends cross-channel access by offering mobile device capabilities
in WebSphere Commerce. Mobile messaging enhances the shopper's
access to information by providing access through their mobile device.
About this task
This task enables and configures the SMS transport in
WebSphere Commerce using the Administration Console. The steps involved
in this task include:
- Adding an SMS transport to the site, if necessary, using the Administration Console transports.
- Creating and configuring a message type using the Administration Console message types.
- Mapping the message type to a JSP file by editing the struts-config.xml configuration file.
Procedure
Results
After completing the preceding steps in order, you have:
- Added an SMS transport to the site using the Administration Console transports.
- Created and configured a message type using the Administration Console message types.
- Optional: Mapped the message type to a JSP file by editing the struts-config.xml configuration file.
Example
A sample mapping is created between the SMS transport and the sample OrderReceivedSMS.jsp file.
- Complete steps 1 through 14, based on the OrderReceived message type for the SMS transport.
- Create a new OrderReceivedSMS.jsp file with the following sample
content:
<%@ page import="com.ibm.commerce.command.*" %><%@ page import="com.ibm.commerce.common.objects.*" %><%@ page import="com.ibm.commerce.server.*" %> <% try { JSPHelper jhelper = new JSPHelper(request); String orderId = jhelper.getParameter("orderId"); CommandContext commandContext = (CommandContext)request.getAttribute(ECConstants.EC_COMMANDCONTEXT); StoreAccessBean storeAB = commandContext.getStore(); StoreEntityDescriptionAccessBean storeEntDescAB = storeAB.getDescription(new Integer(storeAB.getLanguageId())); String storeName = storeEntDescAB.getDisplayName(); out.println("Thank you for shopping at "+ storeName + ". We received your order, number " + orderId + "."); } catch (Exception e) { out.println(e); } %>
- Open the struts-config.xml configuration file and insert the following
code snippet:
<forward className="com.ibm.commerce.struts.ECActionForward" name="OrderReceivedView/0/-7" path="/OrderReceivedSMS.jsp"> <set-property property="resourceClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/> <set-property property="properties" value="storeDir=no"/> <set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/> <set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/> <set-property property="direct" value="true"/> </forward>
In this example, the -7 value represents the SMS device format as defined in the DEVICEFMT database table, and maps the OrderReceived view to the OrderReceivedSMS.jsp file.
- Save the struts-config.xml configuration file. The sample OrderReceivedSMS.jsp file is now mapped to the OrderReceived view for the SMS transport.