Novell exteNd 5 Guided Tour

LESSON 4

Completing the exteNd Director Project

 
Top of page

About this lesson

 
Top of section

What is exteNd Director?

exteNd Director is an interaction portal server that enables IT organizations to rapidly deliver and easily maintain rich, personalized Web applications. exteNd Director provides a comprehensive development environment to help you create state-of-the-art interactive applications that users access through a portal:

 
Top of section

Objective

In this lesson you will build a simple application that will present an initial form to the user requesting a user ID and then will invoke the Web Service (Composer ViewUserInfo) you deployed. The application will then display the results returned using one of two forms depending on whether user data or a message was returned. This application will run as a portlet in a personal page of a portal application. As you complete the application you will also have the opportunity to test your application.

 
Top of section

What you will do

  1. Create a Web Service pageflow using a wizard

  2. Sidebar: the resource set in an exteNd Director application

  3. Test the default pageflow you created

  4. Edit additional XForms

  5. Add a new form to the pageflow

  6. Change links to include the new form in the pageflow

  7. Test the revised pageflow

 
Top of section

EXERCISE 4-1: Create a Web Service pageflow using a wizard

In this exercise you will use an exteNd Director wizard to create a pageflow—an exteNd Director artifact that links together XForms (presentation and data binding) to the invocation of a Web Service. The wizard builds XForms based on the schema in the Web Service and ties it all together to invoke the Web Service—and includes default exception handling. All this without you writing any code.

  1. Click the New File icon NewFileIcon.

  2. In the New file dialog, select the Portlet tab.

  3. Select the Web Service Pageflow Wizard.

    DirectorNewFilePortletDialog

  4. Click OK. The Web Service Pageflow Wizard displays.

  5. Type UserInformation for the Base Name.

  6. You must select the WSDL document for which you are building a user interface. There are two ways you can do this:

    Use the Resource Set button to navigate to the location of the WSDL in the exteNd Composer project. In the Choose file dialog expand the folders until you see the ViewUserInfo.wsdl file. Select the ViewUserInfo.wsdl file. Click OK.

  7. Accept the default checks on Use CSS Layout and Use the default WSRP CSS classes:

    DirectorCreateWebServicePageflow dialog1

  8. Click Next.

  9. The WSDL has only one operation, so take the defaults for the Select the Web Service Method dialog by clicking Next:

    DirectorCreateWebServicePageflow dialog2

  10. On the Formatting Controls tab, select 2 for number of columns.

  11. Select above for the label alignment.

    DirectorCreateWebServicePageflow dialog4

  12. Click Finish.

  13. Click OK on the Done creating forms and pageflow message:

    DirectorWebServiceFormsPageFlow

  14. Use the percentage dropdown list PageflowEditor SizeAdjustment to adjust the size of the pageflow diagram in the editor. 100% is a good compromise between size and readability.

    DirectorWebServiceFormsPageFlow2

 
Top of section

EXERCISE 4-2: Sidebar: the resource set in an exteNd Director application

An exteNd Director resource set organizes descriptors and other files used by exteNd Director subsystems and provides for dynamic loading during development, avoiding frequent redeployments and speeding up your testing. Each custom Web application can include a resource set.

A resource set holds application-defined resources and classes. Some of these resources are templates or definitions for using a subsystem's features—such as a rule, XForms, pageflows, or a portlet descriptor. Others specify how subsystems work together—such as bindings between rules and users. Resources are usually XML files; some are accompanied by Java classes.

A resource set organizes your application's resources in a known directory structure and within exteNd Director you may use the Resources tab in the Navigation Pane to find the various artifacts in your project. For example, if you wanted to find all the files created in the previous exercise you would do the following:

  1. Select the Resources tab in the Navigation Pane.

    ResourcesNavigationPanel

  2. Select the Search tab.

  3. In the File Name text box, type UserInfo.

  4. Click the Search button:

    ResourcesNavigationSearchTab

  5. You can save this search as a view to reuse the search criteria at a later time. Click the Save button.

  6. Name the file UserInfoStuff.xml and click Save.

    The view is an XML file that describes the search criteria and display structure, and you may edit it to server your specific needs.

  7. Close the open editor by clicking on the editor title tab to close the UserInfoStuff.xml file.

  8. Select the View tab.

  9. In the dropdown list find UserInfoStuff, then select it:

    ResourcesNavigationSearchTab2

    You may expand the folders to see the various artifacts you created—and by double-clicking a particular entry the appropriate editor for working with that artifact will be opened.

    For more information    For details, see the chapter on using the resource set in an exteNd Director application in Developing exteNd Director Applications.

 
Top of section

EXERCISE 4-3: Test the default pageflow you created

Because pageflows and XForms created by the Web Service Pageflow Wizard are stored in the resource set and you already deployed the application, you may immediately test the default portlet that was created. This is because by default during development, your exteNd Director project was configured to dynamically load the resource set artifacts.

  1. Open a browser window.

  2. Type the URL http://localhost/RequestUserInfo/portal/portlet/LoginPortlet in the address bar.

  3. At the portal login page, click the New User? link:

    PortalLogin

  4. Enter the information to create a new user—for example:

  5. Click Register.

  6. Click Continue to return to the login page.

  7. Log in using the account you just created. Click Login or press Enter.

    You will see the default portal shared page with some sample portlets. You will create a personal page where the portlet for the pageflow you created will be placed. You will use this page later in this lesson to test and review your changes.

    DefaultPortal inIE

  8. Click the Personalize link:

    PortalPersonalize IE

  9. Click New under the Personal Pages list to create a new personal page.

  10. Change the name of the page to User Info Test, then click Update:

    PortalPersonalize 2 IE

  11. In the Default Page text box, select the page you just created.

  12. Click the Set as current link. This allows you to quickly get to this page in the portal page.

    PortalPersonalize DefaultPage

  13. Click the Choose Content link.

  14. Scroll the Available Portlets list until you find UserInformationPageflow, then select it and click Add.

    PortalPersonalize ChosePortlet

  15. Click Save Contents.

  16. Click the Portal link.

  17. At the top of the page, click Portal Home—or under Personal Pages click User Info Test (the page you just created)—to view your pageflow portlet.

  18. If you see the message Portlet did not respond in time, click the RestartsCurrentPageflowLink link or reload the page (by clicking on Portal Home or under Personal Pages clicking User Info Test).

    PortalWithLabPortletOnIt

  19. Type SSpade in the UserID text box of the UserInformationInput Portlet page, then click the Submit Request button.

    PortalWithLabPortletOnIt 2

  20. Click the New Request button to return to the first form.

  21. Type SP in the UserID text box, then click the Submit Request button.

    You will not see any message.

  22. Click the New Request button to return to the first form.

    If you take a peek at the exteNd Application Server console, you will see the Log output from the exteNd Composer service that shows the data returned to the application.

    ApplicationServerConsole

    The forms and pageflow created by the wizard did not take this form into consideration, so you need to change the pageflow. You will add a conditional decision to the pageflow that will decide which form is displayed; the decision will be based on the data returned from the invoked Web Service. This is your task for the rest of this lesson.

 
Top of section

EXERCISE 4-4: Edit additional XForms

A form was already created that displays the message returned by the Web Service when an invalid request is made. You will review this form and make some slight modifications. In the next exercise you will insert this form into the pageflow you created earlier with the Web Service Pageflow Wizard.

  1. In exteNd Director, select the Resources tab DirectorResourcesTab of the Navigation Pane.

  2. Select the View tab in the Resources Navigation Pane view, then use the dropdown list to select UserInfoStuff (the view you created earlier).

  3. Expand the listed folders by clicking the expandIcon icon until you find the form folder.

  4. Double-click UserInformationResponse_Message.xhtml, which will open the form in the XForms Editor.

    DirectorXFormsEditor

    You are going to change the look and feel of this form by replacing the input message text box with an output (display only) text box.

  5. Select the Layout Region and, holding the left mouse button, increase its size by scrolling downward with the mouse.

    XFormsLayoutRegionExpanded

  6. Click the Submit button on the form and press the Delete key to delete it.

  7. Click the Insert XForms output XFormsOutputTypeButton button.

  8. Click below the Message text box to add the Output control.

    XFormsAddingOutputTypeToLayout

    XFormsAddedOutputTypeToLayout

  9. Select the Input message text box, then press the Delete key.

  10. Select the Output text box and drag it below the New output label.

  11. Select the label and text box while holding the Ctrl key, then drag both toward the top of the layout area.

  12. Use the Align/Distribute tab to properly align the controls on the layout.

    XFormsAlignToolbar

    XFormsOutputAligned

  13. Click the Save icon FileSaveToolbarIcon to save your changes

  14. Enlarge the Output text box by clicking it and then dragging the corner down and to the right.

  15. In the Instance Data Pane click the expandIcon icon until you see the Message element (you may need to scroll).

  16. Click the Message element, the hold the left mouse button and drag the element on the Output text box in the Form Pane.

    XFormsOutputWithData

  17. Click the Save icon FileSaveToolbarIcon to save your changes.

  18. Select the Output (label) tab in the Property Inspector, scroll to the top, and change the Label to read Message:.

    XFormsOutputNewLabel

  19. Click the Save icon FileSaveToolbarIcon to save your changes.

  20. Click the divider between the Form Layout section and the Instance Property section of the XForms Editor to expand the Form Layout, showing you all the items in the tools tab in the Form Layout section.

    TIP:   If this does not work, maximize the Director Designer, then hold the left mouse button and drag the divider to the right until you see all the XForms tools on the tab.

    XFormsEditorToolbar

  21. Click the Insert Pageflow link region XFormsPageflowRegionButton button.

  22. Click in the Form Layout to add the control to the form:

    XFormsEditorLayoutArea

    This region will be used by the Pageflow button link when you add this page to the existing pageflow.

    XFormsOutputDone

  23. Click the Save icon FileSaveToolbarIcon to save your changes.

 
Top of section

EXERCISE 4-5: Add a new form to the pageflow

In this exercise you are going to add the Message Display page to the existing pageflow and then change the links on this page to include this page as part of the application flow. One of the links will have a condition that will check what result was received from the Web Service to determine which page should be displayed—the User Information page or the Message page. Your objective is to go from the flow pictured just below to the one pictured under it.

Original pageflow

UserRequestPageFlow start

Target pageflow

UserRequestPageFlow final

  1. Select the UserInformationPageflow.xml file in the exteNd Director Edit Pane. UserInformationPageflow.xml opens in the Pageflow Modeler.

    PageflowEditor

  2. Select the Activities tab in the Pageflow Modeler.

    PageflowEditorActivitiesToolbar

  3. Click the Form activity PageflowEditorFormActivityButton toolbar button.

  4. Add the form to the right of the Help HTML activity in the pageflow diagram by moving the mouse pointer to the location and clicking the left mouse button:

    PageflowEditorAddingFormToDiagram

  5. Click the label added under the Form activity you just placed on the diagram and edit it to read Message.

  6. Double-click the Form activity you just placed on the diagram to open the Property Inspector for the activity:

    PageflowEditorPropertyEditor Form

    You may drag this window to a more convenient location on you desktop so that it does not cover the diagram or other parts of the editor that you need to view.

  7. Type Message in the Name text box.

  8. Click the Form tab.

  9. Click the ellipseButton button next to the XHTML text box on the Form tab.

  10. In the Choose The Scoped XPath dialog, select ResourceSet from the dropdown list and then click the Browse button.

  11. In the XPath Navigator, use the expandIcon button to open the ResourceSet and form lists and then select the UserInformationResponse_Message.xhtml file:

    XPathNavigator SelectForm

  12. Click OK.

  13. Click the Save icon FileSaveToolbarIcon to save your changes.

  14. Click the Instance Data tab.

    InstanceData Setup1

  15. Click the ellipseButton button next to Inbound Documents.

    InstanceData Setup2

  16. Click the ellipseLargeButton button next to the Primary Data text box.

    InstanceData Setup3

  17. Click the Scoped XPaths dropdown list to select /Flow/document/RESPONSE.

  18. Click OK.

  19. Click the Save icon FileSaveToolbarIcon to save your changes.

 
Top of section

EXERCISE 4-6: Change links to include the new form in the pageflow

Now you will create links for the new form to include it as part of the normal flow of the application. The Web Service will go to both forms with a condition added to one of the links to determine which one. The new Message form will link to the Input form completing the loop in the application.

  1. Select the Links toolbar in the Pageflow Modeler:

    PageflowEditorLinksToolbar

  2. Click the Button Link button PageflowEditorButtonLinkButton.

  3. Click the Message Form activity, drag to the Input Form activity, then left-click to create a link between the two activities:

    PageflowEditor ButtonLinkBetweenForms

  4. Click the link you just added to select it.

  5. In the Property Inspector in the Button Link tab, change the Description to New Request.

    This is the value that will appear on the button when the page is rendered in the browser.

  6. Click the Link button PageflowEditorLinkButton.

  7. Click the Web Service activity, drag to the Message Form activity, then left-click to create a link between the two activities:

    PageflowEditor LinkBetweenActivities

  8. Change the label next to the Output Form to read User Info.

  9. Click the Save icon FileSaveToolbarIcon to save your changes.

  10. Click on the link between the Web Service activity and the Message Form activity.

  11. In the Property Inspector, click on the Edit Expression link PageflowEditorPropertyEditor EditExpressionLink in the Link tab.

  12. In the Scoped Path text box of the Expression dialog, type the following expression (be careful with the punctuation and case):

      /Flow/document/RESPONSE/*[local-name()='UserInfoResponse']/*[local-name()='Message'] 
    
  13. In the operator dropdown list, select is null, check the Not check box, then click the Add button:

    PageflowEditor ExpressionDialog

  14. Click OK.

  15. In the Link tab of the Property Inspector, make sure that the Precedence text box has a value of 1.

  16. Click on the link between the Web Service activity and the User Info Form activity.

  17. In the Link tab of the Property Inspector, make sure that the Precedence text box has a value of 2.

  18. Click the Save icon FileSaveToolbarIcon to save your changes.

 
Top of section

EXERCISE 4-7: Test the revised pageflow

Now that you have completed the changes to the pageflow to incorporate the new page, the last step is to test your changes in the application server. Because of the dynamic loading feature of exteNd Director, your changed forms and pageflow have been automatically loaded into the application server—and all that is needed to test the changes is to open a browser window and log in to the Portal application.

  1. Open a browser window.

  2. Type http://localhost/RequestUserInfo/portal/portlet/LoginPortlet in the address bar, then press Enter.

  3. Log in as:

  4. Under the Personal Pages list, click the User Info Test link.

  5. In the UserID text box of the UserInformationInput page, type SSpade and then click Submit Request button.

    UserRequestPageFlow UserInfo

  6. Click the New Request button.

  7. Type sp in UserID text box, then click the Submit Request button.

    UserRequestPageFlow Message

  8. Click the New Request button.

    UserRequestPageFlow Input

  9. Close exteNd Director by using File>Exit.

Congratulations. You have successfully completed the Guided Tour.

 
Top of page

Summary

In this Guided Tour through the development features of the exteNd 5 Suite, you have:

In short, you have gone from producing a Web Service to consuming a Web Service, all with one integrated set of tools. The entire application was provided by a robust J2EE application server. And all this without writing one line of Java code.

If you were to continue development of your Web Service application, the next step would be to go from a query-only application to a maintenance-and-query application. But that is a challenge for another time.

Learning more   To learn more about Novell exteNd, see the Learning Resources page in Welcome to Novell exteNd in this help system.



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...