Importing the Sample Projects into Designers
Installing the CAFDemo Package on Integration Server
List
of the Sample Projects in the Package
Descriptions of the Samples
1. Unzip the webm_CAF_Samples_821.zip file (this file is located in the zip file that you downloaded from the Community site). You can unzip the file into any folder, but be sure to preserve the folder structure that exists in the webm_CAF_Samples_821.zip file.
2. Open Designer and go to File > Import.
3. In the Import wizard, select Software AG > Existing CAF Projects into Workspace, and then click Next.
4. Select the root directory field based on whether you want to import all the samples or a single sample.
§ If you want to import all of the CAF sample projects, click Browse and navigate to the folder where you unzipped the sample file.
§ If you want to import a specific CAF sample project, click Browse and navigate to the folder that contains the project. (This folder resides inside the folder where you unzipped the sample file.)
5. If you want to copy the sample project(s) into your workspace, select the Copy projects into workspace check box.
6. Click Finish.
The preceding steps install the CAF projects from the sample file. The sample file also contains the following legacy, non-CAF projects.
7. To import one of these samples into Designer, use the steps below.
a. In Designer, go to File > New > Other.
b. In the New dialog box, enable the Show All Wizards option, select Software AG > Legacy Portlets > Import Existing Component, and then click Next.
c. Navigate to the folder that contains the legacy, non-CAF sample that you want to import and then click Finish.
8. To open a project, go to the Package Explorer view, Project Explorer view, or Navigator view in Designer and do either or both of the following:
§ To display the Portlet Application Configuration Editor, expand the portlet application and double-click this node:
portlet_application/WebContent/WEB-INF/portlet.xml
§ To display the initial view for a portlet in the design canvas, expand the portlet application and double-click this node:
portlet_application/WebContent/portlet_name/default.view
Note: Some portlet applications might have additional levels under WebContent, and some view files might not be named default.view.
1. Copy IS_Package_CAFDemo.zip to the following directory on your Integration Server:
SAG_Installation_Directory\IntegrationServer\replicate\inbound
Note: IS_Package_CAFDemo.zip is located in the zip file that you downloaded from the Community site.
2. In the Integration Server Administrator, go to Packages > Management and click Install Inbound Releases.
3. From the Release file name list, select the file name IS_Package_CAFDemo.zip.
4. Click Install Release.
Installing this package creates a JDBC Adapter connection using the embedded Derby JDBC driver. The JDBC Adapter connection points to a local copy of the Northwind database, which is part of the package itself. The database resides in the following directory:
SAG_Installation_Directory\IntegrationServer\packages\IS_Package_CAFDemo\config
The sample file contains the source code for the following MWS /CAF projects.
Analysis Samples
Bytes Sent Collector
Location Map
Most Popular Pages
Page Speed
Recent Logins
User History
CAF Samples
Journal Logging Sample
Northwind
CAF Custom Components
CAF Miscellaneous
Chart Samples
Core Controls Test
Core Providers Test
Expose Web Service
Functional Privileges Test
Portlet Links
Sales Chart Sample
Search
Wired Configuration
CAF Controls Samples
Access Control
Converters
List Controls
Portlet Tabs
CAF Localization Samples
Localization
Locale Order
Right-to-Left Controls
CAF Wizard Samples
JSR 168 Samples
Third
Party
Hello World
Page JSR 168 Demonstration
Page Components Samples
Extended My Favorites
Related Pages
Spreadsheet Data Source
Security Samples
Audit Commands
Security Redirect
Services Samples
Directory
Performance Service Client
Workflow Samples
Workspace Samples
Demonstrates how to work with security roles to control access and visibility of the user interface and the content on a portlet. The sample contains a set of portlet views that change their text content, access to controls, and navigations dependent on the security role.
The default security role defaults to include the My webMethods Server system administrator. When logged in as the system administrator, you will see text for the administrator, and can control check boxes that configure what additional items a generic user can select. Submitting the form will navigate you to a view that displays all the items available to the generic user. As the administrator you do not get to select an item. As a generic user you will see text for the user and be able to select an item. Submitting the form will navigate you to a view that confirms your selection.
Location
wm_CAF_samples_folder\caf_controls\wm_access_control
Description
Adding an If and Else control block: Drop the logic If control on the canvas. Insert something into the control body. In this case it is a text output for the people in this role. For the If control's value property, bind the security role to it. If the user is in this role, the application will display the text for them. Drop the Else control right after the If control. The Else control will key off the If control and require no binding. Just drop your content into the body of the control.
Adding an Access Control Panel: Drop the Access Control Panel control on the canvas. Insert something into the control body. In this case it is a text output for the users in this role. Set the Access Control Panel's property "Allowed Security Role". This hides it from those not in the security role and displays it to those in the role. For the next panel, the "Disallowed Security Role" property is used to hide the panel from those in the role and show it to those not in the role.
Using the security role to determine the navigation or other outcome from the command button: Add a Command Button control to the canvas. Create a method to bind to, and bind it to the control. Using the BasePortletBean method isUserInRole, add this to the command method to check if the current user is in the specified role. Return a string based on the method results. The navigation is controlled in the faces-config.xml file. For navigation examples, see Wizard Sample.
Implements a sample task and demonstrates how to use dynamically created workspaces in My webMethods Server, how to use workspace templates, and how to set workspace context information to create "Analysis Sessions" for task instances.
Location
wm_CAF_samples_folder\workspace\AnalyzableTaskApp
Description
Analysis Workspace : The first step is to create a mechanism for creating an analysis workspace for a Task. The logical place for this is in that task's Custom Inbox. For this example, we've added an additional column containing a Command Link control. The action handler for this control creates a new workspace, creates a new active tab, and then redirects to that new workspace.
The interesting part of the action handler implementation is the call to wsProvider.createWorkspaceFromTemplate. Our example takes advantage of two workspace features: custom workspace types and workspace templates.
A custom workspace type allows us to assign a unique integer, in our sample the number 99, which will allow us to distinguish our task analysis workspaces from other workspaces. The workspace type is defined in the Task application's xmlImportl.xml file and provides a display string for our type. The workspace picker and Workspace Admin portlets will use this display string and allow the end-user to filter workspace search results based on this type.
The workspace template is a pre-created workspace that we will copy when we create a new workspace. It too is defined in xmlImport.xml. Our sample publishes three portlets in the template: the Customer Orders and Product Details custom portlets that are part of this sample Task application, as well as a built-in Context Viewer portlet so that we can via the contents of the workspace's dynamic context.
Workspace Dynamic Context: Now that we have an analysis workspace, we can demonstrate the workspace's dynamic context feature. This sample includes two custom portlets that we've created to demonstrate adding new properties to the context, as well has consuming those context values.
When we created our workspace, we provided the URL of the task instance we would like to analyze. This URL is stored as the 'context' property of workspace context. The Customer Orders portlets demonstrates programmatically retrieving this context value from the parent workspace and using it to looking the Task instance to get to the Task's 'customerID' business data field. It then displays some sample information for that customerID.
The Customer Orders portlet also displays a list of orders for the Task's customer. Clicking the Product link in the table contributes the selected productID value to the workspace dynamic context. This is done via the ContextUpdater control. We've registered a Invoke Script control that listens for clicks on the link, injects the selected link value into the ContextUpdater, which then updates the parent workspace context. The ContextUpdater also examines the workspace for any portlets that are wired to the context and forces them to refresh.
The Product Details portlet consumes the productID property from the workspace context. This is done through the usual wiring mechanism by specifying Global Wiring Data -> Wiring Source for Workspaces as the wiring source.
This sample portlet demonstrates how to trace internal My webMethods Server administrative and other management events for auditing.
Location
wm_CAF_samples_folder\security\wm_auditcommands
Helper component that implements tracking of the number of bytes transferred by My webMethods Server.
Location
wm_CAF_samples_folder\analysis\ wm_bytessentcollector
A CAF Application sample that demonstrates use of custom JSF Converters and Validators.
Location
wm_CAF_samples_folder\caf\wm_caf_custom_components
Demonstrates the exporting of the file formats: image, csv, xml, and text.
Location
wm_CAF_samples_folder\caf\wm_caf_misc
Description
The sample uses export methods by posting the action to the containing portlet and by posting the action directly to the .view servlet, bypassing the portlet.
Sample CAF application that demonstrates the use of Chart controls.
Location
wm_CAF_samples_folder\caf\wm_chart_samples
Demonstrates the use of custom JSF converters in CAF applications.
Location
wm_CAF_samples_folder\caf_controls\wm_converters
Demonstrates the core controls used to build a portlet application. The controls are displayed in all of their common configurations and uses. All controls are interactive and include output results where applicable. Controls demonstrated are: Panels, table, input, output, list, logic, picker, script, search, table, toggle, util, and validator.
Location
wm_CAF_samples_folder\caf\wm_corecontrolstest.
1. Deploy the wm_corecontrolstest application from Designer to the My webMethods Server.
2. Note: You might receive several validation errors during the build. You can safely ignore these errors.
3. Do one of the following to run the example.
§ To run the sample as a Web application, browse to http://server:port/wm_corecontrolstest, where server:port is the host name and port number for your My webMethods Server.
§ To run the sample as a portlet, do the following:
a. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
b. Go to Public Folders > Samples > CAF Core Controls.
Demonstrates the advanced use of the table controls along with the use of the table content provider. Includes table row deleting, updating, and sorting, and code samples for Pageable Table and Refreshable Content Providers.
Location
wm_CAF_samples_folder\caf\wm_coreproviderstest
Deploying and Running the Sample
1. Deploy the wm_coreproviderstest application from Designer to the My webMethods Server.
2. Configure the data source using the steps below.
a. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
b. Go to Administration > Configuration > Datasource Administration.
c. Update the connectivity parameters for the Northwind database. The sample installs a Northwind data source that uses a SQL Server on localhost:1433 and the sa password configured as "password".
3. Do one of the following to run the example.
§ To run the sample as a Web application, browse to http://server:port/wm_coreproviderstest, where server:port is the host name and port number for your My webMethods Server.
§ To run the sample as a portlet, do the following:
a. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
b. Go to Public Folders > Samples > CAF Provider.
A component that deploys a sample database directory service (it installs tables with sample data into My webMethods Server database schema) and configures a sample database directory service in My webMethods Server to demonstrate configuration properties.
Location
wm_CAF_samples_folder\services\ directory
Description
Deploy both wm_dbdir_auth_template.pdp and wm_dbdir_sample.pdp and then open Directory Services Administration to check that the new database directory service is being automatically configured.
Demonstrates how to host a Web service in a CAF application by using Axis.
Location
wm_CAF_samples_folder\caf\wm_expose_webservice
This portlet displays a list of pages for the current user, which the user accessed the most. It determines this list based on the user's browsing history data from the TBLWEVENTS database table, which requires the extras\analysis\wm_eventscollector.pdp component to first be installed and enabled.
Location
wm_CAF_samples_folder\pagecomponents\wm_extended_my_favorites
Demonstrates how to define and use custom functional privileges to implement an access control in an application.
Location
wm_CAF_samples_folder\caf\wm_functional_privleges_test
A generic Hello World JSR168 portlet sample.
Location
wm_CAF_samples_folder\jsr168\wm_helloworld
A CAF Application sample that demonstrates how to define and use application-specific logging categories.
Location
wm_CAF_samples_folder\caf\JournalLoggingSample
Demonstrates the use of option groups and data models to power list style controls and a table. Each control type is in its own portlet.
§ wm_select_one_listbox. The use of a single selection list box.
§ wm_select_many_listbox. The use of a multi-selection list box.
§ wm_combo_box. The use of a drop list box.
§ wm_radio_button_group. The use of a group of radio buttons.
§ wm_check_box_group. The use of a group of check boxes
§ wm_table_selection. A table display with selectable rows.
§ wm_simple_list. A list of links to update a results list.
§ wm_list_controls_page. The xmlimport for deploying the folder portlet.
The list controls and table portlets display the control populated from three different data types, a Map, List, and Object[], from a single data source. List controls are all the controls listed above except the table and simple list. The table and simple list use a data model to display content and for selection.
The "Select" buttons are bound to a common action to cause the form to submit and the page bean's setters and getters to be called. The Results, a simple list, will use an updated data model to display the selected results.
Each data type is displayed in its own grouping. The data will be displayed in that portlet's showcased control. A selection button and results area is also display for that group.
The simple list and table only display a single grouping and use a data model to render and track selections.
Location
wm_CAF_samples_folder\caf_controls\wm_list_controls
Description
Creating an option group: When creating an option group, create a List and Array of SelectItems. Keep the value and label to simple string object. Complex objects to and from strings can cause problems with getting and setting the selection on that control. A Map can be created form the data source directly. See the JSF java doc and the sample source code for more information.
Adding the control to the panel: Add the control to your panel, an option group to the control, and bind the option group to the data type (Map, List, or Array).
Setting and getting the selection: To set and get the selection, bind to the value property on the control. Tables and Simple List use a data model to set the controls selection. A single select control will use a String, while multi-select will use a String array to represent the selection. These Strings are the values in the SelectItem bound to the option groups. IE create a SelectItem of key "Bob", value "1". When Bob is selected and the form is submitted then the setter method will set "1" as the selected value; also setting up a value returned by the getter method you can set "1" as the selected value causing the control to display "Bob" as selected in the UI.
Using the results section: The results section is a simple list that uses a data model to display results from the selection when the form is submitted. The set selection uses the value to index the data source. This data is added to a list and put in a ListTableContentProvider. The ListTableContentProvider is used as a data model for tables and simple list in the CAF development and runtime.
Using the simple list control: The simple list control (com.webmethods.caf.faces.list.Simple) acts like a container. You can add controls to it. These are displayed as groups for every entry in the data model. For our samples the Customer, ID#, and Order Status are displayed for each customer selected. This control is used for all the results groupings.
Things that need to be done with the simple list control always set the variable property. The samples all use "row". The controls in the simple list's body can be bound to any item in the bean, but to display the data in the list's data model you would use "#{row}". Since the sample data is Customer, ID, and Order Status, you can do "#{row[0]}", "#{row[1]}", or "#{row[2]}". This works the same for the table. You can also do things like '#{row[0]}=="Bob"'. See the wm_corecontrolstest for more examples.
Storing data models as members of the page view bean: These data models are stored as members of the page view bean. This bean must stay around longer than a "request" scope. Make sure the bean is at least "pageflow" scope. These samples use a scope of "session" and will not reset until you end the session.
Initializing the table: The table is initialized like the Simple list and selecting the column data that will be used to ID the selected row. The sample uses "{row[0]}" the customer column. As you select and clear check boxes, it adds and removes the key row value from the data model. When the form is updated, you can access the data model and acquire the selected values. From the values, the results data mode is updated with the selected rows of the data source. Examine "updateSelectionResults" in the table selection sample.
Using the links in a list: The simple list sample is the use of links in a list. These links will do the work of the form submit to update the results. Like the other sample results groupings this sample contains controls. The control is a link and customer column of the source data. The link will use the action bound to its Action property to get the selected item from the data model. Like the table sample that selection is put into the results.
Adding the portlets to a folder: The page is an xmlimport to add these portlets to a folder under public folders. It also sets up an alias for the folder and sets the display of title and border for the portels.
Demonstrates the use of the webMethods G11N API name and address object for displaying their content in the correct order, based on the locale of the user. In Japanese, the last name is always displayed before or above the first name. In US English, the first name is always displayed before or above the last name. The same issues exist for addresses.
Location
wm_CAF_samples_folder\caf_localization\wm_localeOrder
Description
The Name view puts the input first and last name in the proper order for US English and Japanese. The application displays them as inline text and as output for controls ordered via IF ELSE control logic.
For the Address view, the application display a preconfigured input on a single line of text using HTML breaks to make the address display as a column of address items. The address is also iterated into a ListTableContentProvider for display in a table.
Demonstrates how to work with localizable resource bundles for your portlets and portlet applications. This sample shows how to access application resources and portlet resources, and how to load a resource bundle for JavaScript. The sample is a simple portlet that displays these resourced strings and uses a JavaScript alert to display a string from a loaded bundle.
Location
wm_CAF_samples_folder\caf_localization\wm_L10N
Description
Adding an Application resource: Click and drop a text output control on the canvas. From the Wm_L10NBean (application) node on the Bindings view, select applicationResources, title.1. Bind this resource to the control. The binding expression will look like, #{Wm_L10NBean.applicationResouces["title.1"] }
Adding a Portlet resource: Drop a text output control on the canvas. From the Bindings view, select LocaleSampleViewPage (LocaleSampleViewPageBean) > localeSampleBean > portletResources > com.webmethods.localesample.title. Bind this resource to the control. The binding expression will look like:
#{LocaleSampleViewPage.localeSampleBean.portletResouces["com.webmethods.localesample.title"]}
Adding a java script resource: Select a ".properties" file, copy and rename it to be the JavaScript resource bundle. Drop an Include Resource Bundle control on the canvas. For the Include Resource Bundle's value property enter the class path for the bundle. In this sample it is "com.webmethods.portal.localesample.JScriptResource". Drop a Script Block control on the canvas. For the Script Block's value property, add a script that will reference the include resource bundle. CAF.getBundle('from name')['message key']);
This sample collects data about recent logins to My webMethods Server and draws the locations of these logins on the world map.
Location
wm_CAF_samples_folder\analysis\wm_locationmap
Description
This sample uses data from the TBLWEVENTS database table, which requires the extras\analysis\wm_eventscollector.pdp component to first be installed and enabled.
Lists the most popular My webMethods Server pages, for example, the pages accessed the most often for the last week.
Location
wm_CAF_samples_folder\analysis\wm_mostpopularpages
Description
This sample uses data from the TBLWEVENTS database table, which requires the extras\analysis\wm_eventscollector.pdp component to first be installed and enabled.
Demonstrates a custom database application of customer information. The intent of this sample is to show how to link a composite application to a database.The composite application uses a search bar and results page. You select a customer attribute on which to search. The wild card is %; do not use *. The application displays the results in a table, with paging and links to a separate page display of specific information about that customer. Users can edit these customers along with the specific information on the customers. This sample requires an Integration Server and the ability to install a package on that server.
When running this sample, for best search results use all capital letters for your search terms. For example, use ANTO instead of anto.
Location
wm_CAF_samples_folder\caf\northwind
Deploying and Running the Sample
1. Deploy the northwind application from Designer to the My webMethods Server.
2. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
3. Go to Administration > Configuration > Datasources Administration to create a data source named northwind. When defining the data source, point to a SQL Server Northwind database.
4. Map the northwind data source to the application local data source reference.
a. Go to Administration > Configuration > CAF Application Runtime Configuration.
b. Search for the northwind application.
c. Click the northwind application to open its resource references.
d. Select the northwind data source reference.
5. To run the sample as a portlet.
a. Log in to the My webMethods Server using the following credential:
user name: sysadmin
password: manage
b. Go to Public Folders > Samples > CAF Northwind.
This CAF application implements a sample task that uses data supplied by services from IS_Package_CAFDemo.zip demo IS package, which is part of /caf/wm_search_ws sample project.
Location
wm_CAF_samples_folder\workflow\northwind_task
This sample is a My webMethods Server component that deploys pages to My webMethods Server, demonstrating the use of a portlet from the /jsr168/thirdparty/sun/portletsamples project.
This sample also sets up a WSRP producer in My webMethods Server to expose the sample portlets from portletsamples.war and the CAF Core Controls sample from wm_corecontrolstest.war.
Location
wm_CAF_samples_folder\jsr168\wm_page_jsr168_demo
Description
Install portletsamples.war to My webMethods Server, and then install wm_page_jsr168_demo.
This portlet measures the rendering time of the page.
Location
wm_CAF_samples_folder\analysis\wm_pagespeed
Description
To use this portlet, put it in the footer of the current shell.
This sample demonstrates how to access and use the MWS Performance Service APIs to perform in-depth performance analysis of custom applications.
Location
wm_CAF_samples_folder\services\performance\wm_perfserviceclient
Demonstrates links in portlets to other views, data, or actions.
Location
wm_CAF_samples_folder\caf\wm_portlet_links
Description
Control Events view: Links to dynamically submit a value when you click a control.
JSR 168 view: Links to control JSR 168 functionality.
Multiple Portlets view: Click and update properties of the first portlet to see it automatically changed in the second portlet.
Multiple Views: Links to show other views from within the composite application
Order Search view: Search bar and Search Results example.
Portlet Include view: Folder view that includes the portlet wm_folderview, for My webMethods Server in this view.
Table view: A table links to display results in an associated properties group.
This sample CAF application demonstrates the use of multiple views, or pages, inside a single portlet and the use of a tabs control to switch between these view pages.
Location
wm_CAF_samples_folder\caf_controls\wm_portlet_tabs
Displays the list of last 10 users logged into My webMethods Server.
Location
wm_CAF_samples_folder\analysis\wm_recentlogins
This portlet displays a list of pages that are related according to the content of the current My webMethods Server page being browsed. The list is determined based upon the user's browsing history data from the TBLWEVENTS database table, which requires the extras\analysis\wm_eventscollector.pdp component to first be installed and enabled.
Location
wm_CAF_samples_folder\pagecomponents\wm_related_pages
A Web CAF portlet application sample that demonstrates the use of CAF controls in right-to-left browser language environments, for languages such as Hebrew and Arabic.
Location
wm_CAF_samples_folder\caf_localizatoin\wm_rtl_controls
Description
To use, install *.war file into My webMethods Server or a supported application server, browse to http://server:port/wm_rtl_controls, and then follow the online links.
Demonstrates advanced use of chart controls.
Location
wm_CAF_samples_folder\caf\wm_saleschart_sample
The sample shows how to use a search bar and search results to search a database. Selecting a name in the search results table will take you to the linked view of customer information data. The WSDL endpoint is stored in the wm_search_ws application environment setting. Edit the endpoint through the link to the composite application runtime configuration. Search for wm_search_ws and select Environment Entries. This sample requires an Integration Server and the ability to install a package on that server.
When running this sample, for best search results use all capital letters for your search terms and the wildcard value. For example, use ANTO* instead of anto.
Location
wm_CAF_samples_folder\caf\wm_search_ws
Deploying and Running the Sample
Prerequisite: To run the Search application, the IS_Package_CAFDemo package must be installed on your Integration Server. For procedures on installing this package, see Installing the CAFDemo Package on Integration Server.
1. Deploy the wm_search_ws application from Designer to the My webMethods Server.
Note: You might receive application validation errors. You can ignore these errors.
2. If your Integration Server is not running on localhost:5555, do the following to update the application configuration:
a. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
b. Go to Administration > Configuration > CAF Application Runtime Configuration.
c. Search for the wm_search_ws application.
d. Select Environment Variables.
e. Configure the wsclient-endpointAddress environment variable to point to the correct Integration Server endpoint.
3. To run the sample as a portlet, do the following.
a. Log in to the My webMethods Server using the following credentials:
user name: sysadmin
password: manage
b. Go to Public Folders > Samples > CAF Search WebServices.
This portlet implements a simple 'lock-down' policy for all users who are not in the privileged set.
Location
wm_CAF_samples_folder\security\wm_securityredirect
Description
This portlet can be put on the shell and configured with a list of privileged users/groups/roles. Any user then attempting to access this page, who is not in this list, will be redirected to the pre-defined error page.
This portlet demonstrates the dynamic creation of an Excel spreadsheet by using the Apache POI library, which uses data from My webMethods Server.
Location
wm_CAF_samples_folder\pagecomponents\wm_spreadsheetdatasource
Provides simple test JSR168 portlet samples from third-party vendors.
Location
wm_CAF_samples_folder\jsr168\ thirdparty
Displays lists of pages recently accessed by current user.
Webm_caf_samples_802\analysis\wm_userhistory
This sample uses data from TBLWEVENTS database table, which requires the extras\analysis\wm_eventscollector.pdp component to first be installed and enabled.
This sample demonstrates how to work with portlet preferences and access these settings from other portlets using wiring. The portlets are distributed and wired using an xmlImport file. A third portlet is included to simulate Integration Server being installed and uninstalled. Submitted changes in the system settings are reflected in the results portlet controls wired to them. As you change the simulated installed servers, their system settings become enabled and disabled.
Location
wm_CAF_samples_folder\caf\wm_wired_config
Description
If you encounter build path problems after importing the sample into Designer, do the following to add the wm-wsclient.jar to the project libraries list:
1. Open the wm_wired_config sample project in Designer.
2. In the Project Explorer view, right click the project and select Properties.
3. Select Java Build Path entry from the properties tree.
4. In the Java Build Path panel on the right, select the Libraries tab.
5. Click Add External Jars.
6. In the Jars Selection window, browse to and select webMethods\common\lib\wm-wsclient.jar, where webMethods is the directory where the webMethods product suite is installed.
Adding preferences to the portlet: Using the Portlet Application Configuration editor you can add preferences to a portlet. Set the scope to be "session," which preserves the setting for published instances of that portlet. Any portlet wired to this portlet will have access to any of these preferences. After you have added all the preferences, in the design canvas fill in the form with controls and a Command button to submit the preference changes.
Adding a portlet to emulate an installed product: After adding a portlet and preferences for the install state of the servers, complete the form with controls and a Command button. The portlet's BaseFacesPreferencesBean is edited to add methods to get the server install state using the FabricSystem class. This class is for working with the webMethods products. Use the method productExists and the product constant to determine whether that product is running on My webMethods Server. The PortalClient class is used to set the product constant.
Adding wiring to display your configuration settings: Using copy and paste, duplicate the configuration panel in a new portlet to display the results of the wiring. On the design canvas, add all portlets to the page. Set all the wiring. This layout will be used in the xmlImport file so you can deploy this page. Now export the page and use the xmlImport file inside of the exported file.
Demonstrates how to use navigation through views coupled with using a Submit Group control to create a wizard. The sample will show you a table of inventory items and an Add button. By pressing the Add button you can go through the wizard to input all the information for a new item in the table. The last wizard page shows all the content added and allows you to finish adding the item to the table or cancel the process.
Location
wm_CAF_samples_folder\caf_wizard\wm_wizard_sample
Description
Adding a table view: Add a table to a portlet. Add a managed bean to hold the data to be added to the table. Add a Command Button control and bind it to a method in the page view bean. From this method you will return a string that starts your navigation to another view. Values are cleared as the scope of the bean holding the data is session scope. The string returned by the method bound to the Command Button is checked against the navigations defined in the faces-config.xml file. If the string matches the rules, you are sent to WizPageOne.view.
Adding page one of the wizard: There are two actions available on this view, Cancel and Next. Cancel is a generic action that needs to be bound to a string. In this sample it is bound to the string "cancel". The navigation rule for cancel looks for a response of "cancel" from any view under the directory /cafWizardDemo.
The remaining navigation for an action of Next, Back, and Finish are only dependent on the page they come from, the method binding the response is sent from (optional), and the response.
The Next button: The navigation rules for page ID /cafWizardDemo/WizPageOne.view process any response from the method WizPageOneBean.updateSettings. If this method responds with "success" then the rule will navigate to the next view /cafWizardDemo/WizPageTwo.view.
Adding page two of the wizard. The rule for this view, /cafWizardDemo/WizPageTwo.view, has the same layout as page one except for the page ID. If successful this view takes you to the view /cafWizardDemo/WizPageThree.view.
The Back button: The navigation rules for page ID /cafWizardDemo/WizPageOne.view process any response from the method WizPageTwoBean.updateSettings and take the response of "previous" from any bound method. A response of "previous" will cause you to navigate to the pervious view /cafWizardDemo/WizPageOne.view.
Adding page three of the wizard: The same as page Two. Notice the rule is the same except that for the word Two it has Three and you go to page four and back to page two.
Adding page four of the wizard: This view contains navigation that will Finish the wizard. This is an addition to the rule that looks for the response of "success" from page four. If successful you are taken to the view /cafWizardDemo/view.view, the view you started from. The Finished button is bound to a method on view.view's page bean. That method updates the table's data model and responds with "success".