32
Chapter 3: Common Tasks
10.
For each user whose information in Breeze must be updated, obtain the user’s ID, as follows:
a
Examine the data returned by the
principal-list
action in steps 2 through 4 and search
for the ID associated with the user’s login.
b
Obtain the user’s old first name and last name by calling the
principal-info
action.
c
Change the values as needed to match the name given by the directory service.
d
Call the
principal-update
action.
e
Check the returned XML to ensure the status code returned is
"ok"
.
The following code doesn’t include code for calling
principal-update
or checking the
status code because those procedures were described in earlier steps:
<cfset principal= XmlSearch(xmlPrincipalList,
"//principal[login='#login#']")>
<cfset principalId= principal[1].XmlAttributes["principal-id"]>
<cfhttp url="#baseurl#api/xml?
action=principal-info&accesskey=#accesskey#&principal-id=#principalId#
" method="post">
<cfhttpparam type="Cookie" name="BREEZESESSION" value="#loginCookie#">
</cfhttp>
...
<!--- Add code here to check for an "ok" status code. --->
...
<cfset xml= XmlParse(cfhttp.FileContent)>
<cfset firstElement= XmlSearch(xml, "results/contact/first-name")>
<cfset firstName= firstElement[1].XmlText>
<cfset lastElement= XmlSearch(xml, "results/contact/last-name")>
<cfset lastName= lastElement[1].XmlText>
...
<!--- Add code here to set the new values for first name and last name,
call principal-update, and check for an "ok" status code. --->
Integrating Breeze with a portal
Suppose you have a portal application, such as a company’s intranet portal. You can integrate
Breeze into the portal to let users view and modify Breeze-related information from within the
context of the portal. For example, users can view upcoming Breeze meetings and see which
courses they are enrolled in.
The procedures in this section describe how to perform various tasks for a portal application
integrated with Breeze.
To log in as a particular user:
1.
Obtain the user’s login name and password, using a web-based form.
2.
Call the
login
action on the Breeze server, using the specified login name and password.
3.
Check the returned XML to ensure the status code returned is
"ok"
.
Содержание 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...