You can use JSP as a screen.
Our example, we create admin task called "Custom JSP"
- Primary Object is User
- Action is View
Select search screen and select Tab "Tabs"
And add JSP, click icon pencil and select JSP files
If you use weblogic, you can place JSP file at <WebLogic Home>\user_projects\domains\base_domain\applications\iam_im.ear\user_console.war\app\page\jsp
Save this admin task and assign to admin role.
Create JSP file named custom.jsp
<%@page import="com.netegrity.webapp.page.TaskController"%>
<%@page import="com.netegrity.llsdk6.imsapi.managedobject.Account"%>
<%@page import="java.util.Vector"%>
<%@ page
import="com.netegrity.llsdk6.imsapi.managedobject.User"
%>
<%@ page
import="com.netegrity.webapp.UIContext" %>
<%@ page
import="com.netegrity.llsdk6.imsapi.*" %>
<%@ page
import="com.netegrity.llsdk6.imsapi.provider.UserProvider"
%>
<%
TaskController taskController =
(TaskController)request.getAttribute("TaskController");
User user = (User)taskController.getTaskSession().getSubject();
%>
<H1>Hello <%=user.getFriendlyName()%></H1>
Unique Name: <%=user.getUniqueName()%><br/>
List of
accounts:<br/>
<%
Vector<Account> accounts = user.getAccounts();
for(Account
account:accounts){
out.println(" <li> Account Name:"+account.getUserAccountName()+"
Endpoint: "+ account.getEndPointName()+"</li>");
}
%>
<%
User admin = UIContext.getUser(request);
%>
Calling by <%=admin.getFriendlyName()%>
|
PS. you can see how to set class path form book or CA bookshelf.
This code gets user information and display accounts
The key API is:
1. Get TaskSession to get user Object
TaskController
taskController = (TaskController)request.getAttribute("TaskController");
User user =
(User)taskController.getTaskSession().getSubject();
|
2. UIContext, this API you can call Provider Accessor, for example getUserProvider.
UIContext.getUser(request);
|
JSP code is open for you to use any java code to access database or web services. You download JSP code here: http://www.caidentitymanagerbook.com/tutorial.html