- Created by Yellowfin Admin on Mar 28, 2018
You are viewing an old version of this page. View the current version.
Compare with Current View Version History
Version 1 Next »
こちらの関数は、Yellowfinで利用可能なすべてのユーザーロールを返します。応答は、利用可能なロールを表示する、AdministrationRoleオブジェクトの配列を含みます。
リクエスト要素
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「LISTROLES」に設定します。 |
リクエストの例
以下のSOAPの例は、この呼び出しに渡すことのできるパラメーターを表示しています。
<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>LISTROLES</function> </arg0> </web:remoteAdministrationCall> </soapenv:Body> </soapenv:Envelope>
応答要素
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービスの呼び出しのステータスです。値の選択肢は、以下の通りです。
|
Roles | AdministrationRole[] | ロールの一覧です。 |
応答の例
サービスは、今回のSOAPの例に基づき、以下の応答を返します。
<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> <roles> <functions> <accessLevelCode>CRUD</accessLevelCode> <functionCode>ACTIVITYSTREAM</functionCode> <functionDescription>Allows users to access the activity stream.</functionDescription> <functionName>Activity Stream</functionName> </functions> <functions> <accessLevelCode>CRUD</accessLevelCode> <functionCode>TIMELINE</functionCode> <functionDescription>Allows users to access their timeline.</functionDescription> <functionName>Timeline</functionName> </functions> <functions> <accessLevelCode>CRUD</accessLevelCode> <functionCode>BROADCASTSUBSCRIBE</functionCode> <functionDescription>Allows users to subscribe to report broadcasts.</functionDescription> <functionName>Subscribe to Broadcast</functionName> </functions> <functions> <accessLevelCode>R</accessLevelCode> <functionCode>STORYBOARD</functionCode> <functionDescription>Allows users to view, create, edit or delete Storyboards.</functionDescription> <functionName>Storyboard</functionName> </functions> <functions> <accessLevelCode>R</accessLevelCode> <functionCode>DASHPUBLIC</functionCode> <functionDescription>Allows users to create and edit Public dashboards.</functionDescription> <functionName>Public Dashboards</functionName> </functions> <functions> <accessLevelCode>CRUD</accessLevelCode> <functionCode>TASKPERSONAL</functionCode> <functionDescription>Allow users to create and assign tasks to themselves.</functionDescription> <functionName>Personal Tasks</functionName> </functions> . . . <roleCode>YFADMIN</roleCode> <roleDescription>This user has the widest range of access to the system, and as such you should have a very limited number of people assigned this role. They can do everything from create content through to managing system tasks.</roleDescription> <roleName>System Administrator</roleName> </roles> <sessionId>4f86f0e30e30bf4b07dea21267de0a74</sessionId> <statusCode>SUCCESS</statusCode> </return> </ns2:remoteAdministrationCallResponse> </S:Body> </S:Envelope>
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
以下は、こちらの関数の基礎的なリクエストです。
AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(1); rsr.setFunction("LISTROLES");
リクエストを構成したら、呼び出しを実行します。
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
管理サービスを初期化します。実行方法の詳細は、こちらを参照してください。
返される応答には、これらのパラメーターが含まれます。
応答要素 データ型 説明 StatusCode
String
Webサービスの呼び出しのステータスです。値の選択肢は、以下の通りです。
- SUCCESS
- FAILURE
Roles AdministrationRole[] ロールの一覧です。
完成例
以下は、LISTROLES関数の完成例です。こちらを使用するには、以下の手順に従います。
- コードをコピーして、「ws_listroles.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_listroles.jsp」を実行します。
<% /* ws_listroles.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.*" %> <% 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"); // change to be the password of the account above rsr.setOrgId(1); rsr.setFunction("LISTROLES"); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("Success.<br>Available Roles:"); AdministrationRole[] roles = rs.getRoles(); for (AdministrationRole role: roles){ out.write("<br>"); out.write("<br>Role Name: " + role.getRoleName()); out.write("<br>Role Code: " + role.getRoleCode()); out.write("<br>Role Description: " + role.getRoleDescription()); // uncomment to display all the security functions: /* out.write("<br>Function Name | Code | Description | TypeCode | AccessLevelCode"); for (AdministrationFunction f: role.getFunctions()){ out.write("<br>" + f.getFunctionName() + " | " + f.getFunctionCode() + " | " + f.getFunctionDescription() + " | " + f.getFunctionTypeCode() + " | " + f.getAccessLevelCode()); } */ } } else { out.write("Failure"); out.write(" Code: " + rs.getErrorCode()); } %>
- No labels