|
<cffunction name="setStateName" access="private" returntype="void" output="false" roles="" hint="I set the stateName."> <cfargument name="stateName" type="string" required="true" hint="stateName" /> <cfset variables.instance.stateName = arguments.stateName /> </cffunction>
</cfcomponent>
<cfcomponent name="DraftState" extends="AbstractContentState" hint="I am a Singleton state object. I have no instance data, I only manage logic.">
<cffunction name="init" access="public" returntype="DraftState" hint="Constructor."> <cfset super.init('Draft') /> <cfreturn this /> </cffunction>
<cffunction name="save" access="public" returntype="void" output="true" hint=""> <cfargument name="context" type="ContentItemContext" required="true" /> <cfset var local = structNew() /> <cfoutput> State '#getStateName()#' saving content item...<br/> </cfoutput> </cffunction>
<cffunction name="approve" access="public" returntype="void" output="true" hint=""> <cfargument name="context" type="ContentItemContext" required="true" /> <cfset var local = structNew() /> <cfoutput> State '#getStateName()#' saving content item and alerting reviewer about content for review...<br/> </cfoutput> <cfset arguments.context.setStateByName('review') /> </cffunction>
</cfcomponent>
<cfcomponent name="ReviewState" extends="AbstractContentState" hint="I am a Singleton state object. I have no instance data, I only manage logic.">
<cffunction name="init" access="public" returntype="ReviewState" hint="Constructor."> <cfset super.init('Review') /> <cfreturn this /> </cffunction>
<cffunction name="approve" access="public" returntype="void" output="true" hint=""> <cfargument name="context" type="ContentItemContext" required="true" /> <cfset var local = structNew() /> <cfoutput> State '#getStateName()#' alerting content author that content is approved...<br/> State '#getStateName()#' marking content as ready for publish approval...<br/> </cfoutput> <cfset arguments.context.setStateByName('publishApproval') /> </cffunction>
<cffunction name="reject" access="public" returntype="void" output="true" hint="">
|
| 共9页: 上一页 [1] [2] [3] [4] [5] [6] 7 [8] [9] 下一页 |
评论加载中…