ユーザーが所属するすべてのユーザーグループを取得するには、こちらの関数を使用します。これは、AdministrationPersonをパラメーターとして受け付け、ユーザーを特定します。応答には、AdministrationGroupオブジェクトの配列が含まれます。
リクエスト要素以下の要素は、こちらのリクエストとともに渡されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | Function | String | Webサービス関数です。こちらは、「GETUSERGROUPS」に設定します。 | Person | AdministrationPerson | 取得されるグループに所属するユーザーの詳細を含むオブジェクトです。注意:以下の表を参照してください。 | OrgRef | String | クライアント組織内部参照IDです(オプション)。 特定のクライアントに所属するグループを取得する場合に含めます。こちらを指定しない場合は、デフォルト組織のグループが返されます。 | Parameters | String[] | 渡されるパラメーター配列内の最初のアイテムであり、返されるAdministrationGroupオブジェクトにAdministrationGroupMemberオブジェクトを含めるかどうかを指示します。trueに設定すると、返されるグループには、すべてのメンバーの情報が含まれます。 例:「TRUE」、または「FALSE」に設定します。大文字と小文字は区別されません。 |
AdministrationPersonオブジェクトに、以下のいずれかのパラメーターを設定します。 AdministrationPerson要素 | データ型 | 説明 | UserId | String | 取得されるグループに所属するユーザーを特定するユーザーIDです。 これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 | IpId | String | 取得されるグループに所属するユーザーのIp IDです。 |
両方が設定された場合、IpIdがデフォルトで使用されます。
リクエストの例以下のSOAPの例は、こちらの呼び出しに渡すことのできるパラメーターを表示しています。 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>GETUSERGROUPS</function>
<person>
<!-- Set one of userId and ipId. If both are set, ipId will be used by default. -->
<userId>admin@yellowfin.com.au</userId>
<ipId>5</ipId>
</person>
<!-- orgRef is optional -->
<orgRef>org1</orgRef>
<parameters>
<!-- TRUE or FALSE. Case insensitive. -->
<string>true</string>
</parameters>
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答要素返される応答には、これらのパラメーターが含まれます。 応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | Groups | AdministrationGroup[] | グループの一覧です。 |
応答の例サービスは、今回のSOAPの例に基づき、以下の応答を返します。 Code Block |
---|
| <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:remoteAdministrationCallResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://webservices.web.mi.hof.com/">
<remoteAdministrationCallReturn href="#id0"/>
</ns1:remoteAdministrationCallResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:AdministrationServiceResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://service.web.mi.hof.com">
<binaryAttachments xsi:type="ns2:ArrayOfReportBinaryObject" xsi:nil="true"/>
<binaryData xsi:type="xsd:string" xsi:nil="true"/>
<client xsi:type="ns2:AdministrationClientOrg" xsi:nil="true"/>
<clients xsi:type="ns2:ArrayOfAdministrationClientOrg" xsi:nil="true"/>
<contentResources xsi:type="ns2:ArrayOfContentResource" xsi:nil="true"/>
<contentType xsi:type="xsd:string" xsi:nil="true"/>
<datasources xsi:type="ns2:ArrayOfAdministrationDataSource" xsi:nil="true"/>
<entityId xsi:type="xsd:int" xsi:nil="true"/>
<errorCode xsi:type="xsd:int">0</errorCode>
<fileName xsi:type="xsd:string" xsi:nil="true"/>
<group xsi:type="ns2:AdministrationGroup" xsi:nil="true"/>
<groups soapenc:arrayType="ns2:AdministrationGroup[1]" xsi:type="soapenc:Array">
<groups href="#id1"/></groups>
<importIssues xsi:type="ns2:ArrayOfImportIssue" xsi:nil="true"/>
<loadedDataSource xsi:type="ns2:AdministrationDataSource" xsi:nil="true"/>
<loginSessionId xsi:type="xsd:string" xsi:nil="true"/>
<messages soapenc:arrayType="soapenc:string[2]" xsi:type="soapenc:Array">
<messages xsi:type="soapenc:string">Successfully Authenticated User: admin@yellowfin.com.au</messages>
<messages xsi:type="soapenc:string">Web Service Request Complete</messages>
</messages>
<parentDashboard xsi:type="ns2:ParentDashboard" xsi:nil="true"/>
<parentDashboards xsi:type="ns2:ArrayOfParentDashboard" xsi:nil="true"/>
<parentReportGroups xsi:type="soapenc:Array" xsi:nil="true"/>
<people xsi:type="ns2:ArrayOfAdministrationPerson" xsi:nil="true"/>
<person xsi:type="ns2:AdministrationPerson" xsi:nil="true"/>
<personfavourites xsi:type="ns2:ArrayOfPersonFavourite" xsi:nil="true"/>
<queryResults xsi:type="ns2:ArrayOfReportRow" xsi:nil="true"/>
<report xsi:type="ns2:AdministrationReport" xsi:nil="true"/>
<reportGroups xsi:type="ns2:ArrayOfAdministrationReportGroup" xsi:nil="true"/>
<reportId xsi:type="xsd:int" xsi:nil="true"/>
<reports xsi:type="ns2:ArrayOfAdministrationReport" xsi:nil="true"/>
<roles xsi:type="ns2:ArrayOfAdministrationRole" xsi:nil="true"/>
<schedule xsi:nil="true"/>
<schedules xsi:type="ns3:ArrayOfAdministrationSchedule" xsi:nil="true" xmlns:ns3="http://schedule.service.web.mi.hof.com"/>
<sessionId xsi:type="xsd:string">974c65a870699f6f4059ba54c15ddc6c</sessionId>
<statusCode xsi:type="xsd:string">SUCCESS</statusCode>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:AdministrationGroup" xmlns:ns4="http://service.web.mi.hof.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<groupDescription xsi:type="xsd:string">This group contains all users with the Admin role.</groupDescription>
<groupId xsi:type="xsd:int">11950</groupId>
<groupInternalReference xsi:type="xsd:string" xsi:nil="true"/>
<groupMembers soapenc:arrayType="ns4:AdministrationGroupMember[1]" xsi:type="soapenc:Array">
<groupMembers href="#id2"/></groupMembers>
<groupName xsi:type="xsd:string">Administrators</groupName>
<groupStatus xsi:type="xsd:string" xsi:nil="true"/>
</multiRef>
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:AdministrationGroupMember" xmlns:ns5="http://service.web.mi.hof.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<internalId xsi:type="xsd:int">5</internalId>
<loginId xsi:type="xsd:string">admin@yellowfin.com.au</loginId>
</multiRef>
</soapenv:Body>
</soapenv:Envelope> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| 以下は、こちらの関数の基礎的なリクエストです。
Code Block |
---|
| AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("GETUSERGROUPS"); |
クライアント組織に特定のグループを取得する場合は、クライアント組織IDを含めます。(こちらを指定しない場合は、デフォルト(プライマリー)組織のグループが表示されます。)
Code Block |
---|
| rsr.setOrgRef("org1"); |
- AdministrationPersonオブジェクトを使用して、ユーザーID、またはip IDを提供します。
Code Block |
---|
| AdministrationPerson ap = new AdministrationPerson();
// ap.setUserId("admin@yellowfin.com.au");
ap.setIpId(1);
rsr.setPerson(ap); |
リクエストの構成が完了したら、呼び出しを実行します。
Code Block |
---|
| AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理Webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | Groups | AdministrationGroup[] | グループの一覧です。 |
- AdministrationGroup.getGroupMembers()を使用することで、各グループのメンバーを取得することができます。これは、AdministrationGroupMemberの配列を取得します。グループにメンバーとしてのユーザーロールが含まれる場合、これは取得されません。getGroupMembers()を介して、ユーザーアカウントのみが取得されます。
|
完成例以下は、GETUSERGROUPS関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_getusergroups.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_getusergroups.jsp」を実行します。
Code Block |
---|
| <%
/* ws_getusergroups.jsp */
%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.mi.web.service.AdministrationGroup" %>
<%@ page import="com.hof.mi.web.service.AdministrationGroupMember" %>
<%@ page import="com.hof.mi.web.service.AdministrationPerson" %>
<%@ page import="com.hof.mi.web.service.AdministrationServiceRequest" %>
<%@ page import="com.hof.mi.web.service.AdministrationServiceResponse" %>
<%@ page import="com.hof.mi.web.service.AdministrationServiceService" %>
<%@ page import="com.hof.mi.web.service.AdministrationServiceServiceLocator" %>
<%@ page import="com.hof.mi.web.service.AdministrationServiceSoapBindingStub" %>
<%
// Adjust host and port number
AdministrationServiceService adminServiceService = new AdministrationServiceServiceLocator(
"localhost", 8080,
"/services/AdministrationService",
false
);
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) adminServiceService.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
// Provide your Yellowfin web services admin account
rsr.setLoginId("admin@yellowfin.com.au");
// Change to the password of the above account
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("GETUSERGROUPS");
// Provide org reference if required. Default org groups will be retrieved otherwise
// rsr.setOrgRef("org1");
// Provide userId or ipId of the user
AdministrationPerson ap = new AdministrationPerson();
// Set one of userId and ipId. If both are set, ipId will be used by default.
// ap.setUserId("admin@yellowfin.com.au");
ap.setIpId(1);
rsr.setPerson(ap);
// Set the first item in the parameters array as "true" or "false" (String, case insensitive) to indicate
// whether to include AdministrationGroupMember objects in the returned AdministrationGroup objects.
// If true, the returned groups will contain the information of all their members.
rsr.setParameters(new String[]{"TRUE"});
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode())) {
out.write("Success.<br><br>Groups which the user belongs to:");
AdministrationGroup[] groups = rs.getGroups();
for (AdministrationGroup group : groups) {
out.write("<br>");
out.write("<br>Group Name: " + group.getGroupName());
out.write("<br>Group Id: " + group.getGroupId());
out.write("<br>Group Description: " + group.getGroupDescription());
out.write("<br>Group Status: " + group.getGroupStatus());
out.write("<br>Group Internal Reference: " + group.getGroupInternalReference());
// Uncomment to display the members:
out.write("<br><br>Members:<br>Login Id | Internal Id ");
for (AdministrationGroupMember member : group.getGroupMembers()) {
out.write("<br>" + member.getLoginId() + " | " + member.getInternalId());
}
}
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
out.write("<br><br>Messages:");
for (String msg : rs.getMessages()) {
out.write("<br>");
out.write(msg);
}
}
%> |
|