Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-14 Thread Charith Madusanka
Hi Alex,

One issue to investigate is whether you actually need a java.io.File to do
 this or not.


 I think is not, You can generate pdf using another method.

charith.


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-14 Thread Charith Madusanka
hi Uli ,

What do you think my method. This method is ok for render PDF file to Images
?
if you have any suggestion please send me.

charith


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-14 Thread Dmitry Gusev
Alex,

In Google App Engine you may get another problem, the one associated with
Java 2D.

Check this issue as a reference:
http://code.google.com/p/googleappengine/issues/detail?id=1423

On Tue, Apr 13, 2010 at 21:11, Alex Kotchnev akoch...@gmail.com wrote:

 Charith,
   seems like as long as it works, it should be OK. One issue to investigate
 is whether you actually need a java.io.File to do this or not. I for one
 can't do much w/ java.io.File when my app is running in Google App Engine,
 so I ideally I'd like to be able to do the same from a regular input stream
 or a byte array (or something similar). Of course, my needs might not be
 what the majority of the users would need.

 Regards,

 Alex K

 On Tue, Apr 13, 2010 at 5:17 AM, Charith Madusanka charithc...@gmail.com
 wrote:

  Hi ,
 
  If any one can tell me , this method is ok for render PDF file to Images
 ?
 
  charith
 




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-14 Thread Alex Kotchnev
Dmitry,
   good tip !

Thanks,

Alex K

On Wed, Apr 14, 2010 at 3:28 AM, Dmitry Gusev dmitry.gu...@gmail.comwrote:

 Alex,

 In Google App Engine you may get another problem, the one associated with
 Java 2D.

 Check this issue as a reference:
 http://code.google.com/p/googleappengine/issues/detail?id=1423

 On Tue, Apr 13, 2010 at 21:11, Alex Kotchnev akoch...@gmail.com wrote:

  Charith,
seems like as long as it works, it should be OK. One issue to
 investigate
  is whether you actually need a java.io.File to do this or not. I for one
  can't do much w/ java.io.File when my app is running in Google App
 Engine,
  so I ideally I'd like to be able to do the same from a regular input
 stream
  or a byte array (or something similar). Of course, my needs might not be
  what the majority of the users would need.
 
  Regards,
 
  Alex K
 
  On Tue, Apr 13, 2010 at 5:17 AM, Charith Madusanka 
 charithc...@gmail.com
  wrote:
 
   Hi ,
  
   If any one can tell me , this method is ok for render PDF file to
 Images
  ?
  
   charith
  
 



 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com



PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Geoff Callender
It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an 
HttpServletRequestHandler because it results in NullPointerException. I'm using 
T5.1.0.5.

Can anyone confirm this? (and perhaps give a good alternative?)

java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
at 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
at 
$ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
at 
org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
at 
$LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
at 
org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
at 
org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
at 
$PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
at 
jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
at 
$HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
at 
$HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Geoff



Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Robert Zeigler
That's possible... I doubt that Request/Request Globals have been  
initialized yet.
Is there some reason you specifically need an  
HttpServletRequestHandler as opposed to a RequestHandler? More of the  
T5 infrastructure is available/initialized within the RequestHandler  
pipeline...


Robert

On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:

It seems PageRenderLinkSource.createPageRenderLink(..) can't be used  
in an HttpServletRequestHandler because it results in  
NullPointerException. I'm using T5.1.0.5.


Can anyone confirm this? (and perhaps give a good alternative?)

java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ComponentEventLinkEncoderImpl 
.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
	at  
$ 
ComponentEventLinkEncoder_127fc1c7176 
.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
	at  
$ 
LinkSource_127fc1c719d 
.createPageRenderLink($LinkSource_127fc1c719d.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.PageRenderLinkSourceImpl 
.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.PageRenderLinkSourceImpl 
.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
	at  
$ 
PageRenderLinkSource_127fc1c715e 
.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
	at  
jumpstart 
.web 
.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
	at  
$ 
HttpServletRequestHandler_127fc1c7163 
.service($HttpServletRequestHandler_127fc1c7163.java)
	at  
$ 
HttpServletRequestHandler_127fc1c715d 
.service($HttpServletRequestHandler_127fc1c715d.java)
	at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 
127)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
360)
	at  
org 
.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216)
	at  
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 
181)
	at  
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 
722)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
404)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 
139)

at org.mortbay.jetty.Server.handle(Server.java:324)
	at  
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
505)
	at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:828)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at  
org 
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
395)
	at org.mortbay.thread.BoundedThreadPool 
$PoolThread.run(BoundedThreadPool.java:450)

Geoff




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



HttpOnly Cookie

2010-04-14 Thread Mike Oestereter
Hi

I would like to make tapestry append  '; HttpOnly' to the end of
whatever value tapestry decides to write for the SET-COOKIE header
when applicable.

Thanks

Mike

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



GridPager with go to a choosen page number

2010-04-14 Thread TNO

Hi everybody,

I'm working on display a huge list (60 000 elements) with 20 per page.
I've defined my own GridDataSource to get only the data that I display 
in a classic Grid component.

It's very easy and it works fine ! Thanks to Tapestry...

But now, I want to add a textfield and a button (go to page number) to 
the GridPager of my Grid.


It's seems less easy.
Did somebody already create a new GridPager ?
How can I defined my own GridPager without create a new Grid component ??

Thanks, Thomas



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



Re: GridPager with go to a choosen page number

2010-04-14 Thread Christophe Cordenier
Hi

2010/4/14 TNO tno...@free.fr

 Hi everybody,

 I'm working on display a huge list (60 000 elements) with 20 per page.
 I've defined my own GridDataSource to get only the data that I display in a
 classic Grid component.
 It's very easy and it works fine ! Thanks to Tapestry...

 But now, I want to add a textfield and a button (go to page number) to the
 GridPager of my Grid.

 It's seems less easy.
 Did somebody already create a new GridPager ?
 How can I defined my own GridPager without create a new Grid component ??


Set pager position to none and implement your own GridPager using the Grid
component as the GridDataSource (can be obtained via @InjectComponent in
your containing page)

Regards,
Christophe Cordenier.


 Thanks, Thomas



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




-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com


Re: GridPager with go to a choosen page number

2010-04-14 Thread TNO

Any example, please...

Le 14/04/2010 16:58, Christophe Cordenier a écrit :

Hi

2010/4/14 TNOtno...@free.fr

   

Hi everybody,

I'm working on display a huge list (60 000 elements) with 20 per page.
I've defined my own GridDataSource to get only the data that I display in a
classic Grid component.
It's very easy and it works fine ! Thanks to Tapestry...

But now, I want to add a textfield and a button (go to page number) to the
GridPager of my Grid.

It's seems less easy.
Did somebody already create a new GridPager ?
How can I defined my own GridPager without create a new Grid component ??

 

Set pager position to none and implement your own GridPager using the Grid
component as the GridDataSource (can be obtained via @InjectComponent in
your containing page)

Regards,
Christophe Cordenier.


   

Thanks, Thomas



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


 


   



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



Re: GridPager with go to a choosen page number

2010-04-14 Thread TNO

Ok I dit it, but in another simpliest way

I create a form with a textfield in my Grid component.  I inject the 
value in the Grid with setCurrentPage


thats'all

thanks


Le 14/04/2010 17:15, TNO a écrit :

Any example, please...

Le 14/04/2010 16:58, Christophe Cordenier a écrit :

Hi

2010/4/14 TNOtno...@free.fr


Hi everybody,

I'm working on display a huge list (60 000 elements) with 20 per page.
I've defined my own GridDataSource to get only the data that I 
display in a

classic Grid component.
It's very easy and it works fine ! Thanks to Tapestry...

But now, I want to add a textfield and a button (go to page number) 
to the

GridPager of my Grid.

It's seems less easy.
Did somebody already create a new GridPager ?
How can I defined my own GridPager without create a new Grid 
component ??


Set pager position to none and implement your own GridPager using the 
Grid

component as the GridDataSource (can be obtained via @InjectComponent in
your containing page)

Regards,
Christophe Cordenier.



Thanks, Thomas



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







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





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



Re: GridPager with go to a choosen page number

2010-04-14 Thread Christophe Cordenier
Hi

2010/4/14 TNO tno...@free.fr

 Ok I dit it, but in another simpliest way

 I create a form with a textfield in my Grid component.  I inject the value
 in the Grid with setCurrentPage


Nice



 thats'all

 thanks


 Le 14/04/2010 17:15, TNO a écrit :

  Any example, please...

 Le 14/04/2010 16:58, Christophe Cordenier a écrit :

 Hi

 2010/4/14 TNOtno...@free.fr

  Hi everybody,

 I'm working on display a huge list (60 000 elements) with 20 per page.
 I've defined my own GridDataSource to get only the data that I display
 in a
 classic Grid component.
 It's very easy and it works fine ! Thanks to Tapestry...

 But now, I want to add a textfield and a button (go to page number) to
 the
 GridPager of my Grid.

 It's seems less easy.
 Did somebody already create a new GridPager ?
 How can I defined my own GridPager without create a new Grid component
 ??

  Set pager position to none and implement your own GridPager using the
 Grid
 component as the GridDataSource (can be obtained via @InjectComponent in
 your containing page)

 Regards,
 Christophe Cordenier.


  Thanks, Thomas



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





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




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




-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com


Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Howard Lewis Ship
Robert has it exactly; where possible, do the work inside
RequestHandler pipeline.  I've been gradually adding new methods to
Request to wrap HttpServletRequest methods ... in a worst case, inject
HttpServletRequest into your RequestFilter.

On Wed, Apr 14, 2010 at 5:05 AM, Robert Zeigler robe...@scazdl.org wrote:
 That's possible... I doubt that Request/Request Globals have been
 initialized yet.
 Is there some reason you specifically need an HttpServletRequestHandler as
 opposed to a RequestHandler? More of the T5 infrastructure is
 available/initialized within the RequestHandler pipeline...

 Robert

 On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:

 It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an
 HttpServletRequestHandler because it results in NullPointerException. I'm
 using T5.1.0.5.

 Can anyone confirm this? (and perhaps give a good alternative?)

 java.lang.NullPointerException
        at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
        at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
        at
 org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
        at
 $ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
        at
 org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
        at
 $LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
        at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
        at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
        at
 $PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
        at
 jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
        at
 $HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
        at
 $HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
        at
 org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
        at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
        at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
        at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
        at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
        at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
        at
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
 Geoff



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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



How do I set up logging with Tapestry 5 and Tomcat?

2010-04-14 Thread Tim Koop
Hi everyone.  I've been using Tapestry 5 for a while.  I like it, but I 
can't seem to get logging working.


In my page java class I have this:

@Inject
private Logger log;

Object onSuccess() {
log.debug(Tim was here.);
return null;
}

This compiles and runs.  I would like to see that message in a log file 
somewhere, but I can't find it anywhere.  I've looked through Tomcat's 
logs (catalina, hiost-manager, and manager), and I've looked on the 
console that I started Tomcat from, but I can't find it.


I'm not using the Maven setup.  Apparently it makes a log4j.properties 
file somewhere.  I tried making one and I put it in my WEB-INF/classes 
folder.  I also tried putting it in WEB-INF/. Neither seemed to work.  
The contents of my log4j.properties file is this:


log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\\work\\tomcat\\logs\\timslogfile.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.org.apache.catalina=ERROR, R

Does anyone have any ideas?  I'm out of ideas.

Thanks in advance.

--
Tim Koop
t...@timkoop.com mailto:t...@timkoop.com
www.timkoop.com http://www.timkoop.com


Re: How do I set up logging with Tapestry 5 and Tomcat?

2010-04-14 Thread Igor Drobiazko
Tapestry logs with slf4j. You need the slf4j - log4j - bridge. Make sure
log4j-over-slf4j.jar is in the classpath.

On Wed, Apr 14, 2010 at 7:07 PM, Tim Koop t...@timkoop.com wrote:

 Hi everyone.  I've been using Tapestry 5 for a while.  I like it, but I
 can't seem to get logging working.

 In my page java class I have this:

 @Inject
 private Logger log;

 Object onSuccess() {
log.debug(Tim was here.);
return null;
 }

 This compiles and runs.  I would like to see that message in a log file
 somewhere, but I can't find it anywhere.  I've looked through Tomcat's logs
 (catalina, hiost-manager, and manager), and I've looked on the console that
 I started Tomcat from, but I can't find it.

 I'm not using the Maven setup.  Apparently it makes a log4j.properties file
 somewhere.  I tried making one and I put it in my WEB-INF/classes folder.  I
 also tried putting it in WEB-INF/. Neither seemed to work.  The contents of
 my log4j.properties file is this:

 log4j.rootLogger=DEBUG, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=C:\\work\\tomcat\\logs\\timslogfile.log
 log4j.appender.R.MaxFileSize=10MB
 log4j.appender.R.MaxBackupIndex=10
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
 log4j.logger.org.apache.catalina=ERROR, R

 Does anyone have any ideas?  I'm out of ideas.

 Thanks in advance.

 --
 Tim Koop
 t...@timkoop.com mailto:t...@timkoop.com
 www.timkoop.com http://www.timkoop.com




-- 
Best regards,

Igor Drobiazko
http://tapestry5.de/blog


Re: How do I set up logging with Tapestry 5 and Tomcat?

2010-04-14 Thread Tim Koop

Thanks Igor.

I just checked, and there are dozens of jar files in the class path, 
including slf4j-api-1.5.2.jar, slf4j-log4j12-1.5.2.jar, and 
log4j-1.2.14.jar.


Come to think of it, I don't have any need to specifically use log4j at 
all.  If someone can tell me how to get logging to work with slf4j, I 
would be happy with that.


Thanks.


Tim Koop
t...@timkoop.com mailto:t...@timkoop.com
www.timkoop.com http://www.timkoop.com

On 14/04/2010 1:52 PM, Igor Drobiazko wrote:

Tapestry logs with slf4j. You need the slf4j - log4j - bridge. Make sure
log4j-over-slf4j.jar is in the classpath.

On Wed, Apr 14, 2010 at 7:07 PM, Tim Koopt...@timkoop.com  wrote:

   

Hi everyone.  I've been using Tapestry 5 for a while.  I like it, but I
can't seem to get logging working.

In my page java class I have this:

@Inject
private Logger log;

Object onSuccess() {
log.debug(Tim was here.);
return null;
}

This compiles and runs.  I would like to see that message in a log file
somewhere, but I can't find it anywhere.  I've looked through Tomcat's logs
(catalina, hiost-manager, and manager), and I've looked on the console that
I started Tomcat from, but I can't find it.

I'm not using the Maven setup.  Apparently it makes a log4j.properties file
somewhere.  I tried making one and I put it in my WEB-INF/classes folder.  I
also tried putting it in WEB-INF/. Neither seemed to work.  The contents of
my log4j.properties file is this:

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\\work\\tomcat\\logs\\timslogfile.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.org.apache.catalina=ERROR, R

Does anyone have any ideas?  I'm out of ideas.

Thanks in advance.

--
Tim Koop
t...@timkoop.commailto:t...@timkoop.com
www.timkoop.comhttp://www.timkoop.com

 



   


Good practices for handling page cleanup

2010-04-14 Thread Juan Isern

Guys, I've been working with some ajax components that need, to work
properly, to store data in the session as persistent fields.

I thought onActivate() would be a nice place to clean things up, doing it at
the very first moment that a page is requested by the user seems ok.

The problem is that onActivate() gets invoked during ajax requests too. 

Is it any way to determine when a request comes from a user that's entered
an address or followed a link to that page, and make sure that request does
not come from ajax or an action link on it? I think that'd be my requirement

Thanks again, Juan
-- 
View this message in context: 
http://old.nabble.com/Good-practices-for-handling-page-cleanup-tp28247499p28247499.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Extra input field after ajax returning MultiZoneUpdate

2010-04-14 Thread Adam Derkey
Using Tapestry 5.2.0-SNAPSHOT

I'm updating multiple zones after a select on Change event. The JSON
response is including an extra input field after a select field in one of
the zones I'm updating. The extra input is then showing up in the rendered
page in the browser. Why would tapestry be adding in an extra input field?
Is there a way to do this without the extra input being returned?

I created this example using the quickstart app and send the entire project
if needed.

Thanks
Adam

/*
 * Form.java
 */
package com.test.pages;

import com.test.model.GenericSelectModel;
import com.test.vo.SelectObj;
import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry5.EventContext;
import org.apache.tapestry5.SelectModel;
import org.apache.tapestry5.ajax.MultiZoneUpdate;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Select;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.PropertyAccess;
import org.apache.tapestry5.services.Request;

/**
 *
 * @author aderkey
 */
public class Form {

@Inject
private Request request;

@Inject
private PropertyAccess propertyAccess;

@Component(id=selectValue1, parameters = {model=select1Model,
encoder=select1Model})
private Select select1;

@Property
private SelectModel select1Model;

@Property
private SelectObj selectValue1;

@Component(id=selectValue2, parameters = {model=select2Model,
encoder=select2Model})
private Select select2;

@Property
private SelectModel select2Model;

@Property
private SelectObj selectValue2;

@Component(id=select1ValueZone)
private Zone select1ValueZone;

@Component(id=select2ValueZone)
private Zone select2ValueZone;

void onActivate(EventContext ctx) {
ListSelectObj select1List = new ArrayList();
select1List.add(new SelectObj(0, 0 pre ajax));
select1List.add(new SelectObj(1, 1 pre ajax));
select1List.add(new SelectObj(2, 2 pre ajax));
select1List.add(new SelectObj(3, 3 pre ajax));
select1List.add(new SelectObj(4, 4 pre ajax));
select1Model = new GenericSelectModel(select1List, SelectObj.class,
text, id, propertyAccess);

ListSelectObj select2List = new ArrayList();
select2List.add(new SelectObj(0, 0 pre ajax));
select2List.add(new SelectObj(1, 1 pre ajax));
select2List.add(new SelectObj(2, 2 pre ajax));
select2List.add(new SelectObj(3, 3 pre ajax));
select2Model = new GenericSelectModel(select2List, SelectObj.class,
text, id, propertyAccess);
}

public Object onValueChangedFromSelectValue1(SelectObj selectObj) {
System.out.println(onValueChangedSelectValue1);
ListSelectObj select2List = new ArrayList();
select2List.add(new SelectObj(4, 4 post ajax));
select2List.add(new SelectObj(5, 5 post ajax));
select2List.add(new SelectObj(6, 6 post ajax));
select2List.add(new SelectObj(7, 7 post ajax));
select2Model = new GenericSelectModel(select2List, SelectObj.class,
text, id, propertyAccess);

if(request.isXHR()) {
return new MultiZoneUpdate(select1ValueZone,
select1ValueZone.getBody()).add(select2ValueZone,
select2ValueZone.getBody());
} else {
return this;
}
}

}

Form.tml

body t:type=Layout t:title=form t:bodyId=formPage xmlns:t=
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
xmlns:p=tapestry:parameter
form t:type=Form t:id=form t:clientValidation=false action=#
select t:type=Select t:id=selectValue1 t:validate=required
t:zone=select1ValueZone/
t:zone t:id=select1ValueZone visible=falseShow/t:zone
t:zone t:id=select2ValueZoneselect t:type=Select
t:id=selectValue2 t:validate=required//t:zone
/form
/body

JSON Response:
{content:,zones:{select2ValueZone:select
id='selectValue2-127fe104b7d' name='selectValue2'option value='4'4 post
ajax\/optionoption value='5'5 post ajax\/optionoption value='6'6
post ajax\/optionoption value='7'7 post ajax\/option\/select
input\/input,select1ValueZone:Show}}


Re: How do I set up logging with Tapestry 5 and Tomcat?

2010-04-14 Thread Tim Koop

To answer my own question, the answer is this:

You need a log4j.properties file in $CATALINA_HOME/lib, as this page 
describes:


http://tomcat.apache.org/tomcat-6.0-doc/logging.html

As soon as that file was there, my own log4j.properties in my classes 
folder started to be used.  Just a guess, but I guess that the missing 
file in Tomcat's directory caused an irrecoverable error with log4j (I 
did have a log4j error in the Tomcat startup script), so nothing else 
worked after that.


But now it all works fine.



Tim Koop
t...@timkoop.com mailto:t...@timkoop.com
www.timkoop.com http://www.timkoop.com

On 14/04/2010 12:07 PM, Tim Koop wrote:
Hi everyone.  I've been using Tapestry 5 for a while.  I like it, but 
I can't seem to get logging working.


In my page java class I have this:

@Inject
private Logger log;

Object onSuccess() {
log.debug(Tim was here.);
return null;
}

This compiles and runs.  I would like to see that message in a log 
file somewhere, but I can't find it anywhere.  I've looked through 
Tomcat's logs (catalina, hiost-manager, and manager), and I've looked 
on the console that I started Tomcat from, but I can't find it.


I'm not using the Maven setup.  Apparently it makes a log4j.properties 
file somewhere.  I tried making one and I put it in my WEB-INF/classes 
folder.  I also tried putting it in WEB-INF/. Neither seemed to work.  
The contents of my log4j.properties file is this:


log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\\work\\tomcat\\logs\\timslogfile.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.org.apache.catalina=ERROR, R

Does anyone have any ideas?  I'm out of ideas.

Thanks in advance.



RE: Good practices for handling page cleanup

2010-04-14 Thread Alfie Kirkpatrick
There's been some discussion on this in the past. The easiest way if AJAX is 
your only scenario is probably using request.isXHR(). An alternative is to 
maybe use the ComponentEventLinkEncoder either directly or by intercepting it. 
It knows whether the request is for a page or component event.

http://markmail.org/message/mug7wv5gueuw6hhj
http://markmail.org/message/gds72nly2vk5sqm3

Hope it helps,
Alfie.

-Original Message-
From: Juan Isern [mailto:juanis...@gmail.com] 
Sent: 14 April 2010 21:01
To: users@tapestry.apache.org
Subject: Good practices for handling page cleanup


Guys, I've been working with some ajax components that need, to work
properly, to store data in the session as persistent fields.

I thought onActivate() would be a nice place to clean things up, doing it at
the very first moment that a page is requested by the user seems ok.

The problem is that onActivate() gets invoked during ajax requests too. 

Is it any way to determine when a request comes from a user that's entered
an address or followed a link to that page, and make sure that request does
not come from ajax or an action link on it? I think that'd be my requirement

Thanks again, Juan
-- 
View this message in context: 
http://old.nabble.com/Good-practices-for-handling-page-cleanup-tp28247499p28247499.html
Sent from the Tapestry - User mailing list archive at Nabble.com.



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



How to change the clientId for AbstractField parent class

2010-04-14 Thread Robert Hailey


I'd like to pragmatically change the super-class's field 'clientId' so  
that I can get a good string value coming into processSubmission.  
However... AbstractField.getClientId() is final and cannot be  
overridden.


Rather than re-writing (or copy/pasting) AbstractField to simply  
provide a setClientId() method or make getClientId() non-final, I  
thought I might try something a bit hackish.


I've tried getting a propertyconduit (but it complains the field is  
readonly; as it is bound to 'componentResources.id'). I would like to  
try a ParameterAccess but I cannot seem to get a handle on one from  
inside the component (which currently extends AbstractField).


Is this what createDefaultParameterBinding() is meant for? I can't  
seem to figure that one out.


Is there a better way to do this? Tapestry can write to the field, so  
I know that it is possible in theory.


--
Robert Hailey

tapestry 5.1.0.5


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



Re: How to change the clientId for AbstractField parent class

2010-04-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Apr 2010 18:32:39 -0300, Robert Hailey rob...@cmediacorp.com  
wrote:


I'd like to pragmatically change the super-class's field 'clientId' so  
that I can get a good string value coming into processSubmission.


What exactly are you trying to implement?

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

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



Re: How to change the clientId for AbstractField parent class

2010-04-14 Thread Robert Hailey


On Apr 14, 2010, at 4:36 PM, Thiago H. de Paula Figueiredo wrote:

On Wed, 14 Apr 2010 18:32:39 -0300, Robert Hailey rob...@cmediacorp.com 
 wrote:


I'd like to pragmatically change the super-class's field 'clientId'  
so that I can get a good string value coming into processSubmission.


What exactly are you trying to implement?



Well... it's a conglomerate field which is backed by a hibernate pojo  
and represents a date range (so it contains two dateFields).


So I'd like to be able to render it as: t:dateRangeField  
value=dbPojo/


At present I just copied/modified AbstractField to get setClientId  
access, and it mostly works.


It looks like tapestry now and then does not initialize one of the  
injected parameters during the processSubmission time, though. Since  
my client id is derived from the hibernate id, I can easily reload it  
(it's just a bit kludge-ish).


--
Robert Hailey




Re: How to change the clientId for AbstractField parent class

2010-04-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Apr 2010 19:10:10 -0300, Robert Hailey rob...@cmediacorp.com  
wrote:



Well... it's a conglomerate field which is backed by a hibernate pojo
and represents a date range (so it contains two dateFields).


In this case, keep the original id as is and use it as a prefix to the  
other two dateFields:


String idDateField1 = getClientId() + -start;
String idDateField2 = getClientId() + -end;

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

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



RE: Good practices for handling page cleanup

2010-04-14 Thread Juan Isern

Alfie, thanks.

It seems that the isXHR() approach will be good enough but it's nice to know
of other mechanisms in the case the thing gets too complex.


Alfie Kirkpatrick wrote:
 
 There's been some discussion on this in the past. The easiest way if AJAX
 is your only scenario is probably using request.isXHR(). An alternative is
 to maybe use the ComponentEventLinkEncoder either directly or by
 intercepting it. It knows whether the request is for a page or component
 event.
 
 http://markmail.org/message/mug7wv5gueuw6hhj
 http://markmail.org/message/gds72nly2vk5sqm3
 
 Hope it helps,
 Alfie.
 
 -Original Message-
 From: Juan Isern [mailto:juanis...@gmail.com] 
 Sent: 14 April 2010 21:01
 To: users@tapestry.apache.org
 Subject: Good practices for handling page cleanup
 
 
 Guys, I've been working with some ajax components that need, to work
 properly, to store data in the session as persistent fields.
 
 I thought onActivate() would be a nice place to clean things up, doing it
 at
 the very first moment that a page is requested by the user seems ok.
 
 The problem is that onActivate() gets invoked during ajax requests too. 
 
 Is it any way to determine when a request comes from a user that's entered
 an address or followed a link to that page, and make sure that request
 does
 not come from ajax or an action link on it? I think that'd be my
 requirement
 
 Thanks again, Juan
 -- 
 View this message in context:
 http://old.nabble.com/Good-practices-for-handling-page-cleanup-tp28247499p28247499.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Good-practices-for-handling-page-cleanup-tp28247499p28249538.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Can't autoload pages from Sub Module?

2010-04-14 Thread 董和平
I package a module into a jar file: subapp.jar
the packages list are :
subapp.jar
META-INF
com
com/gsww
com/gsww/subapp
com/gsww/subapp/pages


in AppModule, I can't load getResources(com/gsww/subapp/pages) from 
ContextClassLoader.
but I can load getResources(com/gsww/subapp/pages/User.class) from 
ContextClassLoader.
Why? this make my 
contributeComponentClassResolver(ConfigurationLibraryMapping configuration)  
don't worked!

Code: 
@SubModule(com.gsww.subapp.SubappModule.class)
public class AppModule {
public static void contributeApplicationDefaults(
MappedConfigurationString, String configuration)
{
configuration.add(SymbolConstants.PRODUCTION_MODE, false);
printPackageExists(com/gsww/subapp/pages);
}

private static void printPackageExists(String packageName)
{
EnumerationURL urls = null;
  try {
   
   urls = AppModule.class.getClassLoader().getResources(packageName);
   System.out.println(packageName + : + urls.hasMoreElements());
   while(urls.hasMoreElements())
   {
URL url = urls.nextElement();
System.out.println(packageName + : + url.toString());
   }
 
  } catch (IOException e) {
   e.printStackTrace();
  }
}
}

Why SubModule exported by eclipse can't auto loaded it's pages/* ? but sub module packaged by maven can be loaded?

2010-04-14 Thread 董和平


Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Geoff Callender
Thanks guys, making it a RequestHandler did the trick. On reflection, there was 
no need for it to be so early in the pipeline. I guess you could even argue it 
was inappropriate for it to be there, because an HttpServletRequestHandler 
isn't intended to be aware of Tapestry concepts like page and Link.

Geoff

On 15/04/2010, at 2:31 AM, Howard Lewis Ship wrote:

 Robert has it exactly; where possible, do the work inside
 RequestHandler pipeline.  I've been gradually adding new methods to
 Request to wrap HttpServletRequest methods ... in a worst case, inject
 HttpServletRequest into your RequestFilter.
 
 On Wed, Apr 14, 2010 at 5:05 AM, Robert Zeigler robe...@scazdl.org wrote:
 That's possible... I doubt that Request/Request Globals have been
 initialized yet.
 Is there some reason you specifically need an HttpServletRequestHandler as
 opposed to a RequestHandler? More of the T5 infrastructure is
 available/initialized within the RequestHandler pipeline...
 
 Robert
 
 On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:
 
 It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an
 HttpServletRequestHandler because it results in NullPointerException. I'm
 using T5.1.0.5.
 
 Can anyone confirm this? (and perhaps give a good alternative?)
 
 java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
at
 org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
at
 $ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
at
 org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
at
 $LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
at
 $PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
at
 jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
at
 $HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
at
 $HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
at
 org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
 Geoff
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator of Apache Tapestry
 
 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!
 
 (971) 678-5210
 http://howardlewisship.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



Tapestry/JEE6 developer needed

2010-04-14 Thread Pierce T. Wetter III

  Hey gang, we need a new Senior Java developer.  San Jose, CA  or Flagstaff, 
AZ. 

  http://sfbay.craigslist.org/sby/eng/1691929735.html

  Send me your resume if you're interested (you'll be working for me). We're 
also looking for a consultant to help us bootstrap with OFBiz if there's anyone 
on this list who knows both.

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



Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-14 Thread Charith Madusanka
hi Uli and Thiago ,

What do you think about this method. Is this method is ok for render PDF
file to Images ?
if you have any suggestion please send me.It's great help to me.

Thank you,

charith