<%! private static final String cvsId = "$Id: listusergroups.jsp,v 1.0 2020/02/06 02:26:51 Neal Exp $"; %> <%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ page import="com.hof.util.*, java.util.*, java.text.*" %> <%@ page import="com.hof.web.form.*" %> <%@ page import="com.hof.mi.web.service.*" %> <% /* List Groups Using Java generated stubs rather that using the Yellowfin webservices API.. */ AdministrationServiceResponse rs = null; AdministrationServiceRequest rsr = new AdministrationServiceRequest(); AdministrationServiceService ts = new AdministrationServiceServiceLocator("localhost", 8080, "/services/AdministrationService", false); AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(new Integer(1)); rsr.setFunction("LISTGROUPS"); String user_id = request.getParameter("user_id").trim().toUpperCase(); if (user_id != null && user_id != "") { out.write("
Groups for " + user_id.toLowerCase() + ""); rs = rssbs.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { for (int i =0; i < rs.getGroups().length; i++ ) { for (int j = 0; j < rs.getGroups()[i].getGroupMembers().length; j++ ) { if (user_id.equals(rs.getGroups()[i].getGroupMembers()[j].getLoginId().trim().toUpperCase())) { out.write("
" + rs.getGroups()[i].getGroupName()); break; } } } } else { out.write("Failure"); out.write(" Code: " + rs.getErrorCode()); } } else { out.write("Please enter a valid user id"); } %>


Done.