Passing environment specific datasource name to model using Wirebox

Hello,

This has got me stumped a little. I simply want to pass the
appropriate datasource name ( a string not the datasource bean) based
on my environment setting to my model's using the Wirebox's dependency
dsl.

In my Wirebox.cfc, I understand that I can do this:

mapPath("model.Services.ArticleService")
      .initArg(name="DSN1",value="Foo")

However, what I want to do is something like this using dsl (which
would pass the appropriate dsn name based on the enviroment):

mapPath("model.Services.ArticleService")
      .initArg(name="DSN1",dsl="coldbox:datasource:DSN1.Name")

Any way to do something like this?

Thanks,
Marcus

Ahh got it. Well remember that the wirebox binder has access to ALL of your coldbox configuration settings:

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

You can easily try dumping this:

so you can see all your settings and then use them via getProperty().

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

Thanks Luis!

Should have known it would be something easy to do.

On another note, I keep seeing this in my debugging tracer messages,
although the page works fine:

Message:
WARN 01:39:25.386 PM coldbox.system.ioc.Builder
The DSL dependency definition:
{JAVACAST={null},NAME={mailserver},DSL={model},REQUIRED={false},SCOPE={variables},VALUE={null},REF={null}}
did not produce any resulting dependency

I'm on using RC2.

Thanks!

It says it can find’t mailserver model mapping.

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