<cfcomponent name="MethodExplosionContentItem" hint="I am a per-reqeust CFC that represents a Content Item, but does not use the State pattern.">
<cffunction name="init" access="public" returntype="MethodExplosionContentItem" hint="Constructor.">
<cfreturn this />
</cffunction>
<cffunction name="saveDraft" access="public" returntype="void" output="true" hint="">
<cfoutput>
Draft: saving content item...<br/>
</cfoutput>
</cffunction>
<cffunction name="savePublished" access="public" returntype="void" output="true" hint="">
<cfoutput>
Published: setting the content to draft mode...<br/>
</cfoutput>
</cffunction>
<cffunction name="approveDraft" access="public" returntype="void" output="true" hint="">
<cfoutput>
Draft: saving content item and alerting reviewer about content for review...<br/>
</cfoutput>
</cffunction>
<cffunction name="approveReview" access="public" returntype="void" output="true" hint="">
<cfoutput>
Review: alerting content author that content is approved...<br/>
Review: marking content as ready for publish approval...<br/>
</cfoutput>
</cffunction>
<cffunction name="approvePublishApproval" access="public" returntype="void" output="true" hint="">
<cfoutput>
Publish approval: Marking content as deployed...<br/>
Publish approval: Pushing live and updating content cache...<br/>
</cfoutput>
</cffunction>
<cffunction name="rejectReview" access="public" returntype="void" output="true" hint="">
<cfoutput>
Review: alerting content author that content is rejected...<br/>
Review: setting back to draft mode...<br/>
</cfoutput>
</cffunction>
<cffunction name="rejectPublishApproval" access="public" returntype="void" output="true" hint="">
<cfoutput>
Publish approval: alerting reviewer that publishing is rejected...<br/>
Publish approval: setting back to review mode...<br/>
</cfoutput>
</cffunction>
</cfcomponent>
<cffunction name="save" access="public" returntype="void" output="true" hint="">
<cfthrow message="State '#getStateName()#' does not implement the save method." />
</cffunction>
<cffunction name="approve" access="public" returntype="void" output="true" hint="">
<cfthrow message="State '#getStateName()#' does not implement the approve method." />
</cffunction>
<cffunction name="deploy" access="public" returntype="void" output="true" hint="">
<cfthrow message="State '#getStateName()#' does not implement the deploy method." />
</cffunction>
<cffunction name="makeDraft" access="public" returntype="void" output="true" hint="">
<cfthrow message="State '#getStateName()#' does not implement the makeDraft method." />
</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="">
<cfargument name="context" type="ContentItemContext" required="true" />
<cfset var local = structNew() />
<cfoutput>
State '#getStateName()#' alerting content author that content is rejected...<br/>
State '#getStateName()#' setting back to draft mode...<br/>
</cfoutput>
<cfset arguments.context.setStateByName('draft') />
</cffunction>
</cfcomponent>
<cfcomponent name="ApprovePublishState" extends="AbstractContentState" hint="I am a Singleton state object. I have no instance data, I only manage logic.">
<cffunction name="approve" access="public" returntype="void" output="true" hint="">
<cfargument name="context" type="ContentItemContext" required="true" />
<cfset var local = structNew() />
<cfoutput>
State '#getStateName()#' Marking content as deployed...<br/>
State '#getStateName()#' Pushing live and updating content cache...<br/>
</cfoutput>
<cfset arguments.context.setStateByName('published') />
</cffunction>
<cffunction name="reject" access="public" returntype="void" output="true" hint="">
<cfargument name="context" type="ContentItemContext" required="true" />
<cfset var local = structNew() />
<cfoutput>
State '#getStateName()#' alerting reviewer that publishing is rejected...<br/>
State '#getStateName()#' setting back to review mode...<br/>
</cfoutput>
<cfset arguments.context.setStateByName('review') />
</cffunction>
</cfcomponent>
<cfcomponent name="PublishedState" extends="AbstractContentState" hint="I am a Singleton state object. I have no instance data, I only manage logic.">