iPlanet Application Builder 6.0 Service Pack 1 Tutorial

This tutorial introduces features of the iPlanet Application Builder by walking you through the creation of:

This tutorial assumes you have successfully installed:

Additionally, your development machine must have an HTTP server installedand running. Also, the tutorial database should already be set up by running the tutorial database scripts.

For additional information, such as which drivers to use, how to create ODBC and JDBC data sources, and how to register the tutorial files, see the iPlanet Application Builder Version 6.0 Installation Instructions.

Part 1: Sales Tax Simple Session Bean Application

To create a simple session bean:

  1. Launch the Application Builder program.
  2. From the Welcome screen, select the "Create a new project" button and select OK.

    The New Project Wizard is launched to assist you in the creation of your new project.

  3. In the Name field, enter the name "SalesTax" for the name of your project and select Next.

  4. Enable both the Create starting index.html file, and Create validate.js file project features and select next.

    The New Project Wizard identifies the files that will be generated.

  5. Select Finish to generate the new project.

    The Create Data Model window appears.

  6. Select the No, Wait Until Later button.
  7. From the Project Pane, select the Enterprise Java Beans folder.
  8. Right click to display the EJB pop-up menu.
  9. Select Add EJB...

    The New Files window appears.

  10. Select the Session Bean icon and select add.

    The Session Bean wizard is launched to assist you in creating a new session bean.

  11. In the Name field, enter the name "Sales" for the name of your session bean and select Next.

  12. Accept all the default settings and select Next.

  13. For the Session Bean Properties, be sure Stateless is selected and select next.

    The Session Bean Wizard identifies the files that will be generated.

    In the Project Pane, the Sales session bean appears including the following files:

    ISales.java Remote interface
    ISalesHome.java Home interface
    ISalesBean.java Bean implementation class

  14. Select the ISales.java file and right-click to display the pop-up menu.

  15. Select Open.
  16. Insert the following code in the body of the interface:

    {public double calculateTax(double amount) throws RemoteException; }
    

    Your source code for the ISales.java file should read as follows:

  17. Save the file.

  18. From the Project pane, select the SalesBean.java file.
  19. Right-click to display the pop-up menu and select Open.

  20. Add the following method to the end of the implementation class:

    public double calculateTax(double amount) throws RemoteException
        {      return (0.0825*amount);
        } 
    

    Your source code for the SalesBean.java file should read as follows:

  21. Save the file.
  22. From the project pane, right click on the SalesTax.iab project to display the pop-up menu.

  23. Select Project Metadata...

    The Project Metadata Editor appears.

  24. Select the EJB References Tab.

  25. Select the New Reference button to add a new reference.

  26. Add the following information in each field:

    Field Information
    Reference Sales
    Bean Type Session
    Bean Home Interface ISalesHome
    Bean Remote Interface ISales
    JNDI Name ejb/SalesTaxEjb/SalesTax/Sales

  27. Right click on the Project MetaData tabbed window.
  28. Select Save WebApp Descriptor from the pop-up window to save your settings.

    If you click again, the menu items from the pop-up window should appear grayed out indicating the modifications have been saved.

  29. From the File Menu, Select New, then Input.

    The Input Page Wizard appears to help you create the HTML input page.

  30. In the Name field, enter SalesPage and click Next.
  31. Make sure the "Handle information with custom code" radial button is selected and click Next.

  32. In the Name field, enter the label "Amount" and accept the default settings for the other fields in the table.

  33. Click Next.

    The Input Page Wizard identifies the files that will be generated.

    The input wizard will generate a SalesPage.html, a CalledSalesPage.java, and a CalledSalesPage.jsp file.

  34. Click Finish to generate the identified files.

    Notice that in the Project pane Java Files folder a CalledSalesPage.java file is generated. Also, in the Java Server Pages folder a CalledSalesPage.jsp file is generated.

  35. Double-click on the CalledSalesPage.java file to open it.
  36. Copy the following code and paste it within the defaultAction() method.

    String JNDI_NAME="ejb/SalesTax/Sales";
    javax.naming.Context initContext=null;
    java.util.Hashtable env = new java.util.Hashtable(1);
    try
    {
    initContext = new javax.naming.InitialContext(env);
    }
    catch(Exception e)
    {
    System.out.println("could not get initContext");
    }
    System.out.println("EJB Lookup");
    try
    {
    String amount1=req.getParameter("Amount");
    Double d = new Double(amount1);
    System.out.println("Amount entered is :" + d.doubleValue());
    Object beanObject = null;
    beanObject = initContext.lookup(JNDI_NAME);
    SalesTax.ISalesHome home = (SalesTax.ISalesHome) beanObject;
    SalesTax.ISales remote = (SalesTax.ISales)home.create();
    double sAmount = remote.calculateTax(d.doubleValue());
    Double foo = new Double(sAmount);
    String s = foo.toString();
    int pos = s.indexOf(".");
    s = s + "0000";
    String iNeed = s.substring(0,pos+4);
    req.setAttribute("Tax",iNeed);
    RequestDispatcher dis = getServletContext().getRequestDispatcher("/CalledSalesPage.jsp");
    dis.forward(req,res);
    } catch(Exception e) {
    e.printStackTrace();
    }
    

  37. Save your work.
  38. From the Project Pane Java Server Pages folder, double-click on the CalledSalesPage.jsp file to open it.
  39. Replace the string "Input Successful!" with the string "Sales Tax for ..."
  40. From the Palette, select the JSP tab.
  41. Drag a and drop it onto the CalledSalesPage.jsp file.
  42. In the Properties Editor JSP Expression value field, enter the following value: request.getParameter("Amount").

  43. From the Palette, drag another and drop it onto the CalledSalesPage.jsp file.
  44. In the Properties Editor, JSP Expression value field, enter the following value: request.getAttribute("Tax").

  45. Save your work.
  46. From the Project Pane HTML Pages folder, double-click to open the index.html file.
  47. Delete the text and replace it with "Sales Tax Calculation." Also, add the text "Click Here" and highlight it to create a link.
  48. In the Properties Editor, select the Destination URL field and enter SalesPage.html to activate the link.
  49. Test your project by selecting Test Project from the Test menu.

    A browser window should appear similar to the following:

  50. Enter some data in the Enter Amount field and click Calculate Tax.
  51. Select the "Click Here" link to view the JavaServer page application.

    Congratulations, you have just completed a simple session bean employing a Sales Taxcalculation application.

Part 2: Compact Disc Sample Application

This Compact Disc tutorial includes the following tasks:

You can use Visual Cafe Pro (WebGain) to edit, compile, and debug your Javaservlets. For more information, see Using iPlanet Application Builder with Visual Café.

Task 1: Starting a New Project

This part of the tutorial describes launching iPlanet Application Builder,creating a new project, creating a data model to link the application witha database, and saving the project files to disk.

To create a new project, perform the following tasks:

Launch iPlanet Application Builder

Launch iPlanet Application Builder from the Windows Start Menu by choosingthe iPlanet Application Builder 6.0 menu item. iPlanet Application Builderstarts the New Project wizard.

Create a New Project

Name the new project cdx1 in directory "<iasRoot>\cdx1".

Note that the sample tutorial created uses the directory "cdx",you cannot copy pieces of the cdx tutorial into your cdx1 projectwithout modifications, such as query (.gxq) paths, JavaServerPage (.jsp) paths, and class definitions.

  1. Click Next to create each of the project starter files.
  2. In this tutorial, you need not create an index.html page, becauseyou will copy an existing file when you come to the section on AddingAny Pre-Existing HTML Files. The purpose of this dialog box is to allowyou some flexibility in which files are created initially. For example,if you wanted to keep an existing index.html file in your webserver's doc directory, you would uncheck this file; otherwise,your file would be overwritten by the empty index.html file createdby this wizard.

  3. Click Next. The New Project wizard displays the files it will create.
  4. Click Finish.
  5. The iPlanet Application Builder creates the following files:

    File TypeFile Names
    Projectcdx1.xml
    HTML start pageindex.html
    JavaScript source codevalidate.js

You only use the project file to open an existing project. You shouldnot modify the project file; iPlanet Application Builder handles all changesto the project file for you.

Create a Data Model

  1. Click the Yes, Add a Data Model button in the Create Data Model dialog.

  2. Double-click the Data Model icon under New file(s).

  3. Specify a name and directory for your data model and click Continue.

  4. Specify "Create a new connection" and click OK.

  5. Specify the following values for the listed fields:

    FieldValue
    DriverThe name of your driver, such as ODBC
    Data Sourcescdx
    User nameThe data source's user name, such as netscape
    PasswordThe associated password, such as netscape

    Note that if you select another driver, such as select ORACLE_OCIforthe table, iPlanet Application Builder displays an additional field, Database;the proper value you should supply is nsample.

  6. Click OK and the Add Tables dialog appears.
  7. Add cdxinventory and cdxuser to the Data Model by selectingthem from the available tables and clicking the right-arrow button to movethem to the "Tables in data model" pane.

  8. Click OK to finish.
  9. Click OK to create the relationships.

Creating Aliases

You will see each table with its list of columns in the Data Model editor.

You are then ready to establish relationships between these tables.In the cdx application, three columns of the cdxinventory tableare related to the same column (id) in the cdxuser table.

To represent this in iPlanet Application Builder, you create two aliasesof the cdxinventory table.

  1. Right-click the cdxinventory table and select Insert Table Aliasfrom the pop-up menu.

    iPlanet Application Builder displays the table cdxinventory_2.

  2. Repeat this step to create another table (cdxinventory_3).

Joining Tables

To create the joins, first drag the table boxes so they do not overlap,then perform the following steps:

  1. Click the cdxuser.id field and drag it to cdxinventory.owner.

    This step creates a one-to-many join from cdxuser.id tocdxinventory.owner.

  2. Drag the cdxuser.id field to cdxinventory_2.buyer.
  3. Drag the cdxuser.id field to cdxinventory_3.xlock.

    The data model now allows one user to own many titles, purchase manytitles, and have many purchases pending.

  4. Click the close box [x] to close the data model editor.
  5. Save the cdx1.kdm file when prompted.

Alternatively, you can access the existing data model. To specify an existingdata model, perform the following steps:

  1. Yes, Add a Data Model.
  2. Click the Existing tab.
  3. Select cdx\cdx.kdm.
  4. Double click cdx.kdm in the project tree to view the data model.

Clean Up Project File

Since the tutorial already includes a file named index.html, youneed to remove the file of the same name iPlanet Application Builder automaticallycreates for you.

  1. Right-click index.html in the iPlanet Application Builder Projecttree, and select "Remove".
  2. Check "Also remove index.html from the file system" so that the actualfile is deleted.
  3. Click Yes to remove the file from the project and from disk.

Add Any Pre-Existing HTML Files

Now, it's time to add any pre-existing HTML files, or imagesto the project. For this tutorial, we will start with the files installedin <iasroot>/APPS/GXAPP. To add these pre-existing HTML filesto the tutorial application, perform the following steps:

  1. Using Windows Explorer, copy the files and sub-folders in <IABroot>\tutorial\startersto the web server's project directory under <WebRoot>\docs\cdx1.
  2. Using iPlanet Application Builder, select Project - Add File(s) then selectthe Existing tab to add existing files to the project.
  3. Select the Existing tab and, Under Web Server root\cdx1, selectthe following files:
  4. Click Add.

    The iPlanet Application Builder adds the files to the project.

  5. You must copy the logo image file to your project directory as well,so that .jsp templates will properly display the logo.

    The cdx1\templates subdirectory includes a Macromedia Dreamweavertemplate that can be applied within Dreamweaver to the pages generatedby iPlanet Application Builder. You do not need to add this file to youriPlanet Application Builder project.

Save Your Work

Now is a good time to save your work. Click the double-disk toolbar iconto save all project files. If the Save All option is not enabled, thenClick Save.

Task 2: Creating Static Links

iPlanet Application Builder provides easy-to-use code generation wizardsto create sets of HTML and JavaServer pages, servlets, and database queries.To use these wizards most effectively, it is best to think of your applicationin terms of activities, and from there, map each activity to the use ofone or more Wizards.

This tutorial illustrates this process as you first create and linkin the activities for the Main Menu page and the User Menu page. The primarydifference between these pages, is that the User Menu page presents someactivities that require a user to have previously logged in.

Create and/or Link the Destinations for the Main Menu (index.html)

  1. From the Project tree, double-click the HTML Page "index.html"to open it in iPlanet Application Builder's integrated HTML editor.
  2. You may use an HTML editor of your choice by specifying a third-partyHTML editor in the Tools -> Development Options dialog. However, to createor modify links, especially those that call servlets, it is much easierto use the iPlanet Application Builder "built-in" HTML editor.

  3. Perform the following steps to convert the static text "Instructions" toa hyperlink to the instructions.html page:
    1. Select the text of the first bullet: Instructions.
    2. Click the Create Link icon at the far right of the toolbar. If the Create Link icon is not present, then select View -> Toolbars -> Standard.

    Note that you can also right-click the highlighted text and choose "CreateLink" from the pop-up menu to create the link.

    The text becomes a link.

  4. In the Properties inspector, click the Destination URL property editorbutton.
  5. In the HTML File drop-down, select the file Instructions.html.
  6. Click OK to complete the link.

Task 3: Creating an Input Form

To create the "New Account" data entry form, perform the following tasks:

For the new account activity, use the Input Wizard to generate a data entryform and a servlet to process the form data.

  1. Select File -> New -> Input.
  2. Type "CreateAccount" for Name.
  3. Store to a database table.
  4. Select the project data model (cdx1.kdm).
  5. Select Use the existing connection and verify that the name is "cdx".
  6. Select the table cdxuser to specify name, email, phone, and passwordfields for stored input data (uncheck "id" so it does not appearon the form).
  7. Click Next.
  8. Click Finish.

The iPlanet Application Builder generates the following project files,which are identified in the project window:

Edit the JavaServer Page

Next, edit the CalledCreateAccount.jsp response page to add anidentifying message and a link to index.html. To create link:

  1. Type in the text "Main Menu" and select the text.
  2. Click the Create Link icon at the far right of the toolbar.
  3. If the Create Link icon is not present, then select View -> Toolbars-> Standard. Note that you can also right-click the highlighted text andchoose "Create Link" from the pop-up menu to create the link.

    The text becomes a link.

  4. In the Properties inspector, click the Destination URL property editorbutton.
  5. In the HTML File drop-down, select the file "index.html".
  6. Click OK to complete the link.
  7. Close and save the file.

Edit the Query File

  1. Double-click CalledCreateAccount.gxq in Project tree to open thequery file.
  2. Double-click the CalledCreateAccount_Insert query.
  3. The iPlanet Application Builder displays the InsertQuery PropertiesDialog.

  4. Click the Fields tab, and set the Value for the "id" column to be :id.
  5. This action tells iPlanet Application Builder to bind the idcolumn to the value of the 'id' valList parameter.

  6. Click Finish.
  7. Close and save the file.

Edit the Servlet File

  1. Add the code to set the "id" parameter in the servlet, CalledCreateAccount.java.
  2. Double-click the CalledCreateAccount.java file to open it.
  3. Find the defaultAction() method and before the insertStmt.executeUpdate()statement, add the following code to the servlet file:
  4. 	String sname = (String)req.getParameter("NAME");	int code = sname.hashCode();	insertStmt.setInt(((Integer)params.get("ID")).intValue(), code);

  5. In order to display the "CalledCreateEntry.jsp" on successful creationof the new account, enter the following code after the statement "insertStmt.executeUpdate( );":

    	String addJsp = "/CalledCreateAccount.jsp"; 	RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(addJsp);	res.setContentType("text/html");	dispatcher.forward(req, res);

  6. Delete or comment-out the line "displayMessage( req, res, "Insert Success");"
  7. Save all modified files.
  8. Compile (and test, if desired).

Add the Link in index.html

  1. Open the index.html file and select the "Create New Account" text.
  2. Click the link icon.
  3. Select the destination URL Property Editor.
  4. Select the html page CreateAccount.html.
  5. Click OK.
  6. Close and save the file.

Task 4: Creating a Login Sequence

To create the login page and associated servlet, perform the following tasks:

Create the Login Page and Servlet to Process Login Data

  1. Select File -> New -> Login.
  2. Type "Login" for Name.
  3. The Username and Password parameters are already specified; select Next.
  4. Check Authenticate with a Database Table.
  5. Select the project's data model (cdx1.kdm).
  6. Select Use the existing connection and verify that the name is "cdx".
  7. Select Table "cdxuser" and bind Username and Password to nameand pswd columns, respectively; click Next.
  8. Make sure "id" and "name" are checked to save to session.
  9. Click Next.
  10. Click Finish.
  11. The iPlanet Application Builder creates the following files:

    	Login.html	CalledLogin.java	CalledLogin.jsp	CalledLogin.gxq

Edit the CalledLogin.jsp file

  1. Open CalledLogin.jsp.
  2. Select the Layout view by clicking on the Layout tab at thebottom of the editor frame.
  3. Type in "UserMenu" below the "Login Successful" text.
  4. Highlight and link the "UserMenu" text to userMenu.html.
  5. Type in "Try Again" below the "Login Failed" text.
  6. Highlight and link the "Try Again" text to Login.html.

Link the Login Page to the Main Menu

  1. Open index.html.
  2. Select Log In and specify it as a link.
  3. Click the link icon.
  4. Select the destination URL Property Editor.
  5. Select the html page Login.html.
  6. Close and save the file.

Task 5: Creating a Database Form

  1. Create the List Users destination.
  2. Select File -> New -> Database Forms.
  3. Type "ListUsers" for Name.
  4. Click Next and specify "Use data model."
  5. Click Next and specify cdx1.kdm for your data model.
  6. Select Single page, Multiple record master.
  7. Specify the project's data model (cdx1.kdm).
  8. Select Use the existing connection and verify that the name is "cdx".
  9. Select the cdxuser table and the name, email,and phone fields.
  10. Select display all records at once.
  11. Select cdxuser.name to sort.
  12. Click Next.
  13. Click Finish.
  14. The iPlanet Application Builder creates the following files:

    	ListUsers.gxq	ListUsers.java	ListUsers.jsp

  15. Open ListUsers.jsp and add a link back to the main menu.
  16. Type the text "Main Menu" and select it.
  17. Click the Link icon.
  18. Set destination URL property to index.html.
  19. You can also drag index.html to the page, and change text to "Main Menu".

  20. Open index.html and convert the text "List Users" to a link.
  21. Select the text, then click the Create Link icon at the far right of the toolbar.
  22. If the Create Link icon is not present, then select View -> Toolbars -> Standard. Edit Destination URL in Properties.

  23. Select the ListUsers servlet from the Servlet drop-down and click OK.
  24. You can also right-click the highlighted text and choose CreateLink from the pop-up menu to create the link.

Task 6: Creating Browse Activities

To create the browse activities, perform the following tasks:

Create Browse Titles By Artist Activity

  1. Select File -> New -> Database Forms.
  2. Type "BrowseArtist" for Name; then click Next.
  3. Choose "Use a data model;" then click Next.
  4. Specify the project's data model (cdx1.kdm); then click Next.
  5. Select Single page, Multiple Record Master; then click Next.
  6. Select Use the existing connection and verify that the name is cdx; thenclick next.
  7. Select table: cdxinventory.
  8. Select table fields: id, artist, title, andprice.
  9. Click Next.
  10. Select Browse 20 records at a time; then click Next.
  11. Select Sort by cdxinventory.artist; then click Next.
  12. Click Next.
  13. Click Finish.
  14. The iPlanet Application Builder creates the following files:

    	BrowseArtist.gxq	BrowseArtist.java	BrowseArtist.jsp

Adding Select Conditions

Now must edit the query to only display available CDs. In the datamodel, CDs that have already been purchased or are pending purchase willbe marked with the buyer's id in the buyer or xlock field.

  1. Open the query, BrowseArtist.gxq.
  2. Double-click the BrowseArtist.
  3. Select the Conditionals tab on the query properties dialog.
  4. Click Add Condition.
  5. Select the cdxinventory table, buyer field, and =operator, and enter 0 as the value.
  6. Click OK, then repeat steps 4 and 5 for the xlock field.
  7. The Conditions panel of the Query Designer displays the new query conditions.

  8. Click Finish.

Converting a Column to Links

Convert the id column to the Buy! link in the BrowseArtist.jsp file:

  1. Open BrowseArtist.jsp.
  2. Click the BrowseArtist.id data-bound label.
  3. Press the Delete key to delete it.
  4. Drag the Data-Bound HTML hyperlink from the Palette to the cell, creating a hyperlink.
  5. Select the Hyperlink and change the text to Buy!
  6. You can also right-click the highlighted text and choose "CreateLink" from the pop-up menu to create the link.

    After you create the Buy! activity (see Task 8: UsingQueries and Result Sets), you will use the Destination URL propertyeditor to complete the data-bound link.

Create Browse Titles By Price Activity

  1. Select File -> New -> Database Forms.
  2. Type "BrowsePrice" for Name; then click Next.
  3. Click Use a data model; then click Next.
  4. Specify the project's data model (cdx1.kdm); then click Next.
  5. Select Single page, Multiple Record Master; then click Next.
  6. Specify the project's data model (cdx1.kdm); then click Next.
  7. Select Use the existing connection and verify that the name is cdx;then click Next.
  8. Select table: cdxinventory.
  9. Select table fields: id, artist, title, andprice; then click Next.
  10. Choose Browse 20 records at a time; then Click Next.
  11. Select Sort by cdxinventory.price; then click Next.
  12. Click Next.
  13. Click Finish.

The iPlanet Application Builder creates the following files:

	BrowsePrice.gxq	BrowsePrice.java	BrowsePrice.jsp

Adding Select Conditions

  1. Open the query, BrowsePrice.gxq; double-click the BrowsePriceselect query; and select the Conditionals tab on the query properties dialog.
  2. Click Add Condition.
  3. Select the cdxinventory table, buyer field, and =operator, and enter 0 as the value.
  4. Click OK.
  5. Repeat steps 2 and 3 for the xlock field.

    The Conditions panel of the Query Designer displays the new query conditions.

  6. Click Finish.

Converting Columns to Links

  1. Convert the id column to the Buy! link in the BrowserPrice.jspfile.
  2. Open the BrowsePrice.jsp file.
  3. Select BrowsePrice.id data-bound label.
  4. Press the Delete key to delete it.
  5. Drag the Data-Bound HTML hyperlink from the Palette to the cell, creating a hyperlink.
  6. Select the Hyperlink and change the text to Buy!
  7. If the Create Link icon is not present, then select View -> Toolbars-> Standard. Note that you can also right-click the highlighted text andchoose "Create Link" from the pop-up menu to create the link.

    After you create the Buy! activity (see Task 8: UsingQueries and Result Sets), you will use the Destination URL propertyeditor to complete the data-bound link.

Connect Main Menu Links to the Browse Activities

To connect the Main menu links to the Browse By Artist & Browse byPrice activities, perform the following steps:

  1. Open UserMenu.html.
  2. Select the text to become a link, either Browse Available Titles [Sortedby Price] or Browse Available Titles [Sorted by Artist].
  3. Click the Create Link icon at the far right of the toolbar.
  4. If the Create Link icon is not present, then select View -> Toolbars-> Standard. Note that you can also right-click the highlighted text andchoose "Create Link" from the pop-up menu to create the link.

  5. Bring up Destination URL Property Editor from Properties.
  6. Select BrowseArtist or BrowsePrice servlet as necessary.
  7. Click OK.
  8. Repeat steps 2-6 for the other link.

Task 7: Creating a Search Activity

Now you are ready to create the User Menu activities. You will also createthe "Buy CD" activity and connect it to the "Browse CD Buy!" links. Toperform this task, you need to create the CD Browser master/detail/searchset, which is designed for browsing after login with view of owner detailfor purchase.

  1. Select File -> New -> Database Forms.
  2. Type CDBrowser for Name; click Next.
  3. Select the option "Use a data model" and click Next.
  4. Specify the project's data model.
  5. Select cdx1.kdm and click Next.
  6. Select Multiple record master and single record detail.
  7. Select the "Create a search page" checkbox.
  8. Click Next.
  9. Select "Use an existing connection" and verify that the name is cdx;then click Next.
  10. Select fields to display in master in the following order:
  11. 	cdxinventory.id	artist	title	price	cdxuser.name	cdxinventory.notes

    The id will be converted to the Buy! link later.

  12. Select browse 20 records at a time; then click Next.
  13. Select sorting by cdxinventory.artist and cdxinventory.title;then click Next.
  14. Select the fields to display in the detail; then click Next.
  15. Choose cdxuser: name, email, and phone.
  16. Leave detail fields display-only; then click Next.
  17. Select name for Display Field; this is the drill-down field.
  18. Specify join as (Master) cdxinventory.owner= (Detail) cdxuser.id.
  19. Click Next.
  20. Specify columns for search page: title and artist; thenclick Next.
  21. Click Next.
  22. Click Finish.
  23. The iPlanet Application Builder creates the following files:

    	CDBrowser_Search.html	CDBrowser.gxq	CDBrowser.java	CDBrowser.jsp	CDBrowserDetail.java	CDBrowserDetail.jsp

Modifying a SQL Query

Next, you need to edit the generated query, CDBrowser.gxq to ensurethat only CDs that are available for purchase are displayed.

  1. Open the CDBrowser.gxq query file.
  2. Double-click the CDBrowser select query.
  3. This time, the Conditionals panel is disabled because the query includesthe variable ":Whereclause" and is considered a custom query.

  4. Select the SQL panel where you can enter the additional where conditionsdirectly into the SQL SELECT statement.
  5. Edit the statement to include the conditions:
  6. 	cdxuser.id = cdxinventory.owner and	cdxinventory.xlock = 0 and cdxinventory.buyer = 0	and :WhereClause

  7. Click Finish.
  8. Close and save the file.

Deleting Column From a JavaServer Page

Edit the CDBrowser.jsp JavaServer page as follows:

  1. Select "id" text in column header.
  2. Right click and choose Table options.
  3. Select Delete column to delete "id" column.
  4. At the bottom of the page enter text "UserMenu".
  5. Select the text "UserMenu".
  6. Click the Create Link icon at the far right of the toolbar.
  7. Set destination URL property to Usermenu.html.
  8. Close and save the file.

Edit the CDBrowserDetail.jsp JavaServer page as follows:

  1. At the bottom of the page, enter the text "UserMenu."
  2. Select the text "UserMenu."
  3. Click the Create Link icon at the far right of the toolbar.
  4. Set the destination URL property to UserMenu.html.
  5. Close and save the file.

Add the Link in UserMenu.html

  1. Open UserMenu.html.
  2. Select the text to become a link "Search for CDs".
  3. Click the Create Link icon at the far right of the toolbar.
  4. If the Create Link icon is not present, select View -> Toolbars-> Standard. You can also right-click the highlighted text and choose "Create Link" from the pop-up menu to create the link.

  5. Bring up Destination URL Property Editor from Properties.
  6. Select CDBrowse_search.html.

Task 8: Using Queries and Result Sets

To create the Buy! browse activities, perform the following tasks:

Create SELECT Query

To create a SELECT query to specify purchase item, perform the following steps:

  1. Select File -> New -> Query.
  2. Type cdrecord for Name.
  3. Specify the project's data model (cdx1.kdm).
  4. Specify Select for the query type; then press Continue.
  5. Using the Select Query Properties dialog box, perform the followingactions:

    • Under the Name Tab, specify cdrecord; then click Next.
    • Under the Fields Tab, specify All from cdxinventory, then click Next.

    • Under the Conditionals Tab, select Add Condition and set cdxinventory.id to :id.
    • Click OK to continue.
    • Click Finish.
    • The iPlanet Application Builder creates the cdrecord.gxq SELECT query.

Create UPDATE Query

To create an UPDATE query for locking the purchase, perform the following steps:

  1. Select File -> New -> Query.
  2. Type updatelock for Name; then click Next.
  3. Specify the project's data model (cdx1.kdm); then click Next.
  4. Select Update for the query type; then click Continue.
  5. Using the UpdateQuery Properties dialog, perform the following steps:

Create New Database Form

  1. Select File -> New -> Database Forms.
  2. Type BuyCD for Name; then click Next.
  3. Specify "Use an existing query file."
  4. Select cdrecord.gxq query; then click Next.
  5. Select "Multiple Records" to get a tabular layout; then click Next.
  6. Specify "Use an existing connection" and verify that it is cdx; thenclick Next.
  7. Click Next.
  8. Do not check the "Create input page" checkbox.

  9. Click Next.
  10. Click Finish.
  11. The iPlanet Application Builder creates the following files:

    	BuyCD.java	BuyCD.jsp

Edit BuyCD JavaServer Page

  1. Open the BuyCD.jsp file.
  2. From the Palette Form tab, drag a push button component below the table.
  3. Use the Properties editor to change the Label property to Buy It!.
  4. Drag the BuyCD.id column to the form.
  5. Right click on the field and choose "Change Type To Data-Bound Text Field."
  6. Reselect the BuyCD.id text field.
  7. In the Properties window, change the Type of field attribute to HIDDEN.
  8. Select the owner, buyer, xlock, and genre column headings.
  9. Press the Delete key to delete them.
  10. Select the empty id column and delete it.
  11. You may need to change to Outline view first.

  12. Repeat the above steps to delete the owner, buyer, xlock, and genre columns.
  13. After the BuyCD pages is presented and the user confirms the purchase,the BuyCommit servlet updates the cdxinventory table and sends mail to the seller.

Create Transaction Confirmation Page

Use the iPlanet Application Builder Results wizard toget started on the BuyCommit servlet and transaction confirmation page.

To create the transaction confirmation page, perform the following tasks:

Using the Results Wizard

  1. Select File -> New -> Results.
  2. Type BuyCommit for Name.
  3. Enter the input parameter id and check Required.
  4. Click Next.
  5. Click Finish.
  6. The iPlanet Application Builder creates the following files:

    	BuyCommit.java	BuyCommit.jsp

  7. Copy the implementation inside the BuyCommit class from <IASRoot>\Apps\cdx\BuyCommit.javato your BuyCommit.java file; do not change import, or class declarations.
  8. Change the package name at the beginning of BuyCommit.java to cdx1.
  9. Change the directories for cdrecord.gxq, updatelock.gxq, and CDBrowser.gxq from cdx to cdx1:
  10. 	cdx1/cdrecord.gxq	cdx1/updatelock.gxq	cdx1/CDBrowser.gxq

Link BuyCommit to the BuyCD Confirmation Page

Next, you need to link the BuyCommit servlet to the BuyCD confirmation page.

  1. Open the BuyCD.jsp file.
  2. Select Form: Form1.
  3. Open Action property editor.
  4. Select Action.
  5. Click within the rightmost part of a blank field to activate the customproperty button .
  6. Click the property button .
  7. Select BuyCommit from the servlet drop-down list.
  8. Open the <IASRoot>\Apps\cdx\BuyCD.jsp file.
  9. Copy the following line.

    <rdbm:param name="ID" type="String" bindOnLoad="true">
    <attr:getParametername="ID">1=1</attr:getParameter></rdbm:param>

  10. In BuyCD.jsp search for the following code:
  11. <INPUT TYPE="HIDDEN" NAME="ID" VALUE="<rdbm:field query="BuyCD" name="ID" urlEncode="true" />" FILEREFS="validate.js"EBPROPS="{ dataField = ID;dataSet = BuyCD;}" EBCLASS="netscape.blizzard.components.TextField">

  12. Delete the above code.
  13. Now, insert the following code:

    <rdbm:goRecord query="BuyCD" start="1" execute="true"/>
    <INPUT TYPE="HIDDEN" NAME="ID" VALUE="<rdbm:field query="BuyCD" name="ID" />"

    The Buy! Activity is now complete. Next, return to Browse pagesto connect the "Buy!" JSP to the BuyCD servlet.

Link Buy! to BuyCD Servlet

  1. Open the BrowseArtist.jsp file.
  2. Select Buy! to edit the Destination URL property.
  3. Select the BuyCD servlet.
  4. Click the Add button, Click in name field, enter ID and press Enter.
  5. Select Data Bind-Value.
  6. In the cell editor dialog box, select BrowseArtist in the ResultSetdrop-down list and select id in the DataField drop-down list; click Add.
  7. The iPlanet Application Builder displays the data-binding expression.

  8. Click OK in the Cell editor.
  9. Click OK in the Edit property dialog box.
  10. Repeat steps 1-7 for BrowsePrice.jsp.
  11. Select BrowsePrice in step 5.

Task 9: Inserting Form Data Into a Database

To add the "CD for Sale/Exchange" buyer destination functions, perform the following steps:
  1. Select File -> New -> Input.
  2. Type "CreateEntry" for Name.
  3. Select "Store to a database table."
  4. Specify the project's data model (cdx1.kdm).
  5. Use an existing connection (cdx).
  6. Select table cdxinventory.
  7. Deselect all fields except those that you want to appear onthe form: price, title, artist, and notes, to appear on the form.
  8. Click Next.
  9. Click Finish.
  10. The iPlanet Application Builder creates the following files:

    	CreateEntry.html	CalledCreateEntry.gxq	CalledCreateEntry.java	CalledCreateEntry.jsp

Editing Called Code

  1. Open CalledCreateEntry.java
  2. Before the statement, insertStmt.executeUpdate( ); in defaultAction method,add the following code:

    	String sname = (String)req.getParameter("TITLE");	int code = sname.hashCode();	insertStmt.setInt(((Integer)params.get("ID")).intValue(), code);	HttpSession session=req.getSession(true);	String curUser = (String)session.getAttribute("NAME");	String ids = ((String)session.getAttribute("ID")).trim();	int idFromSession = new Integer(ids).intvalue();	insertStmt.setInt(((Integer)params.get("OWNER")).intValue(),idFromSession);

    To display the corresponding jsp, add the following code after the insertStmt.executeUpdate(); in defaultAction method:

    	String addJsp = "/CalledCreateEntry.jsp";	RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(addJsp);	res.setContentType("text/html");	dispatcher.forward(req, res);

    If you do not add the above code, the dynamically generated page will display.

  3. Comment out or delete the line: displayMessage( req, res, "Insert Success");.

Creating a Custom Query

To edit CalledCreateEntry.gxq to create the CalledCreateEntry_Countcustom query perform the following steps:

  1. Open the CalledCreateEntry.gxq file.
  2. Right-click the view and select the Insert Select Query pop-up menuitem.
  3. In the SelectQuery Properties dialog, name the query "CalledCreateEntry_Count".
  4. Select the SQL tab and edit the SQL statement to read:
  5. 	/* CalledCreateEntry_Count:  */	query CalledCreateEntry_Count using (ODBC, cdx, iPlanet) is 	select count(*) from cdxinventory

  6. Click Finish.
  7. The query is now a custom query.

    A warning message displays indicating that this is a customquery.

Editing Insert Query Properties

You now need to add the id, buyer, and xlock fields to the query; settingid to the new record identifier and initializing the buyer and xlock fields to 0.

  1. With the CalledCreateEntry.gxq file still open in the Query Editorview, double-click the CalledCreateEntry_Insert icon to display the InsertQueryProperties dialog box.
  2. Select to the SQL tab and edit the SQL statement to contain the followingcode:
  3. 	/* CalledCreateEntry_Insert:  */	query CalledCreateEntry_Insert using (ODBC, cdx, iPlanet) is 	insert into cdxinventory 		(id, owner, buyer, xlock, price, title, artist, notes)	values (:id, :owner, 0, 0, :price, :title, :artist, :notes)

  4. Click Finish.
  5. The query is now a custom query.

Linking to an HTML File

To link the "Add CD for Sale" item to the Create Entry page:

  1. Open the UserMenu.html file.
  2. Select the text "Add CD for Sale/Exchange".
  3. Click the Create Link icon, or right-click the text selection and chooseCreate Link from the pop-up menu.
  4. From the Properties editor, open the Destination URL property editor.
  5. Select CreateEntry.html from the HTML File drop-down list.
  6. Click OK to complete the link.

Task 10: Using Queries WithDatabase Forms

Since the queries for this report are more complicated than for previousreports, this tutorial first uses the query editor to create the queries.Then, we use the Database Forms wizard to use the generated queries. Recallthat in the data model, the alias cdxinventory_3 is joined by xlock touser. For the required SELECT query, you need to take any inventory fieldsfrom this alias because the xlock field identifies CDs with pending transactions.

To create the "view pending transactions" activity, perform thefollowing tasks:

Creating SELECT Queries

First you must create a query for the report itself.

  1. Select File -> New -> Query.
  2. Type PendingSeller for Name.
  3. Specify the project's data model (cdx1.kdm).
  4. Specify Select for Type.
  5. Click Continue.

Selecting Query Properties

Using the SelectQuery Properties dialog box, perform the following steps:

  1. Type PendingSeller for Name.
  2. Select the title, price, and artist fields from the cdxinventory_3table. Choose the cdxinventory_3 table to display relatedinformation about the prospective buyer.
  3. Select name from the cdxuser table.
  4. Select xlock and id from the cdxinventory_3 table.

Specifying Select Conditions

To add conditions for the select query:

  1. Click Add Condition to add the following conditions:
  2. 	cdxinventory_3.xlock <> 0

  3. Click the Join tab.
  4. Remove the join from cdxuser.id to cdxinventory_3.xlock.
  5. Click SQL tab and add the following condition in the where clause:
  6. 	cdxuser.id = cdxinventory_3.owner

    The SQL code appears as follows:

    	query PendingSeller using (oracle_oci, cdx, nsample, netscape) is	select cdxinventory_3.title as title3 ,		cdxinventory_3.price as price3 ,		cdxinventory_3.artist as artist3 ,		cdxuser.name as name ,		cdxinventory_3.xlock as xlock3 ,		cdxinventory_3.id as id4	from cdxinventory cdxinventory_3,		cdxuser	where (cdxinventory_3.xlock <> 0)		and cdxuser.id = cdxinventory_3.owner

    The iPlanet Application Builder creates the PendingSeller.gxq query file.

Creating UPDATE Queries

Next, you need to create an UPDATE query to accept the transaction and sell the CD.

  1. With the PendingSeller query view still active, select Insert -> UpdateQuery from the menu or by right-clicking in the query window.
  2. Type AcceptSale for Name.
  3. From the Fields tab, using the cdxinventory table, set fields buyerand xlock to:
  4. 	buyer = :buyer	xlock = 0

  5. From the Conditionals tab, click Add Condition to add the followingcondition:
  6. 	cdxinventory.id = :id

  7. Click OK.
  8. Click Finish.
  9. The iPlanet Application Builder adds the query to the query file.

    Next, you need another UPDATE query to cancel a sale.

  10. With the PendingSeller query view still active, select Insert -> UpdateQuery from the menu or by right clicking in the query window.
  11. Type CancelSale for Name.
  12. From the Fields tab, using the cdxinventory table, set field xlock to:
  13. 	xlock = 0

  14. From the Conditionals tab, click Add Condition to add the followingcondition:
  15. 	cdxinventory.id = :id

  16. Click Finish.
  17. The iPlanet Application Builder adds the query to the query file.

Build Pending Sales Report

Now you are ready to build the pending sales report.

  1. Select File -> New -> Database Forms.
  2. Type PendingSeller for Name then click Next.
  3. Specify the existing query file: PendingSeller.gxq then click Next.
  4. Specify Parent query: PendingSeller then click Next.
  5. Specify Multiple records then click Next.
  6. Choose "Use an existing connection" and verify that it is cdx thenclick Next.
  7. Do not check "Create input page."
  8. Click Next.
  9. Click Finish.
  10. The iPlanet Application Builder creates the following files:

    	PendingSeller.java	PendingSeller.jsp

Converting Fields to Links

You need to convert the id and xlock fields in the report to "Sold"and "Cancel" links, which enable the user to accept or cancel the sale:

  1. Open the PendingSeller.jsp file.
  2. Edit the column headers for the two right-most columns by replacingthe field text "id4" with "Accept" and "xlock3" with "Cancel".
  3. Select the PendingSeller.id4 data-bound label and delete it.
  4. Type in the text "Accept" and make it a link.
  5. Select the PendingSeller.xlock3 data-bound label and delete it.
  6. Type in the text "Cancel" and make it a link.

Create AcceptSale Servlet

Before you can fill in the Destination URL properties for the two priormanagement links, you need to create two servlets, one that accepts thetransaction, and one that cancels it. For such servlets that return simpleconfirmation pages, you can use the iPlanet Application Builder Resultswizard.

  1. Select File -> New -> Results.
  2. Type AcceptSale for Name.
  3. To execute the AcceptSale query, you need theid and buyer inputs,so specify these parameters as required inputs.
  4. Click Next.
  5. Click Finish.
  6. The iPlanet Application Builder creates the following files:

    	AcceptSale.java	AcceptSale.jsp

Edit Servlet to Load and Execute Update Query AcceptSale

Next, you need to enter the code necessary to load and execute theassociated query from the query file. You will find this code in the completedfile installed in <IASRoot>\Apps\cdx\AcceptSale.java.

This code is similar to the Insert or Update code produced for adata-entry form by the Database Forms Wizard of the Input Wizard.

  1. Copy the implementation inside the AcceptSale class from <IASRoot>\Apps\cdx\AcceptSale.javato your AcceptSale.java file; do not change import, or class declarations.
  2. Change the package name to cdx1.
  3. In AcceptSale.java, change the directories for PendingSeller.gxq  from cdx to cdx1:
  4. 	cdx1/PendingSeller.gxq

Create CancelSale Servlet

To create the CancelSale servlet, use the Results wizard and performthe following steps:

  1. Select File -> New -> Results.
  2. Type CancelSale for Name; click Next.
  3. Specify the id input as a required input; then click Next.
  4. Click Finish.
  5. The iPlanet Application Builder creates the following files:

    	CancelSale.java	CancelSale.jsp

Edit Servlet to Load and Execute Update Query CancelSale

Next, you need to enter the code necessary to load and execute theassociated query from the query file. You will find this code in the completedfile installed in <IASRoot>\Apps\cdx\CancelSale.java.

This code is similar to the Insert or Update code produced for adata-entry form by the Database Forms Wizard of the Input Wizard.

  1. Copy the implementation inside the CancelSale class from <IASRoot>\Apps\cdx\CancelSale.javato your CancelSale.java file; do not change import, or class declarations.
  2. Change the package name to cdx1.
  3. In CancelSale.java, change the directories for PendingSeller.gxq from cdx to cdx1:
  4. 	cdx1/PendingSeller.gxq

Connect Links to Servlets

Next, return to the PendingSeller.jsp file to connect the Accept andCancel links to the update servlets. Start by opening the PendingSeller.jspfile.

Connecting the Accept Link

  1. Click the Accept link and edit the Destination URL property.
  2. In the Servlet drop-down list, select the AcceptSale servlet.
  3. Click the Add button.
  4. Click in the name cell, add "ID4" and press enter.
  5. Then click the Data-bind value button.
  6. In the cell editor drop-down lists, select the PendingSeller ResultSetand the DataField, ID4.
  7. Click Add, then click OK.
  8. Repeat the above steps for the buyer value, setting XLOCK3 in the name cell,and selecting XLOCK3 in the cell editor as the source DataField.
  9. Click OK on the main property editor to complete the Accept URL specification.

Connecting the Cancel Link

Continuing with the Cancel link, click Cancel and edit the DestinationURL with the URL property editor:

  1. In the Servlet drop-down list, select the CancelSale servlet.
  2. Click the Get Arguments button.
  3. Click in the name cell, add "ID4" and press enter.
  4. Click the Data-bind value button.
  5. In the cell editor drop-down lists, select PendingSeller ResultSetand the DataField, ID4.
  6. Click Add, then click OK.
  7. Click OK on the main property editor to complete the Cancel URL specification.

Link View Pending Transactions Activity to User Menu

This completes the View Pending Transactions activity. You can nowreturn to the User Menu and hook up the associated link.

  1. Open the UserMenu.html file.
  2. Select the "View pending transactions on your CDs" text.
  3. Click the Create Link icon at the far right of the toolbar. If theCreate Link icon is not present, then select View -> Toolbars -> Standard.Note that you can also right-click the highlighted text and choose "CreateLink" from the pop-up menu to create the link.
  4. Display the Destination URL property editor, and select the servletPendingSeller.
  5. Click OK.

Add Links in the AcceptSale and CancelSale Java Server pages:

  1. Open AcceptSale.jsp, enter text "UserMenu".
  2. Click on the create link and in the destination url, specify UserMenu.html.
  3. Repeat the above step for CancelSale.jsp.

Task 11: Creating Enterprise JavaBeans

The iPlanet Application Builder allows you to create Enterprise JavaBeansor import existing JavaBeans from jar files. This task shows you how tocreate a session bean using the Session Bean wizard.

  1. Choose New from the File menu and select Session Bean.
  2. Choose CreditCheck for the name of the bean.
  3. Click Next.
  4. The directory specifies the package that contains the bean. Thename specifies the names of the bean class and interfaces. You can changethe class and interface names in the next panel in the dialog box. Youcan also specify control descriptors as well.

    For information about controldescriptors, see the Programmer's Guide.

    No changes are required for this example.

    The next dialog box allows you to specify whether the bean is astateful or stateless session bean.

  5. Choose Stateless; then click Next.
  6. Click Finish.
  7. The iPlanet Application Builder creates the following files:

    	ICreditCheckHome.java	ICreditCheck.java	CreditCheckBean.java

  8. Edit the bean's interface file to define the checkCredit() method.

  9. Open ICreditCheck.java which is the remote interface and define thecheckCredit() method.
  10. 	public interface ICreditCheck extends javax.ejb.EJBObject	{	public boolean checkCredit(String name) throws RemoteException;	}

  11. Add an implementation of the checkCredit() method to the CreditCheckBean.javafile.
  12. 	public boolean checkCredit(String name) throws RemoteException		{			return (!name.equals("deny"));		}

  13. In the Project window, right-click on cdx1.iab to displaya context-sensitive submenu.
  14. Select the Project Metadata ... option.

    The Project Metadata Editor window appears.

  15. Select the EJB References tab.
  16. Add a new reference with the following values:

    Reference:CreditCheck
    BeanType:Session
    Bean Home Interface:ICreditCheckHome
    Bean Remote Interface:ICreditCheck
    Linked To Bean:CreditCheck
    JNDI Name:ejb/cdx1Ejb/cdx1/CreditCheck

  17. Press enter.

    The entire line is highlighted in blue.

  18. Close the Project Meta Editor window and save your project.
  19. Rebuild your project.
  20. Modify the BuyCD.Java file to use the credit check session bean.
  21. Replace occurences of cdx with cdx1.
  22. 	public class BuyCD extends HttpServlet	{		ICreditCheckHome home = null;		ICreditCheck remote = null;		String JNDI_NAME = "java:comp/env/CreditCheck";	public void doGet(HttpServletRequest req, HttpServletResponse res)			throws ServletException, IOException	{		defaultAction(req, res);	}	public void doPost(HttpServletRequest req, HttpServletResponse res)			throws ServletException, IOException	{		defaultAction(req, res);	}	public void displayMessage(HttpServletRequest req,			  HttpServletResponse res,			  String messageText)			throws ServletException, IOException	{		res.setContentType("text/html");		PrintWriter out = res.getWriter();		out.println(messageText);	}	public void defaultAction(HttpServletRequest req, HttpServletResponse res)		throws ServletException, IOException	{	int result = formAction(req,res);	if(result == 1){		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(_defaultTemplate);		res.setContentType("text/html");		dispatcher.forward(req, res);	     }	     else{	     // replace the Below with a suitable Error jsp	     displayMessage(req,res,"Credit Check Failed");	     }	}	public int formAction(HttpServletRequest req, HttpServletResponse res)		throws ServletException, IOException	{	     int result = -1;	     HttpSession session = req.getSession(true);	     javax.naming.Context initContext = null;	     java.util.Hashtable env = new java.util.Hashtable(1);	 try {	     initContext = new javax.naming.InitialContext(env);	     }	     catch(Exception e) {		System.out.println("oops.. couldn't get initContext. caught exception");	     }	     Object beanObject = null;	     try {	     String sName = (String)session.getAttribute("NAME");	     beanObject = initContext.lookup(JNDI_NAME);	     ICreditCheckHome home = (ICreditCheckHome) beanObject;	     ICreditCheck remote = home.create();	     boolean bCreditOK = remote.checkCredit(sName);		if (!bCreditOK) {				return result;		}		else {			result = 1;			System.out.println(sName + " passed the Credit Check");		}	     }	     catch(Exception e)	     {		e.printStackTrace();	     }		return result;	  }	  public int delete(HttpServletRequest req, HttpServletResponse res)		throws ServletException, IOException		  {	     return SUCCESS;	}	     String _defaultAction = "/.jsp";	String _defaultTemplate = "/BuyCD.jsp";	static final int SUCCESS = 0;	static final int STREAM_SUCCESS = 1;	static final int STREAM_ERROR = -1;	}

    Task 12: Building and Testing the Application

    You have finished constructing the CD Exchange tutorial application.You can build and test your application.

    1. Choose Build Project from the Build menu.
    2. Choose Start Server from the Test menu if your server is not running.
    3. Choose Restart Server from the Test menu, if your server is running.
    4. You must restart your server each time you modify sourcecode.

      An informational message appears in the Java Server tab ofthe Messages window indicating that the server is ready: info: ENGINE-ready:ready: <server port number>.

    5. Choose Test Project from the Test menu.
    6. Registration messages are displayed in the Registration tab of theMessages window.
    7. You can ignore "No GUID" messages for EJBs. iPlanet ApplicationBuilder brings up the browser with the initial screen:

    8. Test your application.