MACROMEDIA BREEZE-USING THE BREEZE XML WEB SERVICES Use Manual page 31

Using the breeze xml web services
Table of Contents

Advertisement

For each user listed in the directory service but not in Breeze, add the user to Breeze, as follows:
8.
Obtain the user's first name, last name, and login name from the directory service.
a
The Breeze login name is usually the user's e-mail address.
Call the
b
principal-update
Don't specify a
principal-id
adding a new user rather than updating an existing user.
Check the returned XML to ensure that the status code returned is
c
The following code demonstrates how to add a user to Breeze. It uses variables set up in
previous steps of this procedure, such as
code specifies the user's information in the first few lines, rather than acquiring that
information from a directory service.
<cfset newlogin= "jake2@example.com">
<cfset newpass= "abcdefg">
<cfset newfirst= "Jake">
<cfset newlast= "Doe">
<cfhttp url="#baseurl#api/xml?
action=principal-update&accesskey=#accesskey#&first-name=#newfirst#
&last-name=#newlast#&has-children=0&login=#newlogin#
&type=user" method="post">
<cfhttpparam type="Cookie" name="BREEZESESSION" value="#loginCookie#">
</cfhttp>
<!--- Check for an okay status result. --->
<cfset xml= XmlParse(cfhttp.FileContent)>
<cfset resultsElement= XmlSearch(xml, "//status[@code='ok']")>
<cfif ArrayLen(resultsElement) ne 1>
<!--- No status code "ok" found. Check for other status codes and handle
errors. --->
</cfif>
For each user listed in Breeze but not in the directory service, delete the user from Breeze by
9.
calling the
principals-delete
to ensure that the status code returned is
The following code demonstrates how to delete a specified user:
<cfset userID= "503123">
<cfhttp url="#baseurl#api/xml?
action=principals-delete&accesskey=#accesskey#
&principal-id=#userID#" method="post">
<cfhttpparam type="Cookie" name="BREEZESESSION" value="#loginCookie#">
</cfhttp>
<!--- Check for an "ok" status code. --->
<cfset xml= XmlParse(cfhttp.FileContent)>
<cfset resultsElement= XmlSearch(xml, "//status[@code='ok']")>
<cfif ArrayLen(resultsElement) ne 1>
<!--- No status code "ok" found. Check for other status codes and handle
errors. --->
</cfif>
action, setting the
type
parameter; leaving out
. To keep the example clear and simple, this
baseurl
action and specifying the user's ID. Check the returned XML
.
"ok"
Integrating Breeze with a directory service
parameter equal to
user
indicates that you are
principal-id
.
"ok"
.
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Breeze

Table of Contents