WireBox & getSetting()

Is it possible to use the getSetting() within the WireBox.cfc?

I have an example of a java app that needs to be init’ed with a server IP which is currently stored in Coldbox.cfc’s Settings area.

Example:

map(“java”).toJava(‘javaclient’).initWith(getSetting(‘rmiServerIP’));

However when I try the above example, it can’t find the function getSetting.

Ideas/Suggestions?


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
RantsFromAMadMan.com

I haven't tested it, but I think you can use initArg() instead and
that has a DSL parameter where you should be able to specify the
"ColdBox:setting:myServerIP" DSL for it to build your argument with.

Here's an example of initArg() from the docs:

map("SearchService")
  .to("model.search.SearchService")
  .initArg(name="searchCriteria",dsl="provider:requestCriteria");

Thanks!

~Brad

In the docs it is metnioned that when coldbox creates the wirebox injector it passes ALL the configuration structure to it so the Binder can use them via the following methods:

getProperty()
propertyexists()
setProperty()
getProperties()

So if you do a dump of the binder’s instance scope, you will see that all the coldbox application settings are passed through.

Good one. I can't believe I read the docs and forgot about that.
Any reason why you used method names like getProperty() instead of
getSetting() since that is the convention elsewhere in ColdBox?

Does each injector have it's own "properties" which are a super-set of
the ColdBox settings (if even in use in a CB app) so you wanted to
differentiate between the actual ColdBox settings, and the copy of
them that had been placed in the injector?

~Brad

Well, the injector is initialized with a set of properties that passthrough, and these can be anything not only coldbox settings. So that is why I went with properties instead of settings.