COLDBOX PLATFORM V4.1.0 - User Manual Section 7.7

I have worked my way thorugh to section 7.7 in the Colbox MVC Platform documentation. After twice trying to follow all the steps in Section 7, the Contact application is not working.

The test page is found here - http://coldbox1.srtechgroup.com/

Here is the error that I get -

Event: Contacts.index
Routed URL: Contacts/
Layout: N/A (Module: )
View: N/A
Timestamp: 10/07/2015 01:45:13 PM

Can you show us your config? Specifically the data sources portion?

The Wirebox DSL coldbox:datasource:contacts is not being found.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

colbox.cfc is shown below. I could not find API documentation for dbtype to use for Microsoft SQL so I guessed it may be just “mssql” but perhaps that is not correct.

If “Contacts” is the datasource, where do I indicate which table in the database to use?

I do have a “Contacts” datasource registered and confirmed in the CF administrator.

component{

// Configure ColdBox Application
function configure(){

// coldbox directives
coldbox = {
//Application Setup
appName = “Your app name here”,
eventName = “event”,

//Development Settings
reinitPassword = “”,
handlersIndexAutoReload = true,

//Implicit Events
defaultEvent = “”,
requestStartHandler = “Main.onRequestStart”,
requestEndHandler = “”,
applicationStartHandler = “Main.onAppInit”,
applicationEndHandler = “”,
sessionStartHandler = “”,
sessionEndHandler = “”,
missingTemplateHandler = “”,

//Extension Points
applicationHelper = “includes/helpers/ApplicationHelper.cfm”,
viewsHelper = “”,
modulesExternalLocation = [],
viewsExternalLocation = “”,
layoutsExternalLocation = “”,
handlersExternalLocation = “”,
requestContextDecorator = “”,
controllerDecorator = “”,

//Error/Exception Handling
exceptionHandler = “”,
onInvalidEvent = “”,
customErrorTemplate = “/coldbox/system/includes/BugReport.cfm”,

//Application Aspects
handlerCaching = false,
eventCaching = false,
proxyReturnCollection = false
};

// custom settings
settings = {

};

// environment settings, create a detectEnvironment() method to detect it yourself.
// create a function with the name of the environment so it can be executed if that environment is detected
// the value of the environment is a list of regex patterns to match the cgi.http_host.
environments = {
development = “localhost”
};

// Module Directives
modules = {
//Turn to false in production
autoReload = false,
// 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.ConsoleAppender” }
},
// Root Logger
root = { levelmax=“INFO”, appenders="*" },
// Implicit Level Categories
info = [ “coldbox.system” ]
};

//Layout Settings
layoutSettings = {
defaultLayout = “”,
defaultView = “”
};

//Interceptor Settings
interceptorSettings = {
throwOnInvalidStates = false,
customInterceptionPoints = “”
};

//Register interceptors as an array, we need order
interceptors = [
//SES
{class=“coldbox.system.interceptors.SES”,
properties={}
}
];

/*
// flash scope configuration
flash = {
scope = “session,client,cluster,ColdboxCache,or full path”,
properties = {}, // constructor properties for the flash scope implementation
inflateToRC = true, // automatically inflate flash data into the RC scope
inflateToPRC = false, // automatically inflate flash data into the PRC scope
autoPurge = true, // automatically purge flash data for you
autoSave = true // automatically save flash scopes at end of a request and on relocations.
};

//Register Layouts
layouts = [
{ name = “login”,
file = “Layout.tester.cfm”,
views = “vwLogin,test”,
folders = “tags,pdf/single”
}
];

//Conventions
conventions = {
handlersLocation = “handlers”,
viewsLocation = “views”,
layoutsLocation = “layouts”,
modelsLocation = “models”,
eventAction = “index”
};

//Datasources
datasources = {
contacts = {name=“Contacts”, dbType=“mssql”, username=“cf_user”, password=“pass”},
mysite = {name=“mySite”, dbType=“mysql”, username=“root”, password=“pass”},
blog_dsn = {name=“myBlog”, dbType=“oracle”, username=“root”, password=“pass”}
};
*/

}

/**

  • Development environment
    */
    function development(){
    coldbox.customErrorTemplate = “/coldbox/system/includes/BugReport.cfm”;
    }

}

Your datasources config is inside of comments.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thank you, I see that now. Perhaps a note on this page would be helpful http://coldbox.ortusbooks.com/content/models/coding_solo_style/datasource.html

The error that I get now is:

Event: Contacts.index
Routed URL: Contacts/
Layout: N/A (Module: )
View: N/A
Timestamp: 10/08/2015 04:36:39 PM

Any thoughts on this new error message. I’m trying to work thorugh all the tutorials and it is getting frustrating when the examples just don’t seem to work.

Bo,

Do you have a public method named getAllUsers() in models.ContactDAO?

Alternately, if you have an ORM one-to-many or many-to-many relationship configured with a “User” model, then the correct accessor syntax would be getUsers().

Jon

Or if you are following the tutorial exactly, then the correct method name is getAll(), as listed here: http://coldbox.ortusbooks.com/content/models/coding_solo_style/contactdaocfc.html.

There appears to be a typo on this page: http://coldbox.ortusbooks.com/content/models/coding_solo_style/contactservicecfc.html

Thanks JClausen - you are correct, the samples provided for the tutorial do have an error which I just found. The model did not have the correct method name to call the model.
With that solved now I can move on with the Tutorial.

Thank you!

Bo