ColdBox / Lightwire - injecting a CB setting into a Transfer Decorator on init

Hi there,

Is it possible to inject a ColdBox setting into a Transfer Decorator
when that object is first called?

The scenario I have is this ....

I've got a Transfer "Login" object - in the Decorator I have a method
called "isUnlocked()" which checks to see if the internal counter of
login attempts has hit the limit and returns true / false for the
result.

The actually limit just now is 6 but what I don't like is the fact
this setting is hardcoded into the top of my Decorator.

What I would like ideally is to have ColdBox / Lightwire inject this
into the object when I make a call like so:

var objLogin = super.getTransfer().readByPropertyMap('login',propMap);

Where an instance of Transfer is coming from my Base Service & then
I'm making a save to objLogin from the call to readByPropertyMap()

Is that possible as I don't really want to have to do something like
this everytime I call for this object -

var objLogin = super.getTransfer().readByPropertyMap('login',propMap);
     objLogin.setLockLimit(super.getColdBox().getSetting('lockLimit');

Basically I need something like this but for LightWire :-
http://www.briankotek.com/blog/index.cfm/2008/1/14/My-Transfer-Decorator-Bean-Injector-Observer-Is-Now-Available

Cheers,
James

Ok a bit more investigation.... am I right in thinking I need to use
the TDOBeanInjectorObserver.cfc for this? Sounds along the same line
as Brian't CS approach

Managed to do it using the following documentation....
http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbTransferExtras

Guess the answer is - Always read the docs first :slight_smile:

LOL, I was about to answer, but it looks like you found it! Cool!

You can also do the same with ORM entities in ColdBox also using the ColdBox-Hibernate event handler and the Autowire interceptor.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com