Hi Rob,

DynamicXmlBeanFactory allows you to use ${key} anywhere in your xml, but
currently theres no way to tell ModelGlue to use anything other than
DefaultXmlBeansFactory

I'm not sure you need to use DynamicXmlBeanFactory if you're only setting
values in properties or constructor args, coldspring already provides you
with a way to set properties dynamically using the defaultProperties
argument to init().  see page 5 of the
docs<http://www.coldspringframework.org/downloads/ColdSpring_Reference.pdf>


However, i don't think these default properties will filter down from the
parent bean factory to ModelGlue's internal factory, so you'll need to set
them in both.

In you app's /index.cfm, include this

<cfset ModelGlue_LOCAL_COLDSPRING_DEFAULT_PROPERTIES = application.config />

Cheers, Chris

On 19 July 2011 12:40, Rawlins <[email protected]> wrote:

> Hello Guys,
>
> I've been playing around with an implementation for environment specific
> configuration variables. This has been done plenty of times before with
> ColdSpring, and using something like the DynamicXMLBeanFactory from Brian
> Kotek, however, I'm struggling to get it working in the context of
> ModelGlue.
>
> The end goal, is to be able to use values like this in my coldspring file,
> and have them variable upon the environment.
>
> <property name="debug"><value>${dev}</value></property>
>
> I start to do this by creating myself a parent bean factory. This bean
> factory is created using Brians project onApplicationStart().
>
> <!--- Instantiate the Bean Factory. A dynamic one for the environment
> specific stuff. --->
>
> <cfset application.beanfactory = createObject("component",
> "model.beanutils.DynamicXmlBeanFactory").init() />
>
>   <!--- Get the environment specific configuration settings. --->
>
> <cfset application.config = createObject("component",
> "model.environment.environment").init("/config/environment/environment.xml").getEnvironmentByURL(CGI.Server_Name)
> />
>
>   <!--- Load ColdSpring beans & set bean factory into the application
> scope, using our environment specific settings. --->
>
> <cfset application.beanfactory.loadBeansFromDynamicXmlFile(
> "/config/coldspring/beans.xml", application.config) />
>
>
>  I then plumb this parent bean factory into ModelGlue in the index.cfm
> file. (I've been using a parent bean factory for ages for other things and
> it works great)
>
> <cfset ModelGlue_PARENT_BEAN_FACTORY = application.beanfactory />
>
> However, when starting the application, I get an exception saying that the
> ormService object is not found in the config, which is frustrating. I've
> done some jiggling around by importing the
> /modelglue/gesture/configuration/modelglueconfiguration.xml into my
> /config/coldspring/beans.xml file which stops the exception being thrown on
> startup, but causes issues with the ormService still not working as it
> doesn't seem to be inited properly (it doesn't link to transfer) I also get
> stack overflow errors when reiniting the app.
>
> Has anyone got a setup similar to this working? or able to give some insite
> into how the parent bean factory setup with ModelGlue works, in which order
> the config files are loaded etc?
>
> Thanks.
>
> Robert
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to