ColdBox 4 and Interceptors and ValidateThis

I am trying to will my way through getting ValidateThis to working ColdBox. Everything built uses old coldbox 2.6 and 3 so I think I got everything to date but I notice in that the interceptor they are using is my main stopping point ibecause afterAspectsLoad is not getting called.
Everything else Configure and customInterceptionPoints can be access but afterAspectsLoad call is not getting called if I change it to afterConfigurationLoad it totally blows up so i know it knows that its an interception. Is there something else I can use instead of afterAspectsLoad?

Thanks.

I think afterConfigurationLoad is the recommended replacement for afterAspectsLoad. Can you detail that “blows up” when you try that?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

I have tons of logs since I have been working on this since the am but it was a 500 error i believe no dump from coldbox just IIS blah. I can dig throughcoldfusion logs though. I think my issue is that validatethis old version had like two approaches one using it as a module other as interceptor.

I ended up doing it really cheeky and just changing the afterAspectsLoad to be a function call and just calling it after configure() was done. So now i got it where the interceptor is running trying to figure out how to do the follow with it as interceptor (which might be wrong).

handler.cfc

property name=“ValidateThis” inject=“ValidateThis”;<—if i call this will this reference call the object that is called validatethis which is in of my interceptor or am I now mixing the two (figuing that out now)

function searching(event,rc,prc){

announceInterception(“prepareValidationRequest”);<—works fine

rc.Validator = ValidateThis.getValidator( objectType=“Search” );<—erroring it out It looks like its using ValidateThis basic not using what was loaded via configure interceptor

//then move on

event.setView(“docFinder/searching”);
}

I am not sure if interceptor is best approach or maybe putting it as a module and just leaving it at that. I could be way of track totally which is possible

So figured some stuff out using the interceptor I got it to work now.

in my handler i dropped the property inject

and now have this

function searching(event,rc,prc){

announceInterception(“prepareValidationRequest”);

// store Validator for this object in request collection for use in the view
getCache().get(‘ValidateThis’).getValidator( objectType=“some.file”,context=“Searchs”);<—I get back what I am expecting.

My question is at this point I am really interacting with validatethis which was set in cache at interceptors config. Now I believe are am moving away from using a true intercept concept should I keeping with this intended use.

go with something like this

function searching(event,rc,prc){

announceInterception(“prepareValidationRequest”);

rc.objectType=“some.file”;
rc.context=“Searchs”;
announceInterception(“prepareValidationRequestRequiredFields”); ← this would store it in a rc.requiredFields.

would that leverage me more in the long run getting every action in an announce?

Thanks for your time.