ViewPageCommand

Package: MachII.framework.commands
Inherits from: framework.Command
An Command for processing a view.
Method Summary
public ViewPageCommand init(string viewName, [string contentKey=""], [string contentArg=""], [string append="false"])

Used by the framework for initialization.

public boolean execute(Event event, EventContext eventContext)

Executes the command.

private boolean getAppend()
private string getContentArg()
private string getContentKey()
private string getViewName()
private boolean hasContentArg()
private boolean hasContentKey()
private void setAppend(string append)
private void setContentArg(string contentArg)
private void setContentKey(string contentKey)
private void setViewName(string viewName)
Methods inherited from framework.Command:   setParameter , getParameter , setParameters
Method Detail
execute

public boolean execute( Event event, EventContext eventContext )

Executes the command.

Parameters:
Event event
EventContext eventContext

Code:

	<cffunction name="execute" access="public" returntype="boolean" output="true"
		hint="Executes the command.">
		<cfargument name="event" type="MachII.framework.Event" required="true" />
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		
		<cfset arguments.eventContext.displayView(arguments.event, getViewName(), getContentKey(), getContentArg(), getAppend()) />
		
		<cfreturn true />
	</cffunction> 

getAppend

private boolean getAppend( )

Parameters:

Code:

	<cffunction name="getAppend" access="private" returntype="boolean" output="false">
		<cfreturn variables.append />
	</cffunction> 

getContentArg

private string getContentArg( )

Parameters:

Code:

	<cffunction name="getContentArg" access="private" returntype="string" output="false">
		<cfreturn variables.contentArg />
	</cffunction> 

getContentKey

private string getContentKey( )

Parameters:

Code:

	<cffunction name="getContentKey" access="private" returntype="string" output="false">
		<cfreturn variables.contentKey />
	</cffunction> 

getViewName

private string getViewName( )

Parameters:

Code:

	<cffunction name="getViewName" access="private" returntype="string" output="false">
		<cfreturn variables.viewName />
	</cffunction> 

hasContentArg

private boolean hasContentArg( )

Parameters:

Code:

	<cffunction name="hasContentArg" access="private" returntype="boolean" output="false">
		<cfreturn variables.contentArg NEQ '' />
	</cffunction> 

hasContentKey

private boolean hasContentKey( )

Parameters:

Code:

	<cffunction name="hasContentKey" access="private" returntype="boolean" output="false">
		<cfreturn variables.contentKey NEQ '' />
	</cffunction> 

init

public ViewPageCommand init( string viewName, [string contentKey=""], [string contentArg=""], [string append="false"] )

Used by the framework for initialization.

Parameters:
string viewName
[string contentKey=""]
[string contentArg=""]
[string append="false"]

Code:

	<cffunction name="init" access="public" returntype="ViewPageCommand" output="false"
		hint="Used by the framework for initialization.">
		<cfargument name="viewName" type="string" required="true" />
		<cfargument name="contentKey" type="string" required="false" default="" />
		<cfargument name="contentArg" type="string" required="false" default="" />
		<cfargument name="append" type="string" required="false" default="false" />
		
		<cfset setViewName(arguments.viewName) />
		<cfset setContentKey(arguments.contentKey) />
		<cfset setContentArg(arguments.contentArg) />
		<cfset setAppend(arguments.append) />
		
		<cfreturn this />
	</cffunction> 

setAppend

private void setAppend( string append )

Parameters:
string append

Code:

	<cffunction name="setAppend" access="private" returntype="void" output="false">
		<cfargument name="append" type="string" required="true" />
		<cfset variables.append = (arguments.append is "true") />
	</cffunction> 

setContentArg

private void setContentArg( string contentArg )

Parameters:
string contentArg

Code:

	<cffunction name="setContentArg" access="private" returntype="void" output="false">
		<cfargument name="contentArg" type="string" required="true" />
		<cfset variables.contentArg = arguments.contentArg />
	</cffunction> 

setContentKey

private void setContentKey( string contentKey )

Parameters:
string contentKey

Code:

	<cffunction name="setContentKey" access="private" returntype="void" output="false">
		<cfargument name="contentKey" type="string" required="true" />
		<cfset variables.contentKey = arguments.contentKey />
	</cffunction> 

setViewName

private void setViewName( string viewName )

Parameters:
string viewName

Code:

	<cffunction name="setViewName" access="private" returntype="void" output="false">
		<cfargument name="viewName" type="string" required="true" />
		<cfset variables.viewName = arguments.viewName />
	</cffunction>