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
titleDELUSER / DELETEUSER

 

The call will delete a specified user from Yellowfin. Note: To remove a user from a client organization, you should perform the REMOVEUSERACCESS call.

Code Block
languagejava
AdministrationServiceRequest rsr = new AdministrationServiceRequest();

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

rsr.setFunction("DELETUSER");

 

  • The function requires AdministrationPerson object where you provide the user id (email address or Id depending on the Logon ID method) to delete:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("test@yellowfin.com.au");                   // test@yellowfin.com.au should be existing Yellowfin user.
    rsr.setPerson(ap);
    
  • After configuring the request, perform the call:

    Code Block
    languagejava
    AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
    
  • Then initialize the Administration web service. Click here to learn how to do this. 

 

  • The response will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

Complete Example of DELETEUSER:

You can use this example to delete a user. To try it out, follow the steps below:

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

 

Code Block
languagejava
<%            
/*              ws_deleteuser.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("DELETEUSER");


AdministrationPerson ap = new AdministrationPerson();

ap.setUserId("test@yellowfin.com.au"); 
rsr.setPerson(ap);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);


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


 

 

...

Expand
titleGETUSER

 

This function retrieves an existing Yellowfin user's details. It accepts AdministrationPerson as a parameter where you can provide a user ID (email address or any other ID, depending on the Login ID method) to identify the user. For security reasons, passwords will not be returned and will be NULL.

The response will contain the AdministrationPerson object with full user details.

 

  • Following is an example of this request:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("GETUSER");
  • Now provide the user ID via the AdministrationPerson object:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    ap.setUserId("john.smith@yellowfin.com.au");
    rsr.setPerson(ap);
  • Once the request is configured, perform the call:

    Code Block
    languagejava
    AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
  • Then initialize the Administration web service. Click here to learn how to do this. 

 

  • The response will contain the following parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

    Person

    AdministrationPerson

    Object with the user details

     

     

  • To display the retrieved user details, use the following example:

    Code Block
    languagejava
    if ("SUCCESS".equals(rs.getStatusCode()) ) {
    	ap = rs.getPerson();
    	out.write("UserId:" + ap.getUserId() + "<br>");
    	out.write("Password:" + ap.getPassword() + "<br>");
    	out.write("FirstName:" + ap.getFirstName() + "<br>");
    	out.write("LastName:" + ap.getLastName() + "<br>");
    	out.write("Initial:" + ap.getInitial() + "<br>");
    	out.write("SalutationCode:" + ap.getSalutationCode() + "<br>");
    	out.write("RoleCode:" + ap.getRoleCode() + "<br>");
    	out.write("EmailAddress:" + ap.getEmailAddress() + "<br>");
    	out.write("LanguageCode:" + ap.getLanguageCode() + "<br>");
    	out.write("IpId:" + ap.getIpId() + "<br>");
    	out.write("TimeZoneCode:" + ap.getTimeZoneCode() + "<br>");
    	out.write("Status:" + ap.getStatus() + "<br>");
    } else {
    	out.write("Failure");
    	out.write(" Code: " + rs.getErrorCode());
    }
    
    
    

A Complete Example of the GETUSER function:

You can follow the steps below to use this example to retrieve user details:

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

 

Code Block
languagejava
<%            
/*              ws_getuser.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("GETUSER");

AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au");
rsr.setPerson(ap);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	ap = rs.getPerson();
	out.write("User Id:" + ap.getUserId() + "<br>");
	out.write("Password:" + ap.getPassword() + "<br>");
	out.write("First Name:" + ap.getFirstName() + "<br>");
	out.write("Last Name:" + ap.getLastName() + "<br>");
	out.write("Initial:" + ap.getInitial() + "<br>");
	out.write("Salutation Code:" + ap.getSalutationCode() + "<br>");
	out.write("Role Code:" + ap.getRoleCode() + "<br>");
	out.write("Email Address:" + ap.getEmailAddress() + "<br>");
	out.write("Language Code:" + ap.getLanguageCode() + "<br>");
	out.write("IpId:" + ap.getIpId() + "<br>");
	out.write("Time Zone Code:" + ap.getTimeZoneCode() + "<br>");
	out.write("Status:" + ap.getStatus() + "<br>");
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode() );
}
%>


 

 

Expand
titleGETALLUSERS

 

This functions retrieves details of all the users in a specified client organization. The information is retrieved in an array of AdministrationPerson objects. If a client organization is not specified, then all the users will be retrieved. You can use the setParameters() method to specify a searching criteria for users being retrieved. For security reasons, passwords will not be returned and will be NULL.

 

  • Here's an example of a request to retrieve users:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("GETALLUSERS");
    
  • Specify a client organization, otherwise all the client organizations will

 

 

 

 

 

 

 

 

 

 

 

Expand
titleGETUSERBYIP

The following code will call the Yellowfin web service to retrieve a user’s details via their internal IpId:

Code Block
AdministrationServiceRequest rsr = new AdminstrationServiceRequest();
AdministrationServiceResponse rs = null;
AdministrationPerson person = new AdministrationPerson();

Person.setIpId(5);

rsr.setLoginId(this.username);
rsr.setPassword(this.password);
rsr.setOrgId(new Integer(1));
rsr.setFunction("GETUSERBYIP");
rsr.setPerson(person);

rs = AdministrationService.remoteAdministrationCall(rsr);

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

This code will return an AdministrationPerson object with the user’s details and SUCCESS in the rs.getStatusCode(), otherwise it will return an error message explaining why the process failed.

This function will retrieve the details of a particular user in Yellowfin by looking up their IP ID. The details in the AdministrationPerson object will be used in the retrieval process.

Request Element

Data Type

Description

LoginId

String

Login ID of the account used to connect to Yellowfin webservices eg. admin@yellowfin.com.au

Password

String

Password of the account used to connect to Yellowfin webservices

OrgId

Integer

Primary organisation ID within Yellowfin. Always set this to 1.

Function = “GETUSERBYIP”

 

Web services function

Person

AdministrationPerson

The AdministrationPerson object holding the Yellowfin user’s User ID for the retrieval process

These are the parameters that you need to set in the AdministrationPerson object:

AdministrationPerson Element

Data Type

Description

IpId|Integer|IP ID of the Yellowfin User|

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

Person

AdministrationPerson

The AdministrationPerson object holding all of the returned user’s details

...