Documentation home page

MachII.plugins
Component SimplePlugin

framework.BaseComponent
  |
  +--framework.Plugin
      |
      +--plugins.SimplePlugin

A simple Plugin example.

Method Summary
public void configure()
          Configures the plugin.
public void handleException(EventContext eventContext, Exception exception)
public void postEvent(EventContext eventContext)
public void postProcess(EventContext eventContext)
public void postView(EventContext eventContext)
public void preEvent(EventContext eventContext)
public void preProcess(EventContext eventContext)
public void preView(EventContext eventContext)

Methods inherited from framework.Plugin
init, abortEvent

Methods inherited from framework.BaseComponent
setParameters, hasParameter, buildUrlToModule, isParameterDefined, buildUrl, announceEventInModule, setAppManager, getParameter, getProperty, getParameters, setProperty, getPropertyManager, bindValue, getAppManager, setParameter, announceEvent
 

Method Detail

configure

public void configure()
Configures the plugin.


Code:
	<cffunction name="configure" access="public" returntype="void" output="false"
		hint="Configures the plugin.">
	</cffunction>

handleException

public void handleException(EventContext eventContext, Exception exception)
Parameters:
EventContext eventContext
Exception exception

Code:
	<cffunction name="handleException" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfargument name="exception" type="MachII.util.Exception" required="true" />
		<cfoutput>&nbsp;SimplePlugin.handleException()<br /></cfoutput>
	</cffunction>

postEvent

public void postEvent(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="postEvent" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postEvent()<br /></cfoutput>
	</cffunction>

postProcess

public void postProcess(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="postProcess" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postProcess()<br /></cfoutput>
	</cffunction>

postView

public void postView(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="postView" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postView()<br /></cfoutput>
	</cffunction>

preEvent

public void preEvent(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="preEvent" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preEvent()<br /></cfoutput>
	</cffunction>

preProcess

public void preProcess(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="preProcess" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preProcess()<br /></cfoutput>
	</cffunction>

preView

public void preView(EventContext eventContext)
Parameters:
EventContext eventContext

Code:
	<cffunction name="preView" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preView()<br /></cfoutput>
	</cffunction>

Full Component Code:
<!---
License:
Copyright 2007 GreatBizTools, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright: GreatBizTools, LLC
$Id: SimplePlugin.cfc 333 2007-06-22 20:09:00Z pfarrell $

Created version: 1.0.0
Updated version: 1.1.1

Notes:
The PluginManager only calls plugin points that are utilized.
Remove any un-implemented plugin point methods (i.e. preProcess(), etc.)
to improve application performance as fewer plugin points will
be called on each request.  For example if your plugin only implements the
preEvent plugin point, then remove the remaining points. (pfarrell)
--->
<cfcomponent 
	displayname="SimplePlugin" 
	extends="MachII.framework.Plugin" 
	output="false"
	hint="A simple Plugin example.">

	<!---
	PROPERTIES
	--->
	
	<!---
	INITIALIZATION / CONFIGURATION
	--->
	<cffunction name="configure" access="public" returntype="void" output="false"
		hint="Configures the plugin.">
	</cffunction>
	
	<!---
	PUBLIC FUNCTIONS
	--->
	<cffunction name="preProcess" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preProcess()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="preEvent" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preEvent()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="postEvent" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postEvent()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="preView" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.preView()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="postView" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postView()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="postProcess" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfoutput>&nbsp;SimplePlugin.postProcess()<br /></cfoutput>
	</cffunction>
	
	<cffunction name="handleException" access="public" returntype="void" output="true">
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfargument name="exception" type="MachII.util.Exception" required="true" />
		<cfoutput>&nbsp;SimplePlugin.handleException()<br /></cfoutput>
	</cffunction>

	<!---
	PROTECTED FUNCTIONS
	--->

	<!---
	ACCESSORS
	--->

</cfcomponent>