Page History
...
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:
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:
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
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
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:
|
...
Yellowfin's Content Translation functionality allows users to translate content, such as reports, views, dashboards, etc. from a previously configured language. Click here to learn more about this feature and the translation process involved. The following web services relate to this functionality.
Note: You must have this funtionality enabled in your instance, to call these web servicesEnsure that you have defined other languages in Yellowfin before exporting translatable content.
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This web service exports translatable content across all active views, reports, and dashboards.
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 imports content from a YFX or XML file and then tests or validates ita 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 ParametersThe following parameters should be passed with this request:
Request Example
Request ExampleBelow is a SOAP XML example for Below 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 exampleInstructionsSee below for step-by-step instructions on how to perform this call, using a Java example:
InstructionsSee below for step-by-step instructions on how to perform this call, using a Java example: Expand | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("TESTIMPORTCONTENT"); |
Specify the file containing data that is to be imported:
Code Block | ||
---|---|---|
| ||
Path path = Paths.get("/Applications/Yellowfin 7.4/qwerty.yfx");
byte[] data = Files.readAllBytes(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 | ||
---|---|---|
| ||
rsr.setParameters(new String[]{f,"YFX"}); |
|
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_ importtranslation.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_ importtranslation.jsp from your Internet browser.
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* 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"); |
Code Block | ||
---|---|---|
| ||
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
Initialize the Administration web service. Click here to learn how to do this.
Then test the imported content:
Code Block | ||
---|---|---|
| ||
if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("<br>Success");
ContentResource[] crs = rs.getContentResources();
ImportIssue[] ImportIssues = rs.getImportIssues();
out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues"));
out.write("<table>");
out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
for (ContentResource c: crs) {
out.write("<tr>");
out.write("<td>" + c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceName() + "</td><td>" + c.getResourceUUID() + "</td>");
out.write("</tr>");
}
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
}
|
The response will contain the following elements: StatusCode, ImportIssues and ContentResources. (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_ testimportcontent.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_ testimportcontent.jsp from your Internet browser.
Code Block | ||||
---|---|---|---|---|
| ||||
<% /* ws_testimportcontent.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("TESTIMPORTCONTENT"); Path path = Paths.get("/Applications/Yellowfin 7.4/www.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()) ) { out.write("<br>Success"); ContentResource[] crs = rs.getContentResources(); ImportIssue[] ImportIssues = rs.getImportIssues(); out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues")); out.write("<table>"); out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>"); for (ContentResource c: crs) { // set the password of the out.write("<tr>account above rsr.setOrgId(1); rsr.setFunction("IMPORTTRANSLATION"); Path path = Paths.get("/Applications/Yellowfin 7.4/Translations - 8 out.write("<td>" + c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceName() + "</td><td>" + c.getResourceUUID() + "</td>");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("</tr><br>Success"); } } else { out.write("Failure<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 retrieve a Yellowfin 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 the a few content types of content cannot be imported via web services: images, themes, storyboards, users and user groups.
...