|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
MXDJ TOP LINKS YOU MUST CLICK ON ! Breeze
MX Developer's Journal: Using Breeze Web Services to Display a List of Recordings for a Meeting
The Breeze 5 Meeting module creates SWF files to allow for easy delivery of the recording over the web
By: Joseph Baarsch
Mar. 3, 2006 03:45 PM
Digg This!
Page 2 of 2
« previous page
The getPrincipleID() method is used to obtain the principleID associated with a username and password. You can do this by calling the user-accounts web service action and then use the xmlSearch() function to verify that the request was returned. If so, extract the principleID from the return XML string. When extracting data from an XML object, it is sometimes helpful to use the cfdump tag on the XML object to take a look at the structure. Otherwise you may run into problems trying to obtain the exact path of the node data you are looking for. In this case, you can locate the principleID using this syntax: <cfset principalID = xml.results.users.user.XmlAttributes["user-id"]> Once you have obtained the principleID from the return XML you can return it to the calling script with a cfreturn tag. The terminateSession() method simply calls the logout web service action with the session ID to end the session on the Breeze server. You will notice by looking at this method that the same set of ColdFusion tags are used to call and interpret an action from the Breeze server. I will parameterize this common task and construct it as a reusable method in the next CFC to increase cohesiveness.
Manipulating XML Data in MeetingManager.cfc <cfset recordings = xmlSearch(xmlOutput, "//sco[@icon='archive']")> This type is what Breeze 5 associates with all recording sco's. The ColdFusion function xmlSearch() returns a data structure of type array, which is then pass to the scoArray2Query() private method for conversion to data type query (Figure 1). You will be converting the XML to a query because when an XML node is returned from Breeze 5, the data is fragmented inside the heavily nested structure of XML, which complicates data manipulation for display. In addition to this, you are going to need to get more details about each recording before producing the list to the user. Inside the scoArray2Query() method, I take the array of recording nodes and loop through each node and call the sco-info web service action for each recording in the array. You need to do this step to get more detailed information about the recording that is not provided in the initial node returned by the sco-contents web service action. Once this call is made, you will pass the XML to the sco2Record() method to convert the XML into a query record. This is done by using the queryAddRow() and querySetCell() ColdFusion functions. One way that I have found to extract data from an XML node is to use the cfswitch and cfcase tags inside, of a cfloop structure. In this method I also call the ISO8601ToDate() method to convert Breeze dates to ColdFusion data types. This method could be a global function for your application but for this tutorial I have made it part of the MeetingManager component. After the sco2Record() method has finished executing, control is returned to the calling method, scoArray2Query(). This method continues to loop through all of the elements in the array and then returns the resulting query data structure through its cfreturn tag. This returns control to the getRecordings() method, which returns the query to recordingList.cfm. At this point you can run this code on your server by calling the recordingList.cfm in the browser. To verify that it is working, specify a meetingID to a meeting that has two or three recordings. Once run, your app will display a cfdump structure for the query object.
Where to Go from Here I would also encourage you to try to integrate this code into your existing application. You may do this by populating the variables at the top of recordingList.cfm by using session, URL, or form-scoped variables. Perhaps you might set the Breeze URL in application.cfm along with the accessKey for Breeze 4.1 users. Congratulations! You are well on your way to unlocking one of the best kept secrets in the Breeze Web Services API. Today you worked with some of the most important web services actions such as login, logout, sco-info, and user-info. From this point you should be able to experiment with the entire set of web services to best suit your application and integration needs. Happy coding! This article originally appeared on www.macromedia.com/devnet. Reprinted with permission. Page 2 of 2 « previous page
LATEST FLEX STORIES & POSTS
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||