Jsr-286 Support - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion Portlets
• To display Ajax components, all the URLs used in portlets must be encoded.
CFPOD:
<cfset sourceURL = getPortletResponse().encodeURL(getPortletRequest().getContextPath() &
"/<path to cfm>/expandpath.cfm")>
<cfpod name="pod01" source="#sourceURL#" height="500" width="300" title="Example CFPod"/>
expandpath:
<cfoutput>#ExpandPath("./")#</cfoutput>
CFWINDOW:
<cfset sourceURL = getPortletResponse().encodeURL(getPortletRequest().getContextPath() &
"/<path to cfm>/expandpath.cfm")>
<cfwindow title="Test Window" name="myWindow" width="200" height="200" initShow="true"
source="#sourceURL#">
</cfwindow>

JSR-286 Support

ColdFusion 9 also supports JSR-286 specifications. In portlets there are three types of requests: action, event, and
render. A portlet first handles an action request, and then an event request, and only after that, it would render any
request.
Some of the capabilities of JSR-286 include the following:
Publishing and Processing Events
To define an event, you would have to declare it in portlet.xml
<event-definition>
<qname xmlns:cf="http://adobe.com/coldfusion/portlet/example">cf:HelloEvent
</qname>
<value-type>java.lang.String</value-type>
</event-definition>
This code defines an event named cf:HelloEvent, where cf refers to the namespace and HelloEvent is the local name.
Its type is defined by the <value-type> tag. These event definitions require you to use qname to uniquely identify the
event.
Now add the events to specific portlets, which are either going to publish (generate) an event or process (consume) an
event. You add this information to portlet.xml as well.
<supported-publishing-event>
Publishing an event (Event producer)
<portlet>
...
<supported-publishing-event>
<qname xmlns:cf="http://adobe.com/coldfusion/portlet/example">cf:HelloEvent</qname>
</supported-publishing-event>
...
</portlet>
tag is used to publish an event.
Last updated 1/20/2012
909

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents