Re: t5: dispatcher not fired in the start page

2008-03-09 Thread Filip S. Adamsen

Hi Angelo,

Well, let's say I have a filter called CookieLoginRequestFilter that 
implements ComponentEventRequestFilter and PageRenderRequestFilter:


public class CookieLoginRequestFilter
implements ComponentEventRequestFilter, PageRenderRequestFilter {

  private final CookieLoginService cookieLoginService;

  public AccessRequestFilter(CookieLoginService cookieLoginService) {
this.cookieLoginService = cookieLoginService;
  }

  public void handle(ComponentEventRequestParameters parameters, 
ComponentEventRequestHandler handler)

  throws IOException {
cookieLoginService.checkLogin();
handler.handle(parameters);
  }

  public void handle(PageRenderRequestParameters parameters, 
PageRenderRequestHandler handler)

  throws IOException {
cookieLoginService.checkLogin();
handler.handle(parameters);
}

Then I contribute it to the relevant handlers in my AppModule:

  public static void contributeComponentEventRequestHandler(
  OrderedConfigurationComponentEventRequestFilter configuration,
  AccessRequestFilter accessRequestFilter) {
configuration.add(Access, accessRequestFilter, 
after:SetRequestEncoding);

  }

  public static void contributePageRenderRequestHandler(
  OrderedConfigurationPageRenderRequestFilter configuration,
  AccessRequestFilter accessRequestFilter) {
configuration.add(Access, accessRequestFilter, 
after:SetRequestEncoding);

  }

And that's it. Regarding how to handle the actual login, I can't share 
that, but have a look at Tapestry's Cookies service - it's a lot easier 
to work with than CookieSource, which is an internal service, btw.


-Filip

Angelo Chen skrev:


Hi Filip S,

Can you show me sample code of doing that? here is my simple code:

 public boolean dispatch(Request request, Response response) throws
IOException {
Cookie[] cookies = cookieSource.getCookies();
if (cookies != null) {
for (Cookie c : cookies) {
if (LOG_KEY.equals(c.getName())  !signIn.loggedIn()) {
String[] p = c.getValue().split(,);
if (p.length  1) {
try {
signIn.login(p[0], p[1]);
} catch (InvalidUserException e) {
logger.info(invalid user in cookie  + p[0]);
}
}
break;
}
}
}
return false;
}

Filip S. Adamsen-2 wrote:

Angelo,

I do exactly that in the request handling pipeline using a 
ComponentEventRequestFilter and a PageRenderRequestFilter. Works 
beautifully and let's you get the page name etc. easily from the 
supplied parameters. Pretty much doesn't get any easier than that. :)


-Filip






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] Refresh Application context / IoC Registry

2008-03-09 Thread Kheldar666

Hello everybody,

I am using the tapestry-spring package and I was wondering if there is a way
the refresh to WebApplicationContext ? I looked at the sources but it seems
that the implementation of WebApplicationContext does not extends
AbstractApplicationContext [1].

May be there is a way to restart the IoC Registry ? But will this also
reload the Spring context ?

This would be very usefull in developpement phases ovoiding us to restart
Jetty each time we make an update...

Thanks for answers,

Martin

[1]
http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/context/support/AbstractApplicationContext.html#refresh()
-- 
View this message in context: 
http://www.nabble.com/-T5--Refresh-Application-context---IoC-Registry-tp15925862p15925862.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JumpStart 3.3.1 now available - fixes 3.3.0 bugs

2008-03-09 Thread Geoff Callender

Hi Julian,

I've just had a look at how quickstart is organized and it seems to me  
that JumpStart's code organization is very similar.  Was there  
anything in particular that caught your eye, esp. anything that was  
confusing about it?


Cheers,

Geoff

On 26/02/2008, at 6:19 AM, Julian Wood wrote:

Thanks Geoff for continuing to make this available. It is proving to  
be an invaluable resource in getting up to speed on Tap 5.


If I could make one suggestion, it would be to organize the code as  
Howard has done for the quickstart tutorial.


Nevertheless, thanks again for all your efforts!

Julian

On Feb 22, 2008, at 6:44 AM, Geoff Callender wrote:


Hi all,

JumpStart 3.3.1 is now available.  It fixes these bugs that were in  
3.3.0 which was released 2 days ago:


	* Database was not updating.  Due to not replacing  
onValidateFromForm() with onValidateForm() everywhere.
	* Links to components reference were using the old reference, not  
the new one-page-per-component reference.


You'll find it at:

http://files.doublenegative.com.au/jumpstart

Comments and suggestions are always welcome.  Be helpful or brutal  
- I don't care which, because it all helps to make this stuff more  
useful.


Cheers,

Geoff Callender



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



t5: refreshing page inside a javascript

2008-03-09 Thread Angelo Chen

Hi,

I use a javascript(jQuery) to do an ajax call to an onActionFromXXX method
in the page class, I'd like to refresh the page after the call, any idea how
to do that inside a javascript? or just any other way to refresh page
programmatically? thanks.

A.C.
-- 
View this message in context: 
http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15934764.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: t5: refreshing page inside a javascript

2008-03-09 Thread marco pugliese
StreamResponse return type

M.

2008/3/9, Angelo Chen [EMAIL PROTECTED]:


 Hi,

 I use a javascript(jQuery) to do an ajax call to an onActionFromXXX method
 in the page class, I'd like to refresh the page after the call, any idea
 how
 to do that inside a javascript? or just any other way to refresh page
 programmatically? thanks.

 A.C.

 --
 View this message in context:
 http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15934764.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: t5: refreshing page inside a javascript

2008-03-09 Thread Angelo Chen

Hi,
Thanks for the fast response!  in my ajax call I updated some entities, I
can't obtain the streamresponse in the javascript, I need just refresh the
page. any idea?

A.C.


bobpuley wrote:
 
 StreamResponse return type
 
 M.
 
 2008/3/9, Angelo Chen [EMAIL PROTECTED]:


 Hi,

 I use a javascript(jQuery) to do an ajax call to an onActionFromXXX
 method
 in the page class, I'd like to refresh the page after the call, any idea
 how
 to do that inside a javascript? or just any other way to refresh page
 programmatically? thanks.

 A.C.

 --
 View this message in context:
 http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15934764.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15936828.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: t5: refreshing page inside a javascript

2008-03-09 Thread Angelo Chen

window.location.reload(true) works, but reloading seems slow, is there any
way to simulate a click in the javascript?

t:actionLink t:id=refreshRefresh/t:actionLink

then in jQuery, I did:
jQuery(#refresh).click();
it does not trigger the actionLink.

A.C.


bobpuley wrote:
 
 StreamResponse return type
 
 M.
 
 2008/3/9, Angelo Chen [EMAIL PROTECTED]:


 Hi,

 I use a javascript(jQuery) to do an ajax call to an onActionFromXXX
 method
 in the page class, I'd like to refresh the page after the call, any idea
 how
 to do that inside a javascript? or just any other way to refresh page
 programmatically? thanks.

 A.C.

 --
 View this message in context:
 http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15934764.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-refreshing-page-inside-a-javascript-tp15934764p15940737.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Comma-delimited looper

2008-03-09 Thread Bill Holloway
Right, I can do

t:loop...
  t:if ... ,/t:ift:body /
/t:loop

bill

On Fri, Mar 7, 2008 at 7:38 PM, Filip S. Adamsen [EMAIL PROTECTED] wrote:
 And? Whatever content you put after the t:if/ will still be rendered -
  and properly comma-delimited. :)

  -Filip

  Bill Holloway skrev:


  Well, sometimes this will be page links, sometimes literal text,
   sometimes other components.  The loop body might contain anything.
  
   Bill
  
   On Fri, Mar 7, 2008 at 8:24 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote:
   Hi Bill,
  
Try this:
  
  t:loop source=things value=currThing index=var:index
t:if test=var:index, /t:if
  
t:pagelink page=Details
context=currThing.id${currThing.name}/t:pagelink
  /t:loop
  
On the first iteration of the loop index will be 0 which evaluates to
false. Any other iteration will output the comma.
  
-Filip
  
Bill Holloway skrev:
  
  
   I need to comma-delimit components in a loop that will be t:pagelinks. 
  I.e.,

 t:loop source=things value=currThing
 t:pagelink page=Details
 context=currThing.id${currThing.name}/t:pagelink,
 /t:loop

 The above, of course, produces a trailing comma.

 I know that some CSS tricks can turn a ul into a comma-delimited
 list, but the only CSS solutions I've seen use things like ul
 li::before and other CSS things that don't play well with @#$%#$@
 internet exploiter.

 If the _source or even _iterator instance variables of the Loop class
 were protected rather than private, I could just subclass Loop and
 override the afterRenderBody, check _iterator.hasNext and emit ,  if
 there is a next.

 Any thoughts?

 Bill

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]





-- 
The modern conservative is engaged in one of man's oldest exercises
in moral philosophy;  that is, the search for a superior moral
justification for selfishness.

-- John Kenneth Galbraith

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Comma-delimited looper

2008-03-09 Thread Howard Lewis Ship
Clever!

On Fri, Mar 7, 2008 at 7:24 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote:
 Hi Bill,

  Try this:

t:loop source=things value=currThing index=var:index
  t:if test=var:index, /t:if

  t:pagelink page=Details
  context=currThing.id${currThing.name}/t:pagelink
/t:loop

  On the first iteration of the loop index will be 0 which evaluates to
  false. Any other iteration will output the comma.

  -Filip

  Bill Holloway skrev:


  I need to comma-delimit components in a loop that will be t:pagelinks.  
  I.e.,
  
   t:loop source=things value=currThing
   t:pagelink page=Details
   context=currThing.id${currThing.name}/t:pagelink,
   /t:loop
  
   The above, of course, produces a trailing comma.
  
   I know that some CSS tricks can turn a ul into a comma-delimited
   list, but the only CSS solutions I've seen use things like ul
   li::before and other CSS things that don't play well with @#$%#$@
   internet exploiter.
  
   If the _source or even _iterator instance variables of the Loop class
   were protected rather than private, I could just subclass Loop and
   override the afterRenderBody, check _iterator.hasNext and emit ,  if
   there is a next.
  
   Any thoughts?
  
   Bill
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Comma-delimited looper

2008-03-09 Thread Filip S. Adamsen

Well, I learnt that trick from looking at your source code. ;)

-Filip

Howard Lewis Ship skrev:

Clever!

On Fri, Mar 7, 2008 at 7:24 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote:

Hi Bill,

 Try this:

   t:loop source=things value=currThing index=var:index
 t:if test=var:index, /t:if

 t:pagelink page=Details
 context=currThing.id${currThing.name}/t:pagelink
   /t:loop

 On the first iteration of the loop index will be 0 which evaluates to
 false. Any other iteration will output the comma.

 -Filip

 Bill Holloway skrev:



I need to comma-delimit components in a loop that will be t:pagelinks.  I.e.,

 
  t:loop source=things value=currThing
  t:pagelink page=Details
  context=currThing.id${currThing.name}/t:pagelink,
  /t:loop
 
  The above, of course, produces a trailing comma.
 
  I know that some CSS tricks can turn a ul into a comma-delimited
  list, but the only CSS solutions I've seen use things like ul
  li::before and other CSS things that don't play well with @#$%#$@
  internet exploiter.
 
  If the _source or even _iterator instance variables of the Loop class
  were protected rather than private, I could just subclass Loop and
  override the afterRenderBody, check _iterator.hasNext and emit ,  if
  there is a next.
 
  Any thoughts?
 
  Bill
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T4 cancel momentarily shows val errrors

2008-03-09 Thread Heath Nielson
I'm behind in reading my email.  I just updated from 4.1.3 to 4.1.5 and ran
into the same problem that you are describing.  Are you still having this
problem?

Heath

On Sat, Feb 23, 2008 at 08:52:03PM +1100, Geoff Callender wrote:
 Surely someone else is experiencing this symptom in 4.1.5.  No?
 
 On 21/02/2008, at 8:24 AM, Geoff Callender wrote:
 
 Is anyone else seeing this?  In T4.1.5, I'm seeing all the client- 
 side validation errors momentarily displayed when I submit cancel, eg.
 
  input type=submit jwcid=@Submit value=Cancel  
 submitType=cancel/
 
 I'm pretty sure this wasn't happening in 4.1.3.
 
 Cheers,
 
 Geoff
 http://files.doublenegative.com.au/jumpstart
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]