Dynamic property conduit
Hi all, We developed a templating system that allows a user to design a page (using CKEditor) and use tapestry properties to populate dynamic areas. The rendering is performed using a component and standard ${property} syntax. This is perfectly working, but raises an exception if the user uses an unknown property (i.e. ${foo.bar}, where foo or bar do not exist). I would like to build a dynamic property conduit to handle this (this could work either like a universal property provider within a component, or as a “missing_property” fallback, similar to the “missing_method” method in ruby). Ideally, I could add an annotation to a method in the component that would be called in case a a property cannot be found, with the name of the property as parameter. Any idea where I should start? Regards Guillaume
Wizard Component
Hi all, I'm looking for a wizard component for Tapestry 5.3. By "wizard", I mean a conversational set of pages that can manage state and transition rules (previous-next-cancel). If no such component exists, does any of you have ideas about the right design of such a component? Best regards, Guillaume
Custom messages source
Hi all, I am migrating an application to Tapestry 5.3. This application uses its own system to manage i18n messages (using a database to store messages). I would like to bridge its API to t5's Messages API, so I can transparently use the "message" binding with keys from the old system. Unfortunately, I did not find a easy way to achieve this (this only way to contribute the ComponentMessageSource is to provide extra Resources with a file semantic). Any idea? Best regards Guillaume
Re: AppModule: using injected service in ContributeWebSecurityManager
Hi, I created a JNDI object provider to directly inject JNDI resources into managed services : public class JNDIObjectProvider implements ObjectProvider { @Override public T provide(Class objectType, AnnotationProvider annotationProvider, ObjectLocator locator) { JNDIResource annotation = annotationProvider.getAnnotation(JNDIResource.class); if (annotation == null) { return null; } String name = annotation.value(); try { Context ctx = new InitialContext(); T resource = (T) ctx.lookup(name); return resource; } catch (NamingException e) { throw new RuntimeException("JNDI lookup failed for name: " + name, e); } } } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface JNDIResource { String value(); } Used in a service : @Inject @JNDIResource("java:comp/env/jdbc/myDataSource") private DataSource dataSource; Hope it can help Regards, <http://www.financeactive.com/> Guillaume Bodet Directeur de la Technologie - CTO T. +33 177 721 613 M. +33 620 888 665 www.financeactive.com <http://www.financeactive.com/> <https://twitter.com/#!/Financeactive> <http://www.linkedin.com/company/finance-active> <http://fr.viadeo.com/fr/profile/finance.active> <http://fr-fr.facebook.com/pages/Finance-active/426171734065585> P Avant d¹imprimer, pensez à l¹environnement Ce message et toutes les pièces jointes sont établis à l'intention exclusive de ses destinataires et sont confidentiels. L'internet ne permettant pas d'assurer l'intégrité de ce message, Finance active décline toute responsabilité au titre de ce message, dans l'hypothèse où il aurait été intercepté ou modifié. Le 21/06/12 07:01, « cablepuff » a écrit : >Thanks. > >It works. > >I created > >public static DataSource buildMyDataSource() { >// ... implemenation. >} > >then inject the code using @Local @Service("myDataSource") DataSource >dataSource like you suggested. > > > > >-- >View this message in context: >http://tapestry.1045711.n5.nabble.com/AppModule-using-injected-service-in- >ContributeWebSecurityManager-tp5713989p5714000.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 > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Live Class and Template Reloading using jetty and Intellij
I'm using Tapestry together with Idea and live class reloading is just working fine. Launch jetty from the maven plugin, and just hit CTRL+F9 to reload pages and components. Regards Guillaume Tel.: Fax : +33 (0)177 721 613 +33 (0)140 130 430 P Avant d¹imprimer, pensez à l¹environnement Ce message et toutes les pièces jointes sont établis à l'intention exclusive de ses destinataires et sont confidentiels. L'internet ne permettant pas d'assurer l'intégrité de ce message, Finance active décline toute responsabilité au titre de ce message, dans l'hypothèse où il aurait été intercepté ou modifié. Le 12/04/12 09:35, « klausbayrhammer » a écrit : >Hey, > >Im having some trouble with the live class reloading using a >jetty/intellij >setup. > >I deploy the project as an exploded archive starting the jetty (6.1.x) via >intellij's (10.5) jettty integration. Everything starts up just fine and >the >app is running. When i modify a page or tml, build the project and do a >"update classes and resources" i can see that the classes are compiled >correctly and the modified classes/jars have been updated correctly in the >exploded archive. So far so good, but somehow jetty doesn't seem to reload >the changed classes. > >What am I missing? I am using Tapestry 5.2.6 with production-mode disabled >(-Dtapestry.production-mode=false) > >thanks in advance >Klaus > >-- >View this message in context: >http://tapestry.1045711.n5.nabble.com/Live-Class-and-Template-Reloading-us >ing-jetty-and-Intellij-tp5634877p5634877.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 > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Remote validator
It just works! Thanks Thiago (and so sorry not to have figured it out by myself ;;) Regards Guillaume Le 27 mars 2012 à 14:46, Thiago H. de Paula Figueiredo a écrit : > On Tue, 27 Mar 2012 07:47:37 -0300, Guillaume Bodet > wrote: > >> Hi all, > > Hi! > >> Is there any way to access a field container component or ComponentResources >> from inside a validator class? > > Have you tried casting the Field parameter to Component? > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Remote validator
Hi all, I'm working on implementing a remote validator for T 5.3. The remote validator should perform an ajax call to the field's container component to check wether the value is valid, and have the same behavior as other client-side validations. Here is what I did : - extend AbstractValidator to create a RemoteValidator class - extend JS Validators (providing a "remote" validator that performs the ajax call and throw the appropriate message if invalid) - contribute ValidatorSource to add my validator The overall design seems allright but I have a problem accessing the field's container component inside the validator. The render method of the Validator only provides access to the Field and FormSupport interfaces. None on them gives me a handle to the ComponentResources. Hence, I cannot create the link to the component event handler method that should be called via ajax. Is there any way to access a field container component or ComponentResources from inside a validator class? Best regards Guillaume - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Application startup hook
Thanks a lot! Le 15 mars 2012 à 12:19, Dragan Sahpaski a écrit : > Hi, > On Thu, Mar 15, 2012 at 9:20 AM, Guillaume Bodet wrote: > >> Hi, >> >> I'm looking for a way to perform some initialization processing at >> application startup. >> Is there any hook to trigger such processing? >> > Sure. Just use @Startup on a method in your registry module(s). > SeeL: > http://tapestry.apache.org/registry-startup.html#RegistryStartup-StartupMethods > > Cheers, > Dragan Sahpaski > >> >> Best regards >> >> Guillaume >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Application startup hook
Hi, I'm looking for a way to perform some initialization processing at application startup. Is there any hook to trigger such processing? Best regards Guillaume
Programmatical page/component rendering
Hi all, I need to send mails from my application, and I would like to use Tapestry's templating to create the body of the mail. Is there any way to programmatically get the rendering of a page or component (in an output stream, for instance) ? Regards Guillaume - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to return raw page render result on event link
Finally found a way to achieve this : just add support for StreamPageContent handling in the ComponentEventResultProcessor (in my module) : @Contribute(ComponentEventResultProcessor.class) @Ajax public static void provideStreamPageContentAjaxComponentEventResultProcessor( MappedConfiguration configuration) { configuration.addInstance(StreamPageContent.class, StreamPageContentResultProcessor.class); } Now, I can do this : @OnEvent(MY_EVENT) Object onFetchGridContent(){ return new StreamPageContent(GridContent.class, contentContext); } and provide the event URI to the js component. RFE : Couldn't this be done by default in TapestryModule? Regards Guillaume Le 12 déc. 2011 à 18:59, Guillaume Bodet a écrit : > Actually, the browser expects a raw XML response. > If I return a page class or instance from the event handler, the XML content > gets wrapped into a JSON object (which cannot be interpreted by the client). > I hoped the StreamPageContent would return the row page content (I use an XML > tml to build the page). But it seams that the event handler (server side) > doesn't know how to deal with the StreamPageResponse… > > Regards > > Guillaume > > Le 12 déc. 2011 à 16:17, Howard Lewis Ship a écrit : > >> On Mon, Dec 12, 2011 at 1:37 AM, Guillaume Bodet >> wrote: >>> The event handler method throws an exception : >>> A component event handler method returned the value >>> org.apache.tapestry5.services.StreamPageContent@5f00498c. Return type >>> org.apache.tapestry5.services.StreamPageContent can not be handled. >>> >>> I believe this is related to the fact that the request is an XHR request, >>> and the ajax component event handler doesn't kno how to handle the >>> streampagecontent… any idea? >> >> Because the browser is expecting a JSON response, and not a stream of HTML? >> >> From an XHR request, you can return a page class or page instance and >> it will, I believe, encode a JSON response to redirect to the page. >> >>> >>> Regards >>> >>> Guillaume >>> >>> >>> Le 10 déc. 2011 à 06:09, Howard Lewis Ship a écrit : >>> >>>> See >>>> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/StreamPageContent.html >>>> >>>> On Wed, Dec 7, 2011 at 2:17 AM, Guillaume Bodet >>>> wrote: >>>>> Hi, >>>>> >>>>> I'm using a nice js component called DHTMLX Grid in my T5 application. >>>>> DhtmlxGrid fetched its data in an ajax request. Data is formatted as XML : >>>>> >>>>> >>>>> … >>>>> >>>>> >>>>> … >>>>> >>>>> >>>>> >>>>> It is very convenient to use a tapestry page to dynamically create this >>>>> file. >>>>> >>>>> Right now, I'm providing the grid a page render link to the xml page to >>>>> fetch its data. It works great but requires extra effort to share state >>>>> between the containing page and the data page. >>>>> >>>>> What I would like to do is providing the data through an event link in >>>>> the main page. >>>>> >>>>> Here is what the code could look like : >>>>> >>>>> @InjectPage >>>>> private XMLDataPage dataPage; >>>>> >>>>> @OnEvent("loadGrid") >>>>> StreamResponse provideGridData(){ >>>>> dataPage.setState(state); >>>>> String result = pageRenderer.renderPageToString(dataPage); >>>>> return new XMLStreamResponse(result); >>>>> } >>>>> >>>>> Is it feasible ? >>>>> >>>>> Regards >>>>> >>>>> Guillaume >>>>> >>>>> >>>>> - >>>>> 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 ho
Re: How to return raw page render result on event link
Actually, the browser expects a raw XML response. If I return a page class or instance from the event handler, the XML content gets wrapped into a JSON object (which cannot be interpreted by the client). I hoped the StreamPageContent would return the row page content (I use an XML tml to build the page). But it seams that the event handler (server side) doesn't know how to deal with the StreamPageResponse… Regards Guillaume Le 12 déc. 2011 à 16:17, Howard Lewis Ship a écrit : > On Mon, Dec 12, 2011 at 1:37 AM, Guillaume Bodet > wrote: >> The event handler method throws an exception : >> A component event handler method returned the value >> org.apache.tapestry5.services.StreamPageContent@5f00498c. Return type >> org.apache.tapestry5.services.StreamPageContent can not be handled. >> >> I believe this is related to the fact that the request is an XHR request, >> and the ajax component event handler doesn't kno how to handle the >> streampagecontent… any idea? > > Because the browser is expecting a JSON response, and not a stream of HTML? > > From an XHR request, you can return a page class or page instance and > it will, I believe, encode a JSON response to redirect to the page. > >> >> Regards >> >> Guillaume >> >> >> Le 10 déc. 2011 à 06:09, Howard Lewis Ship a écrit : >> >>> See >>> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/StreamPageContent.html >>> >>> On Wed, Dec 7, 2011 at 2:17 AM, Guillaume Bodet >>> wrote: >>>> Hi, >>>> >>>> I'm using a nice js component called DHTMLX Grid in my T5 application. >>>> DhtmlxGrid fetched its data in an ajax request. Data is formatted as XML : >>>> >>>> >>>>… >>>> >>>> >>>>… >>>> >>>> >>>> >>>> It is very convenient to use a tapestry page to dynamically create this >>>> file. >>>> >>>> Right now, I'm providing the grid a page render link to the xml page to >>>> fetch its data. It works great but requires extra effort to share state >>>> between the containing page and the data page. >>>> >>>> What I would like to do is providing the data through an event link in the >>>> main page. >>>> >>>> Here is what the code could look like : >>>> >>>> @InjectPage >>>> private XMLDataPage dataPage; >>>> >>>> @OnEvent("loadGrid") >>>> StreamResponse provideGridData(){ >>>>dataPage.setState(state); >>>>String result = pageRenderer.renderPageToString(dataPage); >>>>return new XMLStreamResponse(result); >>>> } >>>> >>>> Is it feasible ? >>>> >>>> Regards >>>> >>>> Guillaume >>>> >>>> >>>> - >>>> 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 >> > > > > -- > 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
Re: How to return raw page render result on event link
The event handler method throws an exception : A component event handler method returned the value org.apache.tapestry5.services.StreamPageContent@5f00498c. Return type org.apache.tapestry5.services.StreamPageContent can not be handled. I believe this is related to the fact that the request is an XHR request, and the ajax component event handler doesn't kno how to handle the streampagecontent… any idea? Regards Guillaume Le 10 déc. 2011 à 06:09, Howard Lewis Ship a écrit : > See > http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/StreamPageContent.html > > On Wed, Dec 7, 2011 at 2:17 AM, Guillaume Bodet > wrote: >> Hi, >> >> I'm using a nice js component called DHTMLX Grid in my T5 application. >> DhtmlxGrid fetched its data in an ajax request. Data is formatted as XML : >> >> >>… >> >> >>… >> >> >> >> It is very convenient to use a tapestry page to dynamically create this file. >> >> Right now, I'm providing the grid a page render link to the xml page to >> fetch its data. It works great but requires extra effort to share state >> between the containing page and the data page. >> >> What I would like to do is providing the data through an event link in the >> main page. >> >> Here is what the code could look like : >> >> @InjectPage >> private XMLDataPage dataPage; >> >> @OnEvent("loadGrid") >> StreamResponse provideGridData(){ >>dataPage.setState(state); >>String result = pageRenderer.renderPageToString(dataPage); >>return new XMLStreamResponse(result); >> } >> >> Is it feasible ? >> >> Regards >> >> Guillaume >> >> >> - >> 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
How to return raw page render result on event link
Hi, I'm using a nice js component called DHTMLX Grid in my T5 application. DhtmlxGrid fetched its data in an ajax request. Data is formatted as XML : … … It is very convenient to use a tapestry page to dynamically create this file. Right now, I'm providing the grid a page render link to the xml page to fetch its data. It works great but requires extra effort to share state between the containing page and the data page. What I would like to do is providing the data through an event link in the main page. Here is what the code could look like : @InjectPage private XMLDataPage dataPage; @OnEvent("loadGrid") StreamResponse provideGridData(){ dataPage.setState(state); String result = pageRenderer.renderPageToString(dataPage); return new XMLStreamResponse(result); } Is it feasible ? Regards Guillaume - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org