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
titleGETIMPORTCONTENT

This function prepares import content, by placing specified content from a reads a provided YFX or XML file and places specific content from it into a ContentResource object that can be imported.

 

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

OrgRefStringThis optional parameter can be used to specify a client org. ID.
ParameterString[]

This array contains strings with details of content that is to be imported from a file. The first string should be is a byte array of UTF-8 string. The second should be by is the file type, that is "YFX" or "XML".

String array. The first String is UTF-8 string representation of byte array.

The second String is “YFX” or “XML” depending on the file type.

 

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

 

 

Request Example

Below is a SOAP XML example for this request:

Code Block
languagexml
 

 

 

Response Parameters

The returned response will contain these parameters:

Response ContentResource Element

Data Type

Description

ResourceID

StatusCode 

IntegerMandatory 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

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE
ContentResourcesContentResource[]Object array containing details of Yellowfin's content to be imported.

 

Response Example

The service will return the below response, according to our SOAP exampleBelow is a SOAP XML example for this request:

Code Block
languagexml
 

 

 

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 details of Yellowfin's content that can be exported.

 

Response Example

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

Code Block
languagexml
 

 

 

Instructions

Instructions

See below 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("GETCONTENTGETIMPORTCONTENT");
  • You may even identify a specific client organizationSpecify the file containing data that is to be imported:

    Code Block
    languagejava
    rsr.setOrgRef("org1Path path = Paths.get("/Applications/Yellowfin 7.4/qwerty.yfx");
    
    Once the request is configured, perform the call:
    Code Block
    languagejava
    AdministrationServiceResponse rs 
    
    byte[] data = adminServiceFiles.remoteAdministrationCallreadAllBytes(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:

  • path);
    byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
    String f = new String(encodeBase64, "UTF-8");
  • Provide the extension of this file, i.e. either YFX or XML:

    Code Block
    languagejava
    rsr.setParameters(new String[]{f,"YFX"});
  • 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_ getimportcontentCopy the code and save it as ws_ getcontent.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_ getcontentgetimportcontent.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
 <%   	
/*    	ws_getimportcontent.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 web services admin account
rsr.setPassword("test");                                // set to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("GETIMPORTCONTENT");
 
Path path = Paths.get("/Applications/Yellowfin 7.4/qwerty.yfx"); 		// existing file
 
byte[] data = Files.readAllBytes(path);
byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
String f = new String(encodeBase64, "UTF-8");
 
rsr.setParameters(new String[]{f,"YFX"});
 
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
 
if ("SUCCESS".equals(rs.getStatusCode()) ) {
        	ContentResource[] cr = rs.getContentResources();
        	out.write("<br>Success");
        	for (ContentResource o : cr){
                    	out.write("<br><br>resourceType: " + o.getResourceType());
                    	out.write("<br>resourceCode: " + o.getResourceCode());
                    	out.write("<br>resourceName: " + o.getResourceName());
                    	out.write("<br>resourceDescription: " + o.getResourceDescription());
                    	out.write("<br>resourceOrgId: " + o.getResourceOrgId());
                    	out.write("<br>resourceId: " + o.getResourceId());
                    	out.write("<br>resourceUUID: " + o.getResourceUUID());
        	}
} 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.

...