Remove references to the URLREG and VIEWREG database tables

In WebSphere Commerce version 6.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 6.0 database schema.
You must remove all references to the URLREG and VIEWREG database tables that are used during mass loading in your version 5.6.1 store archive.

  1. In your version 5.6.1 store archive, open the command.xml file.

  2. 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 6.0 database schema.

  3. 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>
    
    
    

  4. 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
    <urlreg
    url="OrderItemAdd"
    storeent_id="@storeent_id_1"
    interfacename="com.ibm.commerce.orderitems.commands.OrderItemAddCmd"
    https="1"
    internal="0"
    credaccept="P"
    />
    
    
    
    then add the following entry under the <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>
    
    
    

  5. 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
    <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"
    />
    
    
    
    then add the following entry under both the <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"
     />
    
    
    

  6. In the store archive, open the WEB-INF/stores/StoreAssetsDir/data/ibm-wc-load.xml file.

  7. 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:

    1. 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"/>
      
      
      

    2. Add the following tasks to the ibm-wc-load.xml file after the idResolve, massLoad, and reconcileStoreLanguages 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>
      
      
      

 

Related tasks


Publishing a WebSphere Commerce version 5.6.1 store archive in WebSphere Commerce version 6.0
Applying the correct JSP files to the version 6.0 store archive
Identifying the new store archive as a version 6.0 store archive