Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Web server assets


Update static Web assets to a remote Web server

Overview

Several tools in the WebSphere Commerce, such as Administration Console, allow you to add or change content in the enterprise application.

Store publishing, for example, adds assets such as...

These assets are made available to either the application server or the Web server.

Transfering static Web assets to a remote Web server can be done using an FTP or file copy function.

In a clustered environment, each node which runs the WebSphere Commerce application can use the FTP method to the FTP server machines (web server machines).


Procedure

  1. Determine if an implementation has already been specified for the interface. Run the following SQL query:

    select * from cmdreg 
    where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd'
    

  2. If an implementation is specified, run one of the following...

    FTP...

    update cmdreg
    set className='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFTPCmdImpl' 
    where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd';
    

    FileSystemCopy...

     
    update cmdreg 
    set className='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFileSystemCmdImpl' 
    where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd';
    

    If an implementation is not specified, run one of the following...

    FTP...

    insert into cmdreg (storeent_id,interfacename,description,classname) 
    values (0, 
           'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd', 
           'FTP implementation for UpdateStaticEARContentCmd', 
           'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFTPCmdImpl');
    

    FileSystemCopy...

     
    insert into cmdreg (storeent_id,interfacename,description,classname) 
    values (0, 
           'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd', 
           'FileSystemCopy implementation for UpdateStaticEARContentCmd', 
           'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFileSystemCmdImpl');
    

    The storeend_id value must be set to 0 because the command is only applicable as a site administrator task.

  3. Additional updates are required. Select a file transfer function and complete the updates.

  4. Use the FTP method:

    The FTP service should be configured on the Web server node.

    1. Open the file: WC_EAR/xml/config/FTP.xml.

    2. Create a copy of the file in a temporary location on your system. Ensure the file is stored in Temp_dir/xml/config/FTP.xml.

    3. Edit the Temp_dir/xml/config/FTP.xml file and provide values for the following attributes:

      proceedOnlyWhenAllServersAreWorking

      Set this value to false. This attribute is only applicable to the root element of FTP servers.

      FTPServerFTPHost

      The fully qualified host name of the remote Web server system. The application server must be able to access this host name. Ensure that any configured firewalls allow FTP communication between the Web server and application server systems.

      FTPPort

      The port of the FTP server. If the port is not specified, a default port of 21 is used.

      FTPUser

      A user to connect to the FTP server. Ensure the logon directory for this user has the same value as the FTPTargetDir attribute.

      FTPPassword

      The encrypted password of the FTP user. Use the wcs_encrypt utility to encrypt the password.

      FTPTargetDir

      The directory on the Web server system that represents the wcsstore alias. This is the directory in which static content is placed.

      For example, on an IBM HTTP Server, the directory name is determined by completing these steps on the Web server system:

      1. Open the httpd.conf file found...

      2. In the httpd.conf file, search for wcsstore. An alias entry should exist. An example of the line:

        • Alias /wcsstore "temp/filehold/Stores.war"

      3. Record the full directory. In this example, the directory is temp/filehold/Stores.war. Enter this directory for the FTPTargetDir attribute.

      4. Ensure the value for the FTPTargetDir attribute is the same as the FTPUser logon directory.

    4. Save the changes to the WC_EAR/xml/config/FTP.xml file. Continue to step 6.

  5. Use the FileSystemCopy method:

    1. Locate the file: WC_EAR/xml/config/FileSystem.xml.

    2. Create a copy of the file in a temporary location on your system. Ensure the file is stored in Temp_dir/xml/config/FileSystem.xml.

    3. Edit the Temp_dir/xml/config/FileSystem.xml file and provide values for the following attributes:

      proceedOnlyWhenAllServersAreWorking

      Set this value to false. This attribute is only applicable to the root element of FTP servers.

      FSLocation

      A local directory on the WebSphere Commerce system which is mapped or mounted to a remote directory on the Web server system.

      To determine the FSLocation:

      1. On the Web server system open up file:

        • WC_INSTALL/instances/instance/httpconf/httpd.conf

        • WC_USER/instances/instance/httpconf/httpd.conf

      2. Within the httpd.conf file, search for a line similar to:

        Alias /wcsstore "temp/filehold/Stores.war"

        Record this directory but remove Stores.war . In this example, the FSLocation directory is: temp/filehold.

      3. On the WebSphere Commerce system, map or mount the directory from step 5.c.ii to a local drive or directory. Use this local drive or directory as the value for FSLocation.
      An example of the FileSystem.xml file:

      <FSLocations xmlns="http://www.ibm.com/xmlns/prod/WebSphereCommerce"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce xsd/FileSystem.xsd"
               proceedOnlyWhenAllServersAreWorking="false">        
              
      <FSLocation dir="/temp/filehold"/> 
         
      
      </FSLocations>  
      

    4. Save the changes to the WC_EAR/xml/config/FileSystem.xml file. Continue to step 6.

  6. To specify what files are flagged as static content, review and update the UpdateEARFilter.properties file. Complete the following steps:

    1. Open the following file and review the contents:

      • WC_EAR/properties/com/ibm/commerce/wc/appmanagement/properties/UpdateEARFilter.properties

    2. In the sample file, name value pairs are defined. If an extension is flagged true, any file with this specific extension is treated as static content. This sample file indicates that any file with an extension of .gif is static content.

      #-------------------------------------------------------------------
      # Licensed Materials - Property of IBM
      #
      # WebSphere Commerce #
      # (c) Copyright IBM Corp. 2006
      #
      # US Government Users Restricted Rights - Use, duplication or
      # disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
      #-------------------------------------------------------------------
      #
       .gif=true
       .jpg=true
       .js=true
       .swf=true
       .GIF=true
       .JPG=true
       .JS=true
       .SWF=true
      

    3. If update or specify additional name value pairs...

      1. Create a UpdateEARFilter.properties file that stores the updated or additional name value pairs. Verify the file is stored in file:Temp_dir/properties/extensions/appmanagement/UpdateEARFilter.properties The contents of this file are merged with the file version in step 6.a.

      2. Follow the sample file in step 6.b to update the new UpdateEARFilter.properties file with name value pairs following these guidelines:

        • Extensions flagged as true are considered static content. Extensions flagged as false are non-static content.

        • If you are adding custom value pairs ensure that you add an entry for uppercase and lowercase.

  7. Configuration is complete. When updating the content using the WebSphere Application Server administrative console, the static assets are automatically transferred to the remote Web Server. The following example demonstrates updating a logo using WebSphere Commerce Accelerator.

    1. Prepare a GIF image to use as the store logo file.

    2. Launch the Accelerator tool and select the store where you want the new logo to appear.

    3. Click Store. Click Upload. The upload page is displayed.

    4. Click Browse. Select the logo file that you prepared.

    5. Click Upload.

    6. Click Apply.

    7. Navigate to the location specified in FTP.xml or FileSystem.xml to view the new logo file.

  8. Create a compressed file to use for deploying the changes to the application server:

    1. Create a compressed file with name tempzip in the Temp_dir directory.

    2. Add the files you created in step 6.c and in step 4 or 5 to the file: Temp_dir/tempzip.

  9. To deploy the changes, complete the following steps:

    1. Open the WebSphere Application Server administrative console.

    2. Click Applications > Enterprise Application.

    3. Select WC_instance. Click Update.

    4. Click Replace, add, or delete multiple files. Click Local file system.

    5. In Local file system enter the name of the compressed file you created in step 8.b. For example enter Temp_dir/tempzip.

    6. Click Next. Click OK.

    7. After the update completes, click Save to Master Configuration. Click Save.


What to do next

Restart the WebSphere Commerce application:

.


Previous topic: Validate changes have been deployed for a custom Web server


+

Search Tips   |   Advanced Search