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.

...

This allows Yellowfin to identify the user who is logged in, and to apply any restrictions that may be required. Synchronisation Synchronization is usually performed using web service calls from the OEM application to Yellowfin. This can also be managed manually if users in the OEM application are generally static.

...

Expand
titleADDUSER

This function creates a new user account in Yellowfin.

 

Here's a basic request to create a new Yellowfin user:
Code Block
languagejava
AdministrationServiceRequest rsr = new AdministrationServiceRequest();


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

rsr.setFunction("ADDUSER");
 

 

If you need to create a new user in a specific client organization, add this to your code
Code Block
languagejava
rsr.setOrgRef("org1");      // A new user will be added to the client org with "org1" as an organization reference ID
If you do not define the orgRef parameter, the new user will be created in the default (primary) organization.

Request Elements

The following elements will be passed with this request:

Note: The contents of the AdministrationPerson object will be used to define the user being logged in.

Request Element

Data Type

Description

LoginId

String

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

Password

String

Password of the account used to connect to Yellowfin web services.

OrgId

Integer

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

Function

 

Web services function. Set this to "ADDUSER".

Person

AdministrationPerson

The AdministrationPerson object holding all of the new user’s details for the user creation process. See below table.

OrgRef

String

Client Org Internal Reference Id (optional). This will create a new user in the referenced Client Org. If this is not set, then the new user will be created in default (primary) org.

 

These are the mandatory parameters that you need to set in the AdministrationPerson object to create a new user:

AdministrationPerson Element

Data Type

Description

UserId

String

User ID of the user that you wish to log in. This can be the user ID or the email address, depending on the Logon ID method.

Password

String

Password of the new user. This must comply with Yellowfin's Password Policy.

FirstNameStringThe first name of the new user.
LastNameStringThe last name of the new user.
RoleCodeString

Set the user role for this new user. For example, YFREPORTCONSUMER.

Note: You can get a list of Yellowfin's role codes from the configured database, for example, by using a SQL query: SELECT * FROM OrgRole

EmailAddressStringEmail address of the new user.

 

Reponse 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

 

Instructions

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

Expand
titleStep-by-step instructions
  • Here's a basic request to create a new Yellowfin user:

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

 

  • If you need to create a new user in a specific client organization, add this to your code

    Code Block
    languagejava
    rsr.setOrgRef("org1");      // A new user will be added to the client org with "org1" as an organization reference ID


    If you do not define the orgRef parameter, the new user will be created in the default (primary) organization.

 

  • The ADDUSER function requires AdministrationPerson object where you define the new Yellowfin user details:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
  • To create a new user, you need to fill these mandatory parameters: UserId, FirstName, LastName, RoleCode, Password, EmailAddress:

    Code Block
    languagejava
    ap.setUserId("john.smith@yellowfin.com.au");  		// if Yellowfin authentication option is set to "email address"
    ap.setFirstName("John");
    ap.setLastName("Smith");
    ap.setRoleCode("YFREPORTCONSUMER"

 

The ADDUSER function requires AdministrationPerson object where you define the new Yellowfin user details:
Code Block
languagejava
AdministrationPerson ap = new AdministrationPerson();
To create a new user, you need to fill these mandatory parameters: UserId, FirstName, LastName, RoleCode, Password, EmailAddress:
Code Block
languagejava
ap.setUserId("john.smith@yellowfin.com.au");  		// if Yellowfin authentication option is set to "email address"
ap.setFirstName("John");
ap.setLastName("Smith");
ap.setRoleCode("YFREPORTCONSUMER");                // Yellowfin role codes can be found performing this query against 
												   // Yellowfin configuration database: SELECT * FROM OrgRole

ap.setPassword("test");                    		   // Password must comply with your Yellowfin password policy
ap.setEmailAddress("john.smith@yellowfin.com.au");

Other parameters of the AdministrationPerson object are optional.

 

Pass the 'ap' object to the request:
Code Block
languagejava
rsr.setPerson(ap);

 

Once the request is configured, carry out 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 ADDUSER function. To use it for yourself, carry out the following the steps:

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

 

Code Block
languagejava
<% /* ws_adduser.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");
  • // Yellowfin role codes can be found performing this query against 
    												   // 
provide
  • Yellowfin 
your
  • configuration 
Yellowfin
  • database: 
web
  • SELECT 
service
  • * 
admin
  • FROM 
account
  • OrgRole
    
    
rsr
  • ap.setPassword("test");                    		   // Password must comply 
//
  • with 
change
  • your 
this
  • Yellowfin 
to the password of the above account rsr.setOrgId(1); rsr.setFunction("ADDUSER"); AdministrationPerson ap = new AdministrationPerson();
  • password policy
    ap.
setUserId
  • setEmailAddress("john.smith@yellowfin.com.au");
// if Yellowfin authentication option is set to "email address" ap.setFirstName("John"); ap.setLastName("Smith"); ap.setRoleCode("YFREPORTCONSUMER"); // Yellowfin role codes can be found performing this query against // Yellowfin configuration database: SELECT * FROM OrgRole ap.setPassword("test"); // Password must comply with your Yellowfin password policy ap.setEmailAddress("john.smith@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()); } %>  

 

 

...

  • Other parameters of the AdministrationPerson object are optional.

 

  • Pass the 'ap' object to the request:

    Code Block
    languagejava
    rsr.setPerson(ap);
    

 

  • Once the request is configured, carry out 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 the following parameter:

    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 ADDUSER function. To use it for yourself, carry out the following the steps:

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

 

Code Block
languagejava
<%            
/*              ws_adduser.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 service admin account
rsr.setPassword("test");                   

...

Expand
titleADDUSERS

 

This function creates users in bulk. It is similar to the ADDUSER function, however this requires that you pass an array of AdministrationPerson objects.

Note: Ensure that you mention the proper name of this function, which is ADDUSERS.

 

Complete Example

Below is a complete example of the ADDUSER function. This example code adds two new Yellowfin users, user1@yellowfin.com.au and user2@yellowfin.com.au, in the default organization.

To use it for yourself, carry out the following the steps:

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

 

Code Block
languagejava
<%            
/*              ws_addusers.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);        // change adjustthis hostto andthe port number

AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsrpassword of the above account
rsr.setOrgId(1);
rsr.setFunction("ADDUSER");


AdministrationPerson ap = new AdministrationServiceRequestAdministrationPerson();

rsr
ap.setLoginIdsetUserId("admin@yellowfinjohn.smith@yellowfin.com.au"); 		// if Yellowfin authentication option is set to  // provide your Yellowfin web services admin account
rsr.setPassword("test");       "email address"
ap.setFirstName("John");
ap.setLastName("Smith");
ap.setRoleCode("YFREPORTCONSUMER");                // Yellowfin role codes can be found performing this query against 
												   // changeYellowfin toconfiguration thedatabase: passwordSELECT of* theFROM above account
rsr.setOrgId(1);
rsr.setFunction("ADDUSERS");

AdministrationPerson[] ap = new AdministrationPerson[2];

ap[0] = new AdministrationPerson();
ap[0].setUserId("user1@yellowfin.com.au");OrgRole

ap.setPassword("test");                      
ap[0].setFirstName("user1");
ap[0].setLastName("Lastname1");
ap[0].setRoleCode("YFREPORTCONSUMER");          
ap[0].setPassword("test");                                 
ap[0].setEmailAddress("user1@yellowfin	   // Password must comply with your Yellowfin password policy 
ap.setEmailAddress("john.smith@yellowfin.com.au");

ap[1]rsr.setPerson(ap);


AdministrationServiceResponse rs = new AdministrationPerson(adminService.remoteAdministrationCall(rsr);
ap[1].setUserId("user2@yellowfin.com.au");         
ap[1].setFirstName("user2");
ap[1].setLastName("Lastname2");
ap[1].setRoleCode("YFREPORTCONSUMER");          
ap[1].setPassword("test");                                 
ap[1].setEmailAddress("user2@yellowfin.com.au");


rsr.setPeople(ap);


AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

...



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

 

 

Anchor
addusers
addusers

Expand
titleADDUSERS

 

This function creates users in bulk. It is similar to the ADDUSER function, however this requires that you pass an array of AdministrationPerson objects.

Note: Ensure that you mention the proper name of this function, which is ADDUSERS.

 

Complete Example

Below is a complete example of the ADDUSER function. This example code adds two new Yellowfin users, user1@yellowfin.com.au and user2@yellowfin.com.au, in the default organization.

To use it for yourself, carry out the following the steps:

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

 

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

AdministrationPerson[] ap = new AdministrationPerson[2];

ap[0] = new AdministrationPerson();
ap[0].setUserId("user1@yellowfin.com.au");         
ap[0].setFirstName("user1");
ap[0].setLastName("Lastname1");
ap[0].setRoleCode("YFREPORTCONSUMER");          
ap[0].setPassword("test");                                 
ap[0].setEmailAddress("user1@yellowfin.com.au");

ap[1] = new AdministrationPerson();
ap[1].setUserId("user2@yellowfin.com.au");         
ap[1].setFirstName("user2");
ap[1].setLastName("Lastname2");
ap[1].setRoleCode("YFREPORTCONSUMER");          
ap[1].setPassword("test");                                 
ap[1].setEmailAddress("user2@yellowfin.com.au");


rsr.setPeople(ap);


AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

Anchor
addusersignoreduplicates
addusersignoreduplicates

Expand
titleADDUSERSIGNOREDUPLICATES

 

This function allows multiple users to be created, without adding duplicates. It works similarly to the ADDUSERS function, however in this case, if the login ID or email of a potential new user is already in use, or the password isn't supplied, then a 'no exceptions' error will be generated and the user will not be created. The response will contain an array of AdministrationPerson objects with failed users that were not added.

 

Request Elements

The following elements will be passed with this request:

Note: The contents of the AdministrationPerson object will be used to define the user being logged in.

Request Element

Data Type

Description

LoginId

String

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

Password

String

Password of the account used to connect to Yellowfin web services.

OrgId

Integer

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

Function

 

Web services function. Set this to "ADDUSER".

Person

AdministrationPerson

The AdministrationPerson object holding all of the new user’s details for the user creation process. See below table.

OrgRef

String

Client Org Internal Reference Id (optional). This will create a new user in the referenced Client Org. If this is not set, then the new user will be created in default (primary) org.

 

These are the mandatory parameters that you need to set in the AdministrationPerson object to create a new user:

AdministrationPerson Element

Data Type

Description

UserId

String

User ID of the user that you wish to log in. This can be the user ID or the email address, depending on the Logon ID method.

Password

String

Password of the new user. This must comply with Yellowfin's Password Policy.

FirstNameStringThe first name of the new user.
LastNameStringThe last name of the new user.
RoleCodeString

Set the user role for this new user. For example, YFREPORTCONSUMER.

Note: You can get a list of Yellowfin's role codes from the configured database, for example, by using a SQL query: SELECT * FROM OrgRole

EmailAddressStringEmail address of the new user.

 

Reponse 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

People

AdministrationPerson[]

Failed users whose accounts were not created.

 

 

Expand
titleStep-by-step instructions

...

Expand
titleADDUSERSIGNOREDUPLICATES

 

This function allows multiple users to be created, without adding duplicates. It works similarly to the ADDUSERS function, however in this case, if the login ID or email of a potential new user is already in use, or the password isn't supplied, then a 'no exceptions' error will be generated and the user will not be created. The response will contain an array of AdministrationPerson objects with failed users that were not added.

 
  • The code for this will be exactly like the ADDUSERS example. However, the function name would be different:

    Code Block
    languagejava
    rsr.setFunction("ADDUSERSIGNOREDUPLICATES");

 

  • Use this command to retrieve failed users:

    Code Block
    languagejava
    AdministrationPerson[] failed_users = rs.getPeople();

 

  • The response will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

    People

    AdministrationPerson[]

    Failed users whose accounts were not created.

 

 

 

Anchor
deleteuser
deleteuser

Expand
titleDELUSER / DELETEUSER

 

This function 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("DELETEUSER");

 

  • The function requires an AdministrationPerson object, which is used to specify which user to delete, by providing their ID (for example, their email address or another type of ID depending on the Login ID method):

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("test@yellowfin.com.au");                   // test@yellowfin.com.au should be an 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

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

  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 web services admin account
rsr.setPassword("test");                           // change to the password of the above account
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);
  • 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());
    }
    
    
    

Complete Example

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

  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 web services admin account
rsr.setPassword("test");                           // change to the password of the above account
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
titleGETUSERBYIP

This function will retrieve details of a user by their IP. It accepts the AdministrationPerson object as a parameter, which can be used to identify the user, by providing their IPID (which in the Yellowfin configuration database is the IpId field of the Person table).

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

 

  • Here is what a basic request for this call:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("GETUSERBYIP");
    
  • Then use the AdministrationPerson object to identify the user whose details are to be retrieved, by providing their IpId:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setIpId(5);                  //IpId of the admin@yellowfin.com.au account
    rsr.setPerson(ap);

     

     

  • 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.

 

  • This call's response will contain these 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

  • Use this example to display the result of this call:

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

 

Complete Example

Below is a complete example of the GETUSERBYIP function. To use it for yourself, first carry out the following the steps:

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

 

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

AdministrationPerson ap = new AdministrationPerson();

ap.setIpId(5);
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 get searched:

    Code Block
    languagejava
    rsr.setOrgRef("org1");
    
    String[] searchingCriteria = new String[] {"John","yellowfin.com.au"};
    rsr.setParameters(searchingCriteria);
    


    Searching Criteria: The GETALLUSERS function accepts an array of 2 Strings. The first string (searchingCriteria[0]) will be compared with Yellowfin database users’ first names, last names, email left or email right, using the condition LIKE ‘%John%’. The second string (searchingCriteria[1]) will be compared with email right (domain) of the Yellowfin database users.

 

  • 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 will contain the following parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

    People

    AdministrationPerson[]

    Array of objects with the users’ details.

Complete Example

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

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

 

Code Block
languagejava
<%            
/*              ws_getallusers.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");
rsr.setPassword("test");
rsr.setOrgId(1);

rsr.setFunction("GETALLUSERS");

rsr.setOrgRef("org1");

String[] searchingCriteria = new String[] {"John","yellowfin.com.au"};
rsr.setParameters(searchingCriteria);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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

 

 

...

Expand
titleVALIDATEUSER

 

This function validates a Yellowfin user. It accepts AdministrationPerson as a parameter where you can provide user ID (email address or another ID depending on the Login ID method) and password to identify the user.

The response will be SUCCESS if the user with provided details exists. Otherwise the response will return code 25 (COULD_NOT_AUTHENTICATE_USER) if the user is not valid.

 

  • Here's an example of a basic request to call this function:

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

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("john.smith@yellowfin.com.au");
    ap.setPassword("test");
    
    rsr.setPerson(ap);
    
  • You can provide a client organization reference ID if you need to validate the user of a specific organization:

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

    If the OrgRef parameter is omitted, the user will be validated against the default (primary) organization.

 

  • 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 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 complete example of the VALIDATEUSER function. To use it for yourself, carry out the following the steps:

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

 

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

AdministrationPerson ap = new AdministrationPerson();

ap.setUserId("john.smith@yellowfin.com.au");
ap.setPassword("test");

rsr.setPerson(ap);
rsr.setOrgRef("org1");

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

...

Expand
titleVALIDATEPASSWORD

 

This call validates a user's password. If the password is expired, the call will return SUCCESS as the StatusCode, otherwise it will return FAILURE. It accepts AdministrationPerson as a parameter where you can provide a user ID (email address or another ID depending on the Login ID method) and password to validate.

Keep in mind that for a freshly created user who has not yet logged into Yellowfin, the call retrieves SUCCESS meaning that their password is expired. This happens because for every new user, Yellowfin is required to reset the password at the first login.

 

  • Here is a basic 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("VALIDATEPASSWORD");
    
  • Then provide the user ID via the AdministrationPerson object:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    ap.setUserId("john.smith@yellowfin.com.au");
    ap.setPassword("test");
    
    rsr.setPerson(ap);
    



  • 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 will contain the following parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

 

 

Complete Example

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

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

 

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

AdministrationPerson ap = new AdministrationPerson();

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

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
	out.write("Password is expired");
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode() );
}
%>


 

 

...

Expand
titleCHANGEPASSWORD

This function will call the Yellowfin web service and change the password for the specified Yellowfin user. The password will be reset for a user specified through the AdministrationPerson parameter, based on their user ID (email address or another type of ID depending on the Login ID method).

 

  • This example shows a basic request for this call:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("CHANGEPASSWORD");
    
  • Specify the user using the AdministrationPerson object:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("john.smith@yellowfin.com.au");
    ap.setPassword("test123");
    rsr.setPerson(ap);
  • 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 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 complete example of the CHANGEPASSWORD function. To use it for yourself, carry out the following the steps:

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

 

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

AdministrationPerson ap = new AdministrationPerson();

ap.setUserId("john.smith@yellowfin.com.au");
ap.setPassword("test123");

rsr.setPerson(ap);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

...

Expand
titleRESETPASSWD

This function resets a user's Yellowfin account and prompts them to change their password.

Note: This call will not change the password of the account itself. To change the password, use the CHANGEPASSWORD function.

 

  • Here is what a basic request for this call will look like:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("RESETPASSWD");
    
  • Use the AdministrationPerson object to identify the user whose account is to be reset:

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

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

 

  • This call's 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

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

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

 

Code Block
languagejava
<%            
/*              ws_ resetpwd.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("RESETPASSWD");

AdministrationPerson ap = new AdministrationPerson();

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

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

 

...

Expand
titleUPDATEUSER

This call will edit a user’s details. It accepts AdministrationPerson as a parameter, which can be used to identify the user, by providing their ID (for example, their email address, or another type of ID depending on the Login ID method).

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

Note: This call will not change the password of the user's account. To change the password, use the CHANGEPASSWORD function.

 

  • Here is what a basic request for this call will look like:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("UPDATEUSER");
    
  • Then use the AdministrationPerson object to identify the user whose details are to be updated:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("john.smith@yellowfin.com.au");
  • Specify what detail is to be changed. For example:

    Code Block
    languagejava
    ap.setStutus("INACTIVE");               // This shows that the user "john.smith@yellowfin.com.au" will not be able to log in
    
    rsr.setPerson(ap);
    



  • 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.

 

  • This call's response will contain these 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

 

Complete Example

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

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

 

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


AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au");
ap.setStutus("INACTIVE");
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
titleLOGOUTUSER

 

This service terminates a Yellowfin session. However, it requires the LoginSessionId to be able to log the user out, which is enough to identify the user, hence the user ID is not required. When a single sign-on is performed with either the LOGINUSER or LOGINUSERNOPASSWORD functions, you can get the LoginSessionId via:

Code Block
languagejava
String token = response.getLoginSessionId();

 

Save this value, so that you can pass it out to the LOGOUTUSER request later:

Code Block
languagejava
request.setLoginSessionId(token);

 

 

  • Here is a basic request for this call:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("LOGOUTUSER");
  • Pass the login session ID:

    Code Block
    languagejava
    rsr.setLoginSessionId(token);
    
  • If the user is logged into multiple Tomcat sessions simultaneously, then you can even specify which session to terminate by setting a parameter, for example:

    Code Block
    languagejava
    String[] _sessionId = new String[]{sessionId}; // log out by Tomcat session Id (cookies JSESSIONID)
    rsr.setParameters(_sessionId);

    Only one session should be provided for termination per request. Note that the Tomcat session ID is optional; if omitted, Yellowfin will terminate all of the user's sessions.

  • 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.

 

  • This call's 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

Below is a complete example of the LOGOUTUSER function. This script is designed to perform the following steps:

  • Call the LOGINUSER service which retrieves the LoginSessionId;
  • Configures the login link. You will need to click this link first, to initialize a Yellowfin session for the specifed user. (In our example we will log in the user john.smith@yellowfin.com.au. Make sure that the user you mention, already exists in your Yellowfin instance, or you can even modify the userId.)
  • Configure the link to log out. You will need to click this once the session has started.

 

To use this script for yourself, carry out the following the steps:

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

 

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

String token = request.getParameter("token");

if (token == null) {
	
	//login the user:

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

	AdministrationPerson ap = new AdministrationPerson();

	String userId = "john.smith@yellowfin.com.au";

	ap.setUserId(userId);
	ap.setPassword("test");

	rsr.setPerson(ap);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		String token_ = rs.getLoginSessionId();
		out.write("Login by opening the link in a new subtab prior to Logout. The tomcat session must be initialized...");
		out.write("<BR>Login: <A href='http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "'>");
		out.write("http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "</a><br>");
		out.write("<BR>Logout: <A href='http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "'>");
		out.write("http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "</a><br>");
	} else {
		out.write("Failure");
		out.write(" Code: " + rs.getErrorCode() );
		return;
	}
} else {

	//logout the user:

	out.write("Trying to logout " + token + " session...<br>");

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

	rsr.setLoginSessionId(token);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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


 

 

...

Expand
titleLOGOUTBYUSERID

 

This service is similar to the LOGOUTUSER function in that it logs out a specified user, however this one requires either a user ID (for example, an email address or any other type of ID depending on the Login ID method) or a user IpID (that is, the value of the IpId field in the Person table in Yellowfin's database), rather than a login session ID to identify the user.

This call uses the AdministrationPerson object which is used to provide the user ID or the user IpId.

 

  • Here is a basic request for this call:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("LOGOUTBYUSERID");
  • Identify the user to log out, by passing their user ID or IpId:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    ap.setUserId(userId); 
          
    rsr.setPerson(ap);
    
  • If the user is logged into multiple Tomcat sessions simultaneously, then you can specify which session to terminate by setting a parameter, for example:

    Code Block
    languagejava
    String[] _sessionId = new String[]{sessionId}; // log out by Tomcat session Id (cookies JSESSIONID)
    rsr.setParameters(_sessionId);

    Only one session should be provided for termination per request. Note that the Tomcat session ID is optional; if omitted, Yellowfin will terminate all of the user's sessions.

  • 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.

 

  • This call's 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

Below is a complete example of the LOGOUTUSER function. This script is designed to perform the following steps:

  • Configures the login link. You will need to click this link first, to initialize a Yellowfin session for the specifed user. (In our example we will log in the user john.smith@yellowfin.com.au. Make sure that the user you mention, already exists in your Yellowfin instance, or you can even modify the userId.)
  • Configure the link to log out. You will need to click this once the session is set up.

 

To use this script for yourself, carry out the following the steps:

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

 

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


String userId = request.getParameter("userId");

if (userId == null) {

	//login the user:

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


	AdministrationPerson ap = new AdministrationPerson();

	userId = "john.smith@yellowfin.com.au";

	ap.setUserId(userId);
	ap.setPassword("test");


	rsr.setPerson(ap);
	
	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);


	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		String token_ = rs.getLoginSessionId();
		out.write("Login by opening the link in a new subtab prior to Logout. The tomcat session must be initialized...");
		out.write("<BR>Login: <A href='http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "'>");
		out.write("http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "</a><br>");

		out.write("<BR>Logout: <A href='http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "'>");
		out.write("http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "</a><br>");

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

	//logout the user:
	
	out.write("Trying to logout " + userId + " session...<br>");

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

	AdministrationPerson ap = new AdministrationPerson();
	ap.setUserId(userId);
	
	rsr.setPerson(ap);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);


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



 

 

...