Using the Portlet
Generator
Now, you will learn how to use the Portlet Generator. The completed
Project InterChange file is in the sample
Portlet_Generator_PI.zip
file.
Creating the business
process
Figure 4 shows a simple business process, SimpleOrderProcess, used in
our example to illustrate the Portlet Generator application. This
is optional if you use an existing business process.
Figure 4. Sample business
process
The installable process file, CustomerServiceApp.ear, is included in
the Download section.
Defining a user
interface
This section describes how to define user interface client from
WebSphere Integration Developer.
Adding the user interface
client definition
- Open the WebSphere Integration Developer project in the
Business Integration perspective.
- Click the plus sign in the Human Task interface (CustomerService
in the sample) as shown in Figure 5, and navigate to
CustomerService (double-click to open the Human Task
panel).
- Add a user interface definition to be used by the client by
clicking the plus sign shown in Figure 5, and then choose
Portlets for Portal Server.
Figure 5. User interface definition
Specifying portal client
properties
Specify the unique name and type as shown in Figure 6.
Figure 6. Portal client
properties
Note: The unique name will be associated with the task page in
the process portal.
Generating the portlet graphic
user interface
Now, you are ready to use the Portlet Generator wizard.
- Start the Portlet Generator from any Human Task (CustomerService
in our example). Right-click the popup menu and choose Generate
Human Task User Interface..., as shown in Figure 7.
Figure 7. Human task user
interface menu option
- Specify the Generator type, Portlets for WebSphere Portal
Server, and select the human tasks for generation,
CustomerService in our example, as shown in Figure 8.
Figure 8. Client generator
selection
- On the Portlet Generator Settings page, enter a portlet project
name,
portlet_w, in our example.
Choose the target runtime as WebSphere Portal v6.1 stub,
and click the Finish button as shown in Figure 9.
Figure 9. Portlet
generator settings
Hint: Alternatively, you can start the Portlet Generator from a
human task Properties panel, as shown in Figure 10, to generate the
portlet user interface for the human task.
Figure 10. Alternative
Portlet Generator button
Copying business process
files
Copy all Web Service Description Language (WSDL) and XML Schema
Definition (XSD) files that are associated with the business process
into the portlet project created by the Portlet Generator wizard. The
file structure of these copied files in the portlet project needs to
be the same as the process project.
- In our example, go to the WebSphere Integration Developer
Resource perspective, and copy all files under the
CustomerService > com.ibm.sample package
as shown in Figure 11.
Figure 11. Business
process source files
- Paste these files into the portlet project's class directory as
shown in Figure 12:
portlet_w > WebContent > WEB-INF > classes.
Figure 12. Business
process files inclusion in the portlet project
These process files are required in the cross-cell deployment
scenario.
Hint: Alternatively, you can include the business process jar
file (CustomerService.jar, in our example) into the portlet project's
WEB-INF > lib directory.
Exporting the generated portlet
application
To export the generated portlet application, do the following
steps:
- Go to WebSphere Integration Developer Menu: File > Export.
- Select War > War File.
- Export the portlet application
portlet_w.war in our
example, to a chosen destination folder.
|