[CB4.2] Best Practice for including Modules

38 views
Skip to first unread message

David Mooney

unread,
Jul 11, 2016, 11:04:06 AM7/11/16
to ColdBox Platform
Is there a best practice for including modules that are also dependencies of other install modules? for example my project has the ORM module which has the validation module as a dependency. Should I be extending coldbox.modules.cborm.modules.cbvalidation.models.validators.IValidator for my custom validators or should I install validation at the root of the modules and extend it instead?  

br...@bradwood.com

unread,
Jul 11, 2016, 3:18:04 PM7/11/16
to col...@googlegroups.com
Neither.  You should be able to use the "/cbvalidation" CF mapping automatically registered by ColdBox that points to the module.  That way you don't care where the actual physical files live.
 
 
Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/abd26e7f-5f5a-450c-a209-d68bba2661e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Mooney

unread,
Jul 27, 2016, 3:06:59 PM7/27/16
to ColdBox Platform
If I am understanding you correctly I should not have to manually map the validation module. However when I remove my manually added cbvalidation mapping from the application cfc I get the following error in my custom validators after restarting the Adobe CF 11 service

The cbvalidation.models.validators.IValidator ColdFusion component or interface name, used to extend or implement the NavigationPortal.validators.medication.Repeat component is invalid. Ensure that the file exists, that the name does not start or end with a period (.), and the name is not an empty string.


My custom validator implements the IValidator class but it does not seem to know about the cbvalidation mapping 

component accessors="true" implements="cbvalidation.models.validators.IValidator" singleton {

br...@bradwood.com

unread,
Jul 27, 2016, 3:29:10 PM7/27/16
to col...@googlegroups.com
Does the validation module have a setting for the CF mapping.  Coldbox doesn't do it by default.
 
Also, what's the stack trace?  is the mapping being used before the modules are loaded?
--------- Original Message ---------
Reply all
Reply to author
Forward
0 new messages