Setting up the HTMLSampleBP application in WebSphere Studio Application Developer 5.1.1 Integration Edition running on Windows(R)

The following procedure describes how to install the HTMLSampleBP Application in WebSphere(R) Studio Application Developer 5.1.1 Integration Edition and run the sample in one of the Test Environment configurations.

The following procedure applies whether you are running WebSphere Studio Application Developer 5.1.1 Integration Edition on windows.

To set up the application in WebSphere Studio Application Developer 5.1.1 Integration Edition:

  1. Copy external files
    1. Extract the BTTHTMLSampleWeb.war file from BTTHTMLSample.ear, then extract the \dse directory from the BTTHTMLSampleWeb.war.
    2. On your OS system, create a directory /dse.
    3. Copy all the files in the \dse directory you extracted from BTTHTMLSampleWeb.war to the \dse directory you created in step 1.a.
  2. Create database and tables.
    1. Run DB2(R) CREATE DATABASE SAMPLE in DB2 command window to create a database named sample. You can set user and password for database SAMPLE. For example, set both user and password as db2inst1.
    2. Create three tables:
      1. Create a directory called c:\temp.
      2. Copy createCHATables.ddl to directory c:\temp.
      3. Shift to c:\temp directory and open DB2 Command Window.
      4. In DB2 Command Window, run DB2 CONNECT TO SAMPLE USER DB2ADMIN USING DB2ADMIN
      5. In DB2 Command Window, run db2 -tvf createCHATables.ddl

        You will see messages indicating that CHAChildren , CHAInstance and CHAControl tables have been created successfully.

  3. Import BTTHTMLSampleBPEAR.ear
    1. Start WebSphere Studio Application Developer 5.1.1 Integration Edition. From the menu bar, open J2EE perspective. Select File > Import > EAR file and click Next.
    2. In the Import wizard, set the following parameters:
      • EAR File: <toolkit root>\samples\HtmlSampleBPApplication\ BTTHTMLSampleBPEAR.ear
      • Enterprise Application project name: BTTHTMLSampleBPEAR
    3. Click Next
    4. Select BTTHTMLSampeBP.jar, click Finish
  4. Import dummysnalu0.rar
    1. Open J2EE perspective and from the menu bar, select File > Import > RAR file and click Next.
    2. In the Import wizard, set the following values:
      • Connector File: <toolkit root>\jars\ dummysnalu0.rar
      • Connector Project: dummysnalu0Connector2
    3. Click Finish.
  5. Open J2EE perspective. In the Project Navigator Panel, select BTTHTMLSampleBP and right-click source > Delete .
  6. Import BTTHTMLSampleBP.jar to BTTHTMLSampleBP project.
    1. Extract the BTTHTMLSampleBP.jar file from <toolkit root>\samples\HtmlSampleBPApplication\BTTHTMLSampleBPEAR.ear
    2. Open J2EE perspective. In the Project Navigator Panel , right-click BTTHTMLSampleBP and selectImport > Zip file. Set the following parameters:
      • From Zip file: <toolkit root>/ear/BTTHTMLSampleBP.jar
      • Into folder: BTTHTMLSampleBP
    3. Click Finish.
  7. Edit source folder.
    1. Open J2EE perspective. In the Project Navigator Panel , right-click BTTHTMLSampleBP and select Properties > Java Build Path.
    2. In Source panel, Select BTTHTMLSampleBP/source and click Edit button.
    3. In the opening window that pops up, select Project as source folder option. Click OK.
    4. Check Allow output folders for source folders check-box. Click OK.
  8. Correct build path error.
    1. Open J2EE perspective. In the Project Navigator Panel , right-click BTTHTMLSampleBP and select PropertiesJava Build Path.
    2. In Libraries Panel, select WebSphere V5.1 EE JRE and click Remove button.
    3. Click Add Library button.
    4. In the window that pops up, select JRE System Library. Click Next.
    5. Select WebSphere v5.1 EE JRE and click Finish.
    6. Click OK
  9. Using BPEL file to generate Deploy Code.
    1. Open J2EE perspective. In the Project Navigator Panel , select BTTHTMLSampleBP. Right-click AccountTransfer.bpel and select EnterPrise Services > Generate Deploy Code.
    2. In the window that pops up, click OK.
  10. From the menu bar , select Project > Rebuild All.
  11. Modify WSDL file and rebuild the project BTTHTMLSampleWeb.
    1. Open J2EE perspective. In the Project Navigator Panel, select BTTHTMLSampleWeb and open AccountTransferInterface.wsdl.
    2. Modify following part:
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:import namespace=http://btt.ibm.com/base 
         schemaLocation="BTTSystemData.xsd">
       </xsd:import>
       </xsd:schema>
    3. Save the file. Right-click BTTHTMLSampleWeb and select Rebuild Project.
  12. Set up server in WebSphere Studio Application Developer 5.1 test environment.
    1. Open Server Perspective.
    2. Click New > Server and Server Configuration and set the following parameters:
      • Server name: HTMLSampleServer
      • Folder: Servers
      • Server Type: Integration Test Environment
    3. Click Finish.
    4. Define JAAS Authentication entries in server configuration.
      1. In the Server Configuration panel, double-click the server instance HTMLSampleServer.
      2. Select the Security tab. In the Cell Settings section, click Add button to add a JAAS Authentication Entry and set the following parameters:
        • Alias: CHA
        • User ID: db2admin
        • Password: db2admin
        • Description: HTMLSample
      3. Click Add button to add a JAAS Authentication Entry and set the following parameters:
        • Alias: sna
        • User ID: sna
        • Password: sna
        • Description: HTMLSample
    5. Click OK.
    6. Select Data source tab. In the Server Settings section, Click Add button to add an IBM(R) DB2 JDBC Provider (XA) to the JDBC Provider list.
    7. In the window that pops up , select IBM DB2 in the DataBase type section and DB2 JDBC Provider (XA) in the JDBC Provider type section, Click Next.
    8. In the window that pops up, input name DB2 JDBC Provider (XA) and Click Finish.
    9. Also in Data source tab and the Server Settings section , select DB2 JDBC Provider (XA) in JDBC Provider list and then click Add button to create a Data Source. In the window that pops up , select DB2 JDBC Provider (XA) in the type of JDBC Provider section and select Version 5.0 data source in the data source type section . Click Next.
    10. In the pop-up Modify Data Source window, set the following parameters:
      • Name: CHADataSource
      • JNDI name: jdbc/CHADataSource
      • Description: CHA Exercise
      • Statement cache size: 10
      • Data source helper class name: com.ibm.websphere.rsadapter.DB2DataStoreHelper
      • Connection timeout: 1800
      • Maximum connections: 10
      • Minimum connections: 1
      • Reap time: 180
      • Unused timeout: 1800
      • Aged timeout: 0
      • Purge policy: EntirePool
      • Component-managed authentication alias: CHA
      • Container-managed authentication alias: CHA
      • Check the checkbox: use this data source in container managed persistence (CMP)
    11. Select the J2C tab. In the J2C Resource Adapters section, click Add button to add an Resource Adapter to the Resource Adapter list.
    12. In the Create Resource Adapter window that pops up, click OK.
    13. In the Resource Adapter list, select dummysnalu0Connector. In the J2C Connection Factories section, click Add button.
    14. In the Create Connection Factory window that pops up, set the following parameters:
      • Name: snalu0
      • JNDI name: snalu0
      • Description: snaDataSource
      • Component-managed authentication alias: sna
      • Container-managed authentication alias: sna
      • Others use default value
    15. Click OK.
    16. In the Resource Properties section, set the following parameters:
      • TestFile: http://127.0.0.1:9080/BTTHTMLSampleBPWeb/response.res
      • userName: sna
      • userPassword: sna
    17. Save the modification to server configuration and close server configuration content editor.
  13. Do EJB to RDB mapping.
    1. From J2EE perspective, right-click BTTCHAEJB and select Generate > EJB to RDB Mapping .
    2. In the EJB to RDB Mapping window, select Create a new backend folder option, click Next.
    3. Select Top Down option and click Next.
    4. Do the following settings:
      • In Target Database section, select DB2 Universal Database(TM) V8.1
      • In Database name section, type SAMPLE.
      • In Schema name section, type db2admin.
      • Uncheck the two checkbox Generate DDL and WebSphere 3.x Compatible.
    5. Click Finish.
  14. Deploy BTTCHAEJB , BTTFormaterEJB, BTTHTMLSampleBPEJB, bttsvcinfra, BTTHTMLSampleEJB.
    1. From J2EE perspective, right-click BTTCHAEJB. Select Generate > Deploy and RMIC Code.
    2. In the window that pops up, check all check-boxes and Click Finish.
    3. From J2EE perspective, right-click BTTFormaterEJB, select Generate > Deploy and RMIC Code.
    4. In the window that pops up, check all check-boxes and Click Finish.
    5. From J2EE perspective, right-click BTTHTMLSampleBPEJB, select Generate > Deploy and RMIC Code.
    6. In the window that pops up, check all check-boxes and Click Finish.
    7. From J2EE perspective, right-click bttsvcinfra, select Generate > Deploy and RMIC Code.
    8. In the window that pops up, check all check-boxes and Click Finish.
    9. From J2EE perspective, right-click BTTHTMLSampleEJB, select Generate > Deploy and RMIC Code.
    10. In the window that pops up, check all check-boxes and Click Finish.
  15. Associate the BTTHTMLSample project with the server configuration. In the Servers view, right-click and select Add and Remove Projects. Add BTTHTMLSampleBPEAR, Click Finish.
  16. Start HTMLSampleServer. In the HTMLSampleServer view, right-click and select Start.
  17. Run HTMLSample. Open Web Browser and input URL: http://serverName:9080/BTTHTMLSampleWeb/btt/html/sign/prepareSignIn.do