Integrating Breeze with a directory service
33
Creating and managing learning paths
To create and manage learning paths, use the following APIs:
learning-path-info
,
learning-
path-update
, and
user-transcript-update
. Call
learning-path-info
to discover the
restrictions on a particular learning object that create the learning path (for example, which
learning objects must be completed, if any, before the next learning object is attempted). Call
learning-path-update
to modify the learning path by changing the prerequisite or
preassessment requirements for a particular learning object.
Integrating Breeze with a directory service
Suppose your organization uses a central repository of user information, such as Lightweight
Directory Access Protocol (LDAP). Breeze lets you import or synchronize user information from
such a directory service.
The following procedure describes the steps that your application should follow to perform this
task. This procedure assumes that if the information provided by the directory service doesn’t
match the information provided by the Breeze server, the information from the directory service
is correct and up-to-date.
To synchronize Breeze with the directory service:
1.
Log in by calling the
login
API on the Breeze server, specifying the login name and password
of an account administrator. Examine the returned HTTP headers to find the value of the
BREEZESESSION
cookie, which you need when calling subsequent APIs.
Note:
Consider creating an administrative user specifically for performing synchronizations. If you
create such a user, you should exclude it from the list of users to synchronize when you perform the
synchronization.
The following code example logs in a user and obtains the cookie value:
<cfset login="[email protected]">
<cfset password="abcdefg">
<cfset baseurl="http://breeze.example.com/">
<cfset params="action=login&login=#login#&password=
#password#">
<cfhttp url="#baseurl#api/xml?#params#" method="get">
<cfset loginHeaders= "#cfhttp.ResponseHeader#" />
<cfloop collection="#loginHeaders#" item="httpHeader">
<cfif httpHeader eq "Set-Cookie">
<cfset value= loginHeaders[httpHeader] />
<cfset cookieHeader="#value[1]#" />
<cfloop list="#cookieHeader#" index="c" delimiters=";">
<cfset cookieName= Left(c, Find('=', c)-1) />
<cfif cookieName eq "BREEZESESSION">
<cfset fullCookie= mid(c, len(cook2,
len(c)-len(cook1) />
<cfset loginCookie= Left(fullCookie, Find('.', fullCookie)-1) />
</cfif>
</cfloop>
</cfif>
</cfloop>
Содержание BREEZE 5
Страница 1: ...Breeze Integration Guide ...
Страница 40: ...40 Chapter 3 Common Tasks ...