
1289
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
<cfapplication name="gateway_tool" sessionmanagement="yes">
<!--- Set the gateway buddy name to default values.--->
<cfparam name="session.gwid" default="XMPP Buddy Manager">
<cfparam name="session.buddyid" default="hlichtin2@mousemail">
<!--- Reset gateway and buddy ID if form was submitted. --->
<cfif isdefined("form.submitbuddy")>
<cfset session.buddyid=form.buddyid>
<cfset session.gwid=form.gwid>
</cfif>
<!--- Display the current gateway and buddy ID. --->
<h3>Using the GatewayHelper</h3>
<!--- Form to display and reset gateway and Buddy ID. --->
<cfform action="#cgi.script_name#" method="post" name="changeIDs">
Current buddy ID: <cfinput type="text" name="buddyid" value="#session.buddyid#"><br>
Current gateway ID: <cfinput type="text" name="gwid" value="#session.gwid#"><br>
<cfinput name="submitbuddy" value="Change gateway/buddy" type="submit">
</cfform>
<!--- When a buddy is set, display the links and forms to get and set
information, and so on, Where form input is required, the form uses a GET method
so a url.cmd variable represents each selection. --->
<cfoutput>
<h3>Select one of the following to get or set.</h3>
<ul>
<li><a href="#cgi.script_name#?cmd=buddyinfo">buddyinfo</a>
<li>LIST: <a href="#cgi.script_name#?cmd=buddylist">buddylist</a> |
<a href="#cgi.script_name#?cmd=permitlist">permitlist</a> |
<a href="#cgi.script_name#?cmd=denylist">denylist</a>
<li>ADD: <a href="#cgi.script_name#?cmd=addbuddy">addbuddy</a> |
<a href="#cgi.script_name#?cmd=addpermit">addpermit</a> |
<a href="#cgi.script_name#?cmd=adddeny">adddeny</a>
<li>REMOVE: <a href="#cgi.script_name#?cmd=removebuddy">removebuddy</a> |
<a href="#cgi.script_name#?cmd=removepermit">removepermit</a> |
<a href="#cgi.script_name#?cmd=removedeny">removedeny</a>
<!--- NOTE: This list does not include OFFLINE because the gateway resets itself to online.
--->
<li>setStatus (XMPP):
<cfloop list="ONLINE,AWAY,DND,NA,FREE_TO_CHAT" index="e">
<a href="#cgi.script_name#?cmd=setstatus&status=#e#">#e#</a> |
</cfloop>
<li>setStatus (Sametime):
<cfloop list="ONLINE,AWAY,DND,IDLE" index="e">
<a href="#cgi.script_name#?cmd=setstatus&status=#e#">#e#</a> |
</cfloop>
<li>
<form action="#cgi.script_name#" method="get">
setStatus with CustomAwayMessage:
<input type="hidden" name="cmd" value="setstatus2">
<select name="status">
<cfloop
list="ONLINE,OFFLINE,AWAY,DND,IDLE,INVISIBLE,NA,OCCUPIED,FREE_TO_CHAT,ONPHONE,ATLUNCH,BUSY,N
OT_AT_HOME,NOT_AT_DESK,NOT_IN_OFFICE,ON_VACATION,STEPPED_OUT,CUSTOM_AWAY" index="e">
<option value="#e#">#e#</option>