WCS | Command Redirect / Forward to a View


Redirect:
public void performExecute() throws ECException {
..........
..........
        TypedProperty rspProp = new TypedProperty();
        rspProp.put(ECConstants.EC_URL, "ViewName");
        rspProp.put(ECConstants.EC_VIEWTASKNAME,
                ECConstants.EC_GENERIC_REDIRECTVIEW);

.........
.........
}
               
Forward:

public void performExecute() throws ECException {
..........
..........

        TypedProperty rspProp = new TypedProperty();
        rspProp.put(ECConstants.EC_VIEWTASKNAME,
        "
ViewName");       

.........
.........
}

WCS | Setting up WCS Schedulers

We can setup WebSphere Commerce Schedulers in two ways,
1. Setting up through Administration Console
2. By updating scheduler information into the database through queries

In local environments, we can setup WebSphere Commerce Scheduler through the Admin console. But, moving to higher environments, it might not be possible to setup the jobs through Admin console. It can be accomplished by adding scheduler information directly to the DB.

Sample queries for inserting scheduler information to the DB,

  • insert into schconfig (sccjobrefnum,scchost,member_id,storeent_id,sccrecdelay,sccrecatt,sccpathinfo,sccquery, sccstart,sccinterval,sccpriority,sccsequence,sccactive,sccapptype,interfacename,optcounter) values ((select Max(sccjobrefnum)+1 FROM schconfig),null, -1000,0, 0,0,'MySchedulerControllerCmd',null, CURRENT_TIMESTAMP, 120, 1,0,'A',default,'com.mycompany.scheduler.commands.MySchedulerControllerCmd',0);
  • insert into schactive (scsinstrefnum,scsjobnbr,scsactlstart,scsattleft,scsend, scsinstrecov,scsprefstart,scsqueue,scsresult,scssequence,scsstate,scspriority,optcounter) values ((select Max(scsinstrefnum)+1 FROM schactive),(select max(sccjobrefnum) FROM schconfig), SYSDATE,1,null,null,CURRENT_TIMESTAMP,null,null,0,'I',default,0);


WCS | EJB files to be committed in repository | Steps to take care in Server Env

Steps to be taken care while working with Access Beans in WCS:

Step 1:

After creating/updating Access Beans in local environment, only the following files has to be committed in repository,

Java Files:
1. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLogKey.java
2. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects3. \XLogHome.java
3. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLogFactory.java
4. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLogBean.java
5. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLogAccessBeanData.java
6. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLogAccessBean.java
7. WebSphereCommerceServerExtensionsData\ejbModule\com\abc\member\objects\XLog.java


Configuration Files:
1. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\backends\DB2UDBNT_V95_1\Map.mapxmi
2. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\backends\DB2UDBNT_V95_1\ProfileDBSchema.dbm
3. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ejb-jar.xml
4. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-access-bean.xmi
5. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-jar-bnd.xmi
6. WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-jar-ext.xmi


Step 2:

While moving to next higher environment the data source has to be updated to point to that appropriate database in ibm-ejb-jar-bnd.xmi,

If your data source of the environment is "MyDBSource" then defaultCMPConnectionFactory's JNDI should look like the following,

<?xml version="1.0" encoding="UTF-8"?>
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1041304850140" currentBackendId="DB2UDBNT_V95_1">
.......

.......
  <defaultCMPConnectionFactory xmi:id="CMPConnectionFactoryBinding_1069893248765" jndiName="jdbc/WebSphere Commerce DB2 DataSource
MyDBSource" resAuth="Per_Connection_Factory"/>
</ejbbnd:EJBJarBinding>


Step 3:


Go to Server's Administration Console and update JNDI name 

Applications --> Application Types --> WebSphere enterprise applications --> WC_<SERVERENV> --> Enterprise Java Bean Properties --> Provide default data source mapping for modules containing 1.x entity beans

Update Target Resource JNDI Name in the appropriate input box,

jdbc/WebSphere Commerce DB2 DataSource MyDBSource

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

  Local Store Remote Store Project Type Migrated (Lift & Shift) - Newly Imp...