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.

...

These web services are specific to Yellowfin user roles.

Note

When using LDAP authentication, any web services that return a role, will return the role that the LDAP user last logged in with successfully. (This role is updated every time an LDAP user logs in.)


Anchor
listroles
listroles

Expand
titleLISTROLES

This function returns all the user roles available in Yellowfin. The response contains an array of AdministrationRole objects displaying available roles.


Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

Yellowfin web services admin user ID. This can be the user ID or the email address, depending on the Logon ID method.

This Yellowfin account must have the “web services” role enabled, and must belong to the Default (i.e. Primary) Org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. Primary) organization ID within Yellowfin. Always set this to 1.

Function

String

Web services function. Set this to "LISTROLES".



Request Example

The following SOAP example shows the parameters that you can pass to this call:

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteAdministrationCall>
         <arg0>
            <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <function>LISTROLES</function>                            
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>



Response Elements

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

Roles

AdministrationRole[]

List of roles



Response Elements

The service will return the below response, according to our SOAP example:

Code Block
languagexml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <roles>
               <functions>
                  <accessLevelCode>CRUD</accessLevelCode>
                  <functionCode>ACTIVITYSTREAM</functionCode>
                  <functionDescription>Allows users to access the activity stream.</functionDescription>
                  <functionName>Activity Stream</functionName>
               </functions>
               <functions>
                  <accessLevelCode>CRUD</accessLevelCode>
                  <functionCode>TIMELINE</functionCode>
                  <functionDescription>Allows users to access their timeline.</functionDescription>
                  <functionName>Timeline</functionName>
               </functions>
               <functions>
                  <accessLevelCode>CRUD</accessLevelCode>
                  <functionCode>BROADCASTSUBSCRIBE</functionCode>
                  <functionDescription>Allows users to subscribe to report broadcasts.</functionDescription>
                  <functionName>Subscribe to Broadcast</functionName>
               </functions>
               <functions>
                  <accessLevelCode>R</accessLevelCode>
                  <functionCode>STORYBOARD</functionCode>
                  <functionDescription>Allows users to view, create, edit or delete Storyboards.</functionDescription>
                  <functionName>Storyboard</functionName>
               </functions>
               <functions>
                  <accessLevelCode>R</accessLevelCode>
                  <functionCode>DASHPUBLIC</functionCode>
                  <functionDescription>Allows users to create and edit Public dashboards.</functionDescription>
                  <functionName>Public Dashboards</functionName>
               </functions>
               <functions>
                  <accessLevelCode>CRUD</accessLevelCode>
                  <functionCode>TASKPERSONAL</functionCode>
                  <functionDescription>Allow users to create and assign tasks to themselves.</functionDescription>
                  <functionName>Personal Tasks</functionName>
               </functions>
               .
               .
			   .
               <roleCode>YFADMIN</roleCode>
               <roleDescription>This user has the widest range of access to the system, and as such you should have a very limited number of people assigned this role. They can do everything from create content through to managing system tasks.</roleDescription>
               <roleName>System Administrator</roleName>
            </roles>
            <sessionId>4f86f0e30e30bf4b07dea21267de0a74</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>


Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
 
  • 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("LISTROLES");



  • 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

    Roles

    AdministrationRole[]

    List of roles




Complete Example

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

  1. Copy the code and save it as ws_listroles.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_listroles.jsp from your Internet browser.


Code Block
languagejava
themeEclipse
<%            
/*              ws_listroles.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 webservices admin account
rsr.setPassword("test");                           // change to be the password of the account above
rsr.setOrgId(1);

rsr.setFunction("LISTROLES");

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	out.write("Success.<br>Available Roles:");
	AdministrationRole[] roles = rs.getRoles();
	for (AdministrationRole role: roles){
		out.write("<br>");
		out.write("<br>Role Name: " + role.getRoleName());
		out.write("<br>Role Code: " + role.getRoleCode());
		out.write("<br>Role Description: " + role.getRoleDescription());
                                  
		// uncomment to display all the security functions:
		/*
		out.write("<br>Function Name | Code | Description | TypeCode | AccessLevelCode");
		for (AdministrationFunction f: role.getFunctions()){
			out.write("<br>" 	+ f.getFunctionName() + " | " 
								+ f.getFunctionCode() + " | " 
								+ f.getFunctionDescription() + " | " 
								+ f.getFunctionTypeCode() + " | " 
								+ f.getAccessLevelCode());
		}
		*/

	}
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode());
}
%>



...