I just replied on the "MG controllers reference CS beans" thread with pretty much the same problem (unfortunately I just now saw this post). I've tried using the parent bean factory, but the variables don't seem to get evaluated by MG.
-Tony On Dec 15, 4:44 am, Chris Blackwell <[email protected]> wrote: > You've probably moved on from here, but i was just reading the recent > thread on controllers and coldspring (http://groups.google.com/group/ > model-glue/browse_thread/thread/4bfdecab6b1ba23f?hl=en#) and thought > this might provide a solution for you. > > If you define your controllers in a _parent_ coldspring bean factory > and then reference the beans in your mg.xml then you can use Brian > Koteks DynamicXMLBeanFactory (part ofhttp://coldspringutils.riaforge.org/) > to replace the class path with your clients specific path > > in the parent coldspring.xml > > <bean id="userController" > class="{clientClassPath}.controllers.UserController"> > <property name="userService"> > <ref bean="userService" /> > </property> > </bean> > > in mg.xml > > <controllers> > <controller id="userController" bean="userController"> > <message-listener message="getUsers" function="getUsers" /> > </controller> > </controllers> > > in Application.cfc > <cfset settings = structnew() /> > <cfset settings["clientClassPath"] = "customer.foo.com" /> > <cfset application.cs = createobject("component", > "coldspring.utils.DynamicXMLBeanFactory").init() /> > <cfset application.cs.loadBeansFromDynamicXmlFile("/config/ > controllers.xml", settings) /> > > in index.cfm > > <cfset ModelGlue_PARENT_BEAN_FACTORY = application.cs /> > > I've not tried this so i might have missed something, but it looks > like it should work. > > Chris > > On Nov 19, 7:33 pm, Jonathan Logue <[email protected]> wrote: > > > Since we have such a range of experience levels, I hesitate to throw > > ANT into the mix. Nobody in our client implementation group has used > > MG or ColdSpring and along with a more service-oriented architecture > > we already have a steep learning curve. I think that is direction we > > will go in the future. Thanks for the feedback. > > > On Nov 19, 11:03 am, Sean Coyne <[email protected]> wrote: > > > > You can use ANT to look for and replace the {companyRoot} or other > > > variable strings that you create. > > > > On Nov 19, 12:57 pm, Jonathan Logue <[email protected]> wrote: > > > > > Yeah, that might be the only option. This is going to be used by > > > > developers with a wide variety of expertise, so I am trying to make it > > > > as straight forward as possible... I suppose I could bury the > > > > generated files someplace obscure to avoid the confusion of multiple > > > > MG files. > > > > > Thanks for the input! > > > > > On Nov 19, 9:34 am, "Chris Peterson" <[email protected]> wrote: > > > > > > If there is it would make my life easier as well, but for now I just > > > > > placed > > > > > variables in there like {companyRoot}, and then onApplicationStart, I > > > > > copy > > > > > from my shared source file to a new per-application location, and > > > > > replace > > > > > all instances of {companyRoot} with the proper string. Takes just a > > > > > second > > > > > when your app first starts, and is worth it in the flexibility of not > > > > > having > > > > > to maintain 5 copies of controller / transfer / coldspring / > > > > > model-glue > > > > > config files! > > > > > > Chris Peterson > > > > > > On Wed, Nov 19, 2008 at 12:15 PM, Jonathan Logue > > > > > <[email protected]>wrote: > > > > > > > I am sure this has been posted somewhere at sometime, but I am not > > > > > > finding anything... > > > > > > > Is there a way to use a variable in a controller's class path? > > > > > > > <controllers> > > > > > > <controller name="Controller" > > > > > > type="[custom_mapping].web.mod.Controller"> > > > > > > </controllers> > > > > > > > We have an application template in source control that we use as a > > > > > > starting point for deploying an application to multiple servers, but > > > > > > the CF mappings will be different in every situation. We have the > > > > > > code > > > > > > organized so that the Controller, ModelGlue, and ColdSpring > > > > > > configuration files are all module specific and reside in a number > > > > > > of > > > > > > different folders. It is a pain to go in and change every class > > > > > > path, > > > > > > so having some way to use a variable would be a nicety. > > > > > > > Thanks, > > > > > > > Jonathan Logue > > > > > > -- > > > > > Hey! I dont tell you how to tell me what to do, so dont tell me how > > > > > to do > > > > > what you tell me to do! ~ Bender (Futurama)- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
