Re: Default Ordering for BeanEditForm
Use BeanEditForms reorder property. The argument is a comma-separated list of property names that will be displayed in the given order. Omitted properties will be appended automatically to this list, in alphabetical order. Uli On 19.02.2011 23:33, Mark wrote: I have a configuration page that I want to edit using a BeanEditForm. I have created getter/setter methods on the page itself and I'm creating the BeanEditForm using: t:beaneditform object=this/ This works, but the properties are not listed in the order of the getters. Instead they are in alphabetical order. Is this a bug in 5.2.4 or is there something about using a page as the bean that is causing the order to be wrong? Mark - 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: Configuration Data
There is a SymbolProvider for properties files in the non-public parts of the API. Have a look at that. Uli On 19.02.2011 16:36, Mark wrote: I have an application that requires a great deal of configuration data after the app is running and needs to be configurable by the end user from within the application This includes things like Facebook admin id, Twitter account info, Mailchimp api key, etc. So far I've been just creating objects, storying them in the database and then accessing them using Hibernate. However this is getting a bit cumbersome and I'd prefer to use some type of properties file that I can configure by hand or have the end user update from within the application. So it needs to be something where: 1. If the property is changed it gets saved back to the file. 2. Changes can be made at run time without reloading the application. I like the way you can inject values from Tapestry Symbols, but I didn't see an easy way to load and save the symbols to/from a properties file. My plan was to use the Apache Common's Configuration for this, but I wanted to make sure I didn't overlook some built in capability and re-invent the wheel. Does anyone have any suggestions? Mark - 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: Configuration Data
On 19.02.2011 16:36, Mark wrote: I have an application that requires a great deal of configuration data after the app is running and needs to be configurable by the end user from within the application This includes things like Facebook admin id, Twitter account info, Mailchimp api key, etc. So far I've been just creating objects, storying them in the database and then accessing them using Hibernate. However this is getting a bit cumbersome and I'd prefer to use some type of properties file that I can configure by hand or have the end user update from within the application. So it needs to be something where: 1. If the property is changed it gets saved back to the file. 2. Changes can be made at run time without reloading the application. If you already use a database in the project and if the project is depending on the operation of the database, than I would say that there is no reason that is sufficient to justify the use of a property file beside the database. Especially when you have many users which are all configuring their stuff. Reinventing a wheel in such case would be to NOT use the database (you will have the problems of multi-user concurent access and file-locking, versioning, ACID transactions). I would also add that you shouldn't split the user profile personal data from the user profile configuration data - they are both user personal data and according to privacy-related laws should be protected. If you split it, than you will have two separate locations to deal with and protect (database and file). Most web applications I have seen that have a lot of user configuration data, store it in a single table that will mimic the property file, that has a composite key like this: (#userid, #property-key, value) Is this what you're currently doing? Because from what I read, it sounded like you are creating separate entity classes for separate properties. smime.p7s Description: S/MIME Cryptographic Signature
Re: Configuration Data
On Sun, Feb 20, 2011 at 5:34 AM, Ulrich Stärk u...@spielviel.de wrote: There is a SymbolProvider for properties files in the non-public parts of the API. Have a look at that. I'm using those in a few places where I need to set a value once before the app is started. However, I was wanting something that would handle automatically writing the values back to the the config file for configuration data that the end user needs to change. Is there a way to save changes back to a file using SymbolProvider? Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Configuration Data
On Sun, Feb 20, 2011 at 6:34 AM, Vangel V. Ajanovski a...@ii.edu.mk wrote: If you already use a database in the project and if the project is depending on the operation of the database, than I would say that there is no reason that is sufficient to justify the use of a property file beside the database. Especially when you have many users which are all configuring their stuff. Reinventing a wheel in such case would be to NOT use the database (you will have the problems of multi-user concurent access and file-locking, versioning, ACID transactions). I would also add that you shouldn't split the user profile personal data from the user profile configuration data - they are both user personal data and according to privacy-related laws should be protected. If you split it, than you will have two separate locations to deal with and protect (database and file). Most web applications I have seen that have a lot of user configuration data, store it in a single table that will mimic the property file, that has a composite key like this: (#userid, #property-key, value) Is this what you're currently doing? Because from what I read, it sounded like you are creating separate entity classes for separate properties. Originally I was using Entity classes which was making things more complicated than they needed to be and that prompted my original question. The single table that mimics the property file is what I'm doing now and I wanted to make sure there weren't any built in facilities for reading and writing these files or the keys to a database that I was overlooking. I started experimenting with Apache Commons Configuration an it lets me use a properties file, XML or a database. Changes from the web interface get written to the file and changes to the file get immediately read back into the web application. Thanks for your suggestions! Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
On Sun, Feb 20, 2011 at 5:32 AM, Ulrich Stärk u...@spielviel.de wrote: Use BeanEditForms reorder property. The argument is a comma-separated list of property names that will be displayed in the given order. Omitted properties will be appended automatically to this list, in alphabetical order. I know I can use the reorder properties, but the Tapestry documentation says that the order should follow the order of the getter methods in the bean. This works with a bean that is not a page class. Is there a reason this isn't true if the bean is also a page class or is this a bug? Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Re: Tapestry 5.1.0.5 and HTML 5 Doctype
I use nille's trick on Tapestr5-jquery-mobile http://bit.ly/fBNNzi. As excepted, I have now the right doctype for html5 but I still not able to use HTML entities. I did not get the time to look how tapestry 5.2 sax parser works. What is the best class entry point to get into tapestry's parser? Regards 2011/1/14 nille hammer tapestry.nilleham...@winfonet.eu Hi Benny, put the following method into your class file: @SetupRender final void renderDocType(final MarkupWriter writer) { writer.getDocument().raw(!DOCTYPE html); } If you use a central Layout component, put it there. Otherwise put it into the page classes. I have tested this with Tap 5.2, but it should work in 5.1 too. Regards nillehammer original Nachricht Betreff: Re: Tapestry 5.1.0.5 and HTML 5 Doctype Gesendet: Fr, 14. Jan 2011 Von: Benny Lawbenny.mk@gmail.com I have looked at the patch provided in https://issues.apache.org/jira/browse/TAP5-840 but it seems to be dealing with the issue of entities only and it's not for Tapestry 5.1.0.5. What I really want is to be able to output !DOCTYPE html. Putting this in the .tml file isn't working. Can somebody suggest a solution for this please? Benny On Wed, Jan 12, 2011 at 9:47 AM, Benny Law benny.mk@gmail.com wrote: Hi François, Thanks for the info. I am aware of TAPS-840 but haven't studied the patch. It looks like that's the only solution for now. Without !DOCTYPE html, Firefox 3.6 renders the page in Quirks mode instead of Standards compliance mode, and I have already noticed some minor issues. I hope this patch gets integrated with Tapestry soon. Benny 2011/1/12 François Facon francois.fa...@atosorigin.com Hi Benny, In order to use html5 in our Web Mobile Solution, I have ask Robin to work on html5 compatibility last year. He had post our feedback in the mailing list. The thread is here http://tapestry.1045711.n5.nabble.com/State-on-HTML5-integration-woodstox-ro llback-td2470926.html I suggest you also to have a look on the related Jira https://issues.apache.org/jira/browse/TAP5-840 If you don't want to patch Tapestry, you have to know that currently most of modern browser run html5 tag even if you are not using !DOCTYPE html. For client side detection Modernizr http://www.modernizr.com/%20is very fine. 2011/1/12 Benny Law benny.mk@gmail.com I am trying to convert my pages to HTML5 but am having problem getting the correct DOCTYPE to be output. The !DOCTYPE html I put in the .tml file is ignored, and the generated HTML code has no DOCTYPE. I'm interested in how people are working around this. Thanks. Benny --- original Nachricht Ende - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Uli On 20.02.2011 15:38, Mark wrote: On Sun, Feb 20, 2011 at 5:32 AM, Ulrich Stärk u...@spielviel.de wrote: Use BeanEditForms reorder property. The argument is a comma-separated list of property names that will be displayed in the given order. Omitted properties will be appended automatically to this list, in alphabetical order. I know I can use the reorder properties, but the Tapestry documentation says that the order should follow the order of the getter methods in the bean. This works with a bean that is not a page class. Is there a reason this isn't true if the bean is also a page class or is this a bug? Mark - 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: Tapestry 5.1.0.5 and HTML 5 Doctype
Hi François, the central template parser class is org.apache.tapestry5.internal.services.SaxTemplateParser. Look at the parse() method. From there you'll get to org.apache.tapestry5.internal.services.XMLTokenStream and its inner class SaxHandler. You'll have to patch somewhere in there, I think :-) Good luck! Christian Am 20.02.2011 um 16:22 schrieb François Facon: I use nille's trick on Tapestr5-jquery-mobile http://bit.ly/fBNNzi. As excepted, I have now the right doctype for html5 but I still not able to use HTML entities. I did not get the time to look how tapestry 5.2 sax parser works. What is the best class entry point to get into tapestry's parser? Regards 2011/1/14 nille hammer tapestry.nilleham...@winfonet.eu Hi Benny, put the following method into your class file: @SetupRender final void renderDocType(final MarkupWriter writer) { writer.getDocument().raw(!DOCTYPE html); } If you use a central Layout component, put it there. Otherwise put it into the page classes. I have tested this with Tap 5.2, but it should work in 5.1 too. Regards nillehammer original Nachricht Betreff: Re: Tapestry 5.1.0.5 and HTML 5 Doctype Gesendet: Fr, 14. Jan 2011 Von: Benny Lawbenny.mk@gmail.com I have looked at the patch provided in https://issues.apache.org/jira/browse/TAP5-840 but it seems to be dealing with the issue of entities only and it's not for Tapestry 5.1.0.5. What I really want is to be able to output !DOCTYPE html. Putting this in the .tml file isn't working. Can somebody suggest a solution for this please? Benny On Wed, Jan 12, 2011 at 9:47 AM, Benny Law benny.mk@gmail.com wrote: Hi François, Thanks for the info. I am aware of TAPS-840 but haven't studied the patch. It looks like that's the only solution for now. Without !DOCTYPE html, Firefox 3.6 renders the page in Quirks mode instead of Standards compliance mode, and I have already noticed some minor issues. I hope this patch gets integrated with Tapestry soon. Benny 2011/1/12 François Facon francois.fa...@atosorigin.com Hi Benny, In order to use html5 in our Web Mobile Solution, I have ask Robin to work on html5 compatibility last year. He had post our feedback in the mailing list. The thread is here http://tapestry.1045711.n5.nabble.com/State-on-HTML5-integration-woodstox-ro llback-td2470926.html I suggest you also to have a look on the related Jira https://issues.apache.org/jira/browse/TAP5-840 If you don't want to patch Tapestry, you have to know that currently most of modern browser run html5 tag even if you are not using !DOCTYPE html. For client side detection Modernizr http://www.modernizr.com/%20is very fine. 2011/1/12 Benny Law benny.mk@gmail.com I am trying to convert my pages to HTML5 but am having problem getting the correct DOCTYPE to be output. The !DOCTYPE html I put in the .tml file is ignored, and the generated HTML code has no DOCTYPE. I'm interested in how people are working around this. Thanks. Benny --- original Nachricht Ende - 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: Default Ordering for BeanEditForm
On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: RequestFilter not called (sometimes)
On Sat, 19 Feb 2011 14:50:03 -0200, Donny Nadolny donny.nado...@gmail.com wrote: It's making the request each time (and getting a 304: not modified). So your RequestFilter wasn't invoked because the request wasn't really executed (i.e. processed again). This is part of HTTP: browsers can ask for an URL to be fetched again if it wasn't changed since some given time. Summary: what you're experiencing is not a bug and it's absolutely correct. -- 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
Re: RequestFilter not called (sometimes)
Hi Thiago, I don't think that fully explains the behavior I'm seeing - the request is always a 304, but in the first trial of 3 requests the request filter ran each time, in the second trial (after killing and restarting jetty) it never ran. Again, this is only for static files - for pages it would always run. I've also just confirmed that this happens even for normal return code 200 requests. In the first run, I request layout.css, img01.jpg, and img02.jpg. I get a 304, 200, 200 and the request filter never runs. I killed jetty and started it again, and requested layout.css, img03.jpg, and img04.jpg. Again I get a 304, 200, and a 200, but the request filter runs each time: 2011-02-20 22:05:54.116::INFO: Started SelectChannelConnector@0.0.0.0:8080 [INFO] Started Jetty Server 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:06:01 +] GET /myapp5.2.4/layout/layout.css HTTP/1.1 304 0 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:07:15 +] GET /myapp5.2.4/layout/images/img01.jpg HTTP/1.1 200 752 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:07:27 +] GET /myapp5.2.4/layout/images/img02.jpg HTTP/1.1 200 3878 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 2011-02-20 22:09:39.228::INFO: Started SelectChannelConnector@0.0.0.0:8080 [INFO] Started Jetty Server [INFO] AppModule.TimingFilter Request time: 7 ms 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:09:41 +] GET /myapp5.2.4/layout/layout.css HTTP/1.1 304 0 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 [INFO] AppModule.TimingFilter Request time: 0 ms 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:09:53 +] GET /myapp5.2.4/layout/images/img03.jpg HTTP/1.1 200 2913 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 [INFO] AppModule.TimingFilter Request time: 1 ms 0:0:0:0:0:0:0:1 - - [21/Feb/2011:03:10:01 +] GET /myapp5.2.4/layout/images/img04.jpg HTTP/1.1 200 3287 - Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 Any ideas? I'm not sure why this is happening. On Sun, Feb 20, 2011 at 5:38 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Sat, 19 Feb 2011 14:50:03 -0200, Donny Nadolny donny.nado...@gmail.com wrote: It's making the request each time (and getting a 304: not modified). So your RequestFilter wasn't invoked because the request wasn't really executed (i.e. processed again). This is part of HTTP: browsers can ask for an URL to be fetched again if it wasn't changed since some given time. Summary: what you're experiencing is not a bug and it's absolutely correct. -- 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
Re: Tapestry 5 - cache issue when accessed via proxy
Hi Josh Thanks for your response. You're right. We dont have the search parameter in the URL but wondering how does it work in a scenario where there no proxy server. I have seen an option disableCaching. If i enable that, will it work. Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. I will anyway check the proxy logs. Thanks Sundar -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-cache-issue-when-accessed-via-proxy-tp3388994p3393672.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: Tapestry 5 - cache issue when accessed via proxy
Hi Richard Thanks for your response. I dont really suspect the database part here because it works fine without proxy server. I will take a look at the server/proxy logs. That should give some hint. Will keep you guys updated. Thanks Sundar -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-cache-issue-when-accessed-via-proxy-tp3388994p3393674.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 pass parameters from a Page to another Page in java code?
Hi All, I know that we can pass a parameter through context attribute of tag in template, but how to achieve it in java code? like this: public class Edit { @Property @Autowired private Employee employee; @InjectPage private View view; @Log Object onSuccess() { employee.persist(); // Pass parameter employeeId to view Page return view; } } public class View { @Parameter private Long employeeId; @Property private Employee employee; void onActivate(Long employeeId) { if (employeeId != null) employee = Employee.findEmployee(employeeId); } } Thanks! -- Best Regards Rock Lee
Re: How to pass parameters from a Page to another Page in java code?
On Mon, Feb 21, 2011 at 9:50 AM, leon mail@gmail.com wrote: Hi All, Hi I know that we can pass a parameter through context attribute of tag in template, but how to achieve it in java code? like this: public class Edit { @Property @Autowired private Employee employee; @InjectPage private View view; @Log Object onSuccess() { employee.persist(); view.setEmployeeId(employee.getId()); // Pass parameter employeeId to view Page return view; } } public class View { @Parameter private Long employeeId; public void setEmployeeId(Long employeeId){ this.employeeId = employeeId; } Long onPassivate(){ return employeeId; } @Property private Employee employee; void onActivate(Long employeeId) { if (employeeId != null) employee = Employee.findEmployee(employeeId); } } Thanks! -- Best Regards Rock Lee regards Taha
Re: Tapestry 5 - cache issue when accessed via proxy
If you want to use the exact same URL to serve different content, you'll need to make sure the response is never cached by the client. Add appropriate HTTP headers to the response: @Inject private Response response; void onActivate(...) { response.setHeader(Cache-Control, no-cache); response.setDateHeader(Expires, 0); } On Mon, 21 Feb 2011 05:11:43 +0100, sunmoor007 sunmoo...@gmail.com wrote: Hi Josh Thanks for your response. You're right. We dont have the search parameter in the URL but wondering how does it work in a scenario where there no proxy server. I have seen an option disableCaching. If i enable that, will it work. Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. I will anyway check the proxy logs. Thanks Sundar - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org