Registering commands, views, and URLs

When the WebSphere Commerce instance is created commands, views and URLs are loaded into the database by the language-independent bootstrap file. If you create or customize multiple new commands, views, URLs, or JSP files for your store, you may want to register them using an XML file, which you can then load into the database using the Loader package, or as part of a store archive that can be published using the Publish wizard.

To create an XML file to register the new commands, views, and JSP files for your store:

  1. Create an XML file that follows the wcs.dtd. The DTD files are located in the following directory:
  2. Controller commands must be registered in the URLREG table and the CMDREG table. To register a new or customized controller command in the URLREG table, create an entry in the XML file for each new customized controller command, using the following example as your guide:
    <urlreg
    url="MyProductDisplay"
    storeent_id="@storeent_id_1"
    interfacename="com.mystore.commerce.catalog.commands.ProductDisplayCmd"
    https="0"
    description="Product display command for my store"
    authenticated="0"
    internal="0" />
    
  3. To register a new controller command, or a new task command, in the CMDREG table, create an entry in the XML file for each new or customized controller or task commands, using the following example of a task command as your guide:
    <cmdreg
    storeent_id="@storeent_id_1"
    interfacename="com.ibm.commerce.payment.commands.DoPaymentCmd"
    classname="com.ibm.commerce.payment.commands.DoPaymentMPFCmdImpl"/>
    
  4. To register new views, or to associate new JSP files with a view, create an entry in the VIEWREG table, using the following example as your guide:
    <viewreg
    viewname="OrderOptionsView"
    devicefmt_id="-1"
    storeent_id="@storeent_id_1"interfacename="com.ibm.commerce.command.ForwardViewCommand" 
    classname="com.ibm.commerce.command.HttpForwardViewCommandImpl"
    properties="docname=Shipping.jsp"
    internal="0"https="0"/>
    

Enhancing confidentiality

When WebSphere Commerce receives a URL request, the Web controller retrieves the interface name for the requested controller command and uses it to look up the implementation class name from the CMDREG table. It also determines if HTTPS (secured) protocol is required for the URL request by checking the HTTPS column in the URLREG table.

Any command which displays sensitive information should have the HTTPS value set to a value of "1" (one) in the URLREG table. For example, an OrderProcessView view command containing details of a customer order should only be transmitted over HTTPS protocol, and therefore the OrderProcessView entry in the URLREG table has a value of "1" (one) in the HTTPS column.

Feedback