Removing references to the URLREG and VIEWREG database tables
In WebSphere Commerce version 7.0, the WebSphere Commerce Web application moved from a proprietary model-view-controller implementation to the Struts open source framework. When WebSphere Commerce moved to the Struts framework, the URLREG and VIEWREG database tables were removed from the WebSphere Commerce version 7.0 database schema.
About this task
Procedure
- In your version 5.6.1 store archive, open the command.xml file.
- Remove all references to the
<urlreg>
and<viewreg>
database tables to ensure that no attempts are made to load data into these tables, since they no longer exist in the version 7.0 database schema. - In the store archive, create a new struts-config-update.tpl.xml
file in the WEB-INF/stores/StoreAssetsDir/data folder,
with the following content:
<?xml version="1.0" encoding="UTF-8"?> <struts-config> <global-forwards> </global-forwards> <action-mappings type="com.ibm.commerce.struts.ECActionMapping"> </action-mappings> </struts-config>
- For each
<urlreg>
entry that was contained in the command.xml file, add an<action>
tag under the<action-mappings>
node in the new struts-config-update.tpl.xml file. For example, if the following<urlreg>
entry existed in the command.xml file:
then you must add the following entry under the<urlreg url="OrderItemAdd" storeent_id="@storeent_id_1" interfacename="com.ibm.commerce.orderitems.commands.OrderItemAddCmd" https="1" internal="0" credaccept="P" />
<action-mappings>
node in the new struts-config-update.tpl.xml file:<action path="/OrderItemAdd" parameter="com.ibm.commerce.orderitems.commands.OrderItemAddCmd" type="com.ibm.commerce.struts.BaseAction"> <set-property property="https" value="${storeId}:1"/> <set-property property="credentialsAccepted" value="0:P"/> </action>
- For each
<viewreg>
entry that was contained in the command.xml file, add a<forward>
tag under both the<global-forwards>
node and the<action-mappings>
node in the new struts-config-update.tpl.xml file. For example, if the following<viewreg>
entry existed in the command.xml file:
then you must add the following entry under both the<viewreg viewname="AccessControlErrorView" devicefmt_id="-1" storeent_id="@storeent_id_1" interfacename="com.ibm.commerce.command.ForwardViewCommand" classname="com.ibm.commerce.command.HttpForwardViewCommandImpl" properties="docname=GenericError.jsp" https="1" credaccept="P" />
<global-forwards>
and<action-mappings>
nodes in the new struts-config-update.tpl.xml file:<action path="/AccessControlErrorView" type="com.ibm.commerce.struts.BaseAction"> <set-property property="https" value="${storeId}:1"/> <set-property property="credentialsAccepted" value="0:P"/> </action> <forward name="AccessControlErrorView/${storeId}" className="com.ibm.commerce.struts.ECActionForward" path="/GenericError.jsp" />
- In the store archive, open the WEB-INF/stores/StoreAssetsDir/data/ibm-wc-load.xml file.
- To update the struts-config-ext.xml file contained in the
Stores.war/web-inf folder with the entries that you added to the struts-config-update.tpl.xml
template file during the store publishing process:
- Add the following references to the ibm-wc-load.xml
file:
<asset id="strutsConfigUpdate.template" location="struts-config-update.tpl.xml"/> <asset id="strutsConfigUpdate" location="struts-config-update.xml"/> <deploy-task-cmd name="findStore" class="com.ibm.commerce.tools.devtools.publish.tasks.StoreIdBaseDeployTaskCmd"/> <deploy-task-cmd name="fileFilter" class="com.ibm.commerce.tools.devtools.publish.tasks.unpack.FileFilterTaskCmd"/>
- Add the following tasks to the ibm-wc-load.xml file
after the
idResolve
,massLoad
, andreconcileStoreLanguages
tasks:<!-- Find the store id of the published store. And save that value in storeEntityId variable --> <task name="findStore"> <param name="storeIdentifier" value="${asset:foreignKeys#STORE_IDENTIFIER}" /> <param name="organizationDN" value="ou=${asset:foreignKeys#ORGENTITYNAME},${asset:foreignKeys# ORGANIZATION_DN}" /> <export name="storeEntityId" value="storeEntityId"/> </task> <!--Update the struts-config-update.tpl.xml file and replace all occurrences of ${storeId} with the actual store id. --> <task name="fileFilter"> <param name="input-filename" value="${asset:strutsConfigUpdate.template}"/> <param name="output-filename" value="${asset:strutsConfigUpdate}"/> <param name="storeId" value="${context:storeEntityId}"/> </task> <!--Update the struts-config-ext.xml file present in Stores.war/web-inf folder with the entries present in struts-config-update.xml file --> <task name="commandInvoker"> <param name="invoked_commandClassName" value="com.ibm.commerce.struts.commands.UpdateStrutsConfigFileCmd"/> <param name="webAppName" value="Stores" /> <param name="updateFileName" value="${asset:strutsConfigUpdate}"/> </task>
- Add the following references to the ibm-wc-load.xml
file: