Common methods used in portlet.cfc

Some common methods that are used frequently while creating the ColdFusion component portlet, such as HelloPortlet.cfc, are:

Method

Description

Syntax

doView()

This method renders the portlet content. It is called by the portlet container to allow the portlet to generate the content of the response based on its current state.

<cffunction name="doView" returntype="void" output="true"> <cfargument name="renderRequest" type="any" required="true" hint="A javax.portlet.RenderRequest java object"> <cfargument name="renderResponse" type="any" required="true" hint="A javax.portlet.RenderResponse java object"> <!--- User code goes here --?> </cffunction>

doHelp()

Helper method to serve up the HELP mode.

<cffunction name="doHelp" returntype="void" output="true"> <cfargument name="renderRequest" type="any" required="true" hint="A javax.portlet.RenderRequest java object"> <cfargument name="renderResponse" type="any" required="true" hint="A javax.portlet.RenderResponse java object"> <!--- User code goes here --? </cffunction>

doEdit()

Helper method to serve up the EDIT mode.

<cffunction name="doEdit" returntype="void" output="true"> <cfargument name="renderRequest" type="any" required="true" hint="A javax.portlet.RenderRequest java object"><cfargument name="renderResponse" type="any" required="true" hint="A javax.portlet.RenderResponse java object"> <!--- User code goes here --? </cffunction>

ProcessAction()

Called by the portlet container to allow the portlet to process an action request

<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"> <!--- User code goes here --? </cffunction>

Init()

Called by the portlet container to indicate to a portlet that the portlet is being placed into service

<cffunction name="init" returntype="void" access="public" output="false" hint="Called by the portlet container to indicate to a portlet that the portlet is being placed into service."> <cfargument name="portletConfig" type="any" required="true" hint="A javax.portlet.PortletConfig java object"> <!--- User code goes here --? </cffunction>

processEvent

This is used to consume the event once it is published.

<cffunction name="processEvent" returntype="void" access="public" output="false" hint="Called by the portlet container requesting the portlet to process a specific event."> 
<!---user code---> 
</cffunction>