Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated based on YFN-16875

...

Expand
titleASSIGNDEFAULTDASHBOARD

This function is used to assign a particular dashboard as the default dashboard for a specified user group. Use the ContentResource object to specify the dashboard and the AdministrationGroup object to identify the user group.


Request Parameters

The following parameters will be passed with this request:

Request Element

Data Type

Description

LoginId

String

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

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

Password

String

Password of the above account.

OrgId

Integer

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

Function

String

Web services function. Set this to "ASSIGNDEFAULTDASHBOARD".

GroupAdministrationGroupObject containing details of the user group. See table below.
ContentResourcesContentResource[]

Object array containing the details of the dashboard that is to be made the default one for the group. See table below.


Anchor
defaultdashag
defaultdashag

These are the main parameters that you need to set in the AdministrationGroup object for this function:

AdministrationGroup Element

Data Type

Description

GroupNameString

Name of the group that is to be assigned a default dashboard.

GroupIdIntegerUnique ID of the user group.


Anchor
defaultdashcr
defaultdashcr

These are the main parameters that you need to set in the ContentResource object for this function:

ContentResource Element

Data Type

Description

ResourceIdInteger

ID of the dashboard.

ResourceTypeStringThis must be set to the fixed value "GROUP". Any elements which do not have this value set correctly will be ignored.



Request Example

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

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteAdministrationCall>
         <arg0>
 		  <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <function>ASSIGNDEFAULTDASHBOARD</function>
            <group>
            	<groupName>Administrators</groupName>
            	<groupId>11950</groupId>
            </group>
            <contentResources>
            	<resourceId>61251</resourceId>
                <ResourceType>GROUP</ResourceType>
            </contentResources>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>



Response Parameters

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



Response Example

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

Code Block
languagexml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <sessionId>7b5510bf9919823f6067747b5d305984</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>



Instructions

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

Expand
titleStep-by-step instructions
  • Start with a basic request for this function:

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


  • Specify the group by using the AdministrationGroup object:

    Code Block
    languagejava
    AdministrationGroup administrationGroup = new AdministrationGroup();
    administrationGroup.setGroupName("Administrators");
    administrationGroup.setGroupId(11950);


  • Use the ContentResources object to specify a dashboard:

    Code Block
    languagejava
    ContentResource dashboardContentResource = new ContentResource();
    dashboardContentResource.setResourceId(61195);
    dashboardContentResource.setResourceType("GROUP");


  • Then set this object in the request:

    Code Block
    languagejava
    rsr.setContentResources(new ContentResource[] { dashboardContentResource });



  • Once the request is configured, perform the call:

    Code Block
    languagejava
    AdministrationServiceResponse rs = null;
    rs = rssbs.remoteAdministrationCall(rsr);

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


  • The response returned will contain the StatusCode parameter. See the Response Parameters table above for details.




Complete Example

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

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


Code Block
languagejava
themeEclipse
<%            
/*              ws_assigndefaultdashboard.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.*" %>
<%

AdministrationServiceResponse rs = null;
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
AdministrationServiceService ts = new AdministrationServiceServiceLocator("localhost", 8080, "/services/AdministrationService", false);
AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService();

rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(new Integer(1));
rsr.setFunction("ASSIGNDEFAULTDASHBOARD");
    
// This is the group 
AdministrationGroup administrationGroup = new AdministrationGroup();
administrationGroup.setGroupName("Administrators");
administrationGroup.setGroupId(11950);
    
rsr.setGroup(administrationGroup);

// This is the Dashboard
ContentResource dashboardContentResource = new ContentResource();
dashboardContentResource.setResourceId(61195);
dashboardContentResource.setResourceType("GROUP");
    
rsr.setContentResources(new ContentResource[] { dashboardContentResource });
    
rs = rssbs.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode())) {
    out.write("Success");
} else {
    out.write("Failure");
    out.write(rs.toString());
}
%>