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
titleEXPORTCONTENT

This function exports selected Yellowfin content into an XML file.

 

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

OrgRefStringThis optional parameter can be used to specify a client org. ID.
ContentResourcesContentResourceObject used to specify the content that is to be exported. 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>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:

  • SUCCESS
  • FAILURE
BinaryAttachmentsReportBinaryObject[]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:

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>
            <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>
            <sessionId>111efc95cc598355645e6bf8d588d80f</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("EXPORTCONTENT");
  • Specify which content to export by using an object:

    Code Block
    languagejava
    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
    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 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:

  1. Copy the code and save it as ws_exportcontent.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_exportcontent.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
<%   	
/*    	ws_exportcontent.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 web services admin account
rsr.setPassword("test");                            // 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>Success");
        	byte[] data = rs.getBinaryAttachments()[0].getData();
        	String xml = new String(data, "UTF-8");
        	PrintWriter writer = new PrintWriter("/Applications/Yellowfin 7.4/YFexport.xml", "UTF-8");
        	writer.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());
}
%>

 


 

Define the request for this function, which includes logging in as the admin user and specifying the web service call to perform:
Expand
titleGETIMPORTCONTENTGETEXPORTDEPENDENCIES

This function reads a provided YFX or XML file and places specific content from it into ContentResource object that can be importedreturns 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 "GETIMPORTCONTENTGETEXPORTDEPENDENCIES".

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

This array contains strings with details of content that is to be 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
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 to be imported.

 

Response Example

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

Code Block
languagexml
 

 

 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
ContentResourceObject 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>
    
Code Block
languagejava
themeConfluence
rsr.setLoginId("admin@yellowfin.com.au"); 
rsr.setPassword("test"); 
rsr.setOrgId(1);
rsr.setFunction("GETIMPORTCONTENT");
  • Specify the file containing data that is to be imported:

    Code Block
    languagejava
    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
    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_ getimportcontent.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_ getimportcontent.jsp from your Internet browser.

     

    Code Block
    languagejava
    themeEclipse
    <%   	
    /*    	ws_getimportcontent.jsp        <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/>	*/
    %>
    <%@ 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){       <resourceId>54701</resourceId>
                   <resourceName>Yellowfin Configuration Database</resourceName>
       	out.write("<br><br>resourceType: " + o.getResourceType());
             <resourceOrgId>1</resourceOrgId>
               	out.write("<br>resourceCode: " + o.getResourceCode());    <resourceType>DATASOURCE</resourceType>
                </contentResources>
             	out.write("<br>resourceName: " + o.getResourceName()); <errorCode>0</errorCode>
                <messages>Successfully Authenticated       	out.write("<br>resourceDescription: " + o.getResourceDescription());User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request Complete</messages>
         	out.write("<br>resourceOrgId: " + o.getResourceOrgId());
        <sessionId>97d7f893d787daf2806a13cdfa6f09d3</sessionId>
                    	out.write("<br>resourceId: " + o.getResourceId());<statusCode>SUCCESS</statusCode>
             </return>
               	out.write("<br>resourceUUID: " + o.getResourceUUID());
            	}
    } else {
            	out.write("Failure");
            	out.write(" Code: " + rs.getErrorCode());
    }
    %>
    
    
    

     

     

    Expand
    titleGETEXPORTDEPENDENCIES
    </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");  

    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> set to the password of the account   
             </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/">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()) ) {
             <return>	out.write("<br>Success");
            	ContentResource[] crs   <contentResources>= rs.getContentResources();
            	out.write("<table>");
           <resourceDescription/>
            	out.write("<tr><td> id </td><td> type </td><td> UUID </td></tr>");
            <resourceId>54701</resourceId>
        	for (ContentResource c: crs) {
               <resourceName>Yellowfin Configuration Database</resourceName>
           	out.write("<tr>");
            <resourceOrgId>1</resourceOrgId>
                	out.write("<td>" + c.getResourceId() + <resourceType>DATASOURCE</resourceType>
                </contentResources>"</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceUUID() + "</td>");
                <errorCode>0</errorCode>
                <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>	out.write("</tr>");
       }
    } else {
           <messages>Web Service Request Complete</messages> 	out.write("Failure");
            	out.write(" Code: "  <sessionId>97d7f893d787daf2806a13cdfa6f09d3</sessionId>
                <statusCode>SUCCESS</statusCode>
             </return>
          </ns2:remoteAdministrationCallResponse>
       </S:Body>
    </S:Envelope>+ rs.getErrorCode());
    }
    %>
    
    

     


     

     

    Instructions

    ...

    Main Import Functions

     

    Define the request for this function, which includes logging in as the admin user and specifying the web service call to perform:
    Expand
    titleGETIMPORTCONTENT

    This function reads a provided YFX or XML file and places specific content from it into 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 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
    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 to be imported.

     

    Response Example

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

    Code Block
    languagexml
     

     

     

    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("GETIMPORTCONTENT");
    • Specify the file containing data that is to be imported:

      Code Block
      languagejava
      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
      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_ getimportcontent.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_ getimportcontent.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();
    
    Step-by-step instructions
    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><br>Success");
            	for (ContentResource o : cr){
                        	out.write("<td><br><br>resourceType: " + co.getResourceIdgetResourceType() + "</td><td>);
                        	out.write("<br>resourceCode: " + co.getResourceTypegetResourceCode() + "</td><td>);
                        	out.write("<br>resourceName: " + co.getResourceUUIDgetResourceName() + "</td>");
                        	out.write("</tr>");
       }
    } else {
    <br>resourceDescription: " + o.getResourceDescription());
                        	out.write("Failure");
    <br>resourceOrgId: " + o.getResourceOrgId());
                        	out.write(" Code<br>resourceId: " + rso.getErrorCodegetResourceId());
    }
    %>
    
    
     
                        	out.write("<br>resourceUUID: " + o.getResourceUUID());
            	}
    } else {
            	out.write("Failure");
            	out.write(" Code: " + rs.getErrorCode());
    }
    %>
    
    
    

     


     

    Main Import Functions

     

    Anchor
    TestImportContentimportContentTestImportContent
    importContent

    if ("SUCCESS".equals(rs.getStatusCode()) ) {
    
     
            	ImportOption[] options = new ImportOption[2];
            	options[0] = new ImportOption();
            	
    out.write("<br>Success"
    options[0].setItemIndex(0);
            	options[0].setOptionKey("OPTION");
            	
    ContentResource
    options[0]
    crs = rs.getContentResources(
    .setOptionValue("REPLACE");
            	
            	
    ImportIssue
    options[1]
    ImportIssues
     = 
    rs.getImportIssues
    new ImportOption();
            	
    out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues")
    options[1].setItemIndex(0);
            	options[1].setOptionKey("EXISTING");
            	
            	
    out.write("<table>");
    /*    	existing report Id. Can 
    out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
    be retrieved from ReportHeader table of Yellowfin database, ReportId column.
              
    for
     
    (ContentResource
     
    c:
     
    crs)
     
    {
          	keep in mind that the reportId changes each time when a user modifies the 
    out.write("<tr>");
    report.
                        	
    out.write("<td>" + c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceName() + "</td><td>" + c.getResourceUUID() + "</td>");
    You can use the GETIDFORUUID call to get the valid reportId value for the report.
            	*/
            	options[1].setOptionValue("70279");
            	
    out
    
    rsr.
    write("</tr>"
    setImportOptions(options);
     
    AdministrationServiceResponse rs1 
    } } else {
    = adminService.remoteAdministrationCall(rsr);
            	
    out.write("Failure");
    
            	
    out.write
    if ("
    Code: " + rs.getErrorCode()); }
  • The response will contain the following elements: StatusCode, ImportIssues and ContentResources. (See details in the Response Parameters table above.)

     

  • Expand
    titleTESTIMPORTCONTENTIMPORTCONTENT

    This function imports content from a an XML or YFX or XML file and then tests or validates itfile into Yellowfin.

     

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

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

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

    ImportOptionsImportOption[]This optional parameter can be used to define how content should be imported.

      

    If not specified, Yellowfin will import all the content as new, exactly how it is contained in the 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>
             <!--Optional:-->
             <arg0>
                <loginId>admin@yellowfin.com.au</loginId>
            	<password>test</password>
                <orgId>1</orgId>
                <function>TESTIMPORTCONTENT<<function>IMPORTCONTENT</function>
                <parameters>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i ... </parameters>
                <parameters>XML</parameters>
                <importOption>
              	      	<optionIndex>0</optionIndex>
                        	<optionKey>OPTION</optionKey>
                        	<optionValue>REPLACE</optionValue>
              	      	<optionIndex>1</optionIndex>
                        	<optionKey>EXISTING</optionKey>
                        	<optionValue>70279</optionValue>
                 </importOption>
              </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
    ImportIssuesImportIssue[]Object array containing issues faced while importing the file.
    ContentResourcesContentResource[]Object array containing details of Yellowfin's content to be imported.

    Note: The status corresponds to whether or not the call was performed, not if the actual import was carried out.

     

    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><errorCode>0</errorCode>
                <messages>Successfully   <resourceDescription>months, 6/3/2018 8:53 AM</resourceDescription>Authenticated User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request <resourceId>70279<Complete</resourceId>messages>
               	<resourceName>My Report 1000<<sessionId>3c25c8a81c971e26bd23d4ed60194fba</resourceName>sessionId>
               	<resourceType>REPORT< <statusCode>SUCCESS</resourceType>statusCode>
             </return>
          <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID></ns2:remoteAdministrationCallResponse>
                </contentResources>
                <errorCode>0</errorCode>
            	<importIssues>
               	<issueElements>
                  	<messageKey>error.reports.import.view</messageKey>
                  	<renderedMessage>View has not been selected.</renderedMessage>
               	</issueElements>
       </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("IMPORTCONTENT");
    • Specify the file containing data that is to be imported:

      Code Block
      languagejava
      Path path = Paths.get("/Applications/Yellowfin 7.4/YFexport.xml");
       
      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
      languagejava
      rsr.setParameters(new String[]{f,"XML"});
    • Specify how the file content should be imported:

      Code Block
      languagejava
      ImportOption[] options = new ImportOption[2];
      options[0] = new ImportOption();
      options[0].setItemIndex(0);
      options[0].setOptionKey("OPTION");
      options[0].setOptionValue("REPLACE");
              	
    <issueElements>
    • 
      options[1] = new ImportOption();
      options[1].setItemIndex(0);
      options[1].setOptionKey("EXISTING");
      options[1].setOptionValue("70279");
    • Set the import options object into the request:

      Code Block
      languagejava
      rsr.setImportOptions(options);
    • 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_ importcontent.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_ importcontent.jsp from your Internet browser.

     

    Code Block
    languagejava
    themeEclipse
    <%   	
    /*    	ws_importcontent.jsp                 <messageKey>error.reports.import.category</messageKey>
                  	<renderedMessage>Folder has not been selected.</renderedMessage>
               	</issueElements>
               	<resource>
                      <resourceDescription>months, 6/3/2018 8:53 AM</resourceDescription>
                 	 <resourceId>70279</resourceId>
                  	<resourceName>My Report 1000</resourceName>
                      <resourceType>REPORT</resourceType>
                      <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID>
               	</resource>
                </importIssues>
    */
    %>
    <%@ 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");             <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request Complete</messages>
         // set to the password of  <sessionId>ab398569ce36672e9d776c3dae3804d6</sessionId>
    the above account
    rsr.setOrgId(1);
    rsr.setFunction("IMPORTCONTENT");
     
    /*    	Yfexport.xml contains just one report with no <statusCode>SUCCESS</statusCode>dependencies
            	which can be </return>
    retrieved using an EXPORTCONTENT web  </ns2:remoteAdministrationCallResponse>
       </S:Body>
    </S:Envelope>
    
    

     

    Instructions

    See below for step-by-step instructions on how to perform this call, using a Java example:

    Path path
    service call and passing a single report id.
            	FYI. Latest Yellowfin builds do not allow export Yellowfin content WITHOUT dependencies,
            	so ImportOption in this example will not suit any YFX file.
            	You need to define proper ImportOption anyway
    */
    Path path = Paths.get("/Applications/Yellowfin 7.4/
    qwerty
    YFexport.
    yfx
    xml");
     
    
    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:

    
     
    rsr.setParameters(new String[]{f,"
    YFX
    XML"});
    Once the request is configured, perform the call:
    Expand
    titleStep-by-step instructions
    Code Block
    languagejava
    themeEclipse
    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("TESTIMPORTCONTENT");

    Specify the file containing data that is to be imported:

    Code Block
    languagejava
    Code Block
    languagejava
    Code Block
    languagejava
    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
    languagejava

     

     

    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_ testimportcontent.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_ testimportcontent.jsp from your Internet browser.

     

    <%   	
    /*    	ws_testimportcontent.jspSUCCESS".equals(rs1.getStatusCode()) ) {
                        	out.write("<br>Test Import Success");
            	}
            	else {
            	out.write("Failure");
            	out.write(" Code: " + rs1.getErrorCode());
            	}         	
     
    %>
    
    
    

     


     

    Expand
    titleIMPORTCONTENTNOVALIDATION

     

    This web service is the same as the IMPORTCONTENT, with the only difference being that it does not validate the data source.

     

    Anchor
    TestImportContent
    TestImportContent

    Expand
    titleTESTIMPORTCONTENT

    This function imports content from a YFX or XML file and then tests or validates it.

     

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

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

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

    ImportOptionsImportOption[]This optional parameter can be used to define how content should be imported.

      

    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>
             <!--Optional:-->
             <arg0>
         	*/
    %>
    <%@ 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");        <loginId>admin@yellowfin.com.au</loginId>
            	<password>test</password>
              	  <orgId>1</orgId>
      // 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()) ) {
       <function>TESTIMPORTCONTENT</function>
                <parameters>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i ... </parameters>
                <parameters>XML</parameters>
                 	out.write("<br>Success");<importOption>
            	
      	      	ContentResource[] crs = rs.getContentResources();
    <optionIndex>0</optionIndex>
                	
            	ImportIssue[] ImportIssues = rs.getImportIssues();<optionKey>OPTION</optionKey>
            	out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues"));
            	<optionValue>REPLACE</optionValue>
            	out.write("<table>");
      	      	out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
    <optionIndex>1</optionIndex>
                     	for (ContentResource c: crs) { 	<optionKey>EXISTING</optionKey>
                        	out.write("<tr>");<optionValue>70279</optionValue>
                 </importOption>
           	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());
    }
    %>
    
    

     

     

     

    Expand
    titleTESTIMPORTCONTENTNOVALIDATION

     

    This web service is the same as the TESTIMPORTCONTENT, with the only difference being that it does not validate the data source.

     

    ...

    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
    ImportIssuesImportIssue[]Object array containing issues faced while importing the file.
    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 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>months, 6/3/2018 8:53 AM</resourceDescription>
                   <resourceId>70279</resourceId>
               	<resourceName>My Report 1000</resourceName>
               	<resourceType>REPORT</resourceType>
                   <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID>
                </contentResources>
                <errorCode>0</errorCode>
            	<importIssues>
               	<issueElements>
                  	<messageKey>error.reports.import.view</messageKey>
                  	<renderedMessage>View has not been selected.</renderedMessage>
               	</issueElements>
               	<issueElements>
                      <messageKey>error.reports.import.category</messageKey>
                  	<renderedMessage>Folder has not been selected.</renderedMessage>
               	</issueElements>
               	<resource>
                      <resourceDescription>months, 6/3/2018 8:53 AM</resourceDescription>
                 	 <resourceId>70279</resourceId>
                  	<resourceName>My Report 1000</resourceName>
                      <resourceType>REPORT</resourceType>
                      <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID>
               	</resource>
                </importIssues>
                <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request Complete</messages>
                <sessionId>ab398569ce36672e9d776c3dae3804d6</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("TESTIMPORTCONTENT");
    • Specify the file containing data that is to be imported:

      Code Block
      languagejava
      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
      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. 

     

    • Then test the imported content:

      Code Block
      languagejava
      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:

    1. Copy the code and save it as ws_ testimportcontent.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_ testimportcontent.jsp from your Internet browser.

     

    Code Block
    languagejava
    themeEclipse
    <%   	
    /*    	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) {
                        	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());
    }
    %>
    
    

     


     

    Expand
    titleTESTIMPORTCONTENTNOVALIDATION

     

    This web service is the same as the TESTIMPORTCONTENT, with the only difference being that it does not validate the data source.

     

    Content Translation Functions

    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 services.

     

    Expand
    titleEXPORTTRANSLATIONALL

    This web service exports translatable content across all active views, reports, and dashboards.

     

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

      

    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>EXPORTTRANSLATIONALL</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
    ContentTypeStringType of the export file. For example, text/comma-separated-values
    FileNameStringGenerated file name.
    BinaryDataStringBase64 encoded string with translated data.

     

    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>
                <binaryData>77u/VVVJRCxUZXh0IFR5cGUsS2V5LE9yaWdpbmFsIFRleHQs ... </binaryData>
                <contentType>text/comma-separated-values</contentType>
                <errorCode>0</errorCode>
                <fileName>Translations - 10 Mar 2018.csv</fileName>
                <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request Complete</messages>
                <sessionId>4a19aa468b23ab18d3aee5c7121bcacd</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("EXPORTTRANSLATIONALL");
    • 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, BinaryData, FileName and ContentType. (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_ exporttranslationall.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_ exporttranslationall.jsp from your Internet browser.

     

    Code Block
    languagejava
    themeEclipse
    <%   	
    /*    	ws_exporttranslationall.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 web services admin account
    rsr.setPassword("test");                            // set to the password of the above account
    rsr.setOrgId(1);
    rsr.setFunction("EXPORTTRANSLATIONALL");
     
    AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
            	
            	if ("SUCCESS".equals(rs.getStatusCode()) ) {
                        	out.write("<br>Success");
                        	
                        	//response.setBinaryData(Base64.encodeBytes(pdf.getData()));
                        	
                        	String Base64encoded = rs.getBinaryData();
                        	Base64encoded = Base64encoded.replace("\n", "").replace("\r", "");
                        	
                        	byte[] bytes = Base64encoded.getBytes();
                        	byte[] decoded = java.util.Base64.getDecoder().decode(bytes);
                        	
                        	String text = new String(decoded, "UTF-8");
                        	PrintWriter writer = new PrintWriter("/Applications/Yellowfin 7.4/" + rs.getFileName(), "UTF-8");
                        	writer.println(text);
                        	writer.close();
            	}
            	else {
            	out.write("<br>Failure");
            	out.write(" Code: " + rs.getErrorCode());
            	}       	
    %>
    
    
    

     


     

    Expand
    titleTESTIMPORTCONTENT

    This function imports content from a YFX or XML file and then tests or validates it.

     

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

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

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

    ImportOptionsImportOption[]This optional parameter can be used to define how content should be imported.

      

    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>
             <!--Optional:-->
             <arg0>
                <loginId>admin@yellowfin.com.au</loginId>
            	<password>test</password>
                <orgId>1</orgId>
                <function>TESTIMPORTCONTENT</function>
                <parameters>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i ... </parameters>
                <parameters>XML</parameters>
                <importOption>
              	      	<optionIndex>0</optionIndex>
                        	<optionKey>OPTION</optionKey>
                        	<optionValue>REPLACE</optionValue>
              	      	<optionIndex>1</optionIndex>
                        	<optionKey>EXISTING</optionKey>
                        	<optionValue>70279</optionValue>
                 </importOption>
              </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
    ImportIssuesImportIssue[]Object array containing issues faced while importing the file.
    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 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>months, 6/3/2018 8:53 AM</resourceDescription>
                   <resourceId>70279</resourceId>
               	<resourceName>My Report 1000</resourceName>
               	<resourceType>REPORT</resourceType>
                   <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID>
                </contentResources>
                <errorCode>0</errorCode>
            	<importIssues>
               	<issueElements>
                  	<messageKey>error.reports.import.view</messageKey>
                  	<renderedMessage>View has not been selected.</renderedMessage>
               	</issueElements>
               	<issueElements>
                      <messageKey>error.reports.import.category</messageKey>
                  	<renderedMessage>Folder has not been selected.</renderedMessage>
               	</issueElements>

    ...

    Expand
    titleIMPORTCONTENT

    This function imports content from an XML or YFX file into Yellowfin.

     

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

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

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

    ImportOptionsImportOption[]This optional parameter can be used to define how content should be imported. If not specified, Yellowfin will import all the content as new, exactly how it is contained in the 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>
             <!--Optional:-->
             <arg0>
                <loginId>admin@yellowfin.com.au</loginId>
    	<resource>
             	<password>test</password>
             <resourceDescription>months, 6/3/2018 8:53 <orgId>1<AM</orgId>resourceDescription>
                <function>IMPORTCONTENT</function>
     	 <resourceId>70279</resourceId>
                 <parameters>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i ... </parameters>
     	<resourceName>My Report 1000</resourceName>
                      <parameters>XML<<resourceType>REPORT</parameters>resourceType>
                <importOption>
          <resourceUUID>fd3794b3-62c0-4cf8-bac0-755e68d9c41e</resourceUUID>
         	      	<optionIndex>0<</optionIndex>resource>
                </importIssues>
                <messages>Successfully Authenticated  	<optionKey>OPTION</optionKey>User: admin@yellowfin.com.au</messages>
                <messages>Web Service Request Complete</messages>
         	<optionValue>REPLACE</optionValue>
           <sessionId>ab398569ce36672e9d776c3dae3804d6</sessionId>
       	      	<optionIndex>1<<statusCode>SUCCESS</optionIndex>statusCode>
             </return>
          </ns2:remoteAdministrationCallResponse>
         	<optionKey>EXISTING</optionKey>
                        	<optionValue>70279</optionValue>
                 </importOption>
              </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

    Note: The status corresponds to whether or not the call was performed, not if the actual import was carried out.

     

    Response Example

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

    </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("TESTIMPORTCONTENT");
    • Specify the file containing data that is to be imported:

      Code Block
      languagejava
      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
      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. 

     

    • Then test the imported content:

      Code Block
      languagejava
      if ("SUCCESS".equals(rs.getStatusCode()) ) {
              	out.write("<br>Success");
    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>3c25c8a81c971e26bd23d4ed60194fba</sessionId>
    • 	
              	ContentResource[] crs 
    <statusCode>SUCCESS</statusCode>
    • = rs.getContentResources();
              
    </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("IMPORTCONTENT");
  • Specify the file containing data that is to be imported:

    Code Block
    languagejava
    Path path = Paths.get("/Applications/Yellowfin 7.4/YFexport.xml");
     
    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
    languagejava
    rsr.setParameters(new String[]{f,"XML"});
  • Specify how the file content should be imported:

    Code Block
    languagejava
    ImportOption[] options = new ImportOption[2];
    options[0] = new ImportOption();
    options[0].setItemIndex(0);
    options[0].setOptionKey("OPTION");
    options[0].setOptionValue("REPLACE");
            	
    options[1] = new ImportOption();
    options[1].setItemIndex(0);
    options[1].setOptionKey("EXISTING");
    options[1].setOptionValue("70279");
  • Set the import options object into the request:

    Code Block
    languagejava
    rsr.setImportOptions(options);
  • 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. 

  •  

     

     
    •    	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:

    1. Copy the code and save it as ws_ importcontenttestimportcontent.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_ importcontenttestimportcontent.jsp from your Internet browser.

     

    Code Block
    languagejava
    themeEclipse
    <%   	
    /*    	ws_importcontenttestimportcontent.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");                               ;     	// adjust sethost toand theport passwordnumber
    AdministrationServiceSoapBindingStub ofadminService the= above account
    rsr.setOrgId(1);
    rsr.setFunction("IMPORTCONTENT");
     
    /*    	Yfexport.xml contains just one report with no dependencies
            	which can be retrieved using an EXPORTCONTENT web service call and passing a single report id.
            	FYI. Latest Yellowfin builds do not allow export Yellowfin content WITHOUT dependencies,
    (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
     
    rsr.setLoginId("admin@yellowfin.com.au"); 				// provide your Yellowfin web services admin account
    rsr.setPassword("test");               	so ImportOption in this example will not suit any YFX file.
     	    // set to 	Youthe needpassword toof definethe proper ImportOption anyway
    */above account
    rsr.setOrgId(1);
    rsr.setFunction("TESTIMPORTCONTENT");
     
    Path path = Paths.get("/Applications/Yellowfin 7.4/YFexportwww.xmlyfx"); 			// 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,"XMLYFX"});
     
            	ImportOption[] options = new ImportOption[2];
            	options[0] = new ImportOption();
            	options[0].setItemIndex(0);
            	options[0].setOptionKey("OPTION");AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
     
    if ("SUCCESS".equals(rs.getStatusCode()) ) {
            	options[0].setOptionValueout.write("REPLACE<br>Success");
            	
            	optionsContentResource[1] crs = new ImportOptionrs.getContentResources();
            	options[1].setItemIndex(0);
            	optionsImportIssue[1].setOptionKey("EXISTING" ImportIssues = rs.getImportIssues();
            	
            	/*    	existing report Id. Can be retrieved from ReportHeader table of Yellowfin database, ReportId column.
              out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues"));
              	keep
     in mind that the reportId changes each time when a user modifies the report. 	out.write("<table>");
            	out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
        	You can use the GETIDFORUUID	for call(ContentResource toc: get the valid reportId value for the report.
     crs) {
                	*/
            	options[1].setOptionValueout.write("70279<tr>");
            	
    rsr.setImportOptions(options);
     
    AdministrationServiceResponse rs1 = adminService.remoteAdministrationCall(rsr);
                	out.write("<td>" +  	
            	if ("SUCCESS".equals(rs1.getStatusCode()) ) {c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceName() + "</td><td>" + c.getResourceUUID() + "</td>");
                        	out.write("<br>Test Import Success</tr>");
            	}
            	} else {
            	out.write("Failure");
            	out.write(" Code: " + rs1rs.getErrorCode());
            	}       	
     
    %>
    
    
    

     

     

    Expand
    titleIMPORTCONTENTNOVALIDATION

     

    This web service is the same as the IMPORTCONTENT, with the only difference being that it does not validate the data source.

     

     


     

    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.

    ...