| Package: MachII.framework.commands |
| Inherits from: framework.EventCommand |
| An EventCommand for processing a view. |
<!--- License: Copyright 2006 Mach-II Corporation 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: Mach-II Corporation Author: Ben Edwards (ben@ben-edwards.com) $Id: ViewPageCommand.cfc 4466 2006-09-15 16:43:50Z pfarrell $ Created version: 1.0.0 Updated version: 1.1.0 ---> |
| 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.EventCommand: 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>