I have an event handler (ehMain.cfc) and I'm trying to inject one of
my manager objects into the handler. I have done the following
1. Added an alias in my ModelMappings.cfm file that points to my
model CFC.
2. I've added auotwire="true" to the event handler ehMain.cfc
3. I've added <cfproperty name="SecurityManager" type="model"
scope="instance" /> to the top of ehMain.cfc
4. I have this code snipept in my ColdBox.cfc file
As Aaron has said ColdBox 3.0 has changed the way it works, however it can
still work with lightwire in some cases. I am still converting a lot of this
stuff myself into the new V3.0 and once you get the hang of it you will see
how much less work it is and not to mention easier to actually learn.
I have an event handler (ehMain.cfc) and I'm trying to inject one of my
manager objects into the handler. I have done the following
1. Added an alias in my ModelMappings.cfm file that points to my model
CFC.
2. I've added auotwire="true" to the event handler ehMain.cfc
3. I've added <cfproperty name="SecurityManager" type="model"
scope="instance" /> to the top of ehMain.cfc 4. I have this code snipept
If you have not set this up in you beanconfig.cfc for lightwire or
coldspring, then this will not exist as an injection. Autowire prior to M6
needed this setup in your beanConfig as well as your interceptor to use
this.
Do you have any other places where this is working?
Again, using type=“model” does nothing anymore. This has been deprecated. The annotation is inject.
Also, if you make changes to your metadata in a handler, model object, etc. You will need to reinit for those changes to take effect as they are cached.
Yes, I understand that now but even changing the <cfproperty tag> as
you've all suggested results in the error I've described. I'm aware
that you must reinit the framework and I've done that over and over.
It isn't clear which scope, if any, this gets injected into, but I've
tried with and
without using the "scope" attribute to no avail.
I still get "Element SECURITYMANAGER is undefined in INSTANCE"
Sorry if I'm being a pain. I've used Lightwire before and it works, but
I'm
trying to just use the native functionality....
-West
> Again, using type="model" does nothing anymore. This has been
deprecated.
> The annotation is inject.
>
> Also, if you make changes to your metadata in a handler, model object,
etc.
> You will need to reinit for those changes to take effect as they are
> cached.
>
> 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
>
>
>
>
> > If you have not set this up in you beanconfig.cfc for lightwire or
> > coldspring, then this will not exist as an injection. Autowire prior
> > to M6 needed this setup in your beanConfig as well as your
> > interceptor to use this.
>
> > Do you have any other places where this is working?
>
> > Regards,
> > Andrew Scott
> >http://www.andyscott.id.au/
>
> > > From: coldbox@googlegroups.com
[mailto:coldbox@googlegroups.com]
> > > On Behalf Of West
> > > Sent: Tuesday, 7 September 2010 9:20 AM
> > > To: ColdBox Platform
> > > Subject: [coldbox:5606] Re: ColdBox DSL Problems?
>
> > > Thanks for all the replies...
>
> > > Aaron mentioned M6 from what I could tell. I'm using M5. Both M5
> > > and
> > > M6 are Coldbox 3, so I'm trying to understand does this:
>
> > > <cfproperty name="sm" type="model" scope="instance" />
>
> > > not work in M5?
>
> > > I get this error:
>
> > > "Element SECURITYMANAGER is undefined in INSTANCE"
>
> > > That error suggest that the SecurityManager object doesn't exist
> > > in the instance scope. I'm not trying to use Lightwire or
Coldspring.
>
> > > -West
>
> > > > As Aaron has said ColdBox 3.0 has changed the way it works,
> > > > however it can still work with lightwire in some cases. I am
> > > > still converting a lot of this stuff myself into the new V3.0
> > > > and once you get the hang of it you will see how much less work
> > > > it is and not to mention easier
> > to
> > > actually learn.
>
> > > > Regards,
> > > > Andrew Scotthttp://www.andyscott.id.au/
>
> > > > > From: coldbox@googlegroups.com
> > > > > [mailto:coldbox@googlegroups.com]
> > > On
> > > > > Behalf Of West
> > > > > Sent: Tuesday, 7 September 2010 8:53 AM
> > > > > To: ColdBox Platform
> > > > > Subject: [coldbox:5602] ColdBox DSL Problems?
>
> > > > > Hi,
>
> > > > > I have an event handler (ehMain.cfc) and I'm trying to inject
> > > > > one of my manager objects into the handler. I have done the
> > > > > following
>
> > > > > 1. Added an alias in my ModelMappings.cfm file that points to
> > > > > my model CFC.
> > > > > 2. I've added auotwire="true" to the event handler ehMain.cfc 3.
> > > > > I've added <cfproperty name="SecurityManager" type="model"
> > > > > scope="instance" /> to the top of ehMain.cfc 4. I have this
> > > > > code snipept
> > > > in
> > > > > my ColdBox.cfc file
>
> > > > > interceptors = [
> > > > > {class="coldbox.system.interceptors.Autowire"}
> > > > > ];
>
> > > > > When my event runs, I tried <cfdump
var="#instance.SecurityManager#"
> > > > > /
> > > > > ><cfabort /> I get an error saying that:
>
> > > > > "Element SECURITYMANAGER is undefined in INSTANCE"
>
> > > > > I can use getModel('SecurityManager') but that is not really
> > > > > using
> > > > injection
> > > > > right? I've looked over the model guide but I still get this