You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kado <ju...@condortech.com.ar> on 2010/11/02 19:13:46 UTC

Access to a component through an URL

Hi,

I am using some components for showing info in my webApp. Right now I am 
trying to access to some of these components by a direct URL (so I can 
access to this components from other webs, other processes and so on) 
and I don't know how to do this.

As we try to re-use as much as we can in my development team, we are 
working with a layout that includes different components. But now I am 
trying to access to one of this components not from the layout

I will need to create a new page that contains the component and have 
the url of this page? Or is any other option to access directly to the 
component without creating a page for it?

Can somebody help me with this problem?

Thanks!

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


Re: Layouts how-to

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 04 Nov 2010 14:24:03 -0200, Kado <ju...@condortech.com.ar>  
wrote:

> Hi,

Hi!

> We have seen 2 possible options.
> The first one:
> http://tapestry.apache.org/tapestry5/guide/layout.html
> We find out that this is not so useful to us because if the idea is to  
> have a general page (to be used in other projects), we can't define a  
> t:type in the page because we don't know if the webApp will have that  
> type defined.

You can. If the given component doesn't exist an exception will be thrown.  
The component is only resolved after the application is started.

> The only way we see is using by convention always "Layout.tml" in the  
> different webApps so that the weblibs refer to "Layout" in the  
> t:type(maybe is the way to use it).

That's a nice convention. :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Layouts how-to

Posted by Kado <ju...@condortech.com.ar>.
Hi,

After the other day mail (no direct URL access to components), we start 
to review our architecture and how to re-design things in order to have 
pages instead of components.

We have seen 2 possible options.
The first one:
http://tapestry.apache.org/tapestry5/guide/layout.html
We find out that this is not so useful to us because if the idea is to 
have a general page (to be used in other projects), we can't define a 
t:type in the page because we don't know if the webApp will have that 
type defined.
This is making a kind of circular dependency between the lib that 
contains the page and the webapp and we are not so sure if that is the best.
The only way we see is using by convention always "Layout.tml" in the 
different webApps so that the weblibs refer to "Layout" in the 
t:type(maybe is the way to use it).

The second option was the layout including blocks of components (the one 
we are using right now). But this solution is no longer useful to us 
because we are needing to access to some components through direct URL 
(that's not possible in tapestry).


Does anybody have some problem like this one? How can we solve this? Is 
the first option the only way to do it?


Thanks to everyone.

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


Re: Access to a component through an URL

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 02 Nov 2010 16:13:46 -0200, Kado <ju...@condortech.com.ar>  
wrote:

> Hi,

Olá, hermano! :)

> I am using some components for showing info in my webApp. Right now I am  
> trying to access to some of these components by a direct URL (so I can  
> access to this components from other webs, other processes and so on)  
> and I don't know how to do this.

Components don't have URLs because they only exist inside a page, so you  
have to rethink your solution. In Tapestry, just pages and events have  
URLs.

Use pages instead of components when you need to provide and URL for  
external use.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Access to a component through an URL

Posted by ael <al...@dash.com.ph>.
You cloud also combine 

LINK & IF :)
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Access-to-a-component-through-an-URL-tp3247169p3248003.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Access to a component through an URL

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 02 Nov 2010 17:26:10 -0200, Kado <ju...@condortech.com.ar>  
wrote:

> Thanks for the links, but this is not solving my problem.

It does solve, but you need to adapt your solution to the tool you're  
using. :)

> An example of what I am needing will be:
> "http://www.mysite.com/component" and this load the component in the  
> browser.

Short answer: this is impossible and doesn't make sense in Tapestry.
Long answer: create a page and use the component inside.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Access to a component through an URL

Posted by Christian Riedel <cr...@googlemail.com>.
sure!
read this page: http://tapestry.apache.org/tapestry5.1/cookbook/lib.html


Am 02.11.2010 um 20:59 schrieb Kado:

> First of all thanks for the hint.
> 
> We are doing this "component thing" in order to re-use pages across many webapps.
> Can we put pages in a library package??
> 
> Thanks.
> 
> 
> 
> 
> On 11/02/2010 04:36 PM, Thiago H. de Paula Figueiredo wrote:
>> On Tue, 02 Nov 2010 17:26:10 -0200, Kado <ju...@condortech.com.ar> wrote:
>> 
>>> Thanks for the links, but this is not solving my problem.
>>> An example of what I am needing will be:
>>> "http://www.mysite.com/component" and this load the component in the browser.
>> 
>> Ooops, I forgot to complete the long answer. :)
>> 
>> Components are not meant to render a complete response, pages and events (through returning a StreamResponse, JSONObject or JSONArray in their handler methods) are. Of course, you can have trigger and handle events in pages, componentes and also in mixins.
>> Pages and events have URLs, components don't. I'm not counting request filters and dispatchers here because they decide which URLs they handle.
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: Access to a component through an URL

Posted by Kado <ju...@condortech.com.ar>.
First of all thanks for the hint.

We are doing this "component thing" in order to re-use pages across many 
webapps.
Can we put pages in a library package??

Thanks.




On 11/02/2010 04:36 PM, Thiago H. de Paula Figueiredo wrote:
> On Tue, 02 Nov 2010 17:26:10 -0200, Kado <ju...@condortech.com.ar> 
> wrote:
>
>> Thanks for the links, but this is not solving my problem.
>> An example of what I am needing will be:
>> "http://www.mysite.com/component" and this load the component in the 
>> browser.
>
> Ooops, I forgot to complete the long answer. :)
>
> Components are not meant to render a complete response, pages and 
> events (through returning a StreamResponse, JSONObject or JSONArray in 
> their handler methods) are. Of course, you can have trigger and handle 
> events in pages, componentes and also in mixins.
> Pages and events have URLs, components don't. I'm not counting request 
> filters and dispatchers here because they decide which URLs they handle.
>

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


Re: Access to a component through an URL

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 02 Nov 2010 17:26:10 -0200, Kado <ju...@condortech.com.ar>  
wrote:

> Thanks for the links, but this is not solving my problem.
> An example of what I am needing will be:
> "http://www.mysite.com/component" and this load the component in the  
> browser.

Ooops, I forgot to complete the long answer. :)

Components are not meant to render a complete response, pages and events  
(through returning a StreamResponse, JSONObject or JSONArray in their  
handler methods) are. Of course, you can have trigger and handle events in  
pages, componentes and also in mixins.
Pages and events have URLs, components don't. I'm not counting request  
filters and dispatchers here because they decide which URLs they handle.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Access to a component through an URL

Posted by Kado <ju...@condortech.com.ar>.
Thanks for the links, but this is not solving my problem.

An example of what I am needing will be:
"http://www.mysite.com/component" and this load the component in the 
browser.




On 11/02/2010 03:53 PM, Muhammad Mohsen wrote:
> I don't think I can help you much, I haven't tackled such functionality yet.
>
> But check this page (I think this will solve it, but sadly there is no
> example on the page, may be you can google or search Google code for the
> annotation and see how it's utilized):
> http://tapestryjava.blogspot.com/2010/06/tapestry-52-improved-query-parameter.html
>
> <http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html>And this :
> http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html
>
> I'm not sure how can you use the parameter you got to make your components
> render in different ways !
> I only did that using ajax for now !
>
> Assuming you already got your parameter from the page, does that answer you
> question ? If you can proceed from here, please tell me how will you do it.
>
> <http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html>Sorry I
> couldn't help much.
>
> On Tue, Nov 2, 2010 at 8:38 PM, Kado<ju...@condortech.com.ar>  wrote:
>
>    
>> Thanks for the quick answer, Is a matter of how-to. What we are really
>> needing is an URL to access to a component.
>> In this case the component is a page in the package components.
>>
>> Is this possible?
>>
>> Thanks!
>>
>>
>>
>>
>>
>> On 11/02/2010 03:18 PM, Muhammad Mohsen wrote:
>>
>>      
>>> If you need to access ComponentA from ComponenB.
>>> And PageA contains ComponentB.
>>>
>>> Then add ComponentA to ComponentB (@InjectComponent). And pass a parameter
>>> to your page to invoke ComponentB in a way that would render ComponentA.
>>>
>>> Did I answer your question ?
>>> Is it a matter of organization or "how-to" ?
>>>
>>> On Tue, Nov 2, 2010 at 8:13 PM, Kado<ju...@condortech.com.ar>   wrote:
>>>
>>>
>>>
>>>        
>>>> Hi,
>>>>
>>>> I am using some components for showing info in my webApp. Right now I am
>>>> trying to access to some of these components by a direct URL (so I can
>>>> access to this components from other webs, other processes and so on) and
>>>> I
>>>> don't know how to do this.
>>>>
>>>> As we try to re-use as much as we can in my development team, we are
>>>> working with a layout that includes different components. But now I am
>>>> trying to access to one of this components not from the layout
>>>>
>>>> I will need to create a new page that contains the component and have the
>>>> url of this page? Or is any other option to access directly to the
>>>> component
>>>> without creating a page for it?
>>>>
>>>> Can somebody help me with this problem?
>>>>
>>>> Thanks!
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>          
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>      
>
>    

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


Re: Access to a component through an URL

Posted by Muhammad Mohsen <m....@gmail.com>.
I don't think I can help you much, I haven't tackled such functionality yet.

But check this page (I think this will solve it, but sadly there is no
example on the page, may be you can google or search Google code for the
annotation and see how it's utilized):
http://tapestryjava.blogspot.com/2010/06/tapestry-52-improved-query-parameter.html

<http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html>And this :
http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html

I'm not sure how can you use the parameter you got to make your components
render in different ways !
I only did that using ajax for now !

Assuming you already got your parameter from the page, does that answer you
question ? If you can proceed from here, please tell me how will you do it.

<http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html>Sorry I
couldn't help much.

On Tue, Nov 2, 2010 at 8:38 PM, Kado <ju...@condortech.com.ar> wrote:

> Thanks for the quick answer, Is a matter of how-to. What we are really
> needing is an URL to access to a component.
> In this case the component is a page in the package components.
>
> Is this possible?
>
> Thanks!
>
>
>
>
>
> On 11/02/2010 03:18 PM, Muhammad Mohsen wrote:
>
>> If you need to access ComponentA from ComponenB.
>> And PageA contains ComponentB.
>>
>> Then add ComponentA to ComponentB (@InjectComponent). And pass a parameter
>> to your page to invoke ComponentB in a way that would render ComponentA.
>>
>> Did I answer your question ?
>> Is it a matter of organization or "how-to" ?
>>
>> On Tue, Nov 2, 2010 at 8:13 PM, Kado<ju...@condortech.com.ar>  wrote:
>>
>>
>>
>>> Hi,
>>>
>>> I am using some components for showing info in my webApp. Right now I am
>>> trying to access to some of these components by a direct URL (so I can
>>> access to this components from other webs, other processes and so on) and
>>> I
>>> don't know how to do this.
>>>
>>> As we try to re-use as much as we can in my development team, we are
>>> working with a layout that includes different components. But now I am
>>> trying to access to one of this components not from the layout
>>>
>>> I will need to create a new page that contains the component and have the
>>> url of this page? Or is any other option to access directly to the
>>> component
>>> without creating a page for it?
>>>
>>> Can somebody help me with this problem?
>>>
>>> Thanks!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Software Programmer*

Re: Access to a component through an URL

Posted by Kado <ju...@condortech.com.ar>.
Thanks for the quick answer, Is a matter of how-to. What we are really 
needing is an URL to access to a component.
In this case the component is a page in the package components.

Is this possible?

Thanks!




On 11/02/2010 03:18 PM, Muhammad Mohsen wrote:
> If you need to access ComponentA from ComponenB.
> And PageA contains ComponentB.
>
> Then add ComponentA to ComponentB (@InjectComponent). And pass a parameter
> to your page to invoke ComponentB in a way that would render ComponentA.
>
> Did I answer your question ?
> Is it a matter of organization or "how-to" ?
>
> On Tue, Nov 2, 2010 at 8:13 PM, Kado<ju...@condortech.com.ar>  wrote:
>
>    
>> Hi,
>>
>> I am using some components for showing info in my webApp. Right now I am
>> trying to access to some of these components by a direct URL (so I can
>> access to this components from other webs, other processes and so on) and I
>> don't know how to do this.
>>
>> As we try to re-use as much as we can in my development team, we are
>> working with a layout that includes different components. But now I am
>> trying to access to one of this components not from the layout
>>
>> I will need to create a new page that contains the component and have the
>> url of this page? Or is any other option to access directly to the component
>> without creating a page for it?
>>
>> Can somebody help me with this problem?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>      
>
>    

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


Re: Access to a component through an URL

Posted by Muhammad Mohsen <m....@gmail.com>.
If you need to access ComponentA from ComponenB.
And PageA contains ComponentB.

Then add ComponentA to ComponentB (@InjectComponent). And pass a parameter
to your page to invoke ComponentB in a way that would render ComponentA.

Did I answer your question ?
Is it a matter of organization or "how-to" ?

On Tue, Nov 2, 2010 at 8:13 PM, Kado <ju...@condortech.com.ar> wrote:

> Hi,
>
> I am using some components for showing info in my webApp. Right now I am
> trying to access to some of these components by a direct URL (so I can
> access to this components from other webs, other processes and so on) and I
> don't know how to do this.
>
> As we try to re-use as much as we can in my development team, we are
> working with a layout that includes different components. But now I am
> trying to access to one of this components not from the layout
>
> I will need to create a new page that contains the component and have the
> url of this page? Or is any other option to access directly to the component
> without creating a page for it?
>
> Can somebody help me with this problem?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Software Programmer*