Re: T5 - Chenillekit Quartz Services
On Tue, Mar 31, 2009 at 7:58 AM, Inge Solvoll inge.tapes...@gmail.com wrote: Is that thread safe, putting the service in a map in non-service class? JobExecutionContext is made available by Quarz just to store job's context information and while jobs are executed in an separate thread i think that should be the case, didn't check right down the code. Ciao. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: T5.1 URL Rewriting
Hey Levi, That's almost identical to what I need for my application. Sorry I missed your post back in Feb, I had a two week holiday mid feb so I wasn't following. You did this the same way as me by creating your own PageRenderDispatcher and LinkFactory. My scenario is possibly a little more complex because if there's a T5 page at /SITE/page then it uses that, if not and SITE is recognised as a configured site then it's moved to the end of the URL. (becoming the last context param) I'm now migrating to T5.1.0.2 and looking at how I should implement this now. That's why I was looking at URL rewriting to see if it was appropriate for this task in 5.1 - I wasn't looking at the nightly docs though. Now I am and I can see what Thiago means but I don't think URL rewriting is the right place to do this. I'm leaning towards a custom implementation of ComponentEventLinkEncoder (possibly extending the internal T5.1 impl) since the URL analysis which is going on in here is what I need to figure out what (if anything) needs doing to the URL. Are there any other ways of doing this, and is this the best? Opinions welcome. Thanks, Andy. -Original Message- From: xfile80303 [mailto:l...@grokers.net] Sent: 30 March 2009 23:28 To: users@tapestry.apache.org Subject: Re: T5.1 URL Rewriting Perhaps a better example is needed... I want to insert the notion of site into the URL and application, such that I can use the same pages to render content, but these pages can have access to what site they are currently rendering and change behavior, look and feel, whatever. The site parameter would need to be available for all pages, not just a page context parameter, so the application url looks something like: http://myhost.com/SITE/page/params Where the only difference from normal Tapestry URL is the insertion of the SITE before the rest of the URI, such that SITE could be anything (like, partner, foo, or main etc.). So the URL Rewriting implementation does not seem to be quite a match since if I insert anything for SITE, as mentioned, it breaks Tapestry's ability to properly deal with the request for pages and page content, etc. The SITE parameter needs to be virtual and yet still generated for page links. Not to cloud the issue, but for reference: http://n2.nabble.com/-T5--Struggling-With-Concepts-tt2324920.html http://n2.nabble.com/-T5--URL-Manipulation-tt2276010.html Since those posts I was able to create a dispatcher which replaced the PageRender dispatcher and a LinkFactory which overrides the createPageRenderLink functionality to insert the site parameter into the generated URLs. Since 5.1.0.0 there seems to have been a lot of work in this space (which is great!) and I was hoping to avoid overriding internal functionality in order to accomplish what I needed (and allow for a simpler upgrade path in the future). Thanks, Levi - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5: create a page link inside a service
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Angelo, Inject the ComponentSource service, get a page from it, then get its ComponentResources. /Filip On 2009-03-31 11:54, Angelo Chen wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0ejpAAoJEEfiH7PpjaMnnS0H/2h9BG8wI6ZuE7+qKa5mVrpg R2MsDTXUlS3qAYabGxmgCK1EIB+ROrOCkP6iHLfHPNm1bpbcuDudZUtgBrs1GX2h Q0bo6azcWn5ZqkFpqVmZaRbdgaeM7wx1poNI99gH4mwwNl8ITi3NPRpIne6pJCFd gXsPMz9TEHy2+ii+R1E5OFRCfGBJV3CvU5bAbyNGq3qGtMAsqCvwvVsiMCfvLK2E 8XghA7L8bgV4qysiI+2LMN+Ov7rpsyqnry+wUmrGk7b+0fDNYQTTl9RQjrYTeF0v ofvY/DoEtrOVwq3sYaE+o1SqR+P7bFyXmhsHJh/ymyHqWlWKxHonke0g40Bapzs= =Krzu -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
t5: create a page link inside a service
Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -- View this message in context: http://www.nabble.com/t5%3A-create-a-page-link-inside-a-service-tp22801831p22801831.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
[T5] Overriding the BeanBlockSource for a specific component only.
Hi all, I am working on a different BeanEditForm, which takes layout parameters as a String and creates a multicolumn layout for a form. A bit like the idea of JGoodies forms. Now I go first for tables, since it is an internal application and accessibility is not an issue, but regardless if I go for tables or css layout it would be very handy to have different BeanEditBlocks say per LayoutManager component. What I have works, but the styling is a pile of ugly hacks, especially when a PropertyEditor spans more than one table column. Now all I could find is how to override BeanEditSouce for a certain datatype and if I understand that correctly it is meant application wide. I would need a different source of BeanEditBlocks per component though, but the resolution of datatypes etc. should be the same aka the resolution to text, password, number etc is done as in default but the actual BeanEditBlock is taken from a page specified by the component. Any ideas on how to accomplish that? Regards, Otho
T5: AccessController Dispatcher asm.exists() not working?
Hi, I am trying to create a dispatcher to define the access levels for the current user. I have followed the steps from the Wiki pages: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2 This seems to work. But as I try to do asm.exists(UserPermissions.class) it returns false. I checked the classpath for the class my.project.services.UserPermissions. And there it does exist. I also tried to make it an interface but this didn't work out either. My classes: -- AccessController.java: public class AccessController implements Dispatcher { private ApplicationStateManager asm; public AccessController(ApplicationStateManager asm) { this.asm = asm; } public boolean dispatch(Request request, Response response) throws IOException { boolean canAccess = true; // to avoid the access violation for now if (asm.exists(UserPermissions.class)) { UserPermissions perms = asm.get(UserPermissions.class); canAccess = perms.canAccess(request); } if (!canAccess) { throw new RuntimeException(Access violation!); } return false; } } -- UserPermissions.java: public class UserPermissions { public boolean canAccess(Request request) { return true; } } -- AppModule.java: public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(AccessController.class).withId(AccessController); } public void contributeMasterDispatcher(OrderedConfigurationDispatcher configuration, @InjectService(AccessController) Dispatcher accessController) { configuration.add(AccessController, accessController, before:PageRender); } } -- Does anyone have a clue what I am doing wrong? Yours, Kasper This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 URL Rewriting
On Tue, Mar 31, 2009 at 1:21 AM, Robert Zeigler robe...@scazdl.org wrote: As a sort of nitpicky aside... does URLRewriterService have to be called that? (Since we're still in new feature api-change mode, here... :). What about just URLRewriter? Or URLRewriteHandler? Either of those seem to gel a little more with existing naming (plus we then don't have the redundancy of org.apache.tapestry5.*services*.URLRewriter*Service* (with * added for emphasis). I agree with you. As you're implementing this improvement, don't forget to update the documentation. ;) And thank you for implementing this, as I unfortunately cannot do this now. :) -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 URL Rewriting
On Tue, Mar 31, 2009 at 6:26 AM, Blower, Andy andy.blo...@proquest.co.uk wrote: Now I am and I can see what Thiago means but I don't think URL rewriting is the right place to do this. I don't think I said that. :) I'm leaning towards a custom implementation of ComponentEventLinkEncoder (possibly extending the internal T5.1 impl) since the URL analysis which is going on in here is what I need to figure out what (if anything) needs doing to the URL. As Fernando Padilla would point out and I would agree 100% :), decorating services is almost always a good option. In this specific case, you would need to change the Link instances returned by ComponentEventLink methods, something that the URL rewriting support already does. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: T5.1 URL Rewriting
I'm leaning towards a custom implementation of ComponentEventLinkEncoder (possibly extending the internal T5.1 impl) since the URL analysis which is going on in here is what I need to figure out what (if anything) needs doing to the URL. As Fernando Padilla would point out and I would agree 100% :), decorating services is almost always a good option. In this specific case, you would need to change the Link instances returned by ComponentEventLink methods, something that the URL rewriting support already does. I can see how that would work, but as I said I'd be repeating a fair bit of the URL analysis that the ComponentEventLinkEncoder is already doing which is why I'm not planning to decorate, advise or rewrite for my use case. Thanks for the help anyway Thiago. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.1.0.2 problem with TestableRequestImpl
I'm in the process of migrating from T5.0.18 to T5.1 and I'm using the T5.1.0.2 release currently being voted on. I've fixed all the compilation errors and disabled enough of our custom stuff to get pages rendering, although most of our javascript seems to be broken (I'll be looking into this issue next), but I have a lot of unit tests failing. Basically all of the tests using org.apache.tapestry5.test.PageTester to do a test render are failing with the stacktrace appended to the bottom of this email. This appears to be caused by the new method that's been added to the Request interface but not implemented in TestableRequestImpl. (well technically it is, but all it does is throw a RuntimeException) So, has anyone else encountered this issue? Why aren't any of the Tapestry tests affected? What's the best way to fix this? Thanks, Andy. Full stacktrace example: org.apache.tapestry5.internal.services.RenderQueueException: Render queue error in BeginRender[core/ExceptionReport:renderobject]: Request: method getServerName() not yet implemented by TestableRequestImpl. [at classpath:org/apache/tapestry5/corelib/pages/ExceptionReport.tml, line 24] at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:86) at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) at $PageRenderQueue_1205c423f94.render($PageRenderQueue_1205c423f94.java) at $PageRenderQueue_1205c423f93.render($PageRenderQueue_1205c423f93.java) at org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37) at org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1752) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1733) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1715) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1701) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1682) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1663) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at org.apache.tapestry5.internal.test.CaptureRenderedDocument.renderMarkup(CaptureRenderedDocument.java:39) at $MarkupRenderer_1205c423f98.renderMarkup($MarkupRenderer_1205c423f98.java) at $MarkupRenderer_1205c423f92.renderMarkup($MarkupRenderer_1205c423f92.java) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) at $PageMarkupRenderer_1205c423f8e.renderPageMarkup($PageMarkupRenderer_1205c423f8e.java) at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) at $PageResponseRenderer_1205c423f33.renderPageResponse($PageResponseRenderer_1205c423f33.java) at org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77) at $RequestExceptionHandler_1205c423f27.handleRequestException($RequestExceptionHandler_1205c423f27.java) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42) at $RequestHandler_1205c423f2a.service($RequestHandler_1205c423f2a.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:782) at $RequestHandler_1205c423f2a.service($RequestHandler_1205c423f2a.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:771) at $RequestHandler_1205c423f2a.service($RequestHandler_1205c423f2a.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_1205c423f2a.service($RequestHandler_1205c423f2a.java) at org.apache.tapestry5.internal.test.EndOfRequestCleanupFilter.service(EndOfRequestCleanupFilter.java:42) at
Re: T5.1 URL Rewriting
Another option would be to combine the URLRewriterRule with an enum to define when it is in effect (INCOMING, OUTGOING, BOTH). On Mon, Mar 30, 2009 at 8:43 PM, Robert Zeigler robe...@scazdl.org wrote: Yeah, I definitely think there needs to be at least /some/ disambiguation between request and response. A number of ways we could do that: 1) Have two separate services, one for incoming, one for outgoing * Not a fan; adds an additional contribution point/burden 2) Have two different process methods: processIncoming and processOutgoing (processRequest, processResponse?) * Clean, I think... 3) Have some sort of context passed to process that can be used to query the state. * ambivalent about this approach. Without having looked over the urlrewriting code, I'm leaning toward approach #2. I'd be interested in hearing your feedback, Thiago. I might have a few spare cycles this week that I can use to implement this change... Robert On Mar 30, 2009, at 3/306:12 PM , xfile80303 wrote: Em Mon, 30 Mar 2009 19:47:31 -0300, xfile80303 l...@grokers.net escreveu: Okay this sounds like a plausible approach, but I'm confused about how I would identify the fact that my filter is being called to handle an incoming request (and remove the SITE) or a link generation request (and insert the site). That's a concrete reason to add some differentiation between incoming URL rewriting and link rewriting. I'll implement it as soon as I can. Thanks Thiago, that would be most appreciated! Levi -- View this message in context: http://n2.nabble.com/T5.1-URL-Rewriting-tp2557652p2560206.html Sent from the Tapestry Users 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: AccessController Dispatcher asm.exists() not working?
exists() looks for an instance in the HttpSession ... what is supposed to be creating this instance? On Tue, Mar 31, 2009 at 3:52 AM, Kasper kas...@nekoconeko.nl wrote: Hi, I am trying to create a dispatcher to define the access levels for the current user. I have followed the steps from the Wiki pages: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2 This seems to work. But as I try to do asm.exists(UserPermissions.class) it returns false. I checked the classpath for the class my.project.services.UserPermissions. And there it does exist. I also tried to make it an interface but this didn't work out either. My classes: -- AccessController.java: public class AccessController implements Dispatcher { private ApplicationStateManager asm; public AccessController(ApplicationStateManager asm) { this.asm = asm; } public boolean dispatch(Request request, Response response) throws IOException { boolean canAccess = true; // to avoid the access violation for now if (asm.exists(UserPermissions.class)) { UserPermissions perms = asm.get(UserPermissions.class); canAccess = perms.canAccess(request); } if (!canAccess) { throw new RuntimeException(Access violation!); } return false; } } -- UserPermissions.java: public class UserPermissions { public boolean canAccess(Request request) { return true; } } -- AppModule.java: public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(AccessController.class).withId(AccessController); } public void contributeMasterDispatcher(OrderedConfigurationDispatcher configuration, �...@injectservice(AccessController) Dispatcher accessController) { configuration.add(AccessController, accessController, before:PageRender); } } -- Does anyone have a clue what I am doing wrong? Yours, Kasper This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 URL Rewriting
On Tue, Mar 31, 2009 at 11:40 AM, Howard Lewis Ship hls...@gmail.com wrote: Another option would be to combine the URLRewriterRule with an enum to define when it is in effect (INCOMING, OUTGOING, BOTH). I still prefer the context parameter option, so it can differentiate page links from action links. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 URL Rewriting
On Tue, Mar 31, 2009 at 11:53 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Tue, Mar 31, 2009 at 11:40 AM, Howard Lewis Ship hls...@gmail.com wrote: Another option would be to combine the URLRewriterRule with an enum to define when it is in effect (INCOMING, OUTGOING, BOTH). I still prefer the context parameter option, so it can differentiate page links from action links. Thinking it over, both approaches can be combine so a rule process() method wouldn't be invoked for an incoming URL when it doesn't rewrite them, for example. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5: create a page link inside a service
http://tapestry.formos.com/nightly/tapestry5/faq/general.html#create-page-link-from-service On Tue, Mar 31, 2009 at 2:54 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -- View this message in context: http://www.nabble.com/t5%3A-create-a-page-link-inside-a-service-tp22801831p22801831.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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 URL Rewriting
Just a suggestion: please quote the messages you're answering with . Without them, it's hard to figure out what's the answer and what's being answered. ;) Hi Thiago, I'm just using nabble.com to access and post to this list and the quoting features of nabble. Perhaps try viewing your email as HTML or using nabble too? Levi -- View this message in context: http://n2.nabble.com/T5.1-URL-Rewriting-tp2557652p2563802.html Sent from the Tapestry Users 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
Re: T5.1 URL Rewriting
On Mar 30, 2009, at 3/304:47 PM , xfile80303 wrote: Is there a way to utilize this to only rewrite page render requests and not component or asset requests? I know it is pretty early on in the request lifespan, but without this discrimination this feature is not nearly as useful to me (and possibly others?). It's really very early in the request handling pipeline. Maybe Tapestry should add some way (maybe methods in the Request instance) that tells if the given request is an page one or an event one or an asset one or etc. -1. Although there are times when I've thought this might be handy, the determination of the request type is resolved via the MasterDispatcher service; if you really need to know the request type, then the operation you're performing probably needs to come later in the flow of operations. Robert Hi Robert, I don't actually need to know the request type /if/ I can implement bi-directional URL re-writing, as discussed. However, you may have a point... the URL Rewriting implementation here is so low level as to be limited in usefulness when dealing with internal Tapestry concepts and conveniences. If I use the URL Rewrite implementation I will need to re-implement a lot of the code Tapestry uses internally to determine page, locale, etc. Levi -- View this message in context: http://n2.nabble.com/T5.1-URL-Rewriting-tp2557652p2563933.html Sent from the Tapestry Users 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
RE: T5.1 URL Rewriting
Hey Levi, That's almost identical to what I need for my application. Sorry I missed your post back in Feb, I had a two week holiday mid feb so I wasn't following. You did this the same way as me by creating your own PageRenderDispatcher and LinkFactory. My scenario is possibly a little more complex because if there's a T5 page at /SITE/page then it uses that, if not and SITE is recognised as a configured site then it's moved to the end of the URL. (becoming the last context param) I'm now migrating to T5.1.0.2 and looking at how I should implement this now. That's why I was looking at URL rewriting to see if it was appropriate for this task in 5.1 - I wasn't looking at the nightly docs though. Now I am and I can see what Thiago means but I don't think URL rewriting is the right place to do this. I'm leaning towards a custom implementation of ComponentEventLinkEncoder (possibly extending the internal T5.1 impl) since the URL analysis which is going on in here is what I need to figure out what (if anything) needs doing to the URL. Are there any other ways of doing this, and is this the best? Opinions welcome. Thanks, Andy. Hi Andy, It certainly looks like we have similar ideas to re-solve with 5.1.0.n1. ;) I'm in the midst of trying to understand the best approach to this myself, and would like to stay away from extending Tapestry internals or other hacks like I did previously so upgrading in the future does not break my app, etc. However, it may be that even the most recent code is not capable of being used in a way that can accomplish our goals without resorting to touching the internals. I'll post back what my solution turns out to be. Best of luck, Levi -- View this message in context: http://n2.nabble.com/T5.1-URL-Rewriting-tp2557652p2563958.html Sent from the Tapestry Users 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
Re: [T5.1] Running on Glassfish?
Hello all, I've been developing locally on Tomcat, but will have to ultimately deploy onto Glassfish . My app works as expected while on Tomcat, but once deployed to Glassfish I get an exception: java.lang.RuntimeException: Exception constructing service 'TemplateParser': Error invoking constructor org.apache.tapestry5.internal.services.TemplateParserImpl(Map, boolean) (at TemplateParserImpl.java:50) via org.apache.tapestry5.internal.services.InternalModule.bind(ServiceBinder) (at InternalModule.java:59) (for service 'TemplateParser'): com.sun.xml.stream.ZephyrParserFactory cannot be cast to org.codehaus.stax2.XMLInputFactory2 Which would seem to indicate some XML library conflict. Any thoughts on resolution? Thanks, Levi For anyone else who may care, we've come up with a solution: Here are the complete steps to run a Tapestry app on Glassfish v2.1 using JDK 6 in 64 bit mode 1) install Glassfish v2.1 and JDK 6 2) modify config/asenv.conf to use JDK 6 like this: - AS_JAVA=/opt/jdk1.6.0_13 3) start Glassfish domain1 4) copy woodstox-core-asl*.jar and stax2-api*.jar from Tapestry application to domains/domain1/lib/ext/ dir (if using Glassfish default domain1). 5) go to Glassfish admin page using browser and modify: - in Application Server/JVM Settings/JVM Options add: -d64 - in Configuration/System Properties add: Instance Variable NameDefault Value javax.xml.stream.XMLEventFactorycom.ctc.wstx.stax.WstxEventFactory javax.xml.stream.XMLInputFactorycom.ctc.wstx.stax.WstxInputFactory javax.xml.stream.XMLOutputFactory com.ctc.wstx.stax.WstxOutputFactory 6) restart Glassfish -- View this message in context: http://n2.nabble.com/-T5.1--Running-on-Glassfish--tp2362542p2563985.html Sent from the Tapestry Users 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
RE: T5.1 URL Rewriting
If you want to stay away from extending the internals then a decorator / advisor of the ComponentEventLinkEncoder service would be the best route, as Thiago suggested. You will still have a reference to LinkImpl which is an internal implementation since you'll need to create a new link. I don't want to duplicate all the processing in ComponentEventLinkEncoderImpl so I will extend and change it, but it's much better than my 5.0 version because it's all in one place and the service interface is public this time. -Original Message- From: xfile80303 [mailto:l...@grokers.net] Sent: 31 March 2009 17:19 To: users@tapestry.apache.org Subject: RE: T5.1 URL Rewriting Hey Levi, That's almost identical to what I need for my application. Sorry I missed your post back in Feb, I had a two week holiday mid feb so I wasn't following. You did this the same way as me by creating your own PageRenderDispatcher and LinkFactory. My scenario is possibly a little more complex because if there's a T5 page at /SITE/page then it uses that, if not and SITE is recognised as a configured site then it's moved to the end of the URL. (becoming the last context param) I'm now migrating to T5.1.0.2 and looking at how I should implement this now. That's why I was looking at URL rewriting to see if it was appropriate for this task in 5.1 - I wasn't looking at the nightly docs though. Now I am and I can see what Thiago means but I don't think URL rewriting is the right place to do this. I'm leaning towards a custom implementation of ComponentEventLinkEncoder (possibly extending the internal T5.1 impl) since the URL analysis which is going on in here is what I need to figure out what (if anything) needs doing to the URL. Are there any other ways of doing this, and is this the best? Opinions welcome. Thanks, Andy. Hi Andy, It certainly looks like we have similar ideas to re-solve with 5.1.0.n1. ;) I'm in the midst of trying to understand the best approach to this myself, and would like to stay away from extending Tapestry internals or other hacks like I did previously so upgrading in the future does not break my app, etc. However, it may be that even the most recent code is not capable of being used in a way that can accomplish our goals without resorting to touching the internals. I'll post back what my solution turns out to be. Best of luck, Levi -- View this message in context: http://n2.nabble.com/T5.1-URL-Rewriting- tp2557652p2563958.html Sent from the Tapestry Users 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - Chenillekit Quartz Services
Is there a more elegant solution than this? If so please share! Cheers, Dan -- View this message in context: http://www.nabble.com/T5---Chenillekit-Quartz---Services-tp22787045p22805264.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
Re: t:body
Please add a bug; Tapestry should not be case sensitive about this (regardless about what the schema says). t:body and t:Body should be equivalent. Tapestry 5.1 may already do this correctly. On Mon, Mar 30, 2009 at 9:28 AM, Luther Baker lutherba...@gmail.com wrote: For some reason, my brain likes to keep a consistent capitalization strategy ... So, I've grown accustomed to t:Parameter t:ActionLink t:PageLink and home/Index.tml, home/Index.java ... etc I just noticed that in my latest new project, I used t:Body/ in a layout template and I'm getting an error: Exception assembling root component of page home/Index: Unable to resolve 'Body' to a component class name. Available component types: ActionLink, AddRowLink, AjaxFormLoop, Any, BeanDisplay, BeanEditForm, BeanEditor, Checkbox, DateField, Delegate, Errors, EventLink, ExceptionDisplay, Form, FormFragment, FormInjector, Grid, GridCell, GridColumns, GridPager, GridRows, If, Label, Layout, LinkSubmit, Loop, Output, OutputRaw, PageLink, Palette, PasswordField, ProgressiveDisplay, PropertyDisplay, PropertyEditor, Radio, RadioGroup, RemoveRowLink, RenderObject, Select, Submit, SubmitNotifier, TextArea, TextField, TextOutput, Unless, Zone. If I switch to t:body/ ... all is well. Just thought this was interesting. -Luther -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - Chenillekit Quartz Services
Dan, I can't call this elegant, but I prefer it to passing dao's in the JobDataMap.. I use Spring with Tapestry, and the SpringAwareStatefulJob from Spring that makes it easy to access the Spring application context. So, I still need to look up things that I'm accustomed to having injected, but I usually look up a service in the Job, and Spring handles injecting the dependencies for that service. Jonathan On Tue, Mar 31, 2009 at 2:16 PM, Daniel Jones d...@murieston.com wrote: Is there a more elegant solution than this? If so please share! Cheers, Dan -- View this message in context: http://www.nabble.com/T5---Chenillekit-Quartz---Services-tp22787045p22805264.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 -- Jonathan Barker ITStrategic
Re: t:body
TAP5-615 Thanks, -Luther On Tue, Mar 31, 2009 at 1:57 PM, Howard Lewis Ship hls...@gmail.com wrote: Please add a bug; Tapestry should not be case sensitive about this (regardless about what the schema says). t:body and t:Body should be equivalent. Tapestry 5.1 may already do this correctly. On Mon, Mar 30, 2009 at 9:28 AM, Luther Baker lutherba...@gmail.com wrote: For some reason, my brain likes to keep a consistent capitalization strategy ... So, I've grown accustomed to t:Parameter t:ActionLink t:PageLink and home/Index.tml, home/Index.java ... etc I just noticed that in my latest new project, I used t:Body/ in a layout template and I'm getting an error: Exception assembling root component of page home/Index: Unable to resolve 'Body' to a component class name. Available component types: ActionLink, AddRowLink, AjaxFormLoop, Any, BeanDisplay, BeanEditForm, BeanEditor, Checkbox, DateField, Delegate, Errors, EventLink, ExceptionDisplay, Form, FormFragment, FormInjector, Grid, GridCell, GridColumns, GridPager, GridRows, If, Label, Layout, LinkSubmit, Loop, Output, OutputRaw, PageLink, Palette, PasswordField, ProgressiveDisplay, PropertyDisplay, PropertyEditor, Radio, RadioGroup, RemoveRowLink, RenderObject, Select, Submit, SubmitNotifier, TextArea, TextField, TextOutput, Unless, Zone. If I switch to t:body/ ... all is well. Just thought this was interesting. -Luther -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t:body
Tapestry 5.1 does handle this correctly. I checked by changing t:body/ to t:Body/ within the Layout.tml template of the quickstart example project and it worked as expected. Yancey On Mar 31, 2009, at 1:57 PM, Howard Lewis Ship wrote: Please add a bug; Tapestry should not be case sensitive about this (regardless about what the schema says). t:body and t:Body should be equivalent. Tapestry 5.1 may already do this correctly. On Mon, Mar 30, 2009 at 9:28 AM, Luther Baker lutherba...@gmail.com wrote: For some reason, my brain likes to keep a consistent capitalization strategy ... So, I've grown accustomed to t:Parameter t:ActionLink t:PageLink and home/Index.tml, home/Index.java ... etc I just noticed that in my latest new project, I used t:Body/ in a layout template and I'm getting an error: Exception assembling root component of page home/Index: Unable to resolve 'Body' to a component class name. Available component types: ActionLink, AddRowLink, AjaxFormLoop, Any, BeanDisplay, BeanEditForm, BeanEditor, Checkbox, DateField, Delegate, Errors, EventLink, ExceptionDisplay, Form, FormFragment, FormInjector, Grid, GridCell, GridColumns, GridPager, GridRows, If, Label, Layout, LinkSubmit, Loop, Output, OutputRaw, PageLink, Palette, PasswordField, ProgressiveDisplay, PropertyDisplay, PropertyEditor, Radio, RadioGroup, RemoveRowLink, RenderObject, Select, Submit, SubmitNotifier, TextArea, TextField, TextOutput, Unless, Zone. If I switch to t:body/ ... all is well. Just thought this was interesting. -Luther -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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: t:body
On Tue, Mar 31, 2009 at 2:36 PM, Yancey Yeargan yan...@unt.edu wrote: Tapestry 5.1 does handle this correctly. I checked by changing t:body/ to t:Body/ within the Layout.tml template of the quickstart example project and it worked as expected. That is correct for 5.1.0.0, but this bug is specific to 5.1.0.1. It is identified it as such in JIRA. *Affects Version/s:* 5.1.0.1 -Luther
access component from mixin
What is the best way to get the component a mixin i applied to, from within the mixin? I want to access the clientId of the component that the mixin has been tied to. How would I do that? pseudo-code: mixin { afterRender { getComponent().getClientId(); } } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: access component from mixin
Em Tue, 31 Mar 2009 17:21:07 -0300, Fernando Padilla f...@alum.mit.edu escreveu: What is the best way to get the component a mixin i applied to, from within the mixin? I want to access the clientId of the component that the mixin has been tied to. How would I do that? I guess it is by using @InjectComponent: @InjectComponent private YourComponent component; component.getClientId(); -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5: create a page link inside a service
Thanks, but that works for 5.1.x, not for 5.0.18. I'm eagerly expecting the release of 5.1.x stable version. Howard Lewis Ship wrote: http://tapestry.formos.com/nightly/tapestry5/faq/general.html#create-page-link-from-service On Tue, Mar 31, 2009 at 2:54 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -- View this message in context: http://www.nabble.com/t5%3A-create-a-page-link-inside-a-service-tp22801831p22801831.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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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://www.nabble.com/t5%3A-create-a-page-link-inside-a-service-tp22801831p22813929.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
Re: access component from mixin
I think this is the standard way of getting the clientId of the mixin's container: @InjectContainer private ClientElement container; On Tue, Mar 31, 2009 at 10:24 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 31 Mar 2009 17:21:07 -0300, Fernando Padilla f...@alum.mit.edu escreveu: What is the best way to get the component a mixin i applied to, from within the mixin? I want to access the clientId of the component that the mixin has been tied to. How would I do that? I guess it is by using @InjectComponent: @InjectComponent private YourComponent component; component.getClientId(); -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - Chenillekit Quartz Services
possible it helps public class ImportEmailToArchive implements Job { private final Logger logger = LoggerFactory.getLogger(ImportEmailToArchive.class); @CommitAfter public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { PerthreadManager perthreadManager = (PerthreadManager) jobExecutionContext.getMergedJobDataMap().get(perthreadManager); EmailArchiveImporter importer = (EmailArchiveImporter) jobExecutionContext.getMergedJobDataMap().get(importer); if (logger.isInfoEnabled()) logger.info(starting email importer ...); try { importer.importMessages(); } finally { perthreadManager.cleanup(); } if (logger.isInfoEnabled()) logger.info(email importer finished); } } public EmailArchiveImporterImpl(Logger logger, SearcherService ldapSearchService, HibernateSessionManager hibernateSessionManager, Resource configResource) { this.logger = logger; this.ldapSearchService = ldapSearchService; this.hibernateSessionManager = hibernateSessionManager; try { this.configuration = new PropertiesConfiguration(configResource.toURL()); } catch (ConfigurationException e) { throw new RuntimeException(e); } } 2009/3/31 Daniel Jones d...@murieston.com Is there a more elegant solution than this? If so please share! Cheers, Dan -- View this message in context: http://www.nabble.com/T5---Chenillekit-Quartz---Services-tp22787045p22805264.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 -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com
Re: t5: create a page link inside a service
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Did my e-mail from almost 15 hours ago not get through to everyone on the list? :P To quote myself, Inject the ComponentSource service, get a page from it, then get its ComponentResources. I've got a dedicated service for this, it gets the ComponentResources of the page you want to link to from the ComponentSource, which has the added benefit of ensuring that you're linking to a valid page. Here's the relevant code (for 5.0.18): private final ComponentClassResolver componentClassResolver; private final ComponentSource componentSource; public RedirectServiceImpl(ComponentClassResolver componentClassResolver, ComponentSource componentSource) { this.componentClassResolver = componentClassResolver; this.componentSource = componentSource; } public Link createPageLink(Class? pageClass, boolean override, Object... context) { String pageName = componentClassResolver.resolvePageClassNameToPageName(pageClass.getCanonicalName()); return componentSource.getPage(pageName).getComponentResources().createPageLink(pageName, override, context); } You can, of course, do the same for events etc. /Filip On 2009-03-31 23:21, Angelo Chen wrote: Thanks, but that works for 5.1.x, not for 5.0.18. I'm eagerly expecting the release of 5.1.x stable version. Howard Lewis Ship wrote: http://tapestry.formos.com/nightly/tapestry5/faq/general.html#create-page-link-from-service On Tue, Mar 31, 2009 at 2:54 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0rqJAAoJEEfiH7PpjaMnKqYIAKoto5n15bm73SjdEKYewlZZ F8sgeoHyj1mAIP8xOLH0d5g9PVffYMlMWTWPyJ+JnDS06dy86/mfgDXOEvBaVuBG 8HHtEiVSwTaNZeE8Z2GOljSH4pMYH2KXsOkWwiI/r7mQWD0IDznNEpDkNx250x2q fkpRGtFWqAchdEj7yRNIGBt9QjgSCstjrXjIJ24IXD+xleHRL3vdJ+4ua2K46/Cc sykyzmr5eZd53eszXtw3kl6occq2Gg5SPGpBOh2WzG3++KjDu3ncohe0bT312BdW frMC8hqv+DTQOWauvVC8PQempEglao13Dd97AgnRtrfffw0lPFRvL8iS9jqNCEA= =BxpZ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org