30日間の無料評価版をお試しいただけます。

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

インポートwebサービス


Styleclass
ClasstopLink

ページトップ

Yellowfinのインポートwebサービスを使用するには、以下のヒントを参照してください。

...

  1. webサービスを使用してコンテンツをインポートするには、YFX、またはXMLファイルが必要です。これは、EXPORTCONTENT関数を呼び出すことで取得します。
    • Yellowfinのエクスポート機能を使用しても取得することができます。しかし、この機能を介して生成されるファイルには、現在webサービスAPIにサポートされているコンテンツタイプよりも多くが含まれています。
    • 次のコンテンツタイプは、webサービスを介してインポートすることができません。:イメージ、テーマ、ストーリーボード、ユーザー、ユーザーグループ
  2. エクスポートファイルを取得したら、ContentResourceオブジェクトにインポートするコンテンツを準備する、GETIMPORTCONTENT関数に渡します。
  3. こちらのオブジェクトの詳細を使用して、ImportOptionと呼ばれる他のオブジェクトを設定し、これをIMPORTCONTENT、またはIMPORTIMPORTCONTENTNOVALIDATION関数に渡すことで、対象のコンテンツをYellowfinにインポートします。ImportOptionは、optionKeyパラメーターを使用することで、インポートするコンテンツを指定することができます。
  4. インポート時に、ImportOptionオブジェクトを設定しない場合、ファイル内のすべてのコンテンツがインポートされる点に注意してください。
  5. インポートするコンテンツのテストや検証を行うには、TESTIMPORTCONTENT、またはTESTIMPORTCONTENTNOVALIDATIONのwebサービスを使用します。インポートするコンテンツのテストや検証を行うには、TESTIMPORTCONTENT、またはTESTIMPORTCONTENTNOVALIDATIONのwebサービスを使用します(これは、実際のデータインポートは実行しません)。
  6. 注意:IMPORTCONTENT関数の例は、Yellowfinのインストールフォルダー(development/examples/webservices/ws_admin_import.jsp)内のImportOptionを変更するユーザーインターフェイスと連携しています。こちらのファイルを、Yellowfin/appserver/webapps/ROOTフォルダーに配置し、ホスト、ポート番号、管理ユーザーの詳細を調整します。そしてこれを、インターネットブラウザから実行します。(http://<host>:<port>/ws_admin_import.jsp)

...

Expand
titleIMPORTCONTENTNOVALIDATION

こちらのwebサービスは、データソースの検証を行わない以外は、IMPORTCONTENT3802028と同様です。

Anchor
TESTIMPORTCONTENT
TESTIMPORTCONTENT

Expand
titleTESTIMPORTCONTENT

こちらの関数は、YFX、またはXMLファイルからコンテンツをインポートし、テスト、または検証を行います。こちらの関数は、YFX、またはXMLファイルからインポートされる可能性のあるコンテンツのテスト、および検証を行います。この関数は、実際のデータのインポートは実行しません。


リクエストパラメーター

以下の要素は、こちらのリクエストとともに渡されます。

リクエスト要素データ型説明

LoginId

String

Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。

このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。

Password

String

上記アカウントのパスワードです。

OrgId

Integer

Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。

Function

String

Webサービス関数です。こちらは、「TESTIMPORTCONTENT」に設定します。

OrgRefStringこちらのオプションパラメーターは、クライアント組織IDの指定に使用することができます。
ParameterString[]こちらの配列は、インポート、検証されるコンテンツの詳細とStringsを含みます。最初のStringは、UTF-8 Stringのバイト配列です。次はファイルタイプであり、「YFX」、または「XML」になります。
ImportOptionsImportOption[]こちらのオプションパラメーターは、コンテンツのインポート方法を定義するために使用することができます。


リクエストの例

以下は、こちらのリクエストのSOAP XMLの例です。

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> 


応答パラメーター

返される応答には、これらのパラメーターが含まれます。

応答要素データ型説明

StatusCode

String

Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。

  • SUCCESS
  • FAILURE
ImportIssuesImportIssue[]

ファイルインポート中に発生した問題を含むオブジェクト配列です。

ContentResourcesContentResource[]インポートするYellowfinのコンテンツの詳細を含むオブジェクト配列です。

  

応答の例

サービスは、今回のSAOPの例に基づき、以下の応答を返します。

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>


手順

Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。

Expand
title詳細手順
  • 管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数の基礎的なリクエストから開始します。

    Code Block
    languagejava
    themeEclipse
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    rsr.setFunction("TESTIMPORTCONTENT");


  • インポートするデータを含むファイルを指定します。


    Code Block
    languagejava
    themeEclipse
    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");


  • ファイルの拡張子を提供します。例:YFX、またはXMLのいずれかです。


    Code Block
    languagejava
    themeEclipse
    rsr.setParameters(new String[]{f,"YFX"});


  • リクエストを構成したら、呼び出しを実行します。

    Code Block
    languagejava
    AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

    管理webサービスを初期化します。実行方法の詳細は、こちらを参照してください。


  • インポートしたコンテンツをテストします。


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


  • 応答は、次の要素を含みます。StatusCode、ImportIssues、ContentResources。(より詳細な情報は、上記応答パラメーターの表を参照してください)



完成例

以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。

  1. コードをコピーして、「ws_testimportcontent.jsp」として保存します。
  2. root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
  3. 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
  4. インターネットブラウザから、「http://<host>:<port>/ws_testimportcontent.jsp」を実行します。

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

こちらのwebサービスは、データソースの検証を行わない以外は、こちらのwebサービスは、TESTIMPORTCONTENTと同様です。と同様のコンテンツインポートテストを実行しますが、TESTIMPORTCONTENTと異なり、データソースの検証は行いません。





コンテンツ翻訳関数


Styleclass
ClasstopLink

ページトップ

Yellowfinのコンテンツ翻訳機能は、レポートやビュー、ダッシュボードのようなコンテンツを、元の言語から翻訳することができます。こちらの機能と翻訳プロセスについて、より詳細な情報は、こちらをクリックしてください。以下のwebサービスには、翻訳されたコンテンツのエクスポートとインポートが含まれます。

...

horizontalrule

Styleclass
ClasstopLink

ページトップ