Operate > WebSphere Commerce Accelerator > Work with the store > Command and view restrictions in preview
Disable and enabling commands and views in preview
The commands and views disabled in preview are determined by the preview exclusion file. Initially, this file is empty, meaning that all commands and views are enabled in preview.
Procedure
- Disable a command or view in preview
- Copy the following file to a temporary location:
- WC_EAR/xml/config/previewExclusion.xml
This file should never be directly modified. For more information, refer to XML configuration directory.
- Open the temporary copy of the file in a text editor.
- Add the command or view to disable in preview in a RestrictedCommand tag.
For commands, you need the URL for the command or view.
To determine the URL for a command or view, examine the contents of the struts-config.xml file...
- WC_EAR/Stores.war
You can determine the short names for command and views by examining the path property of the action tag. The short name is the value in the path property without the initial slash character ("/").
You can also find the URLs for commands and views that to disable by referring to URLs.
For example, OrderItemUpdate has the following entry in the struts-config.xml file:
<action-mappings type="com.ibm.commerce.struts.ECActionMapping"> ... <action parameter="com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd" path="/OrderItemUpdate" type="com.ibm.commerce.struts.BaseAction"> <set-property property="authenticate" value="0:0"/> <set-property property="https" value="0:1"/> </action>
To prevent the OrderItemUpdate URL from running within preview, add the following text:
<RestrictedCommand>OrderItemUpdate</RestrictedCommand>
The resulting file looks like this:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> <RestrictedCommands xmlns="http://www.ibm.com/WebSphereCommerce" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/WebSphereCommerce previewExclusion.xsd"> <RestrictedCommand>OrderItemUpdate</RestrictedCommand> </RestrictedCommands>
- Save the preview exclusion file.
- Update WebSphere Commerce with the updated file. See the Update applications topic in the WebSphere Application Server Information Center for instructions. Ensure that you follow the instructions for updating a single file.
You will need the following information:
- Enterprise application name
- WC_enterpise_application
- Relative path to file
- xml/config/previewExclusion.xml
- Open the Administration Console and select Site on the Administration Console Site/Store Selection page.
- Click Configuration > Registry. A list of registry components is displayed.
- Select Preview Command Exclusion and click Refresh. You do not need to restart the WebSphere Commerce server.
- Enable a command or view in preview
- Copy the following file to a temporary location:
- WC_EAR/xml/config/previewExclusion.xml
This file should never be directly modified. For more information, refer to XML configuration directory.
- Open the temporary copy of the file in a text editor.
- Remove the commands that to enable in preview.
- Save the preview exclusion file.
- Update WebSphere Commerce with the updated file. See the Update applications topic in the WebSphere Application Server Information Center for instructions. Ensure that you follow the instructions for updating a single file.
You will need the following information:
- Enterprise application name
- WC_enterpise_application
- Relative path to file
- xml/config/previewExclusion.xml
- Open the Administration Console.
- Click Configuration > Registry.
- Select Preview Command Exclusion and click Refresh. You do not need to restart the WebSphere Commerce Server.