Index Changes

WLMSE provides a static common service in TaskCommon.wsdl, for operations as GetTaskList, ClaimTask, GetTaskInput, GetTaskOutput, SetTaskOutput, GetTaskXForm, ReassignTask, RevokeTask, etc. The TaskCommon.wsdl is present in the build folder of every wlm project, note although soap binding is on TaskCommon.wsdl, javaeese is used as the proxy between Java EE client (such as a web console) and WLMSE to pass the security context of the client to WLMSE. Our generic web console provided is discussed below, the goal is user can either build their own web console for wlm from scratch (see Make your own Worklist Manager client application), or customize the generic web console

Web Console Overview



wlmEntry.jsp is the entry page to wlm console. wlmEntry calls other jsps when user clicks claim, complete or any task in the task list.
getTaskList.jsp constructs task list content as an xml for the DataTable in wlmEntry.jsp to consume. AJAX is done in wlmEntry.jsp using YUI asynchronous callback, the task list is refreshed every 10 sec (by default and configurable)
checkoutTask.jsp is called when user claims a task, completeTask.jsp is called when user completes a task, task list is auto-refreshed when such actions are done.

When user clicks any task on the task list, showTaskDetails in wlmEntry.jsp calls xforms-jsp/taskDetails.jsp to show task details (request and response if set).
Orbeon Xforms Engine 3.6 is deployed to process any files under xforms-jsp/, the worklist xform flow is configured in web/WEB-INF/resources/worklist/
A custom processor is implemented by WLMProcessor.java which calls the SetTaskOutput with the user set response.





User Configurable

A list of parameters can be turned by user on wlmEntry.jsp

            <!-- User Configurable Begin -->
            var refreshInterval = 10000; //default refreshing = 10 sec            
            var pageSize = 20; //Pagination Enabled, tasks per page, 0 means no pagination
            var savedSort = "id";
            var savedDir = "ASC";
            <!-- User Configurable End -->

Significant data and methods on wlmEntry.jsp

myDataTable and myDataSource

Users want to customize task list headers, add/remove column should start with myDataTable and myDataSource

            var myColumnHeaders = [
                {key:"id", label:"Task Id", type:"number", sortable:true},
                {key:"title", label:"Title", sortable:true},
                {key:"createDate", label:"Submitted On",  sortable:true},
                {key:"priority",  label:"Priority",  sortable:true},
                {key:"status", label:"Status", sortable:true},
                {key:"assignedTo", label:"Assigned To", sortable:true},
                {key:"owner", label:"Claimed By", sortable:true}
            ];

            // Define the data schema
            myDataSource.responseSchema = {
                resultNode: "task", // Node name of each result item
                fields: ["id","title","createDate", "priority", "status", "assignedTo","owner"],
                metaFields: { 
                    totalRecords: "total",
                    returnedRecords: "returned" }                // Field names
            };

myDataSource.responseSchema defines the xml schema of the task list content, in the above example, each task is represented by a task element wrapped around "id","title","createDate", "priority", "status", "assignedTo","owner" elements, totalRecords and returnRecords are parsed outside of the task elements, i.e. in the outer element.

myColumnHeaders maps the fileds in myDataSource.responseSchema to columns in the task list table

The task of add/remove/change columns in task list can be done by changing the myColumnHeaders and myDataSource.responseSchema and also the source of task list data: getTaskList.jsp

AJAX

refreshTaskList () is called every refreshInterval to refresh the current page of the task list, and it is also called when user does claim task or complete task.
dataReturned (sRequest , oResponse , oPayload ) is the callback when data arrives from the callback. In this method, the original selected row is reselected and task details is shown (showTaskDetails())

Configure Security


The Web Console uses JavaEE Security to control the access to the console, user may want to add finer-grained programmatic security (request.isUserInRole) when customizing the page for Administrative operations such as ReAssign.

Add Users and Groups

We use an example to describe how to add users and groups for the Web Console, you can find more details in User Guide On AppServer Security

We want to add both a user Luke and his team Support to access the web console.
Using FileRealm, we will do the following steps:
1. Add Luke as a user and specify he is a member of group: Support in the file realm used in the web console: Configuration --> Security --> file --> Manage Users

Figure: Create User
2. Add permission for Luke to access the web console:
You have 2 options to do it:
a. Add permission for any group of which luke is a member (e.g. Support).

  1. Open WorklistWebApplication/web/WEB-INF/web.xml, add a Security Role : Support (or any name you like), see Figure: Add Security Role
  2. Open WorklistWebApplication/web/WEB-INF/sun-web.xml, go to Security tab and expand the Security Role Mapping for role:Support, add group:Support (the group is configured on admin console in step 1),
see Figure: Add Security Role-Group Mapping

Figure: Add Security Role

Figure: Add Security Role-Group Mapping

b. Add permission for luke as a principal.

  1. Open WorklistWebApplication/web/WEB-INF/web.xml, add a Security Role : Support (or any name you like), see Figure: Add Security Role
  2. Open WorklistWebApplication/web/WEB-INF/sun-web.xml, go to Security tab and expand the Security Role Mapping for role:Support, add principal:luke (configured on admin console in step 1),
see Figure: Add Security Role-Principal Mapping

Figure: Add Security Role-Principal Mapping

3. Add permission for team Support to access the web console: if you do Step 2a, you will have added team Support already
Using LDAPRealm, we will do the following steps:
1. Refer to Realm setting on Glassfish for setting up the realm
2. WorklistWebApplication change is similar to FileRealm with regards to adding role and role-group, role-principal mappings, please see Configure WebApp for Ldap

How-Tos


  • How to add more columns to Task List

Explained in myDataTable and myDataSource, adding more columns needs to change myColumnHeaders and myDataSource.responseSchema and also the source of task list data: getTaskList.jsp

  • How to get information from the input message and shows on Task List

Step 1. Get the data from input message task Title field, this can be done as in PurchaseOrderXpath sample:

    <title>concat($TaskInput.part1/po:purchaserName, concat(' Purchase Order for ', $TaskInput.part1/po:productId))</title>
Using xpath you can construct a delimited string using any delimiter you choose through xpath on input message ($TaskInput) to the task title which effectively saves it into TaskInstance DB table's Title column.

Step 2. Parse title field in getTaskList.jsp and assigns the value to an extra element in the task list xml
Step 3. Follow How to add more columns to Task List

  • How to get information from another web service call to show on Task List

Step 1. Change getTaskList.jsp to call external web service, construct Task List xml with extra elements
Step 2. Follow How to add more columns to Task List

  • How to by-pass XForms

If you want to show your own form and not using the generated xhtml and xform engine, you can do the following :
1. Make your own form in any directory other than xforms-jsp/, since this folder is governed by xform engine
2. In your own form, calls GetTaskInput, GetTaskOutput, SetTaskOutput operations of TaskCommon.wsdl using generated JAX-WS client stub (See TaskXformViewBuilder.java for example)
3. Replace the taskDetails.jsp hook in wlmEntry.jsp

  • How to modify the generated xform, such as changing the control type

You can change the generated xhtml file in the wlm project, the xhtml file will not be overwritten by next build activity

Lightweight Web Console


Lightweight Web Console is a console that shows task input and output as plain xml and with no built-in xform support. It has a much smaller size and flexible to plug-in any view component or external service call to create task presentation. Lightweigh Web Console can be downloaded at here

In the full-size Web Console, user would see task details as a form provided by the xform engine:

Figure: Full-size WLM Console

In the lightweight Web Console, user sees task details as plain xml:

Figure: Lightweight WLM Console

View plugin

User can replace the web/wlm-jsp/taskDetailsIn.jsp and web/wlm-jsp/taskDetailsOut.jsp with custom view component to display task input and task output, user can also integrate information from other sources such as result of web service calls.

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-35) was last changed on 19-Mar-09 09:03 AM, -0700 by MeiWu