Posts

Showing posts from 2016

Adding custom payment method for info purpose

1. Add PaymentMethodConfigurations.xml <PaymentMethodConfiguration humanEditable="true"         maximumAmount="Unbounded" minimumAmount="0"         name="MyPaymentAccountOffline" partiallyConsumable="true"         paymentSystemName="SimpleOffline" priority="LOW"         refundAllowed="false" systemEditable="true"/> 2. Add PaymentMappings.xml <Mapping paymentActionRule="Early Approval"         paymentConfiguration="MyPaymentAccountOffline" paymentMethod="MyPaymentAccountOffline"/> 3. PaymentDeployment.xml :  Used for protocol data to save in PPCEXTDATA <ProtocolProperties>   <ProtocolProperty name="card_number" keep="true"/>   <ProtocolProperty name="account" keep="true"/>   <ProtocolProperty name="cc_brand" keep="true"/>   <ProtocolProperty n

Call Command from Command Factory

SendMsgCmd cmdSendMsg = (SendMsgCmd)CommandFactory.createCommand("com.ibm.commerce.messaging.commands.SendMsgCmd", getStoreId());    cmdSendMsg.setMsgType("TestMsgType");              cmdSendMsg.setStoreID(getStoreId()); cmdSendMsg.setConfigData("recipient",emailId); cmdSendMsg.setContent(null,"-1",body.getBytes()); cmdSendMsg.setConfigData("subject",subject); cmdSendMsg.sendImmediate(); cmdSendMsg.setCommandContext(getCommandContext()); cmdSendMsg.execute();

Adding cache-control on static assets | Improve data integrity and performance

Adding cache-control on static assets | Improve data integrity and performance Static files (example: JS\CSS\HTML.) are cached by client browsers and if they don't carry cache-control directive in the HTTP-header, it is up to the browsers to determine, how often to check to check for updated value from server. Some times browsers could cache stale content for days. This could cause the static file to be obsolete and pick from local browser cache and out of sync and could potentially result in broken pages and corrupt files. The solution is to add cache-control directive to the web server configuration and this will force the browser to check for the updated version from the server when the time specified expires. The functionality would essentially result in HTTP_STATUS code 200 when a file is modified and other wise would return HTTP_STATUS code 304 Testing the HTTP-Header changes: You can using tamper data as Firefox plugin or fiddler for IE to look at the HTTP-header Ma

WCS Dojo Refresh Area (AJAX Request using DOJO)

1.  Create a refreshable div of dojo <div dojoType="wc.widget.RefreshArea" id="MiniShoppingCart" widgetId="MiniShoppingCart" controllerId="MiniShoppingCartController" onmouseover="showMiniShopCartDropDown('placeHolder','quick_cart_container','orderItemsList');" role="wairole:region" waistate:live="polite" waistate:atomic="true" waistate:relevant="all"> <%out.flush();%> <c:import url="${jspStoreDir}include/MiniShopCartDisplay.jsp">  <%-- variables come from HeaderDisplay.jspf --%>   <c:param name="storeId" value="${param.storeId}"/> <c:param name="catalogId" value="${param.catalogId}"/> <c:param name="langId" value="${param.langId}"/> </c:import> <%out.flush();%> </div>

AccountLockoutPolicyCmd : Password Expiry in IBM WCS (Websphere commerce)

Reasons for account lock/ password expiry in IBM web sphere commerce Regardless of whether valid credentials were specified and LDAP mode is not used, the  AccountLockoutPolicyCmd  task command is called to update policy account information for the user: Account lockout policy: USERREG.PASSWORDRETRIES is incremented on a bad password attempt. If there are too many retries with incorrect passwords, the user account gets disabled, by setting USERREG.STATUS to 0. Policy password policy: If the password is too old, the password is changed to the expired state, by setting USERREG.PASSWORDEXPIRED to 1. The AccountLockoutPolicyCmd task command does not do anything, if LDAP is used. https://www.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.developer.doc/refs/rselogon.htm

Order history read access users from same organization.

Order history read access users from same organization. Read only access to users belonging to same organization and Organization Participant role for order history related databeans, the XML policies below is from the reference link below but they have an issue where on the role Buyer (buy-side) role name so that's fixed. Buyer(buy-side) roles needs to defined on the organization using Org admin console. if there is an hierarchy of organizations and the bottom organization is the parent organization for the users. All roles have to be defined to Organizations from Top-Down. Add the xml fragments below to resource_acpolicies.xml and run ACPLoad. Add new policy to allow participants to display the order beans for others in the organization: Relation group: This defines all roles in this case Buyer(buy-side) to BuyingOrganizationalEntity      <RelationGroup Name="Buyer (buy-side)->BuyerOrganizationalEntity" OwnerID="RootOrganization">        

Override Access authority from Commands

Override Access authority from Commands checkResourcePermission The user does not have the authority to run this command. CMN0410E: The system failed to retrieve the message with  key "_ERR_USER_AUTHORITY" from "com.ibm.commerce.ras.properties.ecServerMessages" I am sure all of us working in commerce have seen the above error  a million times and some times it is because we didn't correctly define the access privileges when creating a new command and running ACPLoad but some times it is important to override the out of the box access policies. I would not recommend returning plain null but also find below some more restricted overrides of getResources. public AccessVector getResources() {   return null; } public AccessVector getResources() {          final String METHOD_NAME = "getResources";                         java.util.Vector resourcesVector = new java.util.Vector();             Long parentOrgId= null;             UserAcc

Directory structure : if you were creating new jsp for some customization.

https://www-01.ibm.com/support/knowledgecenter/SSZLC2_8.0.0/com.ibm.commerce.aurora-starterstore.doc/refs/rsmauroradirectories.htm