passing mach-ii properties into coldspring

3 views
Skip to first unread message

Brian Pickens

unread,
Aug 28, 2008, 11:50:20 AM8/28/08
to Mach-II for CFML
Hi guys,

I've seen it mentioned around the mailing list or alluded to but I've
not seen any how to's on how to do it.

How do I pass a mach-ii property into coldspring, mores specifically,
I want to be able to pass this property into a coldspring managed bean.

Adrian Moreno

unread,
Aug 28, 2008, 12:18:49 PM8/28/08
to mach-ii-for...@googlegroups.com
I think Andrew Leaf has all of this figured out. He was showing us some code at the last DFW CFUG.

Now if he would only POST IT TO THE LIST! :P

-- Adrian


From: Brian Pickens <brian.m...@gmail.com>
Sent: Thursday, August 28, 2008 10:50 AM
To: Mach-II for CFML <mach-ii-for...@googlegroups.com>
Subject: [Mach-II] passing mach-ii properties into coldspring

Leaf, Andrew

unread,
Aug 28, 2008, 2:22:07 PM8/28/08
to mach-ii-for...@googlegroups.com

I am working on a post and will be putting it on instant spot soon.

 

Andrew

 


I want to be able to pass this property into a coldspring managed bean.<br


CONFIDENTIALITY NOTICE: The information contained in this e-mail and attached document(s) may contain confidential information that is intended only for the addressee(s). If you are not the intended recipient, you are hereby advised that any disclosure, copying, distribution or the taking of any action in reliance upon the information is prohibited. If you have received this e-mail in error, please immediately notify the sender and delete it from your system.

Peter J. Farrell

unread,
Aug 28, 2008, 3:42:13 PM8/28/08
to mach-ii-for...@googlegroups.com
Even better donate your post to the Mach-II wiki as well as this tends me a common question on the list!  Let me know if you're interested and need help getting it on the wiki.

And Brian, if you are using the ColdspringProperty -- all M2 properties are passed into the CS bean factory. Just reference them with the placeholder syntax:

    <bean id="addressDao"
        class="model.address.address.addressDao_mysql">
        <constructor-arg name="dbDsn"><value>${dbDsn}</value></constructor-arg>
    </bean>

Best,
.Peter


Leaf, Andrew said the following on 8/28/2008 1:22 PM:

Brian Pickens

unread,
Aug 28, 2008, 3:58:49 PM8/28/08
to Mach-II for CFML
ah-ha, see I suspected that but its not explicitly stated anywhere.
Maybe it would be a good idea to place a line in the wiki about this.
Ill do it if you've got a good place for it. Anyway, thanks peter.

On Aug 28, 2:42 pm, "Peter J. Farrell" <pe...@mach-ii.com> wrote:
> Even better donate your post to the Mach-II wiki as well as this tends
> me a common question on the list! Let me know if you're interested and
> need help getting it on the wiki.
>
> And Brian, if you are using the ColdspringProperty -- all M2 properties
> are passed into the CS bean factory. Just reference them with the
> placeholder syntax:
>
> <bean id="addressDao"
> class="model.address.address.addressDao_mysql">
> <constructor-arg
> name="dbDsn"><value>${dbDsn}</value></constructor-arg>
> </bean>
>
> Best,
> .Peter
>
> Leaf, Andrew said the following on 8/28/2008 1:22 PM:
>
>
>
> > I am working on a post and will be putting it on instant spot soon.
>
> > Andrew
>
> > ------------------------------------------------------------------------
>
> > *From:* mach-ii-for...@googlegroups.com
> > [mailto:mach-ii-for...@googlegroups.com] *On Behalf Of *Adrian
> > Moreno
> > *Sent:* Thursday, August 28, 2008 11:19 AM
> > *To:* mach-ii-for...@googlegroups.com
> > *Subject:* [Mach-II] Re: passing mach-ii properties into coldspring
>
> > I think Andrew Leaf has all of this figured out. He was showing us
> > some code at the last DFW CFUG.
>
> > Now if he would only POST IT TO THE LIST! :P
>
> > -- Adrian
>
> > ------------------------------------------------------------------------
>
> > **From**: Brian Pickens <brian.m.pick...@gmail.com>
> > **Sent**: Thursday, August 28, 2008 10:50 AM
> > **To**: Mach-II for CFML <mach-ii-for...@googlegroups.com>
> > **Subject**: [Mach-II] passing mach-ii properties into coldspring

.jonah

unread,
Aug 28, 2008, 4:20:01 PM8/28/08
to Mach-II for CFML
Now if only we could pass in complex and/or nested properties...
mach-ii.xml:
<property name="generalInfo">
<struct>
<key name="siteName" value=" Foo" />
...
</struct>
</property>

coldsrpring services.xml:
<bean id="addressDao"
class="model.address.address.addressDao_mysql">
<constructor-arg name="SiteName"><value>$
{generalInfo.siteName}</value></constructor-arg>
or even:
<constructor-arg name="generalInfo"><value>${generalInfo}</
value></constructor-arg>
</bean>

I got excited and thought maybe that's where things were going with
ExpressionEvaluator.cfc in the latest BER. ;)

On Aug 28, 12:42 pm, "Peter J. Farrell" <pe...@mach-ii.com> wrote:
> Even better donate your post to the Mach-II wiki as well as this tends
> me a common question on the list!  Let me know if you're interested and
> need help getting it on the wiki.
>
> And Brian, if you are using the ColdspringProperty -- all M2 properties
> are passed into the CS bean factory. Just reference them with the
> placeholder syntax:
>
>     <bean id="addressDao"
>         class="model.address.address.addressDao_mysql">
>         <constructor-arg
> name="dbDsn"><value>${dbDsn}</value></constructor-arg>
>     </bean>
>
> Best,
> .Peter
>
> Leaf, Andrew said the following on 8/28/2008 1:22 PM:
>
>
>
> > I am working on a post and will be putting it on instant spot soon.
>
> > Andrew
>
> > ------------------------------------------------------------------------
>
> > *From:* mach-ii-for...@googlegroups.com
> > [mailto:mach-ii-for...@googlegroups.com] *On Behalf Of *Adrian
> > Moreno
> > *Sent:* Thursday, August 28, 2008 11:19 AM
> > *To:* mach-ii-for...@googlegroups.com
> > *Subject:* [Mach-II] Re: passing mach-ii properties into coldspring
>
> > I think Andrew Leaf has all of this figured out. He was showing us
> > some code at the last DFW CFUG.
>
> > Now if he would only POST IT TO THE LIST! :P
>
> > -- Adrian
>
> > ------------------------------------------------------------------------
>
> > **From**: Brian Pickens <brian.m.pick...@gmail.com>
> > **Sent**: Thursday, August 28, 2008 10:50 AM
> > **To**: Mach-II for CFML <mach-ii-for...@googlegroups.com>
> > **Subject**: [Mach-II] passing mach-ii properties into coldspring

Peter J. Farrell

unread,
Aug 28, 2008, 4:31:36 PM8/28/08
to mach-ii-for...@googlegroups.com
.jonah said the following on 8/28/2008 3:20 PM:

Peter J. Farrell

unread,
Aug 28, 2008, 4:35:06 PM8/28/08
to mach-ii-for...@googlegroups.com
Sorry for the blank reply if that comes through.

You can do that - this is more of  CS concern.  Once M2 passes CS the properties, you're in the realm of CS's codebase.  You can do what you ask:

<property name="someProperty"><map>${someStruct}</map></property>
<property name="someProperty"><list>${someArray}</list></property>

This functionality was added in the following ticket (submitted by yours truly):
http://code.coldspringframework.org/browse/CSP-81

Best,
.Peter

.jonah said the following on 8/28/2008 3:20 PM:

.jonah

unread,
Aug 28, 2008, 5:04:10 PM8/28/08
to Mach-II for CFML
Sexy! That works for 1/2 of my examples, but is definitely useful. :)
Reply all
Reply to author
Forward
0 new messages