...
Expand |
---|
title | TESTIMPORTCONTENTNOVALIDATION |
---|
|
こちらのwebサービスは、データソースの検証を行わない以外は、TESTIMPORTCONTENTと同様です。 |
コンテンツ翻訳関数
Yellowfinのコンテンツ翻訳機能は、レポートやビュー、ダッシュボードのようなコンテンツを、元々の言語から翻訳することができます。こちらに機能と翻訳プロセスについて、より詳細な情報は、こちらをクリックしてください。以下のwebサービスは、こちらの機能に関連しています。
注意:翻訳可能なコンテンツをエクスポートする前に、Yellowfin内で他の言語を定義してください。
Expand |
---|
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の例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| - 応答は、次の要素を含みます。StatusCode、BinaryData、FileName、ContentType。(より詳細な情報は、上記応答パラメーターの表を参照してください)
|
完成例以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_exporttranlationall.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_exporttranlationall.jsp」を実行します。
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());
}
%> |
|
Expand |
---|
|
こちらの関数は、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ファイルを表すbyteを含む配列です。 |
リクエストの例以下は、こちらのリクエストの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の例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| - 応答は、次の要素を含みます。StatusCode。(より詳細な情報は、上記応答パラメーターの表を参照してください)
|
完成例以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_importtranlation.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_importtranlation.jsp」を実行します。
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());
}
%> |
|