You can separate the store web application archive
(WAR) file from the WebSphere Commerce enterprise
archive (EAR) file to make developing and updating storefront assets
easier. You can separate the store WAR for your WebSphere Commerce instance
by running an enablement script and updating the WebSphere Commerce
database. When the store separation process
completes, a new store EAR is created that contains an copy of the
store WAR. The original store WAR within the WebSphere Commerce EAR
is disabled. With this separation, the storefront assets for your
WebSphere Commerce instance are included either within the store EAR
or the WebSphere Commerce EAR and referenced by the store EAR through
a shared library.
Note: If your site uses a clustered
environment or you are planning to use a clustered environment, you
can separate the store WAR from the
WebSphere Commerce EAR
for this environment. There are two options for enabling this separation
for a clustered environment:
Before you begin
Ensure that you complete following tasks:Note: There are no disablement scripts for store separation.
If you want to roll back the separation of the store archive for a WebSphere Commerce instance,
you must manually restore your WebSphere Commerce instance.
Procedure
Run the store separation enablement script
- Start the
WebSphere Commerce server.
- In a command-line utility, go to the following directory:
- WC_installdir/bin
- WC_installdir\bin
- Run the following command to run the store separation enablement
script.
- config_ant.sh -buildfile WC_installdir/components/common/xml/enableFeature.xml
-DinstanceName=instance_name -DfeatureName=store-separation
-DdbUserPassword=db_password [-DdbaPassword=administrative_password]
- config_ant.bat -buildfile WC_installdir\components\common\xml\enableFeature.xml
-DinstanceName=instance_name -DfeatureName=store-separation
-DdbUserPassword=db_password [-DdbaPassword=administrative_password]
Where the
administrative_password is mandatory
only when you are enabling store separation on an authoring environment.
The
administrative_password is not needed in a
hosted environment that is not configured for authoring.
When you
run the store separation enablement script, the enablement process
completes the following tasks to separate the store WAR from the
WebSphere Commerce EAR:
- Verify that the store separation enablement script ran
successfully. After enablement process completes, ensure that the BUILD
SUCCESSFUL message displays within the console.
- In a file manager, go to the following directory:
- WC_installdir/instances/instance_name/logs
- WC_installdir\instances\instance_name\logs
- Open the enablestore-separation_timestamp.log file.
Ensure that the BUILD SUCCESSFUL message displays within
the log file.
- Go to the following directory:
- WAS_installdir/profiles/instance_name/installedApps/WC_instance_name_cell
- WAS_installdir\profiles\instance_name\installedApps\WC_instance_name_cell
- Ensure that new store EAR, WCStores_instance_name.ear,
displays within the WC_instance_name_cell directory.
Configure the web server and WebSphere Commerce search
to use the new store archive.
- Regenerate
the WebSphere Application Server web server plug-in configuration
file.
- Optional: If your web server is remote and
the plugin-cfg.xml file is changed, Copy
the new generated plugin-cfg.xml file to your
remote web server.
- Optional: If your web server runs on a separate
node than the WebSphere Commerce node,
copy your store web assets to the separate web server node.
- On the WebSphere Commerce node,
go to the WAS_installdir\profiles\instance_name\installedApps\WC_instance_name_cell\Stores_war.ear\Stores.war directory:
- Copy the store assets within the Stores.war directory.
- On the web server node, go to the WAS_installdir\profiles\instance_name\installedApps\WC_instance_name_cell\Stores_war.ear\Stores.war directory
- Add the copied store assets into this directory on your
web server node.
- Update the configuration file for the web server to map
the WebSphere Commerce store
alias to the store WAR within the new store EAR web module mapping:
- Update the SRCHCONFEXT table
to ensure that the web content index points to the new store WAR location.
- Open a connection to the WebSphere Commerce database.
- Run the following SQL statement:
select config from srchconfext where indexsubtype='WebContent';
The
results that return can resemble the following values:
SearchServerName=commerce.wttedns01.usri.ibm.com,BasePath=WAS_installdir\profiles\instance_name\installedApps\
WC_instance_name_cell\WC_instance_name.ear\Stores.war\Aurora\StaticContent\en_US\,SearchServerPort=3737,StoreId=10101
The
instance_name\profiles\instance_name\installedApps\WC_instance_name_cell\WC_instance_name.ear\Stores.war path
is the original location for the
Stores.war archive.
- Update the path to the Stores.war archive
by running the following SQL statement:
update srchconfext set config='SearchServerName=commerce.wttedns01.usri.ibm.com,BasePath=WAS_installdir\profiles\
instance_name\installedApps\WC_instance_name_cell\WCStores_instance_name.ear\Stores.war\
Aurora\StaticContent\en_US\,SearchServerPort=3737,StoreId=10101' where INDEXSUBTYPE='WebContent'
- Restart the WebSphere Application Server.
By
restarting the server, you ensure that the new store EAR does not
reference any invalid Enterprise JavaBeans (EJB) references.
- Restart the web Server.
Deploy the customization code for the store separation.
The customization code is divided into two parts, server side and
store side code.
- Deploy any server-side customization code to the WebSphere Commerce EAR.
- Group all customized EJBs, access beans, data beans,
command interfaces, and utilities into JAR files.
- Deploy the JAR files into the WebSphere Commerce EAR.
- Optional: If a JAR file that you are deploying
exists within a file path that is not defined as a part of the shared
library configuration, add the JAR files to the custom shared library
configuration.
If your assets are included within a path
that configured for the shared library, you do not need to update
your shared library configuration. Any new JAR files that you deploy
within a configured path for the shared library can automatically
be referenced by the shared library.
By adding the JAR file, the
assets in the new store EAR can reference the assets within this WebSphere
Commerce EAR JAR file. By default, the custom library is named Customer_shared_lib.
Since this shared library is defined at the directories level, any
custom JAR files within a folder that is defined in the Shared_lib,
does not need to be added into the Customer_shared_lib configuration.
If the JAR file exists within a file path that is not a part of the Shared_lib,
you must add the JAR file into your Customer_shared_lib configuration.
You can update your shared library, Customer_shared_lib by
including the JAR file in the class path within the configuration
tab for the shared library properties in the WebSphere Application
Server Admin Console.
- Deploy any store side customization code, such as JSP
files and storefront property files into the new store EAR.
- Apply any database schema changes from customization directly
to the WebSphere Commerce database.
Results
The store WAR for your WebSphere Commerce instance
is separated from the WebSphere Commerce EAR.
You can deploy any future changes into the appropriate EAR without
affecting the other EAR.
What to do next
After you separate the store WAR, update any store functions
and processes that use assets that were included within the default
store WAR. Update these functions and processes to point to the new
location of the store assets in the store EAR.
When your store
developers create or change store assets, the assets can be deployed
into the new store EAR with the WebSphere Commerce Build
and Deployment tool. For more information, see Deploying new and changed store assets into a separated store EAR.