That... is an excellent question. I don't know. I thought it was
supposed to work like that, and it seems to have been working like
that. Let me post our config files, maybe that will help. Forgive me
if I am attaching these wrong:
I will include Coldbox.cfc and Lightwire.cfc:
Coldbox.cfc:
<cfcomponent output="false" hint="My App Configuration">
<cfscript>
// Configure ColdBox Application
function configure(){
// coldbox directives
coldbox = {
//Application Setup
appName = "MyCompanyApp",
appMapping = "",
eventName = "event",
//Development Settings
debugMode = true,
debugPassword = "",
reinitPassword = "",
handlersIndexAutoReload = true,
configAutoReload = false,
//Implicit Events
defaultEvent = "Main",
requestStartHandler = "Main.onRequestStart",
requestEndHandler = "",
applicationStartHandler = "Main.onAppInit",
applicationEndHandler = "",
sessionStartHandler = "Main.onSessionStart",
sessionEndHandler = "",
missingTemplateHandler = "",
//Extension Points
UDFLibraryFile = "includes/helpers/ApplicationHelper.cfm",
coldboxExtensionsLocation = "",
modulesLocation = "",
pluginsExternalLocation = "",
viewsExternalLocation = "",
layoutsExternalLocation = "",
handlersExternalLocation = "",
requestContextDecorator = "",
//Error/Exception Handling
exceptionHandler = "Main.onException",
onInvalidEvent = "Main.onInvalidEvent",
customErrorTemplate = "",
//Application Aspects
handlerCaching = false,
eventCaching = false,
proxyReturnCollection = false,
flashURLPersistScope = "session"
};
// custom settings
settings = {
ssl = true,
"debug" = false,
"cfc.model.root" = "model.",
"cfc.com.root" = "com."
};
// Module Directives
modules = {
//Turn to false in production
autoReload = true,
// An array of modules names to load, empty means all of them
include = [],
// An array of modules names to NOT load, empty means none
exclude = []
};
//LogBox DSL
logBox = {
// Define Appenders
appenders = {
coldboxTracer =
{ class="coldbox.system.logging.appenders.ColdboxTracerAppender" },
fileLog = {
class="coldbox.system.logging.appenders.AsyncRollingFileAppender",
properties={
filePath = "logs",
fileName = coldbox.appName,
autoExpand = true,
fileMaxSize = 2000,
fileMaxArchives = 5
}
}
},
// Root Logger
root = { levelmax="DEBUG", appenders="*" },
// Implicit Level Categories
info = [ "coldbox.system" ]
};
//Layout Settings
layoutSettings = {
defaultLayout = "Main.cfm"
};
//Register Layouts
layouts = {
login = {
file = "Login.cfm",
folders = "user"
}
};
//cacheEngine
cacheBox = {
// The defaultCache has an implicit name "default" which is a
reserved cache name
// It also has a default provider of cachebox which cannot be
changed.
// All timeouts are in minutes
defaultCache = {
objectDefaultTimeout = 120, //two hours default
objectDefaultLastAccessTimeout = 30, //30 minutes idle time
useLastAccessTimeouts = true,
reapFrequency = 2,
freeMemoryPercentageThreshold = 0,
evictionPolicy = "LRU",
evictCount = 1,
maxObjects = 300,
objectStore = "ConcurrentStore", //guaranteed objects
coldboxEnabled = true
},
// Register all the custom named caches you like here
caches = {
// Named cache for all coldbox event and view template caching
template = {
provider =
"coldbox.system.cache.providers.CacheBoxColdBoxProvider",
properties = {
objectDefaultTimeout = 120,
objectDefaultLastAccessTimeout = 30,
useLastAccessTimeouts = true,
reapFrequency = 2,
freeMemoryPercentageThreshold = 0,
evictionPolicy = "LRU",
evictCount = 2,
maxObjects = 300,
objectStore = "ConcurrentSoftReferenceStore" //memory sensitive
}
}
}
};
//Interceptor Settings
interceptorSettings = {
throwOnInvalidStates = false,
customInterceptors = ""
};
//Register interceptors as an array, we need order
interceptors = [
//SES
{class="coldbox.system.interceptors.SES",
properties={
configFile = "config/routes.cfm"
}
},
//SSL
{class="interceptors.ssl",
properties={
checkSSL="true",
pattern="",
addToken="false"
}
},
//Autowire
{class="coldbox.system.interceptors.Autowire"},
//Security - need to figure out ORM settings first
{class="coldbox.system.interceptors.security",
properties={
rulesSource="xml",
rulesFile="config/securityrules.xml.cfm",
debugMode="false",
validatorIOC="securityManager"
}
}
];
//IOC Integration
ioc = {
framework = "lightwire",
reload = true,
objectCaching = false,
definitionFile = "config.Lightwire"
};
//i18n & Localization
i18n = {
defaultResourceBundle = "includes/i18n/main",
defaultLocale = "en_US",
localeStorage = "session",
unknownTranslation = "**NOT FOUND**"
};
//Conventions
conventions = {
handlersLocation = "handlers",
pluginsLocation = "plugins",
viewsLocation = "views",
layoutsLocation = "layouts",
modelsLocation = "model",
modulesLocation = "modules",
eventAction = "index"
};
}
</cfscript>
</cfcomponent>
Lightwire.cfc
<cfcomponent name="LightWire"
extends="coldbox.system.ioc.lightwire.BaseConfigObject" hint="A
LightWire configuration bean.">
<cffunction name="init" output="false" returntype="any" hint="I
initialize the config bean.">
<cfscript>
var cfcComRoot = getController().getSetting('cfc.com.root');
var cfcModelRoot = getController().getSetting('cfc.model.root');
// Call the base init() method to set sensible defaults. Do NOT
remove this.
super.init();
setLazyLoad("false");
addSingleton("#cfcComRoot#company.Utilities");
addTransient("#cfcComRoot#company.ui.Menu");
addSingleton("#cfcComRoot#company.Security","securityManager");
addSingleton("#cfcComRoot#company.Theme","themeManager");
addSingleton("#cfcModelRoot#.UserService","UserService");
return this;
</cfscript>
</cffunction>
</cfcomponent>