Customize netmarkets/jsp/user/profile.jsp to display what you want.
Here's how to find all of a user's roles.... It should be enough to get you going, anyways.
public class MyRoles {
public static void main(String[] args) {
try {
//get your user....
WTPrincipal user = SessionHelper.manager.getPrincipal();
Set<Role> teamRoles = teamRoles(user);
Set<Role> containerTeamRoles = containerTeamRoles(user);
System.out.println("teamRoles.size(): " + teamRoles.size());
System.out.println("containerTeamRoles.size(): " + containerTeamRoles.size());
} catch (Exception e) {
e.printStackTrace();
}
}
public static Set<Role> teamRoles(WTPrincipal principal) throws WTException, WTPropertyVetoException {
Set<Role> roles = new HashSet<Role>();
QuerySpec qs = new QuerySpec();
qs.setDistinct(true);
int rpmIndex = qs.appendClassList(RolePrincipalMap.class, false);
qs.appendSelectAttribute(RolePrincipalMap.ROLE, rpmIndex, false);
qs.appendWhere(new SearchCondition(RolePrincipalMap.class,RolePrincipalMap.PRINCIPAL_PARTICIPANT + ".key",SearchCondition.EQUAL,PersistenceHelper.getObjectIdentifier(principal)),new int[rpmIndex]);
QueryResult qr = PersistenceHelper.manager.find((StatementSpec)qs);
while(qr.hasMoreElements()) {
Object nextArray[] = (Object[])qr.nextElement();
if(nextArray != null && nextArray.length == 1) {
roles.add((Role)nextArray[0]);
}
}
return roles;
}
public static Set<Role> containerTeamRoles(WTPrincipal principal) throws WTException {
Set<Role> set = new HashSet<Role>();
QueryResult containerTeams = findContainerTeams();
while(containerTeams.hasMoreElements()) {
ContainerTeam team = (ContainerTeam)containerTeams.nextElement();
Iterator<Role> roles = team.getRoles().iterator();
while(roles.hasNext()) {
Role role = roles.next();
WTGroup group = ContainerTeamHelper.service.findContainerTeamGroup(team, ContainerTeamHelper.ROLE_GROUPS, role.toString());
if(group != null) {
if(group.isMember(principal)) {
set.add(role);
}
}
}
}
return set;
}
private static QueryResult findContainerTeams() throws WTException {
QuerySpec qs = new QuerySpec(ContainerTeam.class);
return PersistenceHelper.manager.find((StatementSpec)qs);
}
}