Building and deploying the Address Book portlet

StepsDeploying addressbook.war and creating a JSP portlet

  1. Log in to Portal Studio as a user with access to all operations. For example:

  2. Select Build | Portlets from the Portal Studio left pane.

  3. Click New on the Portlet Manager toolbar.

  4. When the Portlet Builder displays, click the down arrow beside the Add button and select JSP Element. The JSP Element Definition window appears.

  5. Click the Browse button and navigate to %SYBASE%\PortalStudio\samples\ on Windows and $SYBASE/PortalStudio/samples on UNIX. Select addressbook.war, and click Open.

  6. Click Upload to upload the file to the machine where the portal Web application is installed on EAServer or Tomcat.

  7. When the file has been uploaded successfully, the WAR File and Web App Display Name are automatically entered for you and you see a prompt confirming the upload was successful.

    Click OK.

  8. In the Initial Resource field, enter:

    index.jsp
    
  9. Keep the Web App Qualified URL option selected.

  10. Click Deploy to deploy the WAR file. You see the Portal Studio – Deploy window.

  11. Complete these fields:

  12. Click Deploy. When you see a prompt that the deploy operation succeeded, click OK.

  13. Enter the Element Name and click Finish.

  14. In the Portlet Builder, click Save As.

  15. Complete the options on the Finish window.

  16. Complete the new element’s properties:

  17. Click Finish. After a message displays that the portlet was saved successfully, click OK to return the Portlet Builder.

  18. Select Status from the View By drop-down list, then click New on the Portlet Manager Status menu to see the new portlet in the detail view. All portlets are saved with a New status.

  19. Right-click the Address Book listing in the detail view and select Status | Approved from the pop-up. When the confirmation prompt displays, click OK.

  20. Right-click the Address Book listing in the detail view and select Active Status | Activate from the pop-up.

You have deployed the Address Book Web application. You have also created, saved, approved, and activated a JSP portlet in which to display the Address Book Web application. Next, add the portlet to a page.

StepsAdding the JSP portlet to a page

  1. Select Build | Pages from the Portal Studio left pane.

  2. Click New on the Page Manager toolbar. The Page Builder displays.

  3. Click the layout icon that indicates the portlet will display on 100% of the page.

  4. Click Add. The Search window displays.

  5. In the Name field, type “Address Book” and click Search. A listing for the Address Book portlet displays in the Results pane.

  6. Click the Address Book listing and click Add above the Results pane. In the Page Builder, you see Address Book in the portlet list in the left pane and a cell representing the portlet displays in the right pane.

  7. Click Save As. The Save Page window displays.

  8. Complete these options:

  9. Click OK.

  10. When a prompt states that the page was saved, click OK.

  11. Click Close to exit the Page Builder.

  12. When you return to the Page Manager, select New from the Status menu. You see the new page listed in the detail view, marked as active.

  13. Right-click the Address Book listing in the detail view and select Approval Status | Approved from the pop-up. When the confirmation prompt displays, click OK.

  14. Select Approved from the Status menu. The page now displays in the approved status detail view.

  15. When a prompt confirms that the user pages have been updated, click OK.

  16. Log out of Portal Studio.

StepsCreating a servlet alias

  1. Start Jaguar Manager and connect to the Jaguar server that has the search EJB installed.

    For example, on Solaris, enter:

    % cd $SYBASE/EAServer/bin
    
    % jagmgr
    

    On Windows, select Start | Programs | Sybase | EAServer 4.2.2 | Jaguar Manager.

  2. When Sybase Central displays, select Tools | Connect | Jaguar Manager.

  3. When the Login dialog box displays, enter:

  4. Click Connect.

  5. Select Jaguar Manager | Servers | Jaguar | Installed Web Applications.

  6. Right-click “addressbook” in the right pane and select Web Application Properties.

  7. Select the Servlet Mapping tab.

  8. Click Add and change the URL Pattern for “Address” servlet to:

    /servlet/com.sybase.sample.addressbook.AddressBookServlet
    
  9. Click OK to save your changes.

  10. Right-click the Address Book Web application and select Refresh.

  11. Select File | Exit to log out of Jaguar Manager.

StepsCustomizing personalization.properties

  1. In any text editor, open personalization.properties, located in %EAServer%\Repository\WebApplication\onepage\WEB-INF\classes\ on Windows and in $EAServer/Repository/WebApplication/onepage/WEB-INF/classes/ on UNIX.

    The current contents are:

    connection_url = jdbc:sybase:Tds:changask:5000/portaldatabase
    
    db_username = sa
    
    db_password = 
    
    driver_classname = com.sybase.jdbc2.jdbc.SybDriver
    
  2. Change the following:

  3. Save the file in the directory that started the EAServer process. If EAServer is started in $JAGUAR/bin (UNIX) or %JAGUAR%\bin (Windows), save the file there, then close the text editor.

  4. Stop and restart EAServer.