What I’m looking to do is a very basic idea. I am hitting a Domino server from a JSP running on Tomcat via “NotesFactory”. All I want to do is find out all of the groups that a particular user belongs to.
I’m open to creativity here. I would have no problem adding additional code to the JSP page to do some sort of loop. Also, I considered maybe calling a Notes agent to do all of the work for me and then return the group membership to the calling JSP page.
Any ideas?
hcl-bot
February 26, 2007, 8:57pm
2
Subject: Group Membership from a JSP
If you run Tomcat like this:Error
you could get the group names using:
DominoUserProfile.getPersonGroupList();
or more examples:
<%@ page import=“com.automatedlogic.domino.sso.DominoUserProfile”%>
<% DominoUserProfile dominoUserProfile = (DominoUserProfile) session.getAttribute(“DominoUserProfile”); %>
Full name: <%= dominoUserProfile.getFullName() %>
Common name: <%= dominoUserProfile.getCommonName() %>
Check for a specific group:
<%
String g;
String groupToCheck = "Tomcat Users";
if( dominoUserProfile.isMemberOfGroup(groupToCheck) ) {
g = "ARE";
} else {
g = "ARE NOT";
}
%>
<%=
"You <u>" + g + "</u> a member of the group \"" + groupToCheck + "\"."
%>
Member of these groups:
<%= dominoUserProfile.printPersonGroups() %>
Other information from the Domino Directory.
Company = <%= dominoUserProfile.getPersonInfo(“CompanyName”) %>
Office phone = <%= dominoUserProfile.getPersonInfo(“OfficePhoneNumber”) %>
Office fax = <%= dominoUserProfile.getPersonInfo(“OfficeFAXPhoneNumber”) %>
Employee ID = <%= dominoUserProfile.getPersonInfo(“EmployeeID”) %>
Subject: Group Membership from a JSP
If you run Tomcat like this:Error
you could get the group names using:
DominoUserProfile.getPersonGroupList();
or more examples:
<%@ page import=“com.automatedlogic.domino.sso.DominoUserProfile”%>
<% DominoUserProfile dominoUserProfile = (DominoUserProfile) session.getAttribute(“DominoUserProfile”); %>
Full name: <%= dominoUserProfile.getFullName() %>
Common name: <%= dominoUserProfile.getCommonName() %>
Check for a specific group:
<%
String g;
String groupToCheck = "Tomcat Users";
if( dominoUserProfile.isMemberOfGroup(groupToCheck) ) {
g = "ARE";
} else {
g = "ARE NOT";
}
%>
<%=
"You <u>" + g + "</u> a member of the group \"" + groupToCheck + "\"."
%>
Member of these groups:
<%= dominoUserProfile.printPersonGroups() %>
Other information from the Domino Directory.
Company = <%= dominoUserProfile.getPersonInfo(“CompanyName”) %>
Office phone = <%= dominoUserProfile.getPersonInfo(“OfficePhoneNumber”) %>
Office fax = <%= dominoUserProfile.getPersonInfo(“OfficeFAXPhoneNumber”) %>
Employee ID = <%= dominoUserProfile.getPersonInfo(“EmployeeID”) %>