Preparing your workspace

In this lesson, you import sample code files into your WebSphere Commerce workspace. This sample code contains code that is required to complete this tutorial.

Procedure

  1. Open WebSphere Commerce Developer.
  2. In the Enterprise Explorer view, ensure the Toggle Project Grouping button is selected as shown in the following screen capture:
    A screen capture that displays the Toggle Project Grouping button.
    By selecting the Toggle Project Grouping button, you ensure that the view in WebSphere Commerce Developer matches the screen captures and instructions in this tutorial.
  3. Import the sample Java code that is provided in the WCSample.zip file into your workspace:
    1. In the Enterprise Explorer view, expand WebSphereCommerceServerExtensionsLogic.
    2. Right-click the src directory; select Import. The Import wizard opens.
    3. From the Select an import source list, select General > File System; click Next.
    4. Click Browse beside the From directory field.
    5. Navigate to the temporary directory where you extracted the WCSample.zip file; navigate to the notcompletedsourcecode\newbusinesslogic\Javafiles directory.
    6. Click Select All to select all the files under the Javafiles directory.
    7. In the Folder field, the WebSphereCommerceServerExtensionsLogic\src folder is specified by default.
    8. Click Finish.
    9. You see errors in the BonusDataBean class. These errors are resolved as you progress through the tutorial.
  4. Import the JSP page for this tutorial:
    1. In the Enterprise Explorer view, expand Stores > WebContent > storedir where storedir is the name of your store.
      For example, Madisons.
    2. Right-click the Madisons directory; select Import.
    3. From the Select an import source list, select General > File System; click Next.
    4. Click Browse beside the From directory field.
    5. Navigate to the temporary directory where you extracted the WCSample.zip file; navigate to the notcompletedsourcecode\newbusinesslogic\storeassets directory.
    6. Click Deselect All; then, select the MyNewJSPTemplate_All.jsp file.
    7. In the Folder field, the Stores\WebContent\Madisons folder is specified by default.
    8. Click Finish.
  5. Import the properties file 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; select Import.
    3. From the Select an import source list, select General > File System; click Next.
    4. Click Browse beside the From directory field.
    5. Navigate to the temporary directory where you extracted the WCSample.zip file; navigate to the notcompletedsourcecode\newbusinesslogic\storeassets directory.
    6. Click Deselect All, then select the Tutorial_All_en_US.properties file.
    7. In the Folder field, the Stores/src/Madisons folder is specified by default.
    8. Click Finish.
  6. Copy the sample policy files from the WCSample.zip file into your workspace:
    1. Navigate to the temporary directory where you extracted the WCSample.zip file.
    2. Navigate to the notcompletedsourcecode\newbusinesslogic\ACpolicies directory.
    3. Copy the following sample policy files:
      • MyNewControllerCmdACPolicy.xml
      • MyNewViewACPolicy.xml
      • SampleACPolicy_template.xml
      • SampleACPolicy_template_en_US.xml
    4. Navigate to the WCDE_installdir\xml\policies\xml directory; paste the sample policy files into this directory.

Results

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

  1. In WebSphere Commerce Developer, switch to the Server view.
  2. Right-click WebSphere Commerce Test Server; select Start if the server is stopped or Restart if the server is running.
  3. In the Enterprise Explorer view, expand Stores > WebContent > Madisons.
  4. Right-click the index.jsp file; select Run As > Run on Server. If the Server Selection window displays, select Choose an existing server and click Finish.
  5. Select a product and ensure that you can purchase it successfully.

You are now ready to proceed with the remaining tutorial lessons.