...
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
こちらの関数は、特定のコンテンツのすべての依存関係を返します。ContentResourceオブジェクトは、リソースID(GETCONTENTの呼び出しを使用して取得することができます)とともにコンテンツを指定するために使用します。 例えば、レポートが定義されたコンテンツタイプであれば、応答にはレポートカテゴリー、サブカテゴリー、データソース、ビューなどの依存関係が表示されます。 リクエストパラメーター以下の要素は、こちらのリクエストとともに渡されます。
以下のパラメーターは、こちらの関数を呼び出すためにContentResourceオブジェクトに指定します。
リクエストの例以下は、こちらのリクエストのSOAP XMLの例です。
応答パラメーター返される応答には、これらのパラメーターが含まれます。
応答の例サービスは、今回のSOAPの例に基づき、以下の応答を返します。
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
完成例以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
|
インポートwebサービス
Yellowfinのインポートwebサービスを使用するには、以下のヒントを参照してください。
- webサービスを使用してコンテンツをインポートするには、YFX、またはXMLファイルが必要です。これは、EXPORTCONTENT関数を呼び出すことで取得します。
- Yellowfinのエクスポート機能を使用しても取得することができます。しかし、この機能を介して生成されるファイルには、現在webサービスAPIにサポートされているコンテンツタイプよりも多くが含まれています。
- 次のコンテンツタイプは、webサービスを介してインポートすることができません。:イメージ、テーマ、ストーリーボード、ユーザー、ユーザーグループ
- エクスポートファイルを取得したら、ContentResourceオブジェクトにインポートするコンテンツを準備する、GETIMPORTCONTENT関数に渡します。
- こちらのオブジェクトの詳細を使用して、ImportOptionと呼ばれる他のオブジェクトを設定し、これをIMPORTCONTENT、またはIMPORTIMPORTCONTENTNOVALIDATION関数に渡すことで、対象のコンテンツをYellowfinにインポートします。ImportOptionは、optionKeyパラメーターを使用することで、インポートするコンテンツを指定することができます。
- インポート時に、ImportOptionオブジェクトを設定しない場合、ファイル内のすべてのコンテンツがインポートされる点に注意してください。
- インポートするコンテンツのテストや検証を行うには、TESTIMPORTCONTENT、またはTESTIMPORTCONTENTNOVALIDATIONのwebサービスを使用します(これは、実際のデータインポートは実行しません)。
- 注意:IMPORTCONTENT関数の例は、Yellowfinのインストールフォルダー(development/examples/webservices/ws_admin_import.jsp)内のImportOptionを変更するユーザーインターフェイスと連携しています。こちらのファイルを、Yellowfin/appserver/webapps/ROOTフォルダーに配置し、ホスト、ポート番号、管理ユーザーの詳細を調整します。そしてこれを、インターネットブラウザから実行します。(http://<host>:<port>/ws_admin_import.jsp)
...
title | ImportContentオブジェクトのセットアップ |
---|
インポートするコンテンツを指定するImportContentオブジェクトをセットアップするには、optionValueを提供することで、optionKeyパラメーターを定義しなくてはいけません。以下は、利用可能な組み合わせの例です。
optionKey | optionValue |
SKIP | 「true」、または「false」に設定します。 |
OPTION | 「REPLACE」、または「ADD」に設定します。 |
EXISTING | 対象のYellowfinインスタンス内の既存項目のUUIDです。 これは、「optionKey=OPTION」、と「optionValue=REPLACE」に設定することで機能します。 |
PASSWORD1 | インポート中にコンテンツを暗号化する場合のデータソースパスワードです。 |
例えば、あるYellowfinレポートを、その依存関係(データソース、ビュー、カテゴリー、サブカテゴリー)とともにエクスポートする場合、ContentResourceオブジェクト(GETIMPORTCONTENTの呼び出しにより取得します)は、以下のように表示されます。
ResourceId | ResourceType | ResourceName | ResourceUUID |
70031 | DATASOURCE | CSV | null |
70209 | VIEW | months | b974f55a-269b-4a4b-b1c6-bf9b968be723 |
null | RPTCATEGORY | Tutorial | a23c2ec6-a2fa-45c7-b5da-dcf3f02e6633 |
null | RPTSUBCATEGORY | Reports | 58834ae1-2f65-44c0-b6c3-7c9cd2f91bd5 |
70279 | REPORT | My Report | fd3794b3-62c0-4cf8-bac0-755e68d9c41e |
次に、5つのすべての項目に対して、インポートオプションを定義しなくてはいけません。ImportOptionのitemIndexパラメーターは、各ContentResource項目のindex番号に対応しているので、上記のContentResource配列の例では、次のように表示されます。
ResourceId | ResourceType | importOption itemIndex |
70031 | DATASOURCE | 0 |
70209 | VIEW | 1 |
null | RPTCATEGORY | 2 |
null | RPTSUBCATEGORY | 3 |
70279 | REPORT | 4 |
レポートを今回の例の他の既存レポートに置き換え、その他すべてのコンテンツをインポートしない場合は、ImportOptionオブジェクトの構成は、以下のようになります。
itemIndex | optionKey | optionValue | 注意 |
0 | SKIP | true | データソースはスキップされます。 |
1 | SKIP | true | ビューはスキップされます。 |
2 | SKIP | true | カテゴリーはスキップされます。 |
3 | SKIP | true | サブカテゴリーはスキップされます。 |
4 | SKIP | false | レポートはインポートされます。 |
4 | OPTION | REPLACE | 既存のレポートは、インポートされるレポートに置き換わります。 |
4 | EXISTING | 70287 | インポートされるレポートにより置き換わる、対象のYellowfin内の既存レポートのレポートIDです。 |
コンテンツを「新規」としてインポートする場合、その依存関係をImportOptionオブジェクト内で指定しなくてはいけない点に注意してください。そのため、新規レポートは、必要な依存関係(ビュー、カテゴリー、サブカテゴリー)のインポートなしにインポートすることができません(注意:エクスポートファイルから取得される依存関係を使用する代わりに、レポートの依存関係を対象環境内の既存のものと置き換える選択をすることができます)。主要なコンテンツタイプに要求される依存関係は、以下を参照してください。
コンテンツ | 要求される依存関係 |
レポート | ビュー、カテゴリー、サブカテゴリー |
ビュー | データソース |
ダッシュボード | カテゴリー、サブカテゴリー |
主要なインポート関数
...
title | GETIMPORTCONTENT |
---|
こちらの関数は、提供されるYFX、またはXMLファイルを読み、特定のコンテンツをインポート可能なContentResourceオブジェクトへ配置します。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「GETIMPORTCONTENT」に設定します。 |
OrgRef | String | こちらのオプションパラメーターは、クライアント組織IDの指定に使用することができます。 |
Parameter | String[] | こちらの配列は、ファイルからインポートされるコンテンツの詳細とStringsを含みます。最初のStringは、UTF-8 Stringのバイト配列です。次はファイルタイプであり、「YFX」、または「XML」になります。 |
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
ContenResources | ContentResource[] | インポートするYellowfinのコンテンツの詳細を含むオブジェクト配列です。 |
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
...
title | 詳細手順 |
---|
...
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("GETIMPORTCONTENT"); |
インポートするデータを含むファイルを指定します。
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サービスを初期化します。実行方法の詳細は、こちらを参照してください。
...
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
...
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* 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();
out.write("<br>Success");
for (ContentResource o : cr){
out.write("<br><br>resourceType: " + o.getResourceType());
out.write("<br>resourceCode: " + o.getResourceCode());
out.write("<br>resourceName: " + o.getResourceName());
out.write("<br>resourceDescription: " + o.getResourceDescription());
out.write("<br>resourceOrgId: " + o.getResourceOrgId());
out.write("<br>resourceId: " + o.getResourceId());
out.write("<br>resourceUUID: " + o.getResourceUUID());
}
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
}
%> |
...
title | IMPORTCONTENT |
---|
こちらの関数は、XML、またはYFXファイルからコンテンツをYellowfinへインポートします。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「IMPORTCONTENT」に設定します。 |
OrgRef | String | こちらのオプションパラメーターは、クライアント組織IDの指定に使用することができます。 |
Parameters | String[] | こちらの配列は、インポート、検証されるコンテンツの詳細とStringsを含みます。最初のStringは、UTF-8 Stringのバイト配列です。次はファイルタイプであり、「YFX」、または「XML」になります。 |
ImportOptions | ImportOption[] | こちらのオプションパラメーターは、コンテンツのインポート方法を定義するために使用することができます。こちらを指定しない場合、Yellowfinはすべてのコンテンツを新規として、ファイルに含まれるそのままの状態でインポートします。 |
リクエストの例
以下は、こちらのリクエストの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>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> |
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
注意:ステータスは、実際のインポートが実行されたかどうかに関わらず、呼び出しが実行されたかどうかに対応します。 |
応答の例
サービスは今回のSOAPの例に基づき、以下の応答を返します。
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>
<errorCode>0</errorCode>
<messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
<messages>Web Service Request Complete</messages>
<sessionId>3c25c8a81c971e26bd23d4ed60194fba</sessionId>
<statusCode>SUCCESS</statusCode>
</return>
</ns2:remoteAdministrationCallResponse>
</S:Body>
</S:Envelope> |
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
...
title | 詳細手順 |
---|
...
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("IMPORTCONTENT"); |
インポートするデータを含むファイルを指定します。
Code Block | ||||
---|---|---|---|---|
| ||||
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"); |
ファイルの拡張子を提供します。例:YFX、またはXMLのいずれかです。
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setParameters(new String[]{f,"XML"}); |
ファイル内のコンテンツのインポート方法を指定します。
Code Block | ||||
---|---|---|---|---|
| ||||
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"); |
リクエストにインポートオプションオブジェクトを設定します。
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setImportOptions(options); |
...
Code Block | ||
---|---|---|
| ||
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
...
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
...
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* ws_importcontent.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("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,
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/YFexport.xml");
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,"XML"});
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");
/* existing report Id. Can be retrieved from ReportHeader table of Yellowfin database, ReportId column.
keep in mind that the reportId changes each time when a user modifies the report.
You can use the GETIDFORUUID call to get the valid reportId value for the report.
*/
options[1].setOptionValue("70279");
rsr.setImportOptions(options);
AdministrationServiceResponse rs1 = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs1.getStatusCode()) ) {
out.write("<br>Test Import Success");
}
else {
out.write("Failure");
out.write(" Code: " + rs1.getErrorCode());
}
%> |
Expand | ||
---|---|---|
| ||
こちらのwebサービスは、データソースの検証を行わない以外は、3802028と同様です。 |
...
title | TESTIMPORTCONTENT |
---|
こちらの関数は、YFX、またはXMLファイルからインポートされる可能性のあるコンテンツのテスト、および検証を行います。この関数は、実際のデータのインポートは実行しません。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
...
LoginId
...
String
...
Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。
このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。
...
Password
...
String
...
上記アカウントのパスワードです。
...
OrgId
...
Integer
...
Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。
...
Function
...
String
...
Webサービス関数です。こちらは、「TESTIMPORTCONTENT」に設定します。
...
リクエストの例
以下は、こちらのリクエストの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の例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
...
title | 詳細手順 |
---|
...
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());
} |
...
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
...
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 | ||
---|---|---|
| ||
こちらのwebサービスは、TESTIMPORTCONTENTと同様のコンテンツインポートテストを実行しますが、TESTIMPORTCONTENTと異なり、データソースの検証は行いません。 |
コンテンツ翻訳関数
Yellowfinのコンテンツ翻訳機能は、レポートやビュー、ダッシュボードのようなコンテンツを、元の言語から翻訳することができます。こちらの機能と翻訳プロセスについて、より詳細な情報は、こちらをクリックしてください。以下のwebサービスには、翻訳されたコンテンツのエクスポートとインポートが含まれます。
注意:翻訳可能なコンテンツをエクスポートする前に、Yellowfin内で他の言語を定義してください。
...
title | EXPORTTRANSLATIONALL |
---|
こちらのwebサービスは、翻訳されたコンテンツをCSVファイルにエクスポートします。返されるデータは、すべての有効なビュー、レポート、ダッシュボードにわたる翻訳可能なコンテンツです。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「EXPORTTRANSLATIONALL」に設定します。 |
リクエストの例
以下は、こちらのリクエストの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>
<arg0>
<loginId>admin@yellowfin.com.au</loginId>
<password>test</password>
<orgId>1</orgId>
<function>EXPORTTRANSLATIONALL</function>
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
ContentType | String | エクスポートファイルのタイプです。例えば、テキストやカンマ区切り値、などが該当します。 |
FileName | String | 生成されるファイル名です。 |
BinaryData | String | 翻訳データとともにBase64でエンコードされたString |
応答の例
サービスは、今回の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>
<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> |
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
...
title | 詳細手順 |
---|
...
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("EXPORTTRANSLATIONALL"); |
...
Code Block | ||
---|---|---|
| ||
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
- 応答は、次の要素を含みます。StatusCode、BinaryData、FileName、ContentType。(より詳細な情報は、上記応答パラメーターの表を参照してください)
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
...
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* 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());
}
%> |
...
title | IMPORTTRANSLATION |
---|
こちらの関数は、Yellowfinに翻訳CSVファイルをインポートします。このファイルは、指定したコンテンツをエクスポートする際に、コンテンツ翻訳プロセス中に生成されます。他の詳細とともに、ファイルには、他に指定した言語のカラム(列)が含まれます。翻訳したコンテンツをその構成されたカラム(列)に追加し、こちらの関数を使用して、システムにファイルをインポートし直します。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「IMPORTTRANSLATION」に設定します。 |
BinaryData | String[] | 翻訳CSVファイルを表すバイトを含む配列です。 |
リクエストの例
以下は、こちらのリクエストの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>
<arg0>
<loginId>admin@yellowfin.com.au</loginId>
<password>test</password>
<orgId>1</orgId>
<function>IMPORTTRANSLATION</function>
<binaryData>-17</binaryData>
<binaryData>-69</binaryData>
<binaryData>-65</binaryData>
<binaryData>85</binaryData>
<binaryData>85</binaryData>
...
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
ステータスは、ファイルのインポートが成功したかどうかに対応します。 |
応答の例
サービスは、今回の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>
<errorCode>0</errorCode>
<messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
<messages>Web Service Request Complete</messages>
<sessionId>11c466874bfbcdb80f5d250c97ffbd03</sessionId>
<statusCode>SUCCESS</statusCode>
</return>
</ns2:remoteAdministrationCallResponse>
</S:Body>
</S:Envelope> |
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
...
title | 詳細手順 |
---|
...
Code Block | ||||
---|---|---|---|---|
| ||||
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("IMPORTTRANSLATION"); |
インポートする翻訳CSVファイルを指定します。
Code Block | ||||
---|---|---|---|---|
| ||||
Path path = Paths.get("/Applications/Yellowfin 7.4/Translations - 8 Mar 2018.csv"); // existing file
byte[] data = Files.readAllBytes(path);
rsr.setBinaryData(data); |
...
Code Block | ||
---|---|---|
| ||
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
- 応答は、次の要素を含みます。StatusCode。(より詳細な情報は、上記応答パラメーターの表を参照してください)
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
...
Code Block | ||||
---|---|---|---|---|
| ||||
<%
/* ws_importtranslation.jsp */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="java.nio.file.Files" %>
<%@ page import="java.nio.file.Paths" %>
<%@ page import="java.nio.file.Path" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin webservices admin account
rsr.setPassword("test"); // set the password of the account above
rsr.setOrgId(1);
rsr.setFunction("IMPORTTRANSLATION");
Path path = Paths.get("/Applications/Yellowfin 7.4/Translations - 8 Mar 2018.csv"); // existing file
byte[] data = Files.readAllBytes(path);
rsr.setBinaryData(data);
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("<br>Success");
}
else {
out.write("<br>Failure");
out.write(" Code: " + rs.getErrorCode());
}
%> |