Integrating Breeze with a portal
33
To determine a user’s ID, given their login name and password:
1.
Log in as the user.
2.
Call the
common-info
action.
3.
Parse the returned XML to find the value of the
user-id
attribute of the
user
tag. That value
is the user’s ID.
To check whether an entered password is correct:
1.
Log in as the user.
2.
If the status code returned is
"ok"
, the password is correct.
This procedure is the only way to check a password; for security reasons, Breeze doesn’t let you
request a user’s password from the server.
To list all the courses the user is enrolled in:
1.
Log in as the user.
2.
Call the
report-my-courses
action.
3.
Parse the returned XML and display the results. For more information about the returned
XML, see
my-courses
on page 137
.
To list all the meetings the user has signed up to attend:
1.
Log in as the user.
2.
Call the
report-my-meetings
action.
3.
Parse the returned XML and display the results. For more information about the returned
XML, see
my-meetings
on page 138
.
To display the contents of the user’s content folder:
1.
Log in as the user.
2.
Call the
sco-shortcuts
action.
This action provides the location of the root folder of the current account as well as the
locations of other folders, such as the current user’s meetings and other content.
The following code uses the same
baseurl
,
accesskey
, and
loginCookie
variables that are
set in the login code in
“Integrating Breeze with a directory service” on page 28
:
<cfhttp url="#baseurl#api/xml?action=sco-shortcuts&accesskey=#accesskey#"
method="post">
<cfhttpparam type="Cookie" name="BREEZESESSION" value="#loginCookie#">
</cfhttp>
3.
Determine the ID of the my-content folder, by searching for the appropriate
type
attribute in
the returned
sco
tags:
<cfset response= cfhttp.FileContent >
<cfset xml= XmlParse(response)>
<cfset contentScoElement= XmlSearch(xml, "//sco[@type='my-content']")>
<cfset contentSco= contentScoElement[1].XmlAttributes["sco-id"]>
Содержание BREEZE-USING THE BREEZE XML WEB SERVICES
Страница 1: ...Using the Breeze XML Web Services...
Страница 8: ...8 Contents...
Страница 12: ...12 Introduction Before You Begin...
Страница 26: ...26 Chapter 2 Working with Filters...
Страница 36: ...36 Chapter 3 Common Tasks...
Страница 112: ...112 Chapter 4 Action Reference...
Страница 186: ...186 Chapter 5 XML Results Reference...
Страница 196: ...196 Index...