Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1291

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
action="noact";
reason="Duplicate ID";
}
</cfscript>
</cflock>
<!--- Log the request and decision information. --->
<cflog file="#CFEvent.GatewayID#Status"
text="onAddBuddyRequest; SENDER: #CFEvent.Data.SENDER# MESSAGE:
#CFEvent.Data.MESSAGE# TIMESTAMP: #CFEvent.Data.TIMESTAMP# ACTION: #action#">
<!--- Return the action decision. --->
<cfset retValue = structNew()>
<cfset retValue.command = action>
<cfset retValue.BuddyID = CFEvent.DATA.SENDER>
<cfset retValue.Reason = reason>
<cfreturn retValue>
</cffunction>
<cffunction name="onAddBuddyResponse">
<cfargument name="CFEvent" type="struct" required="YES">
<cflock scope="APPLICATION" timeout="10" type="EXCLUSIVE">
<cfscript>
//Do the following only if the buddy accepted the request.
if (NOT StructKeyExists(Application, "buddyStatus")) {
Application.buddyStatus=StructNew();
}
if (#CFEVENT.Data.MESSAGE# IS "accept") {
//Create a new entry in the buddyStatus record for the buddy.
if (NOT StructKeyExists(Application.buddyStatus,
Application.buddyStatus[#CFEvent.Data.SENDER#]=StructNew();
}
//Set the buddy status information to indicate buddy was added.
Application.buddyStatus[#CFEvent.Data.SENDER#].status=
"Buddy accepted us";
Application.buddyStatus[#CFEvent.Data.SENDER#].timeStamp=
CFEvent.Data.TIMESTAMP;
Application.buddyStatus[#CFEvent.Data.SENDER#].message=
CFEvent.Data.MESSAGE;
}
</cfscript>
</cflock>
<!--- Log the information for all responses. --->
<cflog file="#CFEvent.GatewayID#Status"
text="onAddBuddyResponse; BUDDY: #CFEvent.Data.SENDER# RESPONSE:
#CFEvent.Data.MESSAGE# TIMESTAMP: #CFEvent.Data.TIMESTAMP#">
</cffunction>
<cffunction name="onIMServerMessage">
<!--- This function just logs the message. --->
<cfargument name="CFEvent" type="struct" required="YES">
<cflog file="#CFEvent.GatewayID#Status"
text="onIMServerMEssage; SENDER: #CFEvent.OriginatorID# MESSAGE:
#CFEvent.Data.MESSAGE# TIMESTAMP: #CFEvent.Data.TIMESTAMP#">
</cffunction>
</cfcomponent>
CFEvent.Data.SENDER)) {
Last updated 1/20/2012
1286

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents