Skip to main content

Posts

How to read applied promotions codes

The below snippet will give you to read the promotions codes which are applied to order number, String orderId = "978593958"; OrderKey orderKey = new OrderKey(new Long(orderId)); PromotionArgumentSessionBeanPersistenceManager promoManager = new PromotionArgumentSessionBeanPersistenceManager(); PromotionArgument promArg = promoManager.load(orderKey); Iterator prmoExeRecds = promArg.getPromotionExecutionRecords(); while(prmoExeRecds.hasNext()) { PromotionExecutionRecord promotionExeecutionRecord = (PromotionExecutionRecord) prmoExeRecds.next(); Promotion promotion = promotionExeecutionRecord.getPromotion(); System.out.println("Name: " + promotion.getName()); System.out.println("Admin description: " + promotion.getDescription(commandContext.getLocale(), com.ibm.commerce.marketing.promotion.Description.SHOPPER_SHORT_DESC)); }

IBM Announces version 9 of WebSphere Commerce!

What’s new in Version 9 includes information about new functionality and changes in existing functionality from previous WebSphere Commerce Version to the modernized WebSphere Commerce Version 9 release: Micro services architecture , with lightweight, self-contained, distributed servers, supports horizontal scaling, parallel development, and utilization of modern, open source tools. Docker containers deliver key benefits for DevOps , including deployment automation, delivery acceleration, and application portability. Flexible deployment options for  Docker containers  gives IT organizations more infrastructure choices for e-commerce workloads, including all cloud options: private, public, or hybrid deployment. Evolution of the technology stacks  makes customization of the brand and business user experience more efficient and cost effective. Key changes include adoption of lightweight IBM WebSphere Liberty, replacement of Enterprise JavaBeans™ (EJBs) with Java™ Pers...

IBM Websphere Commerce V8.0

IBM Websphere Commerce V8.0 is Announced and its Here: Just in case if you have missed the announcement on Oct 1st, 2015 of IBM Websphere Commerce Version 8.0. Here is the  Link . IBM WebSphere Commerce-powered stores are going to get a lot of up-gradation. As IBM releases its  WebSphere Commerce V8.0 enhancements, Merchandisers can expect a richer, easier experience for users and marketers deepen customer engagement, drive customer loyalty, increase revenues, and improve profitability with an improved business user environment. Help deliver a better customer service and support experience. Provide a software platform upgrade to the latest web application server, database, and integrated developer environment, and incorporate earlier WebSphere Commerce V7.0 feature pack capabilities. Key things to know about IBM WebSphere Commerce V8.0: DHTML (Dynamic HTML) :   In Version 8.0, the Management Center is updated to use  Dynamic HTML (DHTML) . ...

Dataload Utility

Data can be loaded into WCS tables using data load utility. WCS Data Load utility performs the following functions in a single operation: 1.                Reads the data from the input source file. 2.                Transforms the source data to Web Sphere Commerce business objects. 3.                Allocates and resolves Web Sphere Commerce business objects to physical data. 4.                Loads the physical data into the database. There are three configurations files and a input source file required to complete the data loader setup. WCS supports only CSV File Reader for other input source you have to write your own Reader Class. This means that if you are using OOB CSV Reader then your input file must be...

Issues While Starting WAS Server

This happens when there is other application which is also using the same port 8880. To resolve the issue, we need to find which application is using the port 8880 through 'netstat' command in command prompt or update our WAS server to not use 8880. We can update the WAS server through these steps: 1) Stop  WAS. 2) Browse to or search for the serverIndex.xml, for example, at "C:\WAS\AppServer\config\yourNode\nodes\yourNode\serverindex.xml" 3) Open the file and locate the following lines:               endPointName="SOAP_CONNECTOR_ADDRESS"> 4) Change "port 8880" to an available port 5) Save the serverindex.xml and restart WAS

Webpshere Commerce Registry

Registry is an another solution for those which can’t be cached using Dyna cache. Another use would be to store configuration data for a store. By using registry, you don't need a server   restart   every time as organization admin console provides an   interface   to refresh registry. The new custom registries will be appearing in the admin console under the   registry section. Steps to create a new custom registry in WCS Step 1. Register the registry in wc-server.xml. <Registries> ...... ..... <registry name="TestRegistry" regClassName="com.wcs.registry.TestRegistry "/>   </Registries> Step 2.Create  a class that implements   interface   com.ibm.commerce.registry.Registry package com.wcs.registry; import java.util.HashMap; import com.ibm.commerce. exception .ECException; import com.ibm.commerce.registry.Registry; import com.ibm.commerce.registry.RegistryManager;     public  cla...

How to do Email Configurations in Web sphere Commerce

Web sphere commerce allows to send email messages to customers by making use of the below mentioned steps. Create the JSP which will be used for generating contents of the email  For e.g.: SendEmail.jsp Create View for the JSP in Struts-Config-Ext.xml Make an Entry in Struts-Config-Ext.xml file for .jsp as below < action path='/SendEmailView' type='com.ibm.commerce.struts.BaseAction'>     < set-property property ='authenticate' value ='10001:1'/>      < set-property property ='https' value ='10001:1'/> < /action> < forward name="SendEmailView /10001/-3" path="/< location of JSP file >/ TestEmail.jsp" className="com.ibm.commerce.struts.ECActionForward">     < set-property property="implClassName"     value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>     < set-property property="int...

Read the Session Data in Web sphere Commerce

By using the below code snippet we can get the session data in Web sphere Commerce. HttpSession httpSession = null; ViewCommandContext viewCmdCtx = (ViewCommandContext) getCommandContext(); Object reqObject = viewCmdCtx.getRequest(); HttpControllerRequestObject httpControllerRequestObject = (HttpControllerRequestObject) reqObject; HttpServletRequest httpRequest = httpControllerRequestObject.getHttpRequest(); httpSession = httpRequest.getSession();

Websphere Commerce Struts-Config.xml Properties

  authenticate :  specifies whether the view requires that the user is authenticated, i.e. that the user has to be a registered user (not guest or generic user). <action path="/RequisitionListDisplayView" type="com.ibm.commerce.struts.BaseAction"> <set-property property=" authenticate " value="10001:1"/> </action> credentialsAccepted:   is used when you have partially authenticed users, i.e. users that have been remembered via the Remember Me function. If a user has not specifically authenticated (i.e. logged on via the Logon command), but has been remembered via the Remember Me persistent cookie, that user is considered partially authenticated my Commerce. <action path="/LogonCmd" parameter="com.ibm.commerce.catalog.commands.LogonCmd" type="com.ibm.commerce.struts.BaseAction"> set-property property="credentialsAccepted" value="0:P" /> </action...

Krypto Parameter in WCS

When we define a view or command as secured page using https in struts-config file then that will add a krypto parameter as shown in the below URL while redirecting. Krypto will have all  the parameters encrypted  as shown below. https://localhost/webapp/wcs/stores/servlet/OrderItemDisplayView?catalogId=10051&langId=-1&storeId=10151&krypto=aLt1shhBswovwONoDZJPI8liwcvzrdPaOx1EbnlkrQ3VPLOhpVtYeHFelH5HQ42q9hFv9GQY%2BQPV614V9IOvBtPrRYsDxyPw5BXJXgRz%2F2DsikPE0TLzXyYIzhkv6MTvGcLs8k1B0eNeiwUNT%2BbkNKyiNIs%3D If we want to prevent certain parameters to be exempted from being encrypted and added in the Krypto then we need to make an entry for those parameters in    the wc-server.xml in the NonEncryptedParameters  section.     <NonEncryptedParameters display="false"> <Parameter name="storeId"/> <Parameter name="langId"/> <Parameter name="catalogId"/> <Parameter name="categoryId"/> <...

How to Enable cross-site request forgery protection in WCS

Cross-site request forgery (CSRF) is a type of malicious attack that tricks a user into sending unintended requests. For example, an attacker can trick an authenticated user into clicking a link to update their personal information. Web Sphere Commerce accepts this request as valid, as proper session cookies exist as part of the request. When cross-site request forgery protection is enabled, a designated URL parameter that is called authToken is required to be included as part of the request. The parameter value is generated by WebSphere Commerce and passed to the page in a request attribute with the same name. The authToken parameter is available only on SSL protected pages because this token must not be apparent. Only sensitive URLs that use SSL should require this protection. Identify the action to protect. For example, UserRegistrationAdd. Open the Struts configuration file where the action is defined. Add a property to the action. Name the property, csrfProtect...

ERROR HANDLING IN WCS

ECApplicationException : This exception is thrown if the error is related to user input and will always fail. For example, when a user enters an invalid parameter, an ECApplicationException is thrown. When this exception is thrown, the solution controller does not retry the command, even if it is specified as a retriable command. ECSystemException: This exception is thrown if a runtime exception or a Websphere Commerce configuration error is detected. Examples of this type of exception include create exceptions, remote exceptions, and other EJB exceptions. When this type of exception is thrown, the solution controller retries the command if the command is retriable and the exception was caused by either a database deadlock or database rollback. Both of the exception types are classes that extend from the ECException class, which is found in the com.ibm.commerce.exception package. In order to throw one of these exceptions, the following information must be specified...