Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 915

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion Portlets
Processing an event (event consumer)
<portlet>
....
<supported-processing-event>
<qname xmlns:cf="http://adobe.com/coldfusion/portlet/example">cf:HelloEvent</qname>
</supported-processing-event>
.....
</portlet>
Portlet definition can have both publishing and processing tags.
event, and processing event tags, as its portlets create and consume events.
Initiate events in portlet (CFC)
You publish events in the
processAction()
object. This
ActionResponse
of object defined in portlet.xml.
Following is an example of processAction() method.
<cffunction name="processAction" returntype="void" access="public" output="false"
hint="Called by the portlet container to allow the portlet to process an action request.">
<cfargument name="actionRequest" type="any" required="true" hint="A
javax.portlet.ActionRequest java object">
<cfargument name="actionResponse" type="any" required="true" hint="A
javax.portlet.ActionResponse java object">
<cfset super.processAction(arguments.actionRequest, arguments.actionResponse)>
<!--- send event notification --->
<cftry>
<cfset arguments.actionResponse.setEvent("HelloEvent",
request.portlet.parameters.event_value)>
<cfcatch type="any">
<cflog file="simple-event-portlet" type="error" text="processAction() threw
exception: #cfcatch.message#">
</cfcatch>
</cftry>
</cffunction>
Capture events in
processEvent()
method of the portlet code by calling
method takes two parameters: the QName of the event object and the type
setEvent()
method:
Last updated 1/20/2012
file has event definition, publishing
portlet.xml
setEvent()
910
on the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents