Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleLISTGROUPS

The LISTGROUPS function returns all the groups available in Yellowfin. The response contains an array of AdministrationGroup objects representing available groups. For a list of groups belonging to a specific client, you can pass the Client Org reference ID in the call. 

 

  • Displayed below is a basic request for this function:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("LISTGROUPS");



  • Include a Client Org ID to list groups specific to that client. (If not included, then the default (that is, the Primary Org) groups will be displayed).

    Code Block
    languagejava
    rsr.setOrgRef("org1");
    



  • Once the request is configured, perform the call:

    Code Block
    languagejava
    AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
    

    Initialize the Administration web service. Click here to learn how to do this. 

 

  • The response returned will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

    Groups

    AdministrationGroup[]

    List of groups

  • You can retrieve members of each group by using AdministrationGroup.getGroupMembers(). This will retrieve an array of AdministrationGroupMember. Keep in mind that if the group has a user role as a member, it will not be retrieved. Only user accounts will be retrieved via getGroupMembers().

 

Complete Example

Below is a full example of the LISTGROUPS function. To use it for yourself, carry out the following the steps:

  1. Copy the code and save it as ws_listgroups.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, admin user details according to your environment.
  4. Run http://<host>:<port>/ws_listgroups.jsp from your Internet browser.

 

Code Block
languagejava
<%            
/*              ws_listgroups.jsp                */
%>
<%@ 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.*" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false);        // adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();

rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
rsr.setPassword("test");                           // change to the password of the above account
rsr.setOrgId(1);

rsr.setFunction("LISTGROUPS");

//rsr.setOrgRef("org1");                    	   // provide org reference if required. Default org groups will be retrieved otherwise


AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	out.write("Success.<br>Available Groups:");
	AdministrationGroup[] groups = rs.getGroups();
	for (AdministrationGroup group: groups){
		out.write("<br>");
		out.write("<br>Group Name: " + group.getGroupName());
		out.write("<br>Group Id: " + group.getGroupId());
		out.write("<br>Group Description: " + group.getGroupDescription());
		out.write("<br>Group Status: " + group.getGroupStatus());
		out.write("<br>Group Internal Reference: " + group.getGroupInternalReference());


		// uncomment to display the members:
		/*
		out.write("<br>Members:<br>Login Id | Internal Id ");
		for (AdministrationGroupMember member: group.getGroupMembers()){
			out.write("<br>" + member.getLoginId() + " | " + member.getInternalId() );
		}
		*/
	}
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode());
}
%>