You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2006/05/19 22:57:42 UTC

Binding a class type to a component

Hi,

I need to pass a class to one of my components. I've tried something 
like below without success ...

    <component id="browser" type="Browser">
        <binding name="dataAccess" value="ognl:dataAccess"/>
        <binding name="size" value="5"/>
        <binding name="value" value="ognl:ad"/>
        *<binding name="type" 
value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
    </component>

Any idea ?

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


RE: Binding a class type to a component

Posted by Mark Stang <ms...@pingidentity.com>.
I think if you define it as of type java.lang.Class and pass in the type.

    <parameter name="certManager" type="java.lang.Object" required="no" direction="in"/>

Should enable you to check what you want.  Or just pass it in as type object.

regards,

Mark

-----Original Message-----
From: Stephane Decleire [mailto:sdecleire@cariboo-networks.com]
Sent: Fri 5/19/2006 3:11 PM
To: Tapestry users
Subject: Re: Binding a class type to a component
 
Thanks Mark but it seems i've not been very clear.
What i want to pass to my component is not a typed value but only the 
type so that i could get it in the component whith somthing like :

    @Parameter(required = true)
    public abstract Class getType();

For example, i would like to inform my Browser component that it will 
have to work with values of type Ad.class

Mark Stang wrote:

><component-specification class="com.pingidentity.component.CertificateSelectionList"
>    allow-body="yes"
>    allow-informal-parameters="yes">
>
>    <description>Provides a drop-down list of Certificates</description>
>
>    <parameter name="certType" type="java.lang.String"
>               required="no" direction="in"/>
>
>    <parameter name="certManager" type="java.lang.Object"
>               required="no" direction="in"/>
>
>    <parameter name="verificationCerts" type="java.util.Set"
>               required="no" direction="custom" />
>
>    <parameter name="connectionCerts" type="org.sourceid.saml20.domain.ConnectionCerts"
>               required="no" direction="custom" />
>
>    <parameter name="selectedCert" type="com.pingidentity.crypto.Cert"
>               required="no" direction="custom"/>
>
>    <parameter name="required" type="boolean"
>               required="no" direction="in" default-value="true"/>
>
>    <parameter name="selectPrompt" type="boolean"
>               required="no" direction="in" default-value="true" />
>
>    <parameter name="keyAlgorithmFilter" type="java.lang.Enum"
>        	   required="no" direction="in"/>
>
>    <parameter name="disabled" type="boolean"
>               required="no" direction="in" default-value="false"/>
>
></component-specification>
>
>
>
>-----Original Message-----
>From: Stephane Decleire [mailto:sdecleire@cariboo-networks.com]
>Sent: Fri 5/19/2006 2:57 PM
>To: users@tapestry.apache.org
>Subject: Binding a class type to a component
> 
>Hi,
>
>I need to pass a class to one of my components. I've tried something 
>like below without success ...
>
>    <component id="browser" type="Browser">
>        <binding name="dataAccess" value="ognl:dataAccess"/>
>        <binding name="size" value="5"/>
>        <binding name="value" value="ognl:ad"/>
>        *<binding name="type" 
>value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
>    </component>
>
>Any idea ?
>
>  
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06



Re: Binding a class type to a component

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Thanks Mark but it seems i've not been very clear.
What i want to pass to my component is not a typed value but only the 
type so that i could get it in the component whith somthing like :

    @Parameter(required = true)
    public abstract Class getType();

For example, i would like to inform my Browser component that it will 
have to work with values of type Ad.class

Mark Stang wrote:

><component-specification class="com.pingidentity.component.CertificateSelectionList"
>    allow-body="yes"
>    allow-informal-parameters="yes">
>
>    <description>Provides a drop-down list of Certificates</description>
>
>    <parameter name="certType" type="java.lang.String"
>               required="no" direction="in"/>
>
>    <parameter name="certManager" type="java.lang.Object"
>               required="no" direction="in"/>
>
>    <parameter name="verificationCerts" type="java.util.Set"
>               required="no" direction="custom" />
>
>    <parameter name="connectionCerts" type="org.sourceid.saml20.domain.ConnectionCerts"
>               required="no" direction="custom" />
>
>    <parameter name="selectedCert" type="com.pingidentity.crypto.Cert"
>               required="no" direction="custom"/>
>
>    <parameter name="required" type="boolean"
>               required="no" direction="in" default-value="true"/>
>
>    <parameter name="selectPrompt" type="boolean"
>               required="no" direction="in" default-value="true" />
>
>    <parameter name="keyAlgorithmFilter" type="java.lang.Enum"
>        	   required="no" direction="in"/>
>
>    <parameter name="disabled" type="boolean"
>               required="no" direction="in" default-value="false"/>
>
></component-specification>
>
>
>
>-----Original Message-----
>From: Stephane Decleire [mailto:sdecleire@cariboo-networks.com]
>Sent: Fri 5/19/2006 2:57 PM
>To: users@tapestry.apache.org
>Subject: Binding a class type to a component
> 
>Hi,
>
>I need to pass a class to one of my components. I've tried something 
>like below without success ...
>
>    <component id="browser" type="Browser">
>        <binding name="dataAccess" value="ognl:dataAccess"/>
>        <binding name="size" value="5"/>
>        <binding name="value" value="ognl:ad"/>
>        *<binding name="type" 
>value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
>    </component>
>
>Any idea ?
>
>  
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


RE: Binding a class type to a component

Posted by Mark Stang <ms...@pingidentity.com>.
<component-specification class="com.pingidentity.component.CertificateSelectionList"
    allow-body="yes"
    allow-informal-parameters="yes">

    <description>Provides a drop-down list of Certificates</description>

    <parameter name="certType" type="java.lang.String"
               required="no" direction="in"/>

    <parameter name="certManager" type="java.lang.Object"
               required="no" direction="in"/>

    <parameter name="verificationCerts" type="java.util.Set"
               required="no" direction="custom" />

    <parameter name="connectionCerts" type="org.sourceid.saml20.domain.ConnectionCerts"
               required="no" direction="custom" />

    <parameter name="selectedCert" type="com.pingidentity.crypto.Cert"
               required="no" direction="custom"/>

    <parameter name="required" type="boolean"
               required="no" direction="in" default-value="true"/>

    <parameter name="selectPrompt" type="boolean"
               required="no" direction="in" default-value="true" />

    <parameter name="keyAlgorithmFilter" type="java.lang.Enum"
        	   required="no" direction="in"/>

    <parameter name="disabled" type="boolean"
               required="no" direction="in" default-value="false"/>

</component-specification>



-----Original Message-----
From: Stephane Decleire [mailto:sdecleire@cariboo-networks.com]
Sent: Fri 5/19/2006 2:57 PM
To: users@tapestry.apache.org
Subject: Binding a class type to a component
 
Hi,

I need to pass a class to one of my components. I've tried something 
like below without success ...

    <component id="browser" type="Browser">
        <binding name="dataAccess" value="ognl:dataAccess"/>
        <binding name="size" value="5"/>
        <binding name="value" value="ognl:ad"/>
        *<binding name="type" 
value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
    </component>

Any idea ?

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06



Re: Binding a class type to a component

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Thanks Norbert.
It's obvious, class is a static property ... Sometimes, i should use my 
brain before sending an sos ...

Norbert Sándor wrote:

> Try
>
> ognl:@com.cariboonetworks.ad.model.Ad@class
>
> BR,
> Norbi
>
> Stephane Decleire wrote:
>
>> Hi,
>>
>> I need to pass a class to one of my components. I've tried something 
>> like below without success ...
>>
>>    <component id="browser" type="Browser">
>>        <binding name="dataAccess" value="ognl:dataAccess"/>
>>        <binding name="size" value="5"/>
>>        <binding name="value" value="ognl:ad"/>
>>        *<binding name="type" 
>> value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
>>    </component>
>>
>> Any idea ?
>>
>> ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.1.392 / Virus Database: 268.6.1/343 - Release Date: 
>> 2006.05.18.
>>   
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: Binding a class type to a component

Posted by Norbert Sándor <de...@erinors.com>.
Try

ognl:@com.cariboonetworks.ad.model.Ad@class

BR,
Norbi

Stephane Decleire wrote:
> Hi,
>
> I need to pass a class to one of my components. I've tried something 
> like below without success ...
>
>    <component id="browser" type="Browser">
>        <binding name="dataAccess" value="ognl:dataAccess"/>
>        <binding name="size" value="5"/>
>        <binding name="value" value="ognl:ad"/>
>        *<binding name="type" 
> value="ognl:com.cariboonetworks.ad.model.Ad.class"/>*
>    </component>
>
> Any idea ?
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.6.1/343 - Release Date: 2006.05.18.
>   

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