the dsplogin function is the default function that gets called when
the user comes to the app to log in, from that point i use
setNextEvent to go to the various other methods
i could not zip it up because the model would not work as it its tied
to our sql server db for user information
the main.cfc :
<cfcomponent output="false">
<!------------------------------------------- GLOBAL IMPLICIT EVENTS
ONLY ------------------------------------------>
<!--- In order for these events to fire, you must declare them in the
coldbox.xml.cfm --->
<cffunction name="index" returntype="void" output="false">
<cfargument name="event" required="true">
<cfset setNextEvent(getSetting('DefaultEvent'))>
</cffunction>
<cffunction name="onAppInit" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
</cfscript>
</cffunction>
<cffunction name="onAppShutDown" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
GetPlugin('SessionStorage').removeStorage();
</cfscript>
</cffunction>
<cffunction name="onRequestStart" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
var rc = event.getCollection();
//setup the session storage containers
HandleMallfinderSessionStorage(event=event);
//Temporary Development Variable
GetPlugin('SessionStorage').setVar('Test',"");
</cfscript>
</cffunction>
<cffunction name="onRequestEnd" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
var rc = event.getCollection();
</cfscript>
</cffunction>
<cffunction name="onSessionStart" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
</cfscript>
</cffunction>
<cffunction name="onSessionEnd" returntype="void" output="false">
<cfargument name="event" required="true">
<cfset var sessionScope = event.getValue("sessionReference")>
<cfset var applicationScope =
event.getValue("applicationReference")>
<cfscript>
GetPlugin('sessionstorage').removeStorage();
</cfscript>
</cffunction>
<cffunction name="onException" returntype="void" output="false">
<cfargument name="event" required="true">
<cfscript>
//Grab Exception From request collection, placed by ColdBox, Place
exception handler below:
var exceptionBean = event.getValue("ExceptionBean");
</cfscript>
</cffunction>
<cffunction name="onMissingTemplate" returntype="void"
output="false">
<cfargument name="event" required="true">
<cfscript>
//Grab missingTemplate From request collection, placed by ColdBox
var missingTemplate = event.getValue("missingTemplate");
</cfscript>
</cffunction>
<!------------------------------------------- PRIVATE EVENTS
------------------------------------------>
<cffunction name="HandleMallfinderSessionStorage" returntype="void"
output="false" access="private">
<cfargument name="event" required="true">
<cfscript>
var rc = event.getCollection();
//get current tabs, breadcrumbs, and navigation
var sSessionStorage=GetPlugin('SessionStorage').getStorage();
//have the tabs been added to the cb storage container
if(
(Not IsDefined("sSessionStorage.sTabs")) OR
(IsDefined("sSessionStorage.sTabs") And Not
IsQuery(sSessionStorage.sTabs))
){
//build default tabs and add it to the cb storage container
GetPlugin('SessionStorage').setVar('sTabs',runEvent(event='layouts.Tabs.GetTabData',private=false));
};
//has the default breadcrumb been added to the cb storage container
if(
(Not IsDefined("sSessionStorage.sBreadCrumbs")) OR
(IsDefined("sSessionStorage.sBreadCrumbs") And Not
IsArray(sSessionStorage.sBreadCrumbs)) OR
(IsDefined("sSessionStorage.sBreadCrumbs") And
IsArray(sSessionStorage.sBreadCrumbs) And
ArrayLen(sSessionStorage.sBreadCrumbs) Eq 0)
){
//build default breadcrumbs and add it to the cb storage container
GetPlugin('SessionStorage').setVar('sBreadCrumbs',runEvent(event='layouts.BreadCrumbs.GetBreadCrumbData',private=false));
};
//has the default navigation been added to the cb storage container
if(
(Not IsDefined("sSessionStorage.sNavigation")) OR
(IsDefined("sSessionStorage.sNavigation") And Not
IsArray(sSessionStorage.sNavigation)) OR
(IsDefined("sSessionStorage.sNavigation") And
IsArray(sSessionStorage.sNavigation) And
ArrayLen(sSessionStorage.sNavigation) Eq 0)
){
//build default breadcrumbs and add it to the cb storage container
GetPlugin('SessionStorage').setVar('sNavigation',runEvent(event='layouts.Navigation.GetNavigation',private=false));
};
</cfscript>
</cffunction>
</cfcomponent>