Preparing your workspace

In this lesson, you import sample code into your WebSphere Commerce workspace. This sample code is the starting point for the tutorial.

Procedure

  1. Import the controller command sample Java code into your workspace:
    1. In the Enterprise Explorer view, navigate to WebSphereCommerceServerExtensionsLogic.
    2. Right-click the src folder and select Import. The Import wizard opens.
    3. From the Select an import source list, select General/File System; click Next.
    4. Click the Browse button next to the From directory field and navigate to the Javafiles directory in the temporary directory, for example C:\temp\startercode\Javafiles. Click OK.
    5. Click Select All to select all the files under the Javafiles directory.
    6. In the Into folder field, ensure the WebSphereCommerceServerExtensionsLogic/src folder is specified.
    7. Click Finish.
  2. Import the sample response JSP page for this tutorial:
    1. In the Enterprise Explorer view, expand Stores/WebContent/Madisons/StoreInfoArea.
    2. Right-click the StoreInfoArea directory and select Import.
    3. From the Select an import source list, select General/File System; click Next.
    4. Click the Browse button next to the From directory field and navigate to the storeassets directory in the temporary directory, for example C:\temp\startercode\storeassets. Click OK.
    5. Click Deselect All, then select the MyContactUsDisplay.jsp and MyContactUsAckDisplay.jsp files.
    6. In the Into Folder field, ensure the Stores/WebContent/Madisons/StoreInfoArea folder is specified.
    7. Click Finish.
  3. Import the sample US English properties file, and default properties file, to be used when a locale-specific properties file is not found. Import these files for the tutorial into the appropriate directory:
    1. In the Enterprise Explorer view, expand Stores/Java Resources: src/Madisons.
    2. Right-click the Madisons directory and select Import.
    3. From the Select an import source list, select General/File System; click Next.
    4. Click the Browse button next to the From directory field and navigate to the storeassets directory in the temporary directory, for example C:\temp\startercode\storeassets. Click OK.
    5. Click Deselect All, then select the StrutsTutorialNLS_en_US.properties and StrutsTutorialNLS.properties file.
    6. In the Into Folder field, ensure the Stores/src/Madisons folder is specified.
    7. Click Finish.
  4. Copy the sample access control policy files to the appropriate directory:
    1. Navigate to the ACPolicies directory in the temporary directory, for example C:\temp\startercode\ACPolicies.
    2. Copy the sample MyContactUsAckViewACPolicy.xml file.
    3. Navigate to the WCDE_installdir\xml\policies\xml directory and paste the MyContactUsAckViewACPolicy.xml in this directory.
    4. Repeat this step to add the sample MyContactUsCmdACPolicy.xml file to the WCDE_installdir\xml\policies\xml directory.
  5. Copy the struts.jar file into the Stores/WEB-INF/lib directory. The Struts tag library definition (TLD) files that are packaged in the strusts.jar file of the WebSphere Commerce EAR library directory cannot be loaded by a web module using the application classloader.
    1. In the Enterprise Explorer view, expand WC/lib.
    2. Right-click struts.jar and select Copy.
    3. Expand Stores/WebContent/WEB-INF/lib.
    4. Right-click lib and select Paste.
  6. Import the sample validation rules for this tutorial:
    1. In the Enterprise Explorer view, expand Stores/WebContent/WEB-INF.
    2. Right-click the WEB-INF directory and select Import.
    3. From the Select an import source list, select General/File System and click Next.
    4. Click the Browse button next to the From directory field and navigate to the storeassets directory in the temporary directory, for example C:\temp\startercode\storeassets. Click OK.
    5. Click Deselect All, then select the validation.xml and validator-rules.xml files.
    6. In the Into Folder field, ensure the Stores/WebContent/WEB-INF folder is specified.
    7. Click Finish. If prompted to overwrite existing files, select Yes To All to add the validation rules.

What to do next

Test your environment to ensure that you are ready to start the tutorial:

  1. In WebSphere Commerce Developer, start or restart the WebSphere Commerce Test Server.
  2. In the Enterprise Explorer view, expand Stores/WebContent/Madisons.
  3. Right-click the index.jsp file and select Run As > Run on Server. If the server selection window displays, select Choose an existing server and click Finish. Your Madisons starter store displays.
  4. Alternatively, to directly launch your Madisons starter store index.jsp, you can enter the following URL directly in your web browser:
    http://localhost/webapp/wcs/stores/servlet/Madisons/index.jsp
    
  5. In the storefront of your Madisons starter store, click Help/Contact Us under Customer Support.
  6. Observe the default Help/Contact Us page, which should appear similar to the following image:

    Default Help/Contact Us page

You are now ready to proceed with the tutorial.