If I understand your question, one way that I have approached this is to actually go the other direction by making ImageSettingsHelper a bean in your CS config, then having some type of plugin that loads it as a M2 property at application init.
~Dave Shuck /************************************** blog: www.daveshuck.com tweets: www.twitter.com/dshuck cf peeps: www.dfwcfug.org **************************************/ On Thu, Apr 15, 2010 at 4:25 PM, Brian FitzGerald <[email protected]>wrote: > Hey guys, I just finished reading this thread about injecting Mach-II > properties in your model, but for some reason I'm lost on this. > > http://groups.google.com/group/mach-ii-for-coldfusion/browse_thread/thread/d68896c29f8ccce/ac2e2d378dc49554?lnk=gst&q=properties+model#ac2e2d378dc49554 > > Basically I have an Mach-II property object called ImageSettingsHelper > which interacts with an xml file that tells me various image settings > (path, required dimensions, etc.). The reason I made it a Mach-II > property, is because I need it in my views to grab the correct path > based on an image type, i.e. > <img src="#imageSettingsHelper.getPath('icon')#" /> > > But I also need it in my model for when I upload images so I know > where to save them. > getFileService().uploadFile(myImage) > > Where I'm getting hung up, is for the life of me I cannot figure out > how to get the property passed into necessary model objects. I've > passed simple values in ColdSprings xml config file ... i.e. ${dsn}, > but how can I get a Mach-II property object injected into my model? > > <bean id="imageSet" singleton="false" > class="model.businessObjects.ImageSet"> > <constructor-arg name="imageSettingsHelper"><value>$ > {imageSettingsHelper}</value></constructor-arg> > </bean> > > This breaks, because ColdSpring won't let you pass complex values, but > what's a reasonable work around here? Honestly at this point I'll > take any work around, reasonable or not =) > > Thanks, > Brian > > -- > You received this message because you are subscribed to Mach-II for CFML > list. > 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/mach-ii-for-coldfusion?hl=en > SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ > Wiki / Documentation / Tickets: > http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ -- You received this message because you are subscribed to Mach-II for CFML list. 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/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ To unsubscribe, reply using "remove me" as the subject.
