You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Wong <be...@matthiasgroup.com> on 2005/08/03 01:06:45 UTC

Rico Ajax / Tapestry - How to Call Tapestry URL

Hi everyone,

 

I am trying to get the Rico LiveGrid (built on top of Ajax) to work with
Tapestry.  Basically, the JavaScript in Rico LiveGrid needs to call an URL
that will come back with a XML response.  However, the URL that LiveGrid
generates is in the form of GET parameters.  For example, if I give it a URL
such as "app?service=direct/1/CustomerListResponsePage.getList", LiveGrid
will end up calling a URL that looks like this:

 

/app?service=direct/1/CustomerListResponsePage.getList?id=customerList&page_
size=35&offset=0&_=

 

There is nothing I can do about these parameters unless I change the
JavaScript code (in LiveGrid) which is not an option.  When I did try the
above, I get back the error
"org.apache.tapestry.ApplicationRuntimeException: Service direct requires
either three or four service context parameters.".  

 

Basically, I do not understand how I can call a Tapestry page that
understands simple GET parameters.  Is this even possible without writing a
new EngineService or something?  Any recommendations or pointers to how to
do this are greatly appreciated.

 

The Rico LiveTable docs is at: http://openrico.org/rico/docs.page for those
of you who are interested.

 

Thanks in advance,

Ben 


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Jesse Kuhnert <jk...@gmail.com>.
I think some of the problems you are experiencing are part of a bug I
found in the current version of protoype, which I've yet to patch back
to them. (I only found and fixed it a day or so ago).

Those interested in tapestry/ajax would benefit from taking a look at
tacos.sourceforge.net. The current release has a few ajax components,
and the current release being worked on (mostly in the mailing list)
is providing a comprehensive support system for ajax tapestry logic
that should fit most peoples needs. It will hopefully provide
equivalent functionality to that of projects like ruby on rails...

The ajax branch being worked on is also heavily involved in
integrating Rico, which ~will~ mean LiveGrid as well, so interested
parties may want to take a peak..

jesse
On 8/18/05, Ben Wong <be...@matthiasgroup.com> wrote:
> 
> Don't know if anyone still cares, but I solved the problem (with the
> recommendations of others in this list) by using a servlet filter.  The
> servlet filter simply checks the incoming URL and rewriting any '?' to '&'
> in the query string (e.g. httpRequest.getQueryString()).  I must admit it is
> a hack but it worked for me.
> 
> On another related note, I gave up on the Rico LiveGrid because I couldn't
> get it to refresh with new records.  And sometimes it was firing off queries
> to the db at random times.  I am sure it is a user problem (not LiveGrid's
> fault), but I didn't have any more time trying to get it to work.  The
> documentation on what the parameters are and how to set them properly also
> wasn't there.  I also realize that we don't have tables that have thousands
> of records (not yet anyway) - so the requirement to use LiveGrid just wasn't
> there.
> 
> I think it is cool technology and I plan to try to use it again in the
> future.
> 
> Thanks all those who help,
> Ben
> 
> 
> > -----Original Message-----
> > From: Darío Vasconcelos [mailto:dario.vasconcelos@gmail.com]
> > Sent: Friday, August 12, 2005 10:39 AM
> > To: Tapestry users
> > Subject: Re: Rico Ajax / Tapestry - How to Call Tapestry URL
> >
> > I do think it would make a cleaner solution. Better yet, if the
> > parameters could be wrapped into a Tapestry-like URL, it would turn
> > LiveGrid into an almost-native component. Maybe someone with
> > experience in Tapestry/Ajax integration could help you...
> >
> > Ben (the original poster) might enlighten us by telling us how he
> > worked it out...
> >
> > On 8/12/05, Richard Cowin <ri...@gmail.com> wrote:
> > > Hi,
> > > I am the designer of Rico's LiveGrid.
> > > Please, excuse my Tapestry ignorance.
> > >
> > > If LiveGrid supported a fixed parameter for the
> > "?service=external/foo&",
> > > would that make a cleaner solution for this issue?   If so, this seems
> > > like  a reasonable thing for LiveGrid  to support and I will post an
> > issue
> > > for  it.
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > --
> > I have enough money to last me the rest of my life, unless I buy
> > something.
> >     Jackie Mason
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

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


RE: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Ben Wong <be...@matthiasgroup.com>.
Don't know if anyone still cares, but I solved the problem (with the
recommendations of others in this list) by using a servlet filter.  The
servlet filter simply checks the incoming URL and rewriting any '?' to '&'
in the query string (e.g. httpRequest.getQueryString()).  I must admit it is
a hack but it worked for me.

On another related note, I gave up on the Rico LiveGrid because I couldn't
get it to refresh with new records.  And sometimes it was firing off queries
to the db at random times.  I am sure it is a user problem (not LiveGrid's
fault), but I didn't have any more time trying to get it to work.  The
documentation on what the parameters are and how to set them properly also
wasn't there.  I also realize that we don't have tables that have thousands
of records (not yet anyway) - so the requirement to use LiveGrid just wasn't
there.

I think it is cool technology and I plan to try to use it again in the
future.

Thanks all those who help,
Ben
 

> -----Original Message-----
> From: Darío Vasconcelos [mailto:dario.vasconcelos@gmail.com]
> Sent: Friday, August 12, 2005 10:39 AM
> To: Tapestry users
> Subject: Re: Rico Ajax / Tapestry - How to Call Tapestry URL
> 
> I do think it would make a cleaner solution. Better yet, if the
> parameters could be wrapped into a Tapestry-like URL, it would turn
> LiveGrid into an almost-native component. Maybe someone with
> experience in Tapestry/Ajax integration could help you...
> 
> Ben (the original poster) might enlighten us by telling us how he
> worked it out...
> 
> On 8/12/05, Richard Cowin <ri...@gmail.com> wrote:
> > Hi,
> > I am the designer of Rico's LiveGrid.
> > Please, excuse my Tapestry ignorance.
> >
> > If LiveGrid supported a fixed parameter for the
> "?service=external/foo&",
> > would that make a cleaner solution for this issue?   If so, this seems
> > like  a reasonable thing for LiveGrid  to support and I will post an
> issue
> > for  it.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> --
> I have enough money to last me the rest of my life, unless I buy
> something.
>     Jackie Mason
> 
> ---------------------------------------------------------------------
> 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


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Darío Vasconcelos <da...@gmail.com>.
I do think it would make a cleaner solution. Better yet, if the
parameters could be wrapped into a Tapestry-like URL, it would turn
LiveGrid into an almost-native component. Maybe someone with
experience in Tapestry/Ajax integration could help you...

Ben (the original poster) might enlighten us by telling us how he
worked it out...

On 8/12/05, Richard Cowin <ri...@gmail.com> wrote:
> Hi,
> I am the designer of Rico's LiveGrid.
> Please, excuse my Tapestry ignorance.
> 
> If LiveGrid supported a fixed parameter for the "?service=external/foo&",
> would that make a cleaner solution for this issue?   If so, this seems
> like  a reasonable thing for LiveGrid  to support and I will post an issue
> for  it.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
I have enough money to last me the rest of my life, unless I buy something.
    Jackie Mason

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


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Richard Cowin <ri...@gmail.com>.
Hi, 
I am the designer of Rico's LiveGrid.  
Please, excuse my Tapestry ignorance.

If LiveGrid supported a fixed parameter for the "?service=external/foo&",  
would that make a cleaner solution for this issue?   If so, this seems 
like  a reasonable thing for LiveGrid  to support and I will post an issue
for  it.  




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


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Mark Dillon <md...@gmail.com>.
I think Danny's solution together with friendly URLs should solve your
problem.  I'll give it a shot when I get home tonight and let you know
what I find.  I'm using Tap 4, which has built in friendly URL
support.  If you're using Tap 3 you'll need to implement the friendly
URL patch from the Tapestry WIKI...

Cheers,
Mark

On 8/2/05, Darío Vasconcelos <da...@gmail.com> wrote:
> But with an IExternalPage you'd still need to pass the
> "?service=external/foo&" part and I don't think this is an option with
> the RicoLiveGrid.
> 
> So it looks as you might need to implement a Service. Another option
> would be creating a JSP (say, TapestryRedirectToFoo.jsp) that would
> redirect the request to Tapestry, adding the "service=external/foo"
> part to the queryString. This ugly hack isn't exactly an
> **integration** with tapestry, of course.
> 
> Dario
> 
> On 8/2/05, Danny Mandel <dm...@tolweb.org> wrote:
> > Hi Ben.  You can implement IExternalPage and get your GET parameters
> > from there.  I use this technique for integrating Tapestry with external
> > apps.
> >
> > For example:
> >
> > public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
> >         RequestContext context = cycle.getRequestContext();
> >         userName = context.getParameter("userName");
> >         groupName = context.getParameter("group");
> >     }
> >
> > If this was in a page named foo you'd have a url like this:
> > http://yourhost/appname/app?service=external/foo&userName=xxx&group=yyy
> >
> > And any get parameters would be available via the RequestContext.
> >
> > Good luck,
> > Danny
> >
> > Ben Wong wrote:
> >
> > >Hi everyone,
> > >
> > >
> > >
> > >I am trying to get the Rico LiveGrid (built on top of Ajax) to work with
> > >Tapestry.  Basically, the JavaScript in Rico LiveGrid needs to call an URL
> > >that will come back with a XML response.  However, the URL that LiveGrid
> > >generates is in the form of GET parameters.  For example, if I give it a URL
> > >such as "app?service=direct/1/CustomerListResponsePage.getList", LiveGrid
> > >will end up calling a URL that looks like this:
> > >
> > >
> > >
> > >/app?service=direct/1/CustomerListResponsePage.getList?id=customerList&page_
> > >size=35&offset=0&_=
> > >
> > >
> > >
> > >There is nothing I can do about these parameters unless I change the
> > >JavaScript code (in LiveGrid) which is not an option.  When I did try the
> > >above, I get back the error
> > >"org.apache.tapestry.ApplicationRuntimeException: Service direct requires
> > >either three or four service context parameters.".
> > >
> > >
> > >
> > >Basically, I do not understand how I can call a Tapestry page that
> > >understands simple GET parameters.  Is this even possible without writing a
> > >new EngineService or something?  Any recommendations or pointers to how to
> > >do this are greatly appreciated.
> > >
> > >
> > >
> > >The Rico LiveTable docs is at: http://openrico.org/rico/docs.page for those
> > >of you who are interested.
> > >
> > >
> > >
> > >Thanks in advance,
> > >
> > >Ben
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> --
> Hay dos tipos de mujeres: las bonitas y las que se pintan. - Enrique
> Jardiel Poncela
> 
> ---------------------------------------------------------------------
> 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


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Darío Vasconcelos <da...@gmail.com>.
But with an IExternalPage you'd still need to pass the
"?service=external/foo&" part and I don't think this is an option with
the RicoLiveGrid.

So it looks as you might need to implement a Service. Another option
would be creating a JSP (say, TapestryRedirectToFoo.jsp) that would
redirect the request to Tapestry, adding the "service=external/foo"
part to the queryString. This ugly hack isn't exactly an
**integration** with tapestry, of course.

Dario

On 8/2/05, Danny Mandel <dm...@tolweb.org> wrote:
> Hi Ben.  You can implement IExternalPage and get your GET parameters
> from there.  I use this technique for integrating Tapestry with external
> apps.
> 
> For example:
> 
> public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
>         RequestContext context = cycle.getRequestContext();
>         userName = context.getParameter("userName");
>         groupName = context.getParameter("group");
>     }
> 
> If this was in a page named foo you'd have a url like this:
> http://yourhost/appname/app?service=external/foo&userName=xxx&group=yyy
> 
> And any get parameters would be available via the RequestContext.
> 
> Good luck,
> Danny
> 
> Ben Wong wrote:
> 
> >Hi everyone,
> >
> >
> >
> >I am trying to get the Rico LiveGrid (built on top of Ajax) to work with
> >Tapestry.  Basically, the JavaScript in Rico LiveGrid needs to call an URL
> >that will come back with a XML response.  However, the URL that LiveGrid
> >generates is in the form of GET parameters.  For example, if I give it a URL
> >such as "app?service=direct/1/CustomerListResponsePage.getList", LiveGrid
> >will end up calling a URL that looks like this:
> >
> >
> >
> >/app?service=direct/1/CustomerListResponsePage.getList?id=customerList&page_
> >size=35&offset=0&_=
> >
> >
> >
> >There is nothing I can do about these parameters unless I change the
> >JavaScript code (in LiveGrid) which is not an option.  When I did try the
> >above, I get back the error
> >"org.apache.tapestry.ApplicationRuntimeException: Service direct requires
> >either three or four service context parameters.".
> >
> >
> >
> >Basically, I do not understand how I can call a Tapestry page that
> >understands simple GET parameters.  Is this even possible without writing a
> >new EngineService or something?  Any recommendations or pointers to how to
> >do this are greatly appreciated.
> >
> >
> >
> >The Rico LiveTable docs is at: http://openrico.org/rico/docs.page for those
> >of you who are interested.
> >
> >
> >
> >Thanks in advance,
> >
> >Ben
> >
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Hay dos tipos de mujeres: las bonitas y las que se pintan. - Enrique
Jardiel Poncela

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


Re: Rico Ajax / Tapestry - How to Call Tapestry URL

Posted by Danny Mandel <dm...@tolweb.org>.
Hi Ben.  You can implement IExternalPage and get your GET parameters 
from there.  I use this technique for integrating Tapestry with external 
apps.

For example:

public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
        RequestContext context = cycle.getRequestContext();
        userName = context.getParameter("userName");
        groupName = context.getParameter("group");
    }

If this was in a page named foo you'd have a url like this: 
http://yourhost/appname/app?service=external/foo&userName=xxx&group=yyy

And any get parameters would be available via the RequestContext.

Good luck,
Danny

Ben Wong wrote:

>Hi everyone,
>
> 
>
>I am trying to get the Rico LiveGrid (built on top of Ajax) to work with
>Tapestry.  Basically, the JavaScript in Rico LiveGrid needs to call an URL
>that will come back with a XML response.  However, the URL that LiveGrid
>generates is in the form of GET parameters.  For example, if I give it a URL
>such as "app?service=direct/1/CustomerListResponsePage.getList", LiveGrid
>will end up calling a URL that looks like this:
>
> 
>
>/app?service=direct/1/CustomerListResponsePage.getList?id=customerList&page_
>size=35&offset=0&_=
>
> 
>
>There is nothing I can do about these parameters unless I change the
>JavaScript code (in LiveGrid) which is not an option.  When I did try the
>above, I get back the error
>"org.apache.tapestry.ApplicationRuntimeException: Service direct requires
>either three or four service context parameters.".  
>
> 
>
>Basically, I do not understand how I can call a Tapestry page that
>understands simple GET parameters.  Is this even possible without writing a
>new EngineService or something?  Any recommendations or pointers to how to
>do this are greatly appreciated.
>
> 
>
>The Rico LiveTable docs is at: http://openrico.org/rico/docs.page for those
>of you who are interested.
>
> 
>
>Thanks in advance,
>
>Ben 
>
>
>  
>


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