Page History
...
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.
Main Export Functions
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This function returns all Yellowfin content that can be exported or imported.
Request ParametersThe following parameters should be passed with this request:
Request ExampleBelow is a SOAP XML example for this request:
Response ParametersThe returned response will contain these parameters:
Response ExampleThe service will return the below response, according to our SOAP example:
InstructionsSee below for step-by-step instructions on how to perform this call, using a Java example:
Complete ExampleBelow is a full example of this web service call. To use it for yourself, carry out the following the steps:
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.exports selected Yellowfin content into an XML file.
Request ParametersThe following parameters should be passed with this request:
The following parameters are specified in the ContentResource object to call this function:
Request ExampleBelow is a SOAP XML example for this request:
Response ParametersThe returned response will contain these parameters:
Response Example
The ReportBinaryObject array will return the following parameters with this call:
Response ExampleThe service will return the below response, The service will return the below response, according to our SOAP example:
InstructionsSee below for step-by-step instructions on how to perform this call, using a Java example:
Complete ExampleBelow is a full example of this web service call. To use it for yourself, carry out the following the steps:
|
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
This function exports selected Yellowfin content into an XML filereads a provided YFX or XML file and places specific content from it into ContentResource object that can be imported.
Request ParametersThe following parameters should be passed with this request:
The following parameters are specified in the ContentResource object to call this function: | ||||||||||||||||||||||
ContentResource Element | Data Type | Description | ||||||||||||||||||||
ResourceID | Integer | Mandatory parameter to provide internal ID of the content. | ||||||||||||||||||||
ResourceType | String | Mandatory parameter to specify the content type. Could be one of:
| ResourceUUID | String |
imported from a file. The first string is a byte array of UTF-8 string. The second is the file type, that is "YFX" or "XML". |
Request Example
Below is a SOAP XML example for this request:
Code Block | ||
---|---|---|
| ||
<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>EXPORTCONTENT</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:
|
BinaryAttachments | ReportBinaryObject[] | Object array containing details of Yellowfin's content that can be exported. See table below. |
The ReportBinaryObject array will return the following parameters with this call:
ReportBinaryObject Element | Data Type | Description |
---|---|---|
Key | String | The unique key for binary object storage for this function will be "EXPORT/XML". |
ContentType | String | The MIME type for this function will be "text/XML". |
Data | Byte[] | This array will contain the metadata of the content that can be saved into an XML file. |
Response Example
The service will return the below response, according to our SOAP example:
|
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:
|
ContentResources | ContentResource[] | Object array containing details of Yellowfin's content to be imported. |
Response Example
The service will return the below response, according to our SOAP example:
Code Block | ||
---|---|---|
| ||
|
Instructions
See below for step-by-step instructions on how to perform this call, using a Java example:
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
|
Complete Example
Below is a full example of this web service call. To use it for yourself, carry out the following the steps:
- Copy the code and save it as ws_ getimportcontent.jsp.
- Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
- Adjust the host, port, and admin user details according to your environment.
- Run http://<host>:<port>/ws_ getimportcontent.jsp from your Internet browser.
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* ws_getimportcontent.jsp | ||||
Code Block | ||||
| ||||
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/"> <return> <binaryAttachments> <contentType>text/xml</contentType> <data>PD94bFORERST1A8L.....</data> <key>EXPORTXML</key> </binaryAttachments> <errorCode>0</errorCode> <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages> <messages>Web Service Request Complete</messages> */ %> <%@ 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"); <sessionId>111efc95cc598355645e6bf8d588d80f</sessionId> <statusCode>SUCCESS<//statusCode> set to the password of the above </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:
title | Step-by-step instructions |
---|
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("EXPORTCONTENT"); |
Specify which content to export by using an object:
Code Block | ||
---|---|---|
| ||
ContentResource[] cr = new ContentResource[1];
cr[0] = new ContentResource();
cr[0].setResourceId(70058);
cr[0].setResourceType("GROUP");
cr[0].setResourceOrgId(1);
|
Place the object in your request:
Code Block | ||
---|---|---|
| ||
rsr.setContentResources(cr); |
Code Block | ||
---|---|---|
| ||
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 ReportBinaryObject. (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:
- Copy the code and save it as ws_exportcontent.jsp.
- Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
- Adjust the host, port, and admin user details according to your environment.
- Run http://<host>:<port>/ws_exportcontent.jsp from your Internet browser.
Code Block | ||||
---|---|---|---|---|
| ||||
<% /* ws_exportcontent.jsp 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){ */ %> <%@ 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 web services admin account rsr.setPassword("test"); 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()); // set to the password of the above account rsr.setOrgId(1); rsr.setFunction("EXPORTCONTENT"); // specify which dashboard to export: ContentResource[] cr = new ContentResource[1]; cr[0] = new ContentResource(); cr[0].setResourceId(70058); cr[0].setResourceType("GROUP"); cr[0].setResourceOrgId(1); rsr.setContentResources(cr); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>resourceOrgId: " + o.getResourceOrgId()); out.write("<br>resourceId: " + o.getResourceId()); out.write("<br>Success"); byte[] data = rs.getBinaryAttachments()[0].getData(<br>resourceUUID: " + o.getResourceUUID()); String} } xml = new String(data, "UTF-8");else { PrintWriter writer = new PrintWriter("/Applications/Yellowfin 7.4/YFexport.xml", "UTF-8out.write("Failure"); writerout.println(xml); writer.close(); ReportBinaryObject[] bo = rs.getBinaryAttachments(); for (ReportBinaryObject o : bo){ out.write("<br><br>Key: " + o.getKey()); out.write("<br>Content Type: " + o.getContentType()); } } else { out.write("Failure"); out.write(" Code: " + rs.getErrorCode()); } %> |
title | GETIMPORTCONTENT |
---|
write(" Code: " + rs.getErrorCode());
}
%>
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 ParametersThe following parameters should be passed with this request:
This function reads a provided YFX or XML file and places specific content from it into ContentResource object that can be imported.
Request ParametersThe following parameters should be passed with this request:
The following parameters are specified in the ContentResource object to call this function:
Request ExampleBelow is a SOAP XML example for this request:
Response ParametersThe returned response will contain these parameters:
Response ExampleThe service will return the below response, according to our SOAP example:
Response ParametersThe returned response will contain these parameters:
Response ExampleThe service will return the below response, according to our SOAP example:
InstructionsSee below for step-by-step instructions on how to perform this call, using a Java example:
Complete ExampleBelow is a full example of this web service call. To use it for yourself, carry out the following the steps:
|
Main Import Functions
Anchor | ||||
---|---|---|---|---|
|
...