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
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 webservices admin account
rsr.setPassword("test");                           // change to be the password of the account above
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 ID (email address or Id another ID depending on the Logon Login ID method) and password to validate.

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

 

 

 

 

 

 

 

Manipulating User Information

A user's details can be modified at a later time using a web service call. The User ID field in the AdministrationPerson object is used to identify the user, so this cannot be changed. The rest of the fields within an AdministrationPerson object are populated with the new changes. For security reasons, the user's password cannot be changed with this web service call, but with a separate CHANGEPASSWORD function (below).

 

These are the parameters that you can set in the AdministrationPerson object:

  • 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

Expand
titleUPDATEUSER

The following code will call the Yellowfin web service to edit a user’s details:

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

person.setUserId("testuser");
person.setFirstName("John");
person.setLastName("Doe");
person.setInitial("F");
person.setSalutationCode("MR");
person.setRoleCode("YFADMIN");
person.setEmailAddress("testuser@yellowfin.com.au")

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

rs = AdministrationService.remoteAdministrationCall(rsr);

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 update a specified Yellowfin user’s details. The details in the AdministrationPerson object will be used in the update process.

Request
  • Element

    Data Type

    Description

LoginId
  • StatusCode

    String

Login ID
  • Status 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 = “UPDATEUSER”

 

Web services function

Person

AdministrationPerson

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

AdministrationPerson Element

Data Type

Description

UserId

String

User ID of the Yellowfin user. This can be the user ID or the email address, depending on the Logon ID method

Password

String

Password of the Yellowfin user

FirstName

String

First name of of the Yellowfin user

LastName

String

Last name of of the Yellowfin user

Initial

String

Middle name of the Yellowfin user

SalutationCode

String

Title of the Yellowfin user. Possible values include:

  • DR
  • MISS
  • MR
  • MRS
  • MS

RoleCode

String

Yellowfin role. The specified role here can be the Org Reference Code (YFADMIN) or the name of the role (Yellowfin Administrator)

EmailAddress

String

Email address of the Yellowfin user

LanguageCode

String

Two letter code for the preferred language

IpId

Integer

Internal Yellowfin IP ID

TimeZoneCode

String

The TimeZoneCode of the Yellowfin user. See appendix for valid values.

StatusString

Indicates a user status. Can be one of the following:

  • ACTIVE
  • INACTIVE
  • INACTIVEWITHEMAIL

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 updated user’s details

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


 

 

 

 

Manipulating User Information

A user's details can be modified at a later time using a web service call. The User ID field in the AdministrationPerson object is used to identify the user, so this cannot be changed. The rest of the fields within an AdministrationPerson object are populated with the new changes. For security reasons, the user's password cannot be changed with this web service call, but with a separate CHANGEPASSWORD function (below).

 

Anchor
changepassword
changepassword

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE
    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 webservices admin account
    rsr.setPassword("test");                           // change to be the password of the account above
    rsr.setOrgId(1);
    rsr.setFunction("CHANGEPASSWORD");
    
    AdministrationPerson ap
    Expand
    titleCHANGEPASSWORD

    The following code will call the Yellowfin web service and change the password for the specified Yellowfin user:

    Code Block
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    AdministrationServiceResponse rs = null;
    AdministrationPerson person = new AdministrationPerson();
    
    personap.setUserId("test@yellowfinjohn.smith@yellowfin.com.au");
    personap.setPassword("testtesttest123");
    
    rsr.setLoginIdsetPerson(this.usernameap);
    rsr.setPassword(this.password);
    rsr.setOrgId(new Integer(1));
    rsr.setFunction("CHANGEPASSWORD");
    rsr.setPerson(person);
    
    
    AdministrationServiceResponse rs = AdministrationServiceadminService.remoteAdministrationCall(rsr);
    
    The code will return SUCCESS in
    
    if ("SUCCESS".equals(rs.getStatusCode(
    ), otherwise it will return an error explaining why the process failed.

    This function will change a specified Yellowfin user’s password.

    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 = “CHANGEPASSWORD”

     

    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

    UserId

    String

    User ID of the Yellowfin user. This can be the user ID or the email address, depending on the Logon ID method

    Password

    String

    New password of the Yellowfin user

    The response returned will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

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