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.

...

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

 Web service calls related to exporting content involve an object called ContentResource. (Refer

Main Export Functions

This process will help you navigate through the export web services, to get exportable information and reuse it for other services:

  1. Use the GETCONTENT function to retrieve all the Yellowfin content available to be exported. This will also be useful if you want to export everything.
  2. This function returns an array of ContentResource objects containing Yellowfin content details, that you can reuse in other calls to import, export, or validate details. Refer to the object definitions for more details on

...

  1. this object.
  2. You can also configure your own export list and place content definitions into the ContentResource object. The object definition will reveal what elements are required for each Yellowfin content.
  3. You need to know the object's resourceType value for each of the Yellowfin content types:

    Content typeContentResource resourceType

    Report category

    RPTCATEGORY

    Report subcategory

    RPTSUBCATEGORY

    Data source

    DATASOURCE

    View

    VIEW

    Dashboard

    GROUP

    Report

    REPORT

    Data Transformation

    ETLPROCESS

  4. Instead of manually searching for dependencies of all content types, use the GETEXPORTDEPENDENCIES function, specifying a content whose dependencies you need by storing its details in the ContentResource object.

  5. For instance, if you export one dashboard, you can include a single object into ContentResource, representing that particular dashboard. The function will return that dashboard's dependencies, including its reports, views, data sources, categories, and sub categories (there are returned in a ContentResource object array).
  6. To get an XML file with Yellowfin content, you can create an array of multiple ContentResource objects and call the EXPORTCONTENT function. You can proceed to import this file into another Yellowfin environment as well.

  7. Note:  The GETEXPORTDEPENDENCIES and EXPORTCONTENT web services do not work properly with Client Org resources. Only default org resources can be exported properly using these functions. 

 

 

 

...

Anchor
GetContent
GetContent

...

Expand
titleGETEXPORTDEPENDENCIES

This function returns all the dependencies of a specific content. The ContentResource object is used to specify the content with the help of the resource ID (which can be retrieved using the GETCONTENT call). For instance if a report is the defined content type, then the response will display its dependencies, such as the report category, sub category, data source, view, etc.

 

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 "GETEXPORTDEPENDENCIES".

OrgRefStringThis optional parameter can be used to specify a client org. ID.
ContentResourcesContentResourceObject containing metadata of the content whose dependencies are to be retrieved. See table below.

 

The following parameters are specified in the ContentResource object to call this function:

ContentResource Element

Data Type

Description

ResourceIDIntegerMandatory parameter to provide internal ID of the content.
ResourceTypeString

Mandatory parameter to specify the content type. Could be one of:

  • RPTCATEGORY
  • RPTSUBCATEGORY
  • DATASOURCE
  • VIEW
  • GROUP
  • REPORT
  • ETLPROCESS
 ResourceUUIDString This optional parameter can be used to provide the UUID of the content. 

 

Request Example

Below is a SOAP XML example for this request:

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>GETEXPORTDEPENDENCIES</function>
            <contentResources>
               <resourceId>56169</resourceId>
               <resourceType>VIEW</resourceType>
            </contentResources>          
         </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
ContentResourcesContentResource[]Object array containing metadata of the specified artifact's dependencies.

 

 

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>
            <contentResources>
               <resourceDescription/>
               <resourceId>54701</resourceId>
               <resourceName>Yellowfin Configuration Database</resourceName>
               <resourceOrgId>1</resourceOrgId>
               <resourceType>DATASOURCE</resourceType>
            </contentResources>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <sessionId>97d7f893d787daf2806a13cdfa6f09d3</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
  • Define the request for this function, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    themeConfluence
    rsr.setLoginId("admin@yellowfin.com.au"); 
    rsr.setPassword("test"); 
    rsr.setOrgId(1);
    rsr.setFunction("GETEXPORTDEPENDENCIES");
  • You may even identify a specific client organization:

    Code Block
    languagejava
    rsr.setOrgRef("org1");
    
  • Using a ContentResource object, specify details of the content whose dependencies are to be retrieved:

    Code Block
    languagejava
    ContentResource[] cr = new ContentResource[1];
     
    cr[0] = new ContentResource();
    cr[0].setResourceId(70307);
    cr[0].setResourceType("GROUP");
    cr[0].setResourceOrgId(1);



  • Then set this object in the request:

    Code Block
    languagejava
    rsr.setContentResources(cr);



  • 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 elements: StatusCode and ContentResource. (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_ getexportdependencies.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, and admin user details according to your environment.
  4. Run http://<host>:<port>/ws_ getexportdependencies.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
<%   	
/*    	ws_getexportdependecies.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.*" %>
<%@ page import="java.nio.file.Files" %>
<%@ page import="java.io.PrintWriter" %>
<%
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");                                // set to the password of the account above
rsr.setOrgId(1);
rsr.setFunction("GETEXPORTDEPENDENCIES");
 
ContentResource[] cr = new ContentResource[1];
 
cr[0] = new ContentResource();
cr[0].setResourceId(70307);
cr[0].setResourceType("GROUP");
cr[0].setResourceOrgId(1);
 
rsr.setContentResources(cr);
 
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
 
if ("SUCCESS".equals(rs.getStatusCode()) ) {
        	out.write("<br>Success");
        	ContentResource[] crs = rs.getContentResources();
        	out.write("<table>");
        	out.write("<tr><td> id </td><td> type </td><td> UUID </td></tr>");
        	for (ContentResource c: crs) {
                    	out.write("<tr>");
                    	out.write("<td>" + c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceUUID() + "</td>");
                    	out.write("</tr>");
   }
} else {
        	out.write("Failure");
        	out.write(" Code: " + rs.getErrorCode());
}
%>

 

 

 

 

Main Import Functions


 


 

 

 

Main Import Functions

The following tips will enable you to navigate through Yellowfin's import web services:

  1. 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. 
  2. You can also use Yellowfin's export feature to do this. Note, however, that a file generated via this feature will contain more content types than those currently supported by the web service API. 
  3. Note: Currently a few content types cannot be imported via web services: images, themes, storyboards, users and user groups.

 

Anchor
GetImportContent
GetImportContent

...

Expand
titleIMPORTTRANSLATION

This function imports a translation CSV file into Yellowfin. This file is generated during the content translation process when specified content is export. Along with other details, the file contains columns for other specified languages. Add the translated content in their designated column and use this function to import the file back into the system.

 

 

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 "IMPORTTRANSLATION".

BinaryDataString[]Array containing bytes that represent a translation CSV file.

  

Request Example

Below is a SOAP XML example for this request:

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>IMPORTTRANSLATION</function>
			<binaryData>-17</binaryData>
			<binaryData>-69</binaryData>
			<binaryData>-65</binaryData>
			<binaryData>85</binaryData>
			<binaryData>85</binaryData>
				...
		</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

The status relates to whether the file import was successfull or not.

 

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>11c466874bfbcdb80f5d250c97ffbd03</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
  • Define the request for this function, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    themeConfluence
    rsr.setLoginId("admin@yellowfin.com.au"); 
    rsr.setPassword("test"); 
    rsr.setOrgId(1);
    rsr.setFunction("IMPORTTRANSLATION");
  • Specify the translation CSV file to be imported:

    Code Block
    languagejava
    Path path = Paths.get("/Applications/Yellowfin 7.4/Translations - 8 Mar 2018.csv"); // existing file
    byte[] data = Files.readAllBytes(path);
     
    rsr.setBinaryData(data);
  • 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 elements: StatusCode. (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_ importtranslation.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, and admin user details according to your environment.
  4. Run http://<host>:<port>/ws_ importtranslation.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
<%   	
/*    	ws_importtranslation.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.*" %>
<%@ page import="java.nio.file.Files" %>
<%@ page import="java.nio.file.Paths" %>
<%@ page import="java.nio.file.Path" %>
<%
 
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");                                // set the password of the account above
rsr.setOrgId(1);
rsr.setFunction("IMPORTTRANSLATION");
 
Path path = Paths.get("/Applications/Yellowfin 7.4/Translations - 8 Mar 2018.csv"); 		// existing file
 
byte[] data = Files.readAllBytes(path);
 
rsr.setBinaryData(data);
 
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
        	if ("SUCCESS".equals(rs.getStatusCode()) ) {
                    	out.write("<br>Success");
        	}
        	else {
        	out.write("<br>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 get an XML file with Yellowfin content, create an array of ContentResource objects and call the EXPORTCONTENT function. You can proceed to import this file in another Yellowfin environment as well.

 

Limitations

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