...
- webサービスを使用してコンテンツをインポートするには、YFX、またはXMLファイルが必要です。これは、EXPORTCONTENT関数を呼び出すことで取得します。
- Yellowfinのエクスポート機能を使用しても取得することができます。しかし、この機能を介して生成されるファイルには、現在webサービスAPIにサポートされているコンテンツタイプよりも多くが含まれています。
- 次のコンテンツタイプは、webサービスを介してインポートすることができません。:イメージ、テーマ、ストーリーボード、ユーザー、ユーザーグループ
- エクスポートファイルを取得したら、ContentResourceオブジェクトにインポートするコンテンツを準備する、GETIMPORTCONTENT関数に渡します。
- こちらのオブジェクトの詳細を使用して、ImportOptionと呼ばれる他のオブジェクトを設定し、これをIMPORTCONTENT、またはIMPORTIMPORTCONTENTNOVALIDATION関数に渡すことで、対象のコンテンツをYellowfinにインポートします。ImportOptionは、optionKeyパラメーターを使用することで、インポートするコンテンツを指定することができます。
- インポート時に、ImportOptionオブジェクトを設定しない場合、ファイル内のすべてのコンテンツがインポートされる点に注意してください。
- インポートするコンテンツのテストや検証を行うには、TESTIMPORTCONTENT、またはTESTIMPORTCONTENTNOVALIDATIONのwebサービスを使用します。インポートするコンテンツのテストや検証を行うには、TESTIMPORTCONTENT、またはTESTIMPORTCONTENTNOVALIDATIONのwebサービスを使用します(これは、実際のデータインポートは実行しません)。
- 注意:IMPORTCONTENT関数の例は、Yellowfinのインストールフォルダー(development/examples/webservices/ws_admin_import.jsp)内のImportOptionを変更するユーザーインターフェイスと連携しています。こちらのファイルを、Yellowfin/appserver/webapps/ROOTフォルダーに配置し、ホスト、ポート番号、管理ユーザーの詳細を調整します。そしてこれを、インターネットブラウザから実行します。(http://<host>:<port>/ws_admin_import.jsp)
...
Anchor |
---|
| TESTIMPORTCONTENT |
---|
| TESTIMPORTCONTENT |
---|
|
Expand |
---|
|
こちらの関数は、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」に設定します。 | OrgRef | String | こちらのオプションパラメーターは、クライアント組織IDの指定に使用することができます。 | Parameter | String[] | こちらの配列は、インポート、検証されるコンテンツの詳細とStringsを含みます。最初のStringは、UTF-8 Stringのバイト配列です。次はファイルタイプであり、「YFX」、または「XML」になります。 | ImportOptions | ImportOption[] | こちらのオプションパラメーターは、コンテンツのインポート方法を定義するために使用することができます。 |
リクエストの例以下は、こちらのリクエストのSOAP XMLの例です。 Code Block |
---|
| <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
<soapenv:Header/>
<soapenv:Body>
<web:remoteAdministrationCall>
<!--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サービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | ImportIssues | ImportIssue[] | ファイルインポート中に発生した問題を含むオブジェクト配列です。 | ContentResources | ContentResource[] | インポートするYellowfinのコンテンツの詳細を含むオブジェクト配列です。 |
応答の例サービスは、今回のSAOPの例に基づき、以下の応答を返します。 Code Block |
---|
| <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
<return>
<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 |
---|
| 管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数の基礎的なリクエストから開始します。
Code Block |
---|
| rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("TESTIMPORTCONTENT"); |
インポートするデータを含むファイルを指定します。
Code Block |
---|
| Path path = Paths.get("/Applications/Yellowfin 7.4/qwerty.yfx");
byte[] data = Files.readAllBytes(path);
byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
String f = new String(encodeBase64, "UTF-8"); |
ファイルの拡張子を提供します。例:YFX、またはXMLのいずれかです。
Code Block |
---|
| rsr.setParameters(new String[]{f,"YFX"}); |
リクエストを構成したら、呼び出しを実行します。
Code Block |
---|
| AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
インポートしたコンテンツをテストします。
Code Block |
---|
| if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("<br>Success");
ContentResource[] crs = rs.getContentResources();
ImportIssue[] ImportIssues = rs.getImportIssues();
out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues"));
out.write("<table>");
out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
for (ContentResource c: crs) {
out.write("<tr>");
out.write("<td>" + c.getResourceId() + "</td><td>" + c.getResourceType() + "</td><td>" + c.getResourceName() + "</td><td>" + c.getResourceUUID() + "</td>");
out.write("</tr>");
}
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
} |
- 応答は、次の要素を含みます。StatusCode、ImportIssues、ContentResources。(より詳細な情報は、上記応答パラメーターの表を参照してください)
|
完成例以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_testimportcontent.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_testimportcontent.jsp」を実行します。
Code Block |
---|
| <%
/* ws_testimportcontent.jsp */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="java.nio.file.Files" %>
<%@ page import="java.nio.file.Paths" %>
<%@ page import="java.nio.file.Path" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin web services admin account
rsr.setPassword("test"); // set to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("TESTIMPORTCONTENT");
Path path = Paths.get("/Applications/Yellowfin 7.4/www.yfx"); // existing file
byte[] data = Files.readAllBytes(path);
byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
String f = new String(encodeBase64, "UTF-8");
rsr.setParameters(new String[]{f,"YFX"});
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("<br>Success");
ContentResource[] crs = rs.getContentResources();
ImportIssue[] ImportIssues = rs.getImportIssues();
out.write("<br>Import Issues: " + (ImportIssues!=null?ImportIssues.length:"no issues"));
out.write("<table>");
out.write("<tr><td> ResourceId </td><td> ResourceType </td><td> ResourceName </td><td> ResourceUUID </td></tr>");
for (ContentResource c: crs) {
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 |
---|
title | TESTIMPORTCONTENTNOVALIDATION |
---|
|
こちらのwebサービスは、データソースの検証を行わない以外は、こちらのwebサービスは、TESTIMPORTCONTENTと同様です。と同様のコンテンツインポートテストを実行しますが、TESTIMPORTCONTENTと異なり、データソースの検証は行いません。 |
コンテンツ翻訳関数
Yellowfinのコンテンツ翻訳機能は、レポートやビュー、ダッシュボードのようなコンテンツを、元の言語から翻訳することができます。こちらの機能と翻訳プロセスについて、より詳細な情報は、こちらをクリックしてください。以下のwebサービスには、翻訳されたコンテンツのエクスポートとインポートが含まれます。
...