Tutorials > Customize the Consumer Direct sample store > Customizing the consumer direct sample store using snippets

< Previous | Next >


Deploy the snippet changes

In this tutorial, you performed actions usually performed by multiple roles. Actions that involved creating assets using WebSphere Commerce Accelerator are not usually performed by a store developer. For example, a sales catalog will likely be created by a Category or Product Manager, and a promotion created by a Marketing Manager.

The following steps describe how to deploy the changes made by a store developer. The changes depend on the information created in this tutorial, such as the e-Marketing Spot name, or the existence of specific catalog entry IDs.

To ensure this code works in the production environment, ensure such information matches exactly.

  1. You published a consumer direct sample store called MyApparelStore with the Apparel catalog.

  2. The changes made in WebSphere Commerce Accelerator and Administration Console have already been made.


Procedure

  1. Export the files

    1. Click to File > Export.

    2. Choose File System and click Next.

    3. Click Deselect All.

    4. Select the following files

      • Stores/WebContent/MyApparelStore/include/styles/style1/CachedHeaderDisplay.jsp

      • Stores/WebContent/MyApparelStore/templates/EmailMessageDisplay.jsp

      • Stores/WebContent/MyApparelStore/include/StoreCatalogDisplay.jsp

      • Stores/WebContent/MyApparelStore/Snippets/ReusableObjects/CatalogEntryThumbnailDisplay.jspf

      • Stores/WebContent/WEB-INF/classes/MyApparelStore/CatalogJSPCodeSnippetText_ locale.properties. There are 11 properties files, one for each locale and one default file with no locale in the file name.

    5. In the To directory field, enter a file name, for example, drive:/temp/.

    6. Click Finish.

    7. Modify the file structure so that it matches the file structure on the production machine:

      1. Rename the Stores directory to Stores.war.

      2. Move the MyApparelStore and WEB-INF directories and their contents under the Stores.war directory.

      3. Delete the now empty WebContent directory.

      The resulting file structure should resemble the following:

      • Stores.war/MyApparelStore/include/styles/style1/CachedHeaderDisplay.jsp

      • Stores.war/MyApparelStore/templates/EmailMessageDisplay.jsp

      • Stores.war/MyApparelStore/include/StoreCatalogDisplay.jsp

      • Stores.war/MyApparelStore/Snippets/ReusableObjects/CatalogEntryThumbnailDisplay.jspf

      • Stores.war/WEB-INF/classes/MyApparelStore/CatalogJSPCodeSnippetText_ locale.properties.

    8. Use a ZIP utility to create a zip file called drive:/temp/snippetTutorial.zip.

  2. Transfer the files to the target machine

    In this section, we will create a temporary directory on the target WebSphere Commerce Server and then copy the file assets into this directory. In subsequent steps, we will place the different types of code into the appropriate place within the WebSphere Commerce application.

    To copy the files from the development machine to the target WebSphere Commerce Server:

    1. On the target WebSphere Commerce Server, create a temporary directory called drive:\SnippetImport.

    2. Determine how we will copy the files from one computer to another. You can do this by mapping a drive on the target WebSphere Commerce Server to the development machine, or by using an FTP application, if you have that configured.

    3. From the development machine, copy the contents of drive:/temp/snippetTutorial.zip to drive:\SnippetImport on the target WebSphere Commerce Server.

    4. Unzip snippetTutorial.zip in the SnippetImport directory.

  3. Stop the target WebSphere Commerce application

    Open the WebSphere Application Server administration console and stop the WebSphere Commerce application:

    1. Open the WebSphere Application Server administrative console by entering the following URL in a Web browser: http://host:portNumber/ibm/console

      ...where host is the name of the target machine and portNumber is the port number used to access the Admin Console is defined during profile creation. The default port number is 9060.

    2. Click Applications > Enterprise Applications to see a list of installed applications.

    3. Select the WebSphere Commerce application, for example WC_demo, and click Stop.

  4. Export a backup copy the EAR

    Export a backup copy of the EAR, so that you can revert to the old version in the future if desired:

    1. In the WebSphere Application Server administrative console, click Applications > Enterprise Applications to see a list of installed applications.

    2. Select the WebSphere Commerce application, for example WC_demo, and click Export.

    3. Follow the wizard and save the EAR file in a backup directory.

  5. Update store assets on the target WebSphere Commerce Server

    Update the store with the modified store assets using the WebSphere Application Server administrative console:

    1. In the WebSphere Application Server administrative console, click Applications > Enterprise Applications.

    2. Select the application name, for example WC_demo, and click Update.

    3. Select Partial Application

    4. If you are running the WebSphere Application Server administrative console on the target machine, select Local file system, since the files are local to the browser. If you are running the WebSphere Application Server administrative console on a different machine, select Remove file system, since the files are remote to the browser.

    5. Specify the path to drive:\snippetImport\SnippetTutorial.zip.

    6. Click Next.

    7. Click OK.

    8. When the update completes successfully, click Save to Master Configuration.

    9. On the Enterprise Applications screen, click Save to save the changes to the master configuration.

    10. Close the WebSphere Application Server administration console.

    If you performed the steps that create an e-mail activity, register the e-mail template in the production database by following the steps in Register the e-mail template.

  6. Stop and start the WebSphere Application Server

    You must stop and start the WebSphere Application Server to pick up the changes you deployed.

    To stop and start the server:

    1. At a command prompt, navigate to WC_PROFILE\bin.

    2. Stop the WebSphere Application Server. For example, on the Windows operating system, enter stopServer server1. The server has stopped successfully when you see the message: Server server1 stop completed.

    3. Start the WebSphere Application Server. For example, on the Windows operating system, enter startServer server1. Wait until you see the message similar to: Server server1 open for e-business; process id is 3740.

    4. Navigate to WC_PROFILE\logs\server1.

    5. Examine the SystemOut.log file. Ensure the server started successfully without errors.

  7. Verify the deployment

    Launch the MyApparelStore. The changes you made to the MyApparelStore in the development environment should display in the target environment, including the MyApparelSalesCatalog, the MyApparelSpot e-Marketing Spot, the e-mail activity and the CatalogEntryThumbnailDisplay.jspf snippet.

< Previous | Next >


+

Search Tips   |   Advanced Search