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

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The web service calls categorized in this section are related to exporting and importing content. The web service API is restricted to exporting or importing the following types of content:

  • Report
  • Report category
  • Report subcategory
  • Data source
  • View
  • Dashboard
  • Transformation flow

 

Web service calls related to exporting content involve an object called ContentResource. (Refer to the object definitions for more details on this object.)  In order to import content using a web service, you would need a YFX or XML file. This is retrieved by calling the EXPORTCONTENT function, or using Yellowfin's export functionality. Note, however, that a file generated via this functionality will contain more content types, than those currently supported by the web service API.

 

 

This function returns all Yellowfin content available for export or import.

 

Request Parameters

The following parameters should be passed with this request:

Request Element

Data Type

Description

LoginId

String

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

This 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 service function. Set this to "GETCONTENT".

  

Request Example

Below is a SOAP XML example for this request:

<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>LISTSCHEDULES</function>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>

 

Response Parameters

The returned response will contain these parameters:

Response Element

Data Type

Description

StatusCode

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE
SchedulesAdministrationSchedule[]This will contain an array of AdministrationSchedule objects describing all the available schedules.

 

Response Example

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

<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>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules>
               <frequency>
                  <frequencyCode>MONDAY</frequencyCode>
                  <frequencyUnit>1</frequencyUnit>
                  <localRunTime>0</localRunTime>
                  <localTimezoneCode>AUSTRALIA/SYDNEY</localTimezoneCode>
               </frequency>
               <lastRunDateTimeGMT>2018-02-25T00:00:00+11:00</lastRunDateTimeGMT>
               <lastRunStatus>SUCCESS</lastRunStatus>
               <nextRunDateTimeGMT>2018-03-12T00:00:00+11:00</nextRunDateTimeGMT>
               <scheduleActive>true</scheduleActive>
               <scheduleDescription>Athlete</scheduleDescription>
               <scheduleUUID>75a2f5b5-162b-49b5-b197-53643f7dc0de</scheduleUUID>
            </schedules>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules>
               <frequency>
                  <frequencyCode>SATURDAY</frequencyCode>
                  <frequencyUnit>6</frequencyUnit>
                  <localRunTime>0</localRunTime>
                  <localTimezoneCode>AUSTRALIA/SYDNEY</localTimezoneCode>
               </frequency>
               <nextRunDateTimeGMT>2018-03-10T00:00:00+11:00</nextRunDateTimeGMT>
               <scheduleActive>false</scheduleActive>
               <scheduleDescription>Common Filters</scheduleDescription>
               <scheduleUUID>fa757330-b4a8-4047-9b96-745a48b1d1b7</scheduleUUID>
            </schedules>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <schedules>
               <frequency>
                  <frequencyCode>SATURDAY</frequencyCode>
                  <frequencyUnit>6</frequencyUnit>
                  <localRunTime>0</localRunTime>
                  <localTimezoneCode>AUSTRALIA/SYDNEY</localTimezoneCode>
               </frequency>
               <lastRunDateTimeGMT>2018-02-19T00:00:00+11:00</lastRunDateTimeGMT>
               <lastRunError>com.hof.util.ActionErrorsException: java.lang.NullPointerException</lastRunError>
               <lastRunStatus>FAILURE</lastRunStatus>
               <nextRunDateTimeGMT>2018-03-10T00:00:00+11:00</nextRunDateTimeGMT>
               <scheduleActive>false</scheduleActive>
               <scheduleDescription>Common Filters</scheduleDescription>
               <scheduleUUID>f732c7a4-b81a-4788-8038-6771229596c1</scheduleUUID>
            </schedules>
            <sessionId>ba906c4149a72b2f3c750467a31adf72</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:

  • Start with a basic request for this function, which includes logging in as the admin user and specifying the web service call to perform:

    AdministrationServiceRequest rsr = new AdministrationServiceRequest(); 
    
    rsr.setLoginId(this.username);
    rsr.setPassword(this.password);
    // This is the primary organization
    rsr.setOrgId(new Integer(1));
    
    rsr.setFunction("LISTSCHEDULES");
  • You may even identify a specific client organization:

    rsr.setOrgRef("org1");
    
  • Once the request is configured, perform the call:

    AdministrationServiceResponse rs = AdministrationService.remoteAdministrationCall(rsr);

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

 

  • The response will contain the following parameters: StatusCode and Schedules. (See details in the Response Parameters table above.)

     

 

 

Complete Example

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

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

 

/* 
 * LISTSCHEDULES Example. ws_listschedules.jsp
 * A more complete example can be found in ws_admin_schedule_management.jsp
 */

<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="java.text.*" %> 
<%@ page import="java.util.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="com.hof.mi.web.service.schedule.*" %>
<%@ page import="com.hof.web.form.*" %>

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

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {
	AdministrationSchedule[] schedules = rs.getSchedules();
	out.write("Loaded " + schedules.length + " schedules: <br>");
	
	for (AdministrationSchedule as: schedules) {
		out.write("Schedule " + as.getScheduleUUID() + "<br>");
	}
	
} else {
    out.write("Failure");
    out.write(" Code: " + rs.getErrorCode() );
}


 


 

 

 

 

 

 

 

 

 

Tips & Tricks

  • The basic function for exporting is GETCONTENT that returns content details in the ContentResource object, which can further be used with other web service calls to import, export or validate content.
  • Instead of searching for dependencies manually, use the GETEXPORTDEPENDENCIES to get a list of dependencies, and then pass them to another call.
  • To retrieve a Yellowfin XML file, create an array of ContentResource objects and call the EXPORTCONTENT. You can proceed to import this file in another Yellowfin environment as well.

 

Limitations

Currently the a few types of content cannot be imported via web services:  images, themes, storyboards, users and user groups.

 

 

 

 

  • No labels