overwrite DSN property

Sorry, thread jumping so I haven’t read the whole thing, but the proper syntax for that injection should be

This is the section of the wirebox docs that explains the DSL.

http://wiki.coldbox.org/wiki/WireBox.cfm#Injection_DSL

Curt

Curt’s right – sorry a typo on my part.

Thank you Curt. Tom no worries, I am just trying to be specific.
So technically it should be
because that is the path to the method in the component that is in the plugins folder, right?

No, it should be coldbox:myPlugin:pluginname

Thanks.
I still get dsn is undefined. Do I have to add a scope?

Nope – not unless you want to.

Have you done a reinit?

It should be

coldbox:myPlugin:{MyPlugin}

{MyPlugin} would be replaced with the name of the ColdBox plugin you created (the name of the plugin cfc) So if my plugin was named “datasource” then it would be

Then from within the handler, model, or whatever you are injecting into, you can call dsnPlugin.getName() to call your getName function within the plugin.

Keep in mind that if you are using this within a model object that you can’t create the object using CreateObject() or new() because then wirebox won’t know to do the injection, but if you are using Coldbox, you can get the model object by using getModel(“cfcName”).

Curt

Yes. I know I am missing somethiing. I have not gotten injection to work at all. I am a noob to Coldbox.

Do I have to add a setting or a mapping or some other information somewhere in coldbox to tell this to work?

I have coldbox installed in a directory other than root then I have created an app through the dashboard as an advanced app. So I have this
webroot
–test
----Me
------coldbox
--------testApp
----------plugins
Basically I have added the datsource setting in the coldbox.xml.cfm in the config folder under the testApp folder. My plugin is in the plugins folder, my model is in the model folder. I know I am missing something here.

Hmm, what version of ColdBox are you using?

I ma running 3.0

You are injecting your plugin into your model object correct?

How do you call your model object?