こちらの関数は、Yellowfinに新規ユーザーアカウントを作成します。こちらのサービスは、Yellowfinに接続し、指定されたユーザーのログオントークンを取得します。ユーザーは、ユーザーID(ログオンID方法に応じて、電子メールアドレス、または他のタイプのIDになります)を使用して指定されます。このトークンがYellowfinのログオンURLとともに渡されると、認証されたユーザーのログイン画面を無効にし、即座にセッションが開始されます。 リクエスト要素リクエストパラメーターLOGINUSER関数は、指定されたユーザーのYellowfinへのシングルサインオンを実行します。以下の要素は、こちらのリクエストとともに渡されます。 以下の要素は、こちらのリクエストとともに渡されます。注意:AdministrationPersonオブジェクトのコンテンツは、ログインするユーザーを定義するために使用されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | Function | String | Webサービス関数です。こちらは、「ADDUSERLOGUINUSER」に設定します。 | Person | AdministrationPerson | ユーザー作成プロセスに関する新規ユーザーの詳細のすべてを含むオブジェクトです。以下の表を参照してください。ログインするユーザーの詳細を含むAdministrationPersonオブジェクトです。注意:以下の表を参照してください。 | OrgRef | String | クライアント組織内部参照IDです(こちらの設定はオプションです)。こちらは、参照されるクライアント組織に新規ユーザーを作成します。こちらを設定しない場合、新規ユーザーはデフォルト(プライマリー)組織内に作成されます。クライアント組織内部参照IDです(こちらの設定はオプションです)。こちらは、参照されるクライアント組織に新規ユーザーを作成します。こちらを設定しない場合、ログイン先のクライアント組織を選択するために、ユーザーにクライアント組織選択ページが表示されます。 |
以下は、新規ユーザーを作成するために、「以下は、こちらの関数のために、「AdministrationPerson」オブジェクトに設定しなくてはいけない必須のパラメーターです。」オブジェクトに設定しなくてはいけない主要なパラメーターです。 AdministrationPerson 要素 | データ型 | 説明 | UserId | String | 新規ユーザーのユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。ログインするユーザーのユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 | Password | String | 新規ユーザーのパスワードです。こちらは、Yellowfinのパスワードポリシーに準拠する必要があります。 | FirstName | String | 新規ユーザーの名です。 | LastName | String | 新規ユーザーの姓です。 | RoleCode | String | 新規ユーザーのロールを設定します。例:YFREPORTCONSUMER 注意:リポジトリデータベースから、Yellowfinのロールコードの一覧を取得することができます。例:SQLクエリーを使用する場合:SELECT * FROM OrgRole | EmailAddress | String | 新規ユーザーの電子メールアドレスです。 |
リクエストの例以下のSOAP XMLの例は、この呼び出しに渡すことのできるパラメーターを表示しています。 以下の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>ADDUSER<<function>LOGINUSER</function>
<person>
<userId>binish.sheikh@yellowfin.com.au</userId> <emailAddress>binish.sheikh@yellowfin.<userId>admin@yellowfin.com.au</emailAddress>userId>
<password>admin<<password>test</password>
<firstName>Binish</firstName>
<lastName>Sheikh</lastName>
<roleCode>YFREPORTCONSUMER</roleCode>
</person>
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答パラメーター応答要素返される応答には、これらのパラメーターが含まれます。 応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | LoginSessionId | String | 一意のログイントークンです。こちらのトークンは、ユーザーをYellowfinへ直接誘導するために、ログインURLへ付加されます。 |
応答の例サービスは、今回の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><loginSessionId>689bce5624f1e5a312eb5ef7801ed9fc</loginSessionId>
<messages>Creating<messages>Successfully NewAuthenticated User: via Webservicesadmin@yellowfin.com..<au</messages>
<messages>Creating SessionBean for webservices user...</messages>
<messages>Looking up user...</messages>
<messages>Web Service Request Complete</messages>
<sessionId>8090cb7879f7d5e72eab9625772c00b5<<sessionId>c8021e27fcc2ce507ff17ec1846919a5</sessionId>
<statusCode>SUCCESS</statusCode>
</return>
</ns2:remoteAdministrationCallResponse>
</S:Body>
</S:Envelope> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| こちらは、Yellowfinの新規ユーザーを作成する基礎的なリクエストであり、管理ユーザーとしてのログインと、実行するWebサービスの呼び出しの指定を含みます。今回の例では、admin@yellowfin.com.auをweb サービス管理者ユーザーに使用するため、こちらの呼び出しに以下のリクエストを実行します。
Code Block |
---|
| AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("ADDUSERLOGINUSER"); |
特定のクライアント組織に新規ユーザーを作成する場合は、こちらをコードに追加します。LOGUINUSER関数は、ログインするユーザーを特定するために、AdministrationPersonオブジェクトを要求します。以下に例を示します。
Code Block |
---|
| rsr.setOrgRef("org1"); // AAdministrationPerson ap = new userAdministrationPerson();
will be added to the client org with "org1" as an organization reference ID | orgRefパラメーターを定義しない場合は、新規ユーザーはデフォルト(プライマリー)組織内に作成されます。
- ADDUSER関数は、新規Yellowfinユーザーの詳細を定義するために、AdministrationPersonオブジェクトを要求します。
ap.setUserId("user@yellowfin.com.au");
ap.setPassword("usertest");
rsr.setPerson(ap); |
ユーザーが複数のクライアント組織に所属する場合、特定の組織を指定してログインさせることができます。例:
Code Block |
---|
| AdministrationPerson ap = new AdministrationPerson(rsr.setOrgRef("org1"); |
新規ユーザーを作成するには、これら必須パラメーターの提供が必要です。:UserId、FirstName、LastName、RoleCode、Password、EmailAddressこの場合「org1」はクライアント組織参照IDです。この参照IDが提供されない場合、ユーザーはログインをするために、クライアント組織選択ページに誘導されます。 ユーザーアカウントがYellowfinに存在しない場合、web
Code Block |
---|
| ap.setUserId("john.smith@yellowfin.com.au"); // if Yellowfin authentication option is set to "email address"
ap.setFirstName("John");
ap.setLastName("Smith");
ap.setRoleCode("YFREPORTCONSUMER"); // Yellowfin role codes can be found performing this query against
// Yellowfin configuration database: SELECT * FROM OrgRole
ap.setPassword("test"); // Password must comply with your Yellowfin password policy
ap.setEmailAddress("john.smith@yellowfin.com.au"); |
AdministrationPersonオブジェクトのその他のパラメーターの設定はオプションです。
リクエストに「ap」オブジェクトを渡します。
Code Block |
---|
| rsr.setPerson(ap); |
- 返される応答には、StatusCodeパラメーターが含まれます。詳細については、上記の応答パラメーターの表を参照してください。
|
完成例以下は、ADDUSER関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_adduser.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じた詳細を追加するために、ホスト、ポート番号、管理ユーザー、ユーザーを調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_adduser.jsp」を実行します。
Code Block |
---|
| <%
/* ws_adduser.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 web service admin account
rsr.setPassword("test"); // change this to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("ADDUSER");
AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au"); // If Yellowfin authentication option is set to "email address"
ap.setFirstName("John");
ap.setLastName("Smith");
ap.setRoleCode("YFREPORTCONSUMER"); // Yellowfin role codes can be found performing this query against
// Yellowfin configuration database: SELECT * FROM OrgRole
ap.setPassword("test"); // Password must comply with your Yellowfin password policy
ap.setEmailAddress("john.smith@yellowfin.com.au");
rsr.setPerson(ap);
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if
("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("Success");
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
}
%> |
|