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());
}
%>


 

 

Expand
titleGETGROUP

Use this function to retrieve a specified user group with its members. Group name should be provided to the request.

Client org reference Id can be passed to manipulate with the client content otherwise default (primary) org will be searched.

 

  • 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("GETGROUP");



  • 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");
    



  • Provide name of a user group to retrieve its members:

    Code Block
    languagejava
    AdministrationGroup group = new AdministrationGroup();
    group.setGroupName("Administrators");
    rsr.setGroup(group);

 

  • 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

    Group

    AdministrationGroup[]

    Group with members

  • Use the following to retrieve members:

    Code Block
    languagejava
    AdministrationGroupMember[] members = rs.getGroup().getGroupMembers();
    
    Tip

    You can use AdministrationGroupMember.getInternalId() to get the IpId of the Yellowfin account. Then pass it to a GETUSERBYIP call to retrieve the AdministrationPerson object for the user.

 

Complete Example

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

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

 

Code Block
languagejava
<%            
/*              ws_getgroup.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 account above

rsr.setOrgId(1);

rsr.setFunction("GETGROUP");

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

AdministrationGroup group = new AdministrationGroup();
group.setGroupName("Administrators");
rsr.setGroup(group);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	out.write("Success.<br>");
	group = rs.getGroup();
	
	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());


	// 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());
}
%>


 

 

Expand
titleCREATEGROUP

Creates a new user group in the client org provided. If the client reference Id is omitted, the group will be created in default (primary) org. The call requires AdministrationGroup object where you provide new group details. If you supply new group members via AdministrationGroupMember, the members will be added to the created group (this must be existing Yellowfin users).

Client org reference Id can be passed to manipulate with the client content otherwise default (primary) org will be used.

 

  • 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("CREATEGROUP");



  • To add the new group to a specific client, include its Client Org ID. (If not included, then the group will be created in the default (that is, the Primary Org) group).

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



  • Set parameters for the new group:

    Code Block
    languagejava
    AdministrationGroup group = new AdministrationGroup();
    group.setGroupName("Test Group");
    
  • Inclue members to the group, for example:

    Code Block
    languagejava
    AdministrationGroupMember[] member = new AdministrationGroupMember[2];
    
    member[0] = new AdministrationGroupMember();
    member[0].setLoginId("admin@yellowfin.com.au");
    
    member[1] = new AdministrationGroupMember();
    member[1].setLoginId("john.smith@yellowfin.com.au");
    
    group.setGroupMembers(member);
    
    rsr.setGroup(group);

 

  • 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

Complete Example

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

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

 

Code Block
languagejava
<%            
/*              ws_creategroup.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);
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();

rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);

rsr.setFunction("CREATEGROUP");

//Specify client org (if omitted, the group will be created in the default (primary) org):
rsr.setOrgRef("org1");

//Set parameters of the new group:
AdministrationGroup group = new AdministrationGroup();
group.setGroupName("Test Group");                          // mandatory. Other parameters are optional.

//Add members:
AdministrationGroupMember[] member = new AdministrationGroupMember[2];
member[0] = new AdministrationGroupMember();
member[0].setLoginId("admin@yellowfin.com.au");

member[1] = new AdministrationGroupMember();
member[1].setLoginId("john.smith@yellowfin.com.au");

group.setGroupMembers(member);

rsr.setGroup(group);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	out.write("Success");
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode() );
}
%>