Author |
Message
|
Prabhakar |
Posted: Thu Jan 08, 2004 10:04 am Post subject: Custom Viewer for MQ Workflow WebClient |
|
|
Newbie
Joined: 08 Jan 2004 Posts: 6
|
Hi viewers,
I am in the process of providing a Customized viewer (replace ListViewer.jsp) for different areas in our company using Workflow WebClient. I have successfully followed the recommendations on Chapter 69 "Customizing the Web client " on page 818 thru 824 of the IBM MQWorkflow 3.4 Programming Guide. We have deployed the out of the box WebClient code "using JSPViewer as the DefaultViewer" in the WebClient.properties file. It is deployed on a UNIX WAS 5.0 environment. I have decided to distinguish the users that log into the WFWebClient using the Category that they are defined to the WF. In other words, each category is tied to an application that uses WF WebClient and has its own customized jsp. However, if the user belongs to multiple categories, in my case two applications, then how do I accommodate this request. Can anyone shed some light on this or give me an alternate solution to satisfy my customers with customized front end.
Thank you
Vijay |
|
Back to top |
|
 |
ucbus1 |
Posted: Thu Jan 08, 2004 12:04 pm Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
One way we do is to provide two userids for the same user and assign the user ids to different "areas/categories/regions/JSPs( in your case". Redundant but simple solution |
|
Back to top |
|
 |
Prabhakar |
Posted: Thu Jan 08, 2004 12:54 pm Post subject: |
|
|
Newbie
Joined: 08 Jan 2004 Posts: 6
|
We are using auth exit using LDAP and we would want to eleminate redundancy of defining the same users twice
Any other thoughts?
Thanks
Vijay |
|
Back to top |
|
 |
jmac |
Posted: Thu Jan 08, 2004 5:03 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I am not sure I completely understand what you are doing... but it sounds to me that during the login you can detect that a user has multiple categories to which they are authorized, then you can let them choose which viewer they want to see. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Prabhakar |
Posted: Fri Jan 09, 2004 7:33 am Post subject: |
|
|
Newbie
Joined: 08 Jan 2004 Posts: 6
|
When, the user log's into the WFWebClient, I am identifying the Categories that the user has access to and then redirect them to their respective custom viewer. This is under the assumption that each user will be tied to only one application, But in reallity this may not be true. Each user may have more than one category and will have to have a screen of some kind which should give them an option to select the custom viewer and should stay with the application until the user logs off the system. If the user does not have any category defined then the user should be defaulted to the GenericListViewer.jsp
Example
USER CATEGORY CUSTOM_VIEWER
user1 test testListViewer.jsp
user2 test, demo testListViewer.jsp and demoListViewer.jsp
user3 no category GenericListViewer.jsp
In the above example, user2 should be given an option of testListeViewwer.jsp and demoListViewer.jsp and after the user chooses to stay on one (testListViewer.jsp), the application should then stay using the testListViewer.jsp until the user logs off.
Hope this explains, what I am trying to do
Thanks
Vijay |
|
Back to top |
|
 |
jmac |
Posted: Fri Jan 09, 2004 8:04 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
You should be able to do what you like pretty easily by just indicating what viewer to use for each logged in user _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Prabhakar |
Posted: Fri Jan 09, 2004 11:30 am Post subject: |
|
|
Newbie
Joined: 08 Jan 2004 Posts: 6
|
how and where do I need to implement the code. I have my viewer redirect the users to the corresponding custom jsp's. But I am not sure how to code dor multiple category. Could you give me some sample or guide me with some code that can handle multiple custom pages for a user?
Thanks
Vijay |
|
Back to top |
|
 |
jmac |
Posted: Fri Jan 09, 2004 12:00 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
You need to write your own viewer class by extending JSPViewer. Then go have a look at the IBM JSPViewer class and find all of the occurances where it has the following style return:
Code: |
return new ResponsePage(context, "/forms/ListViewer.jsp") |
Copy those methods and replace with a return like this:
Code: |
return new ResponsePage(context, useViewer) |
During your logon set your useViewer variable based on the category.
If I am understanding what you want this should do it.
GOOD LUCK _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
alexey |
Posted: Sun Jan 11, 2004 6:31 am Post subject: |
|
|
 Acolyte
Joined: 18 Dec 2003 Posts: 62 Location: Israel
|
You may also use jsp:forward and replace your ListViewer.jsp with somth. like the following code (you'll need an if on categories instead of my if on username).
You may save the choise of the user on his viewer into session and than use it in your if:
session.setAttribute("viewer","whateverchoise");
and use it like:
usersChoise = session.getAttribute("viewer");
if(usersChoise !=null)...
- Alexey.
<jsp:useBean id="context" scope="request" type="com.ibm.workflow.servlet.client.RequestContext"/>
<html>
<% String user = context.getUserID();%>
<head>
<title>
</title>
</head>
<body>
if(user.toUpperCase().equals("ADMIN")) {%>
<jsp:forward page="ListViewerForAdmin.jsp">
<jsp:param name="user" value="<%=user%>"/>
</jsp:forward>
<% }else{ %>
<jsp:forward page="ListViewerForOthers.jsp">
<jsp:param name="user" value="<%=user%>"/>
</jsp:forward>
<% } %>
</body></html> |
|
Back to top |
|
 |
ucbus1 |
Posted: Tue Feb 17, 2004 5:06 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
alexy!
Could you please let me know where the code need to be placed. Does that have to be in the listviewer.jsp.
Prabhakar,
Appreciate if you can Please let me know the status on how you solved the problem you are facing
Thanks |
|
Back to top |
|
 |
Prabhakar |
Posted: Tue Feb 17, 2004 7:23 am Post subject: |
|
|
Newbie
Joined: 08 Jan 2004 Posts: 6
|
The user after login to the WebClient, I check to see which category they belong to and I have defferent listviewer.jsp for each category. In other words, when the user is defined to multiple categories a pop up with the multiple categories are displayed to the user to choose, where they want to go and will stay on the same viewer until they logout.
I am prety much storing the selection in a session and redirecting them to the corresponding page. If the user is an admin the user is displayed with a generic listviewer.jsp which displays the default viewer
Hope this helps.
Thanks.
Vijay |
|
Back to top |
|
 |
ucbus1 |
Posted: Tue Feb 17, 2004 12:02 pm Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Thanks Prabhakar,
Just to make sure i understood it correctly.
You are checking whether a user belongs to a particular category or not. Just curious.. are you using a (your onw) database look up or FMCDB.
Once you decide the category which the user is allowed for, then you pop up a window letting the user to decide which viewer he is interested in. You keep the users choice in a session variable say "users choice"
Then you submit the logon page to (IBM supplied) Main servlet which directs the page to "listViewer.jsp". In the listviewer.jsp you modified to check the session variable "users choice" and redirect the user to different viewer.
Please let me know if I understood it right? |
|
Back to top |
|
 |
alexey |
Posted: Wed Feb 18, 2004 7:33 am Post subject: |
|
|
 Acolyte
Joined: 18 Dec 2003 Posts: 62 Location: Israel
|
Hi, ucbus!
Quote: |
Just to make sure i understood it correctly |
Yes, your explanation is correct.
As for your question about categories - you can use API on Person object called categoriesAuthorizedFor(), getting the Person object from execution service using userSettings() call.
Alexey. |
|
Back to top |
|
 |
|