You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kevin Menard <km...@servprise.com> on 2005/09/01 16:42:21 UTC

Meta data and HiveMind?

Hi,

I've just created my first service and am trying to tie it in with  
HiveMind.  I have a boolean property in this service for indicating  
whether or not to run in debug mode.  In my app spec I have a meta  
property called "debug" with a current value of "true".  In my  
<invoke-factory block> I have a <set-object> that uses the value "app- 
property:debug".  Anyway, the problem is that HiveMind is calling my  
setter with a String argument rather than the boolean I'm expecting;  
i.e., there's no type coercion.  Is there anyway to coerce the  
types?  I'd really rather not have the setter accept strings or write  
some mediator to convert the data types.  At that point, it hardly  
seems like I've saved myself any effort or complexity.

Any help would be appreciated.

Thanks,
Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Meta data and HiveMind?

Posted by Kevin Menard <km...@servprise.com>.
On Sep 1, 2005, at 11:26 AM, Jesse Kuhnert wrote:

> Oh..Sorry..Not familiary with this "app-property" binding that you are
> using. I've been using the symbols replacement package. ..If you  
> change your
> setter to only accept booleans does it blow up?

Yeap, that's the problem.  HiveMind throws an  
IllegalArgumentException, complaining about that argument types don't  
match up.

-- 
Kevin

Re: Meta data and HiveMind?

Posted by Jesse Kuhnert <jk...@gmail.com>.
Oh..Sorry..Not familiary with this "app-property" binding that you are 
using. I've been using the symbols replacement package. ..If you change your 
setter to only accept booleans does it blow up?

On 9/1/05, Kevin Menard <km...@servprise.com> wrote:
> 
> 
> On Sep 1, 2005, at 10:51 AM, Jesse Kuhnert wrote:
> 
> > There are tons of different ways to coerce values built in to
> > hivemind, but
> > I think using the set-property element combined with a value of
> > "ognl:true"
> > might work?
> 
> Well, the idea of having it as an app property is so that I only have
> to change this "debug" value in one place. Or are you suggesting
> make the meta value "ognl:true"?
> 
> Thanks,
> Kevin
>

Re: Meta data and HiveMind?

Posted by Kevin Menard <km...@servprise.com>.
On Sep 1, 2005, at 10:51 AM, Jesse Kuhnert wrote:

> There are tons of different ways to coerce values built in to  
> hivemind, but
> I think using the set-property element combined with a value of  
> "ognl:true"
> might work?

Well, the idea of having it as an app property is so that I only have  
to change this "debug" value in one place.  Or are you suggesting  
make the meta value "ognl:true"?

Thanks,
Kevin

Fwd: Re: Meta data and HiveMind?

Posted by Kevin Menard <km...@servprise.com>.
I didn't get a response on the user list, and given that it's probably  
more appropriate for the dev list, I'm forwarding it here.  Apologies to  
those that have seen it before.

-- 
Kevin

------- Forwarded message -------
From: "Kevin Menard" <km...@servprise.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Cc:
Subject: Re: Meta data and HiveMind?
Date: Mon, 31 Oct 2005 15:26:30 -0500

Given that HiveMind 1.1 has been released without a fix for HIVEMIND-151
(the report for the below bug), is there going to be a straightforward way
of converting meta values into other types in the T4 release?

Thanks,
Kevin

On Thu, 01 Sep 2005 14:09:44 -0400, Howard Lewis Ship <hl...@gmail.com>
wrote:

> In HiveMind, the <set> element (of <construct>, with BuilderFactory)
> will do simple string->primitive conversions.
>
> Alas, the <set-object> element does no conversion at all.
>
> This is really a HiveMind bug ... it should see if the object result
> is java.lang.String and to a simple conversion for it.
>
> Tapestry has a much more involved data-type-conversion system in
> place, used to convert properties of any type to any desired type (or
> explain why it can't).  It's simple, but works.  I've heard of systems
> that can forward- and back-chain conversions until it finds a way to
> convert ... that's probably overkill for Tapestry.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Meta data and HiveMind?

Posted by Kevin Menard <km...@servprise.com>.
Given that HiveMind 1.1 has been released without a fix for HIVEMIND-151  
(the report for the below bug), is there going to be a straightforward way  
of converting meta values into other types in the T4 release?

Thanks,
Kevin

On Thu, 01 Sep 2005 14:09:44 -0400, Howard Lewis Ship <hl...@gmail.com>  
wrote:

> In HiveMind, the <set> element (of <construct>, with BuilderFactory)
> will do simple string->primitive conversions.
>
> Alas, the <set-object> element does no conversion at all.
>
> This is really a HiveMind bug ... it should see if the object result
> is java.lang.String and to a simple conversion for it.
>
> Tapestry has a much more involved data-type-conversion system in
> place, used to convert properties of any type to any desired type (or
> explain why it can't).  It's simple, but works.  I've heard of systems
> that can forward- and back-chain conversions until it finds a way to
> convert ... that's probably overkill for Tapestry.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Meta data and HiveMind?

Posted by Howard Lewis Ship <hl...@gmail.com>.
In HiveMind, the <set> element (of <construct>, with BuilderFactory)
will do simple string->primitive conversions.

Alas, the <set-object> element does no conversion at all.

This is really a HiveMind bug ... it should see if the object result
is java.lang.String and to a simple conversion for it.

Tapestry has a much more involved data-type-conversion system in
place, used to convert properties of any type to any desired type (or
explain why it can't).  It's simple, but works.  I've heard of systems
that can forward- and back-chain conversions until it finds a way to
convert ... that's probably overkill for Tapestry.

On 9/1/05, Kevin Menard <km...@servprise.com> wrote:
> 
> On Sep 1, 2005, at 11:30 AM, Kent Tong wrote:
> 
> > Try:
> >
> > <set property="debug" value="true"/>
> >
> > It will try to convert it automatically.
> 
> Hmm . . . but as far as I know, <set> doesn't allow prefixes.  Please
> correct me if I'm wrong.  I'd ideally be pulling this value out of my
> app spec.
> 
> Thanks,
> Kevin
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Meta data and HiveMind?

Posted by Kevin Menard <km...@servprise.com>.
On Sep 1, 2005, at 11:30 AM, Kent Tong wrote:

> Try:
>
> <set property="debug" value="true"/>
>
> It will try to convert it automatically.

Hmm . . . but as far as I know, <set> doesn't allow prefixes.  Please  
correct me if I'm wrong.  I'd ideally be pulling this value out of my  
app spec.

Thanks,
Kevin

Re: Meta data and HiveMind?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Jesse Kuhnert <jkuhnert <at> gmail.com> writes:

> 
> There are tons of different ways to coerce values built in to hivemind, but 
> I think using the set-property element combined with a value of "ognl:true" 
> might work? 

Try:

<set property="debug" value="true"/>

It will try to convert it automatically.

--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Meta data and HiveMind?

Posted by Jesse Kuhnert <jk...@gmail.com>.
There are tons of different ways to coerce values built in to hivemind, but 
I think using the set-property element combined with a value of "ognl:true" 
might work? 

On 9/1/05, Kevin Menard <km...@servprise.com> wrote:
> 
> Hi,
> 
> I've just created my first service and am trying to tie it in with
> HiveMind. I have a boolean property in this service for indicating
> whether or not to run in debug mode. In my app spec I have a meta
> property called "debug" with a current value of "true". In my
> <invoke-factory block> I have a <set-object> that uses the value "app-
> property:debug". Anyway, the problem is that HiveMind is calling my
> setter with a String argument rather than the boolean I'm expecting;
> i.e., there's no type coercion. Is there anyway to coerce the
> types? I'd really rather not have the setter accept strings or write
> some mediator to convert the data types. At that point, it hardly
> seems like I've saved myself any effort or complexity.
> 
> Any help would be appreciated.
> 
> Thanks,
> Kevin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

RE: Meta data and HiveMind?

Posted by Patrick Casey <pa...@adelphia.net>.
	If you still need I Kevin, I have a wrapper class around somewhere
that does aggressive type conversion and allows get/set of any bean property
by name e.g. public void setFieldByName(String FieldName, Object Value).

	--- Pat

> -----Original Message-----
> From: Kevin Menard [mailto:kmenard@servprise.com]
> Sent: Thursday, September 01, 2005 7:42 AM
> To: Tapestry users
> Subject: Meta data and HiveMind?
> 
> Hi,
> 
> I've just created my first service and am trying to tie it in with
> HiveMind.  I have a boolean property in this service for indicating
> whether or not to run in debug mode.  In my app spec I have a meta
> property called "debug" with a current value of "true".  In my
> <invoke-factory block> I have a <set-object> that uses the value "app-
> property:debug".  Anyway, the problem is that HiveMind is calling my
> setter with a String argument rather than the boolean I'm expecting;
> i.e., there's no type coercion.  Is there anyway to coerce the
> types?  I'd really rather not have the setter accept strings or write
> some mediator to convert the data types.  At that point, it hardly
> seems like I've saved myself any effort or complexity.
> 
> Any help would be appreciated.
> 
> Thanks,
> Kevin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org