Unable to get clientId in a component [T5.3.8]
I’m trying to build a simple component that references up to 4 components on my page. I’m using the component like this: dateRangeFrom, dateRangeTo are both required in the component, and work fine @Parameter(required = true, defaultPrefix = BindingConstants.COMPONENT) private Field dateRangeFrom; @Parameter(required = true, defaultPrefix = BindingConstants.COMPONENT) private Field dateRangeTo; relatedRangeFrom and relatedRangeTo are non-null, in after render, and they are the right type, but the clientId always returns null @Parameter(required = false, defaultPrefix = BindingConstants.COMPONENT) private Field relatedRangeFrom; @Parameter(required = false, defaultPrefix = BindingConstants.COMPONENT) private Field relatedRangeTo; afterRender() does the normal things @Import(library = "DateRangePreset.js") void afterRender() { JSONObject specs = new JSONObject(); specs.put("select", "#" + dateRangePresetSelect.getClientId()); specs.put("dateRangeFrom", "#" + dateRangeFrom.getClientId()); logger.info("ff: " + relatedRangeFrom); if (relatedRangeFrom != null) { logger.info("rel: " + relatedRangeFrom.getClientId()); // specs.put("relatedRangeFrom", "#" + relatedRangeFrom.getClientId()); specs.put("relatedRangeFrom", "#compareDateRangeFrom"); } } In the log I see [INFO ][DateRangePreset] ff: org.apache.tapestry5.corelib.components.DateField@46490fee [INFO ][DateRangePreset] rel: null The only thing that’s different between the required DateFields and the optional ones, are that the required ones are before my component, the optional ones are after my component, but that shouldn’t have anything to do with. For completeness, here is more of my .tml file, what you see here are the two required date fields, my new component, and then the two optional date fields. Thanks in advance for any help. Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: tapestry 4.1.6 and pergmen question
I still have a Tapestry 4 app running with Tomcat 6.0.41, and it runs well enough with: -XX:MaxPermSize=1024m I also have -Xmx12g -Xms4g -XX:+UsseConcMarkSweepGC -XX:+UseParNewGC But those may not be of interest to you. Hope that helps Tony > -Original Message- > From: Ivano Luberti [mailto:lube...@archicoop.it] > Sent: Tuesday, April 05, 2016 3:44 PM > To: Tapestry users > Subject: tapestry 4.1.6 and pergmen question > > I know I know, please don't shoot the pianist. > I have an old application written using Tapestry 4.1.6 and I can't get the > budget to rewrite in Tapestry 5. > (BTW I have already and succesfully used Tapestry 5, so I know what I'm > loosing here) The application run without issues for years on a > CentOS+Tomcat 5.5+Java > 6 combination but recently I had to move it to a new server where I have > CentOS+Tomcat 6+Java 6. > > Suddenly the application started to quickly run out of memory with the > dreadful PermGen Out Of Meory Error. > > I got an heap dump in an hprof file and found that there thousands instances > of > > org.apache.tapestry.enhance.ClassFactoryClassLoader > > still alive > > Does anyone have any clue of permanent generation memory issues with > Tapestry 4 and Tomcat 6 ? > > TIA > > > -- > == > dott. Ivano Mario Luberti > Archimede Informatica societa' cooperativa a r. l. > Sede Operativa > Via Gereschi 36 - 56126- Pisa > tel.: +39-050- 580959 > tel/fax: +39-050-8932061 > web: www.archicoop.it > == > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: URL rewriting help
> -Original Message- > From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] > Sent: Thursday, March 10, 2016 10:02 AM > > On Thu, 10 Mar 2016 10:55:41 -0300, Tony Nelson <tnel...@starpoint.com> > wrote: > > > Hi All, > > Hello, Tony! > Hello again Thiago, > > I need to map URLs from our old application to the new URLs in our 5.3 > > app. Yesterday I found this page: > > > > http://blog.tapestry5.de/index.php/2010/09/06/new-url-rewriting-api/ > > For rewriting incoming requests, but not for rewriting the URLs generated by > Tapestry (usually, you need to have both), I suggest taking a look at > this: > http://tapestry.machina.com.br/2013/10/1/tapestry-url-rewriter-2-0-0- > released. > The T5.1 was very bad for rewriting outgoing URLs, but I think it was very > good for incoming ones. > This was SO MUCH EASIER! And to top it off, it works. > By that way, that very blogging engine was written by me and uses Tapestry > URL rewriter 2.0.0 itself. Sources here: > https://github.com/thiagohp/eloquentia. > I had to look in the AppModule of your blogging software to figure out how to contribute my rules, maybe you could copy that to the example in the blog post. Thanks again for all your hard work Thiago. Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
URL rewriting help
Hi All, I need to map URLs from our old application to the new URLs in our 5.3 app. Yesterday I found this page: http://blog.tapestry5.de/index.php/2010/09/06/new-url-rewriting-api/ Following that I wrote my first rewrite rule /maintenance/agency_required_documents.htm?agencyId=86 to /company/AgencyRequiredDocuments/86 That works fine. This morning I tried my second URL /candidate/ViewPayRate.external?sp=23761 to /candidate/ViewPayRate/23761/true Unfortunately, it seems since the base page name ViewPayRate resolves fine, 5.3 looks at ".external" as a component, and I get the following exception: Component candidate/ViewPayRate does not contain embedded component 'external'. Screenshot: http://take.ms/nLDlR My URL Rewriter isn't even being called, I presume because candidate/ViewPayRate resolves to a valid page. I verified this by slightly changing the input URL to something that wouldn't match, and my rewrite was called and everything worked fine. What is my best approach for this? I'm leaning towards putting my rewrite rules in nginx, but I was really hoping to keep this all in code. Any hints or suggestions would be greatly appreciated. For completeness, here is my existing code: public class OldCodeBaseLinkTransformer implements PageRenderLinkTransformer { @Inject @SuppressWarnings("unused") private Logger logger; @Inject private ValueEncoderSource valueEncoderSource; @Override public Link transformPageRenderLink(Link defaultLink, PageRenderRequestParameters parameters) { logger.debug("LOOK: " + defaultLink.getBasePath()); return defaultLink; } @Override public PageRenderRequestParameters decodePageRenderRequest(Request request) { final String path = request.getPath(); logger.info("path: " + path); if (path.startsWith("/maintenance/agency_required_documents.htm")) { final String agencyId = request.getParameter("agencyId"); final EventContext context = new LinkContext(valueEncoderSource).putValue(agencyId); return new PageRenderRequestParameters("company/AgencyRequiredDocuments", context, false); } else if (path.startsWith("/candidate/ViewPayRate.external")) { final String id = request.getParameter("sp"); final EventContext context = new LinkContext(valueEncoderSource).putValue(id).putValue("true"); return new PageRenderRequestParameters("candidate/viewpayrate", context, false); } return null; } } and my contribution @Contribute(PageRenderLinkTransformer.class) @Primary public static void provideURLRewriting( OrderedConfiguration configuration) { configuration.addInstance( "OldCodeBaseLink", OldCodeBaseLinkTransformer.class); } Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Zone event, new client id
I have a small form in a zone. When an error occurs in the event handler, I need to execute some javascript, which I’m adding with the ajaxResponseRender. I can’t figure out how to access the clientId of the component that will be rendered. If I try to use the Injected component, I get NULL for the client id. If I try to allocate the client id with javascript support, then the one that is actually used has ‘_0’ appended to it. I tried changing my event method to void, and adding onSuccess and onFailure. What is the correct way to get to the client id that will be rendered in an ajax handler? Thanks in advance, Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Re: Zone event, new client id
Sorry, this is the submit of a zone event. Here is all of the relevant code. I did check, afterRender is not called in the chain. The log line that is generated with this code is: [INFO] components.EmailForm tinymce.execCommand('mceAddEditor',true,'null'); Thanks again for any help. @InjectComponent private Field emailBody; public void onSendEmail() { try { messageQueue.sendCommandMessage(commandProducer.createSendJacketEmailMessagesCommand( authenticator.getCurrentUser(), to, cc, bcc, subject, body, null)); } catch (Exception ioe) { emailForm.recordError(An error occurred processing your request, please try again or contact the help desk);; } } @Log Object onFailure() { addReInitTinyMCECommand(); return request.isXHR() ? emailZone.getBody() : null; } @Log Object onSuccess() { resetForm(); if (dialogId != null) { addCloseDialogCommand(); } return request.isXHR() ? emailZone.getBody() : null; } private void addReInitTinyMCECommand() { ajaxResponseRenderer.addCallback(new JavaScriptCallback() { @Override public void run(JavaScriptSupport javascriptSupport) { String cmd = tinymce.execCommand('mceAddEditor',true,' + emailBody.getClientId() + ');; logger.info(cmd); javascriptSupport.addScript(cmd); } }); } On Jul 24, 2015, at 12:01 PM, Thilo Tanner thilo.tan...@reprisk.com wrote: Hi Tony, In which render phase are trying to access the client id? It may help if you post parts of your code. Injecting the component to access the client id works for me (for the following common pattern): @Environmental private JavaScriptSupport javaScriptSupport; @Component private Select mySelect; @AfterRender public void afterRender() { javaScriptSupport.require(my-module).invoke(init).with(mySelect.getClientId()); } This snippet will inject the generated client id in your JS module as a parameter of the init function. Best, Thilo Am 24.07.15 17:43 schrieb Tony Nelson unter tnel...@starpoint.com: I have a small form in a zone. When an error occurs in the event handler, I need to execute some javascript, which I’m adding with the ajaxResponseRender. I can’t figure out how to access the clientId of the component that will be rendered. If I try to use the Injected component, I get NULL for the client id. If I try to allocate the client id with javascript support, then the one that is actually used has ‘_0’ appended to it. I tried changing my event method to void, and adding onSuccess and onFailure. What is the correct way to get to the client id that will be rendered in an ajax handler? Thanks in advance, Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Re: Advanced transaction support for tapestry JPA applications
This does look very interesting. A while back, Howard built a custom commit handler for me, that delays creating the transaction until a method with @CommitAfter is seen. Does your library have a similar side effect, of not starting the transaction because only methods marked with @CommitAfter get wrapped in a TransactionalUnit? I look forward to testing out your library when time permits. Thanks Tony On Jul 23, 2015, at 5:03 PM, Dmitry Gusev dmitry.gu...@gmail.com wrote: Hello Tapestry users! I would like to share with you a new small tapestry5 library that may be helpful for tapestry JPA applications: https://github.com/satago/tapestry-jpa-transactions 1) It overrides @CommitAfter annotation with support for nested calls (only top-most method will actually commit transaction) 2) Simple service for wrapping Runnable/Invokable objects with transactions when you need precise control over transactions 3) Before/after commit callbacks 4) Support @Injects in entity listeners when used with JPA 2.1 Please see GitHub readme for details. It's built against tapestry 5.3.7, but should also work with latest 5.4 versions (not tested). -- Dmitry Gusev AnjLab Team http://anjlab.com Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: hibernateModule is looking for MethodAdvice
Double check that you don't have both tapestry 5.3 and 5.4 jars in your class path. -Tony On Nov 15, 2014, at 3:03 PM, Jan Fryblik jan.fryb...@ebrothers.cz wrote: HI guys, i'm currently migrating from 5.3.7 to 5.4-beta-22 and i'm stuck with strange exception (below) comming from HibernateModule. I have removed all MethodAdvice references from my project, but without any effect. Could you please give me a hint what can be a reason? Thanks for any comments. 19:49:44 [INFO] ioc.RegistryBuilder Adding module definition for class org.got5.tapestry5.jquery.services.JQueryModule 19:49:44 [INFO] ioc.RegistryBuilder Adding module definition for class org.got5.tapestry5.jquery.services.js.JSModule 19:49:44 [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.hibernate.modules.HibernateModule failed Catalog: java.lang.NoClassDefFoundError: org/apache/tapestry5/ioc/MethodAdvice failed org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext@4506b213{/catalog-web,/mnt/ebrothers/katalog/src/Catalog/catalog-web/src/main/webapp}: java.lang.NoClassDefFoundError: org/apache/tapestry5/ioc/MethodAdvice failed ContextHandlerCollection@7dd4d950: java.lang.NoClassDefFoundError: org/apache/tapestry5/ioc/MethodAdvice failed HandlerCollection@7391bf69: java.lang.NoClassDefFoundError: org/apache/tapestry5/ioc/MethodAdvice Error starting handlers java.lang.NoClassDefFoundError: org/apache/tapestry5/ioc/MethodAdvice at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:159) at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:132) at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:105) at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:76) at org.apache.tapestry5.internal.TapestryAppInitializer.init(TapestryAppInitializer.java:123) at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:97) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489) at org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext.doStart(JettyPluginWebAppContext.java:112) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152) Have a nice weekend, Jan Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Advice Order - Tapestry 5.3.7
I have a pretty simple app that uses Tapestry-Hibernate. I want to add a simple advice that is called before the Tapestry hibernate commit. In my module I have: @Match(TaskLogic) public static void adviseTransactions(HibernateTransactionAdvisor advisor, MethodAdviceReceiver receiver) { advisor.addTransactionCommitAdvice(receiver); } @Match(TaskLogic) @Order(before:Transactions) public static void adviseSuccessfulExecutions(SystemLogic systemLogic, MethodAdviceReceiver receiver) { MethodAdvice successAdvice = new MethodAdvice() { @Override void advise(MethodInvocation invocation) { invocation.proceed() systemLogic.updateTaskSuccess(invocation.method.name) } } receiver.adviseAllMethods(successAdvice) } My method, updateTaskSucess is definitely being called, but it's being called after the HibernateTransactionAdvisor has called commit(). Is my @Order annotation incorrect? Thanks for any help in advance Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Tapestry-jpa commitAfter advisor problem
For my projected, I moved the @CommitAfter annotations from the database layer, to the web controllers themselves. Other folks have said that breaks separation of concerns. For my project it was the simplest and most straight forward way of getting tapestry-hibernate to do what was necessary. Tony -Original Message- From: Chris Mylonas [mailto:ch...@opencsta.org] Sent: Thursday, September 25, 2014 9:43 AM To: Tapestry users Subject: Re: Tapestry-jpa commitAfter advisor problem I only know EJB/JPA but I'm sure some people will say Spring. I prototype in tapestry-hibernate because the docs were easier at the time to use than tapestry-jpa, and when I hit nesting problems that's when I switch to using the @EJB annotation. I need to switch to tapestry-jpa to make my transition smoother :) What version of tapestry are you using? Because I've found I can go further on 5.3.7 than I can on 5.4 when it comes to hitting nesting problems. YMMV As an alternative I'm thinking about giving this object mocking workflow a go without all the transaction stuff - just so I can do my tapestry stuff faster. On Thu, Sep 25, 2014 at 11:30 PM, Charlouze m...@charlouze.com wrote: Thx for your quick answer. My method2 can be used in a stand-alone way so removing @CommitAfter is not an option. I could get around the problem with another method called by both method 1 and 2 but it'll bring mess to my code having one method that commits the transaction and another one that don't. If I want a better support of transaction, what should I do then ? 2014-09-25 15:20 GMT+02:00 Dusko Jovanovski dusk...@gmail.com: The @CommitAfter annotation should be used as a convenience for simple scenarios, it doesn't support nesting. This has been discussed many times in the past on this mailing list. For the scenario that you described, I would remove the @CommitAfter annotation from method2, this way all of the code will be wrapped in a single transaction. On Thu, Sep 25, 2014 at 3:08 PM, Charlouze m...@charlouze.com wrote: Hey everyone Here is my problem : I have a service (service1) that has a method (method1) which has the @CommitAfter annotation in order for tapestry to take care of the transaction. I have a second service (service2) that has a method (method2) which also has the @CommitAfter annotation. service2 is injected into service1 and method2 is used by method1. The problem is method2 commits the transaction even though it is not the one that began it. Thus, every modifications made to managed entities that are done after the method2 call in method1 are not commited. Am i wrong using those services like that or is it the advisor that has a wrong behavior ? Thx in advance, Charles. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Tapestry-jpa commitAfter advisor problem
I was just trying to give you an easy option. It has worked well for me. YMMV. Tony -Original Message- From: Charlouze [mailto:m...@charlouze.com] Sent: Thursday, September 25, 2014 9:56 AM To: Tapestry users Subject: Re: Tapestry-jpa commitAfter advisor problem @Chris: I'm using 5.4 and I don't really want to use spring... I'm using tapestry-ioc for my logic/business layer and i'd like it to stay that way. Even though I already used spring for some time, I think it'll be more difficult for new junior devs to get into the code. I'm thinking about writing a more clever advisor for @transactional that will fulfill my simple needs. @Tony: I'm too much a fan of separation of concerns to do what your are telling me ;) 2014-09-25 15:51 GMT+02:00 Tony Nelson tnel...@starpoint.com: For my projected, I moved the @CommitAfter annotations from the database layer, to the web controllers themselves. Other folks have said that breaks separation of concerns. For my project it was the simplest and most straight forward way of getting tapestry-hibernate to do what was necessary. Tony -Original Message- From: Chris Mylonas [mailto:ch...@opencsta.org] Sent: Thursday, September 25, 2014 9:43 AM To: Tapestry users Subject: Re: Tapestry-jpa commitAfter advisor problem I only know EJB/JPA but I'm sure some people will say Spring. I prototype in tapestry-hibernate because the docs were easier at the time to use than tapestry-jpa, and when I hit nesting problems that's when I switch to using the @EJB annotation. I need to switch to tapestry-jpa to make my transition smoother :) What version of tapestry are you using? Because I've found I can go further on 5.3.7 than I can on 5.4 when it comes to hitting nesting problems. YMMV As an alternative I'm thinking about giving this object mocking workflow a go without all the transaction stuff - just so I can do my tapestry stuff faster. On Thu, Sep 25, 2014 at 11:30 PM, Charlouze m...@charlouze.com wrote: Thx for your quick answer. My method2 can be used in a stand-alone way so removing @CommitAfter is not an option. I could get around the problem with another method called by both method 1 and 2 but it'll bring mess to my code having one method that commits the transaction and another one that don't. If I want a better support of transaction, what should I do then ? 2014-09-25 15:20 GMT+02:00 Dusko Jovanovski dusk...@gmail.com: The @CommitAfter annotation should be used as a convenience for simple scenarios, it doesn't support nesting. This has been discussed many times in the past on this mailing list. For the scenario that you described, I would remove the @CommitAfter annotation from method2, this way all of the code will be wrapped in a single transaction. On Thu, Sep 25, 2014 at 3:08 PM, Charlouze m...@charlouze.com wrote: Hey everyone Here is my problem : I have a service (service1) that has a method (method1) which has the @CommitAfter annotation in order for tapestry to take care of the transaction. I have a second service (service2) that has a method (method2) which also has the @CommitAfter annotation. service2 is injected into service1 and method2 is used by method1. The problem is method2 commits the transaction even though it is not the one that began it. Thus, every modifications made to managed entities that are done after the method2 call in method1 are not commited. Am i wrong using those services like that or is it the advisor that has a wrong behavior ? Thx in advance, Charles. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
RE: Tapestry in distributed environment
All you need to do is build the registry. This is the shell of a main class (in groovy). @Slf4j class Main { static void main(String[] args) { // this is the module you wish to load, you may of course add several RegistryBuilder registryBuilder = new RegistryBuilder(); registryBuilder.add(AtlasImporterModule); // I keep configs in modules, DevMode, DemoMode, etc Class clz = Class.forName(com.starpoint.instihire.api.services. + StringUtils.capitalize(config.env) + Mode); registryBuilder.add(clz); Registry registry = registryBuilder.build(); registry.performRegistryStartup(); // registry is up SomeService svc = registry.getService(SomeService) svc.doSomething(); // shut down the registry when you are done registry.shutdown(); } } Hope that helps Tony ps. I apologize in advance if the formatting gets messed up, I am sending this from a web based mail. From: Mugat Gurkowsky [zenpunk...@gmail.com] Sent: Friday, August 29, 2014 7:39 AM To: users@tapestry.apache.org Subject: Tapestry in distributed environment hello, i am currently using tapestry for a web-project which i am developing. the project is meant to work with a lot of data, and requires a lot of processing power. in order to overcome the problems of so much data and processing-power, i intend to use distributed calculations, which will be running on drone-clients which distribute the data as well as the processing. i would like to be able to use tapestry IoC (especially injections) in the drone-clients, but i have run into problems with that. in the documentations i have not seen any way which would make use of Tapestry IoC from a java-main without the ise of a web-server, so i wanted to ask you how i could do that best. thanks in advance for help zenpunk Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Java 8 with Tapestry 5.3.x?
Heh, I'm still running one site with Tapestry 4 and Java 6. And yes, it's still getting active updates. My new version of the site is being written in 5.3.7 with Java 7, but I have another year or so at least according to the project plan, until it will be done. -Original Message- From: Richard Frovarp [mailto:rfrovarp@gmail.com] On Behalf Of Richard Frovarp Sent: Tuesday, August 05, 2014 3:19 PM To: Tapestry users Subject: Java 8 with Tapestry 5.3.x? Is there an easy way to get Tapestry 5.3.7 to work with Java 8? Or is there a plan to release 5.3.8 that would be Java 8 compatible? The big reason I'm asking is that Java 7 goes EOL next April. I would love to start moving our applications over to libraries that support Java 8 starting now so hopefully we can be off of Java 7 when it goes EOL. Thanks, Richard - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Multi Select
We also use Select2 with Tapestry, it's very easy to integrate. -Original Message- From: Balázs Palcsó [mailto:palcso.bal...@gmail.com] Sent: Thursday, May 22, 2014 5:23 PM To: Tapestry users Subject: Re: Multi Select Hi, I can recommend http://ivaynberg.github.io/select2/ It is not an out of box tapestry component, but can be integrated easily. On 22 May 2014 22:10, Lance Java lance.j...@googlemail.com wrote: Select doesn't support multiple options. There is checklist and pallette which do the same job admittedly they look different. There's nothing stopping you from creating a multiselect component by extending AbstractField. On 22 May 2014 21:42, Sanket Sharma sanketsha...@gmail.com wrote: Hi, I was wondering if there is a multi select component available in tapestry? I looked at the palette component and a similar component in chenille kit, but the demo page isn't available anymore. Reading through the email archives and some old links, it seems like there is a way to achieve it using custom encoders etc. - not sure if it is still applicable and valid? Thank you for your assistance. Sanket Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: @CommitAfter for GenericDao
The problem we ran into was explicitly what I documented in my original e-mail. In our Spring based implementation all of our @Transactional annotations we in our logic layer, and it worked well. I started out using @CommitAfter exactly the same way, until I ran into methods like: public void saveSomething(Something something) { // add a bunch of validations // and maybe a bunch of business rules // and then updates to other objects // and then finally dao.save(something); // oh and maybe some post processing } public void saveAListOfSomethings(ListSomething somethings) { for (Something something : somethings) { saveSomething(something); } } After running into this too many times in our codebase, we made the decision to remove all @CommitAfter annotation from our logic layer (even wrote a test case) and push them out to where the actual transaction logically existed. For us this includes web pages, REST endpoints, and even command line programs. This has worked very well for us. I'm also not sure I completely agree with your separation of concerns argument either. Granted, I would never allow anyone to @Inject Session into a page class, that definitely belongs in the DAO layer, but a simple annotation the demarks a transaction doesn't feel out of place to me in a page class. -Original Message- From: John [mailto:j...@quivinco.com] Sent: Monday, May 05, 2014 1:10 PM To: Tapestry users Subject: Re: @CommitAfter for GenericDao At the risk of sounding like a fanatic... I would avoid using @CommitAfter or anything similar to do with persistence in page classes, it contravenes the OO seperation of concerns principle. (For the same reasons @CommitAfter should also not be in interface definitions as suggested in the Tapestry docs' because it's implementation specific.) A better place would be a facade layer* between your DAOs and your page classes. This might not be justified if you want to keep your application architecture minimal, but even so it represents best practice and is a great place to code your business logic. Your page classes can then focus exclusively on delivery of page content and your DAOs on pure data access. regards, John *http://en.wikipedia.org/wiki/Facade_pattern - Original Message - From: Tony Nelson To: Tapestry users Sent: Wednesday, April 30, 2014 9:59 PM Subject: RE: @CommitAfter for GenericDao From my experience, you really don't want to put CommitAfter on a generic method like that. It really doesn't do what you expect in code like this: void saveSomeData(ListWidget widgets) { for (Widget w: widgets) { widgetDao.saveWidget(widget); } } In that case, assuming saveWidget is annotated with @CommitAfter, every iteration of the loop will commit separately, which is likely not what you want. The @CommitAfter annotation is much better used in your page classes to commit transactions after a logical unit of work is complete. Tony -Original Message- From: Eugen [mailto:eugens...@gmail.com] Sent: Wednesday, April 30, 2014 4:48 PM To: Tapestry users Subject: @CommitAfter for GenericDao Hi, I try to use the CommitAfter on a GenericDao, but the method does not commit the transaction. Does it exists a worcaround to do that? This is the code: public interface GenericDaoT { @CommitAfter public void save(T entity); } public abstract class GenericDaoImplT { @Override public void save(T entity) { entityManager.persist(entity); } } public interface UserDao extends GenericDaoUser { } public class UserDaoImpl extends GenericDaoImplUser implements UserDao { } and respective advisor in AppModule: @Match(*Dao) public static void adviseTransactions(JpaTransactionAdvisor advisor, MethodAdviceReceiver receiver) { advisor.addTransactionCommitAdvice(receiver); } if I place the save() function into the UserDao all works fine. Thanks in advice Eugen --- -- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited
RE: @CommitAfter for GenericDao
From my experience, you really don't want to put CommitAfter on a generic method like that. It really doesn't do what you expect in code like this: void saveSomeData(ListWidget widgets) { for (Widget w: widgets) { widgetDao.saveWidget(widget); } } In that case, assuming saveWidget is annotated with @CommitAfter, every iteration of the loop will commit separately, which is likely not what you want. The @CommitAfter annotation is much better used in your page classes to commit transactions after a logical unit of work is complete. Tony -Original Message- From: Eugen [mailto:eugens...@gmail.com] Sent: Wednesday, April 30, 2014 4:48 PM To: Tapestry users Subject: @CommitAfter for GenericDao Hi, I try to use the CommitAfter on a GenericDao, but the method does not commit the transaction. Does it exists a worcaround to do that? This is the code: public interface GenericDaoT { @CommitAfter public void save(T entity); } public abstract class GenericDaoImplT { @Override public void save(T entity) { entityManager.persist(entity); } } public interface UserDao extends GenericDaoUser { } public class UserDaoImpl extends GenericDaoImplUser implements UserDao { } and respective advisor in AppModule: @Match(*Dao) public static void adviseTransactions(JpaTransactionAdvisor advisor, MethodAdviceReceiver receiver) { advisor.addTransactionCommitAdvice(receiver); } if I place the save() function into the UserDao all works fine. Thanks in advice Eugen - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Multiple new objects with a component
I am trying to build a form where there are N instances of a custom editing component. For example, something simple like: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; ${idx} : Id: t:textfield value=domainObj.id validate=maxLength=5 maxlength=5 / : B: t:textfield value=domainObj.a validate=maxlength=10 maxlength=10 / br/ /t:container The component Java code is trivial: public class EditObject { @Property @Parameter(required = true) SimplePojo domainObj; @Property @Parameter(required = false, value = 0) Integer idx; void onValidate() { log.info(EditObject onValidate: + domainObj); } } There is no AJAX, just a simple posted form. This component is used like this: !DOCTYPE html html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; head titleMultiple components in a loop/title /head body t:form t:id=myForm h3Group A/h3 t:loop source=groupA value=domainObj index=idx element=div t:EditObject domainObj=domainObj idx=idx/ /t:loop h3Group B/h3 t:loop source=groupB value=domainObj index=idx element=div t:EditObject domainObj=domainObj idx=idx/ /t:loop t:submit value=Submit/ /t:form /body /html The main controller is very simple: public class MultiDemo { @Inject private Logger logger; @Property ListSimplePojo groupA; @Property ListSimplePojo groupB; @Property SimplePojo domainObj; @Property Integer idx; @Log void onValidateFromMyForm() { for (SimplePojo sp : groupA) { logger.info(A: + sp.toString()); } for (SimplePojo sp : groupB) { logger.info(B: + sp.toString()); } } @Log void setupRender() { createGroups(); } @Log void onPrepare() { // if this is commented out, I get a NPE in onValidateFromMyForm createGroups(); } void createGroups() { groupA = createGroup(); groupB = createGroup(); } ListSimplePojo createGroup() { ListSimplePojo result = new ArrayListSimplePojo(); for (int i = 0; i 3; i++) { result.add(new SimplePojo()); } return result; } } That's it, the whole page. But I just can't get it to work. If I comment out onPrepare() I get a NPE in the onValidateFromMyForm, which makes sense. With it uncommented, onValidateFromMyForm is always new null filled objects. The logging in the component onValidate shows domainObj.id being set, but never domainObj.A. When the form redraws, it loses any values I typed in and is blank again. I'm missing something obvious I'm sure, but can't see what it is. Any help would be greatly appreciated. Thanks Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Pro / Contra: Splitting The Project
I split mine into several components Ih-db - the hibernate domain classes Ih-api - all of the business logic, depends on ih-db Web - the web site, including all of the tapestry stuff, depends on ih-api Utility1..UtilityN - command line programs that do things the system needs, these all depend on ih-api I build it all w/ a multi-project gradle build. Works very nicely. -Original Message- From: Robert Hailey [mailto:rhai...@allogy.com] Sent: Friday, October 11, 2013 4:29 PM To: Tapestry users Subject: Re: Pro / Contra: Splitting The Project The way it usually goes is a three-way split... A B (the logical split), and C (which A B both depend on). -- Robert Hailey On 2013/10/11 (Oct), at 2:44 PM, Jon Williams wrote: yes i do that. pretty standard i think. Cheers Jon On Fri, Oct 11, 2013 at 1:30 PM, Martin Kersten martin.kersten...@gmail.com wrote: Hi, I am sitting in front of 1.5 MB of sources and I think about splitting the project in half. One for the services + entities + utilities the rest for the web fun. It would also allow to test the core only with unit test and barely with integration tests. Where the web part might be all about integration + acceptance testing. But I am in doubt. the only gain I would have is half the packages at once, and some separation and shift in thinking. Does anyone split projects in core vs web? What is the point in doing so and why not? Cheers, Martin (Kersten), Köthen Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
ActivationContext messing up more AJAX calls
Our pages all extend a common layout, that has a simple value that we update every minute with an ajax call. The handler is in the component class for the layout, and is very simple: public JSONObject onUpdateAlertCount() { return request.isXHR() ? new JSONObject(alertCount, getAlertCount()) : null; } We generate the URL for this using ComponentResources: Link link = componentResources.createEventLink(updateAlertCount); JSONObject specs = new JSONObject(); specs.put(timeout, 60s); specs.put(url, link.toAbsoluteURI()); javaScriptSupport.addInitializerCall(alertCount, specs); This ends with URLs like: http://localhost:8080/instihire/index.layout:updatealertcount http://localhost:8080/instihire/jacket/list.layout:updatealertcount Which work just fine. My page with the ActivationContext generates this URL http://localhost:8080/instihire/jacket/view.layout:updatealertcount?t:ac=98298 This call fails very quietly. I don't see anything in the Jetty console, and I only noticed it because I added a global ajax error handler that logs any exceptions to the console. event: [object Object] GlobalErrorHandler.js:12http://localhost:8080/instihire/assets/6.0.0.1376577187577/ctx/js/GlobalErrorHandler.js jqxhr: {readyState:0,responseText:,status:0,statusText:error} GlobalErrorHandler.js:13http://localhost:8080/instihire/assets/6.0.0.1376577187577/ctx/js/GlobalErrorHandler.js settings: {url:http://localhost:8080/instihire/jacket/view.layout:updatealertcount?t:ac=98298,isLocal:false,global:true,type:GET,contentType:application/x-www-form-urlencoded; charset=UTF-8,processData:true,async:true,accepts:{xml:application/xml, text/xml,html:text/html,text:text/plain,json:application/json, text/javascript,*:*/*,script:text/javascript, application/javascript, application/ecmascript, application/x-ecmascript},contents:{xml:{},html:{},json:{},script:{}},responseFields:{xml:responseXML,text:responseText},converters:{text html:true},flatOptions:{context:true,url:true},jsonp:callback,dataTypes:[text],crossDomain:false,hasContent:false} GlobalErrorHandler.js:14http://localhost:8080/instihire/assets/6.0.0.1376577187577/ctx/js/GlobalErrorHandler.js exception: I'm going to try to remove the ActivationContext and see if that fixes these problems. I really don't know what else to do at this point. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Re: ActivationContext messing up more AJAX calls
On Aug 15, 2013, at 12:51 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Your Java code looks ok. Could you please post your JavaScript code that is invoked by the addInitializerCall() call? It may be choking on the query string. Sorry I forgot it. (function ($) { T5.extendInitializers(function () { function init(specs) { $(document).everyTime(specs.timeout, function () { $.get(specs.url) .done(function (data) { $('#alertCount').html(data.alertCount); }); }); } return { alertCount: init } }); })(jQuery); Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: ActivationContext messing up more AJAX calls
On Aug 15, 2013, at 12:51 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Your Java code looks ok. Could you please post your JavaScript code that is invoked by the addInitializerCall() call? It may be choking on the query string. I don't want to waste anyones time. Removing @PageActivationContext and creating on onActivate seems to have solved everything. The urls generated by ComponentResources no longer contain the Id of the main page object. Probably because I didn't' create an onPassivate, but I'll cross that bridge if/when I need to. Thanks Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Quick ActivationContext question
On Aug 13, 2013, at 6:52 PM, Thiago H de Paula Figueiredo thiag...@gmail.commailto:thiag...@gmail.com wrote: On Tue, 13 Aug 2013 18:32:46 -0300, Tony Nelson tnel...@starpoint.commailto:tnel...@starpoint.com wrote: I have a simple page that has an ActivationContext. I'd like to handle a simple ajax call with one parameter. When I use componentResource.createEventLink(foo), the URL contains the ActivationContext, like this: /ih/view:foo?t:ac=77 I don't need the ActivationContext for this call, and I want to post the ajax call, so this URL won't work. Please define this URL won't work. If you created it through ComponentResources.createEventLink(), it will work. The activation context of an event is separate from the activation context of the page surrounding it. The method that I expect to be called is: public void onDeleteContactLog(ContactLog contactLog) { logger.info(contactLog.getContactLogId().toString()); if (isShowEdit()) { jacketLogic.deleteContactLog(contactLog); } } I setup my JS the normal way: @Import(library = { ViewJacket.js, context:/js/tiny_mce/tiny_mce.js }) public void afterRender() { JSONObject specs = new JSONObject( jacketId, jacket.getJacketId().toString(), jacketName, jacket.getFullName(), deleteContactLog, /instihire/jacket/view:deletecontactlog/ // componentResources.createEventLink(deleteContactLog, new Object[] {}).toURI() ); javaScriptSupport.addInitializerCall(viewJacket, specs); } Pasted there is the working, hard coded URL for the event The Javascript is simple click handler: $(.deleteContactLog).click(function (event) { event.stopPropagation(); var url = _specs.deleteContactLog + $(this).data('id'); var self = this; $.post(url, function (data) { $(self).closest(tr).hide(); }) .fail(function (data) { window.alert('Deleting the contact log failed.'); }); }) If I change the URL to the one created by component resources (/instihire/jacket/view:deletecontactlog?t:ac=98298828372) I get the following error: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Request event 'deletecontactlog' (on component jacket/View) was not handled; you must provide a matching event handler method in the component or in one of its containers. org.apache.tapestry5.ioc.internal.util.TapestryException: Request event 'deletecontactlog' (on component jacket/View) was not handled; you must provide a matching event handler method in the component or in one of its containers. at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:114) at org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56) Thanks for your help. Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Quick ActivationContext question
-Original Message- From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Wednesday, August 14, 2013 9:47 AM To: Tapestry users Subject: Re: Quick ActivationContext question On Wed, 14 Aug 2013 10:06:21 -0300, Tony Nelson tnel...@starpoint.com wrote: componentResources.createEventLink(deleteContactLog, new Object[] {}).toURI() Your mistake here is to think that the event context will come from the POST'ed data. It doesn't. It comes from the path in the URL. You're passing an empty context to the createEventLink() method, so the URL it generates doesn't have any, so your onDeleteContactLog(ContactLog contactLog) (which has a parameter) won't be called. That's Tapestry behaving exactly as expected. When you're dealing with dynamic data being posted from JavaScript, use an event handler without parameters and use query parameters to pass the data: void onDeleteContactLog() { String id = request.getParameter(id); ... } Of course, on the JavaScript side, you need to make the AJAX request containing a query parameter named id with the right value. But if I hand craft the URL, /instihire/view/jacket:deletecontactlog/someidhere And post that, it works just fine. My fear is that it won't upgrade, but I'm pretty sure most of my stuff won't upgrade when 5.4 comes out anyways. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Quick ActivationContext question
-Original Message- From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Wednesday, August 14, 2013 10:15 AM To: Tapestry users Subject: Re: Quick ActivationContext question On Wed, 14 Aug 2013 10:50:32 -0300, Tony Nelson tnel...@starpoint.com wrote: But if I hand craft the URL, /instihire/view/jacket:deletecontactlog/someidhere And post that, it works just fine. It does because you manually put the activation context in the URL, not because you put the id in the POST part of the request. With that URL, you could post nothing and it would work the exact same way. My fear is that it won't upgrade, but I'm pretty sure most of my stuff won't upgrade when 5.4 comes out anyways. What do you think will break when you upgrade? It the handcrafted URL will very probably work after the upgrade, as nothing is being changed about URL handling. But, as you said, handcrafting URLs is not a good idea, and I agree with that. Why don't you try what I suggested in my previous e-mail? ;) Because I want to use Tapestry's built in Hibernate ValueEncoders. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Quick ActivationContext question
Try now, I made your user account, olwi Tony -Original Message- From: Tony Nelson [mailto:tnel...@starpoint.com] Sent: Wednesday, August 14, 2013 10:33 AM To: Tapestry users Subject: RE: Quick ActivationContext question -Original Message- From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Wednesday, August 14, 2013 10:15 AM To: Tapestry users Subject: Re: Quick ActivationContext question On Wed, 14 Aug 2013 10:50:32 -0300, Tony Nelson tnel...@starpoint.com wrote: But if I hand craft the URL, /instihire/view/jacket:deletecontactlog/someidhere And post that, it works just fine. It does because you manually put the activation context in the URL, not because you put the id in the POST part of the request. With that URL, you could post nothing and it would work the exact same way. My fear is that it won't upgrade, but I'm pretty sure most of my stuff won't upgrade when 5.4 comes out anyways. What do you think will break when you upgrade? It the handcrafted URL will very probably work after the upgrade, as nothing is being changed about URL handling. But, as you said, handcrafting URLs is not a good idea, and I agree with that. Why don't you try what I suggested in my previous e-mail? ;) Because I want to use Tapestry's built in Hibernate ValueEncoders. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. B KK KKCB [ X ܚX KK[XZ[ \ \ ][ X ܚX P\\ K \X K ܙ B ܈Y][ۘ[ [X[ K[XZ[ \ \ Z[\\ K \X K ܙ B Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Quick ActivationContext question
From: Nathan Quirynen [mailto:nat...@pensionarchitects.be] Sent: Wednesday, August 14, 2013 10:41 AM To: users@tapestry.apache.org Subject: Re: Quick ActivationContext question And what is the reason that you can't add the context when creating the event link as mentioned before: componentResources.createEventLink(deleteContactLog, contactLogId) Because I have a table of between 0 and N contactlogs, all that changes is the ID that I pass in, so I add that just before the ajax call. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Quick ActivationContext question
I have a simple page that has an ActivationContext. I'd like to handle a simple ajax call with one parameter. When I use componentResource.createEventLink(foo), the URL contains the ActivationContext, like this: /ih/view:foo?t:ac=77 I don't need the ActivationContext for this call, and I want to post the ajax call, so this URL won't work. I know that I can hard code the URL as: /ih/view:foo Then add my parameter /ih/view:foo/someval And handle it just fine... void onFoo(String param) { ... } But hard coding the URL doesn't feel like the tapestry way.. is there a better way? Thanks in advance Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: Bootstrap 3 and tapestry 5.4
Is there any way to make all of that completely optional? I already have too much code the requires bootstrap 2, you are going to make it impossible for me to upgrade to 5.4, if you haven't already. -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Monday, July 29, 2013 12:51 PM To: Tapestry users Subject: Re: Bootstrap 3 and tapestry 5.4 My plan is to upgrade to Bootstrap 3, and bundle Glyphicons and Font- Awesome as well. My hope is that Bootstrap 3.x and 4+ will stay compatible w.r.t. class names and structure. There's going to be some work; for instance, the ControlGroup mixin is now poorly named; and we'll need to modify a lot of components (TextField, TextArea, Select, etc.) to add the form-control class. In addition, Bootstrap 3 makes all form controls 100% wide by default, which makes things tricky if we want to easily support both vertical and horizontal layouts. On Mon, Jul 29, 2013 at 1:49 AM, Peter Hvass p.hv...@albourne.com wrote: Hear hear - I've already overridden bundled bootstrap with our own less version (we remove some of the dependencies by default and include them individually (alongside js) with components in order to be more modular). Would be good to see tap 5.4 components updated to reflect any breaking changes between 2.3 and 3. Thanks for all the work on 5.4 so far! It's fantastic. Peter - Original Message - From: Barry Books trs...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Saturday, July 27, 2013 3:49:12 PM Subject: Re: Bootstrap 3 and tapestry 5.4 I would agree with that. I suspect Bootstrap 3 will be done before Tapestry 5.5 and the markup between Bootstrap 2 and 3 changes. On Sat, Jul 27, 2013 at 3:15 AM, Dimitris Zenios dimitris.zen...@gmail.comwrote: Hi everyone Bootstrap 3 RC1 is released and get bootstrap page redirect to download the new version instead of the old (2.3.2) As a suggestion maybe it will be better to upgrade the bundled bootstrap inside tapestry 5.4 to version 3 before a final release Regards Dimitris Zenios -- 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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Bootstrap 3 and tapestry 5.4
I don't think that Tapestry should ship with any css or javascript personally. At least not the base package. If they want to make a contrib package that adds something that's fine by me, but why, as a Tapestry user, am I still forced to swallow their decisions on what libraries I'm supposed to use. That's the whole point of the 5.3/5.4 rewrite. Letting users choose javascript stacks. You can't choose your own js stack if you can't even choose your own css stack. -Original Message- From: Jon Williams [mailto:williams.jonat...@gmail.com] Sent: Monday, July 29, 2013 2:06 PM To: Tapestry users Subject: Re: Bootstrap 3 and tapestry 5.4 That sounds good Mr 'Ship. It's not Mr. 'Ship's fault that twitter chose to change up things in bootstrap 3. It would be a lot of work i would think just to maintain backwards compatibility to now outdated v2 api. Of course obviously v2 is missing features of 3. Also Mr. 'Ship says he's adding even more v3 bonus features. So we need these features right? I for one want new styling features. Don't get upset about losing your v2 work, it's just refactoring. :-) On Mon, Jul 29, 2013 at 11:20 AM, Tony Nelson tnel...@starpoint.com wrote: Is there any way to make all of that completely optional? I already have too much code the requires bootstrap 2, you are going to make it impossible for me to upgrade to 5.4, if you haven't already. -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Monday, July 29, 2013 12:51 PM To: Tapestry users Subject: Re: Bootstrap 3 and tapestry 5.4 My plan is to upgrade to Bootstrap 3, and bundle Glyphicons and Font- Awesome as well. My hope is that Bootstrap 3.x and 4+ will stay compatible w.r.t. class names and structure. There's going to be some work; for instance, the ControlGroup mixin is now poorly named; and we'll need to modify a lot of components (TextField, TextArea, Select, etc.) to add the form-control class. In addition, Bootstrap 3 makes all form controls 100% wide by default, which makes things tricky if we want to easily support both vertical and horizontal layouts. On Mon, Jul 29, 2013 at 1:49 AM, Peter Hvass p.hv...@albourne.com wrote: Hear hear - I've already overridden bundled bootstrap with our own less version (we remove some of the dependencies by default and include them individually (alongside js) with components in order to be more modular). Would be good to see tap 5.4 components updated to reflect any breaking changes between 2.3 and 3. Thanks for all the work on 5.4 so far! It's fantastic. Peter - Original Message - From: Barry Books trs...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Saturday, July 27, 2013 3:49:12 PM Subject: Re: Bootstrap 3 and tapestry 5.4 I would agree with that. I suspect Bootstrap 3 will be done before Tapestry 5.5 and the markup between Bootstrap 2 and 3 changes. On Sat, Jul 27, 2013 at 3:15 AM, Dimitris Zenios dimitris.zen...@gmail.comwrote: Hi everyone Bootstrap 3 RC1 is released and get bootstrap page redirect to download the new version instead of the old (2.3.2) As a suggestion maybe it will be better to upgrade the bundled bootstrap inside tapestry 5.4 to version 3 before a final release Regards Dimitris Zenios -- 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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Bootstrap 3 and tapestry 5.4
-Original Message- That's the whole point of the 5.3/5.4 rewrite. Letting users choose javascript stacks. You can't choose your own js stack if you can't even choose your own css stack. Tapestry can deal with that by having a symbol defining whether you use Bootstrap 2 or 3+, then using it in the components to know how to deal with Bootstrap. What about those of us using a customized version of bootstrap? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Help with bug report
I ran into a problem with JSONArray today that I think deserves a bug report, but I'm not exactly sure what the correct/expected behavior should be, so I'm not sure how to file the bug. This test case demonstrates the issue: def test add null to array() { setup: String n = null JSONArray obj = new JSONArray() obj.put(n) when: String result = obj.toString() then: [] == result } I think I might expect the actual result to be [ null ], but you don't get that either, what you do get is a NULL pointer exception. java.lang.NullPointerException at org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:887) at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436) at org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:47) at com.starpoint.business.BusLogic1Test.test print empty array(BusLogic1Test.groovy:35) Looking at the code, it would appear that you don't want null to be a valid value (though I would argue it's perfectly fine), public JSONArray put(Object value) { assert value != null; JSONObject.testValidity(value); list.add(value); return this; } I don't run with assertions enabled (who does??), but apparently JSONObject.testValidity passes just fine. You don't run into a problem until you actually try to print the array (or return it as an ajax response). What is the correct behavior? Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with bug report
I guess the question still remains. Should I file a bug report? For what? I guess I'm leaning towards JSONArray.put(null) should throw an exception, that way you know exactly when you're screwing up. Thoughts? On Apr 16, 2013, at 1:49 PM, Howard Lewis Ship hls...@gmail.com wrote: I'd need to review the code to determine the why of JSONObject.NULL. I'm at a client today (doing Clojure and AngularJS!) so I can't really divert. On Tue, Apr 16, 2013 at 6:36 PM, Tony Nelson tnel...@starpoint.com wrote: So wouldn't it be DRY to convert null to JSONObject.NULL in put()? Sorry so terse on iPhone @lunch. On Apr 16, 2013, at 1:28 PM, Howard Lewis Ship hls...@gmail.com wrote: Obviously it would blow up if you ran with -ea The docs specify the acceptable values for put(). You don't use a null, you use JSONObject.NULL. I can't remember why it is done this way; it may have simply been done that way in the original JSON.org source that the Tapestry code is evolved from. Glad to see you are using Spock! On Tue, Apr 16, 2013 at 5:37 PM, Tony Nelson tnel...@starpoint.com wrote: I ran into a problem with JSONArray today that I think deserves a bug report, but I'm not exactly sure what the correct/expected behavior should be, so I'm not sure how to file the bug. This test case demonstrates the issue: def test add null to array() { setup: String n = null JSONArray obj = new JSONArray() obj.put(n) when: String result = obj.toString() then: [] == result } I think I might expect the actual result to be [ null ], but you don't get that either, what you do get is a NULL pointer exception. java.lang.NullPointerException at org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:887) at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436) at org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:47) at com.starpoint.business.BusLogic1Test.test print empty array(BusLogic1Test.groovy:35) Looking at the code, it would appear that you don't want null to be a valid value (though I would argue it's perfectly fine), public JSONArray put(Object value) { assert value != null; JSONObject.testValidity(value); list.add(value); return this; } I don't run with assertions enabled (who does??), but apparently JSONObject.testValidity passes just fine. You don't run into a problem until you actually try to print the array (or return it as an ajax response). What is the correct behavior? Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - 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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed
RE: Case sensitivity
My brother swears by Vagrant (http://www.vagrantup.com/) for this type of thing. He creates vms that are “identical” to production. From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Wednesday, April 03, 2013 7:52 AM To: Tapestry users Subject: Re: Case sensitivity On Wed, 03 Apr 2013 05:26:18 -0300, Nathan Quirynen nat...@pensionarchitects.bemailto:nat...@pensionarchitects.be wrote: Not sure if this question belongs here, but: It does. :) Is there a way to force case sensitivity in Tapestry, No. And I wouldn't expect for it to happen. because sometimes when deploying on a Linux server I get errors caused by case sensitivity, which I don't detect on my development machine. So it would be nice to have a way to force this in some way if possible. Or develop in Linux. :) -- Thiago H. de Paula Figueiredo Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
Ajax Parameter Handling
Given a simple contrived example like this: $('#button1').click(function (event) { $.get(specs.button1_url, { a: 'b', c: 'd'}) .done(function(data) { $(#responseDiv).text(data.response); }) }) I know I can handle that in my controller in at least these two ways: JSONObject onButton1Press() { logger.info(a: + request.getParameter(a) + c: + request.getParameter(c)); logger.info(request.getParameterNames().toString()); return new JSONObject(response, ok1); } JSONObject onButton1Press(@RequestParameter(a) String a, @RequestParameter(c) String c) { logger.info(a: + a + c: + c); return new JSONObject(response, ok2); } Ideally, I'd like to handle it like this: JSONObject onButton1Press(SimplePojo pojo) { logger.info(pojo.toString()); return new JSONObject(response, ok3); } I thought maybe I could contribute a ValueEncoder but that only sees individual parameters, not the whole request. Even this might work: JSONObject onButton1Press(JSONObject jsonObject) { SimplePojo pojo = SimplePojo.build(jsonObject); logger.info(pojo.toString()); return new JSONObject(response, ok4); } But I Tapestry doesn't seem to know how to handle that. I even tried changed the ajax params to: {params: { a: 'b', c: 'd'} } I supposed I could build the SimplePojo from the Request, but that just doesn't feel as clean to me. Any suggestions would be appreciated. Thanks Tony Nelson Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax Parameter Handling
I thought maybe I could contribute a ValueEncoder but that only sees individual parameters, not the whole request. Even this might work: JSONObject onButton1Press(JSONObject jsonObject) { SimplePojo pojo = SimplePojo.build(jsonObject); logger.info(pojo.toString()); return new JSONObject(response, ok4); } Why don't you use a query parameter to pass a String containing a JSON-encoded object and then use the JSONObject(String string) to parse it? This worked like a charm! $('#button1').click(function (event) { $.get(specs.button1_url, {params: JSON.stringify({ a: 'b', c: 'd'}) }) .done(function(data) { $(#responseDiv).text(data.response); }) }) JSONObject onButton1Press(@RequestParameter(params) String jsonString) { SimplePojo pojo = SimplePojo.build(new JSONObject(jsonString)); logger.info(pojo.toString()); return new JSONObject(response, ok5); } Thank you very much Theo! If you see any further enhancements you might make to that, I'd be very interested in hearing them. Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Component Problem
I built a page with some pieces that I want to extract to a component. The pieces are parts of a form. I'm not sure I'm taking the proper approach. My current idea is to use delegates and blocks. My component template is: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; xmlns:p=tapestry:parameter t:block t:id=clientBlock t:hidden t:id=clientId value=client / t:textfield t:id=clientName value=clientName / t:checkbox type=checkbox t:id=includeInactiveClients value=includeInactiveClients / /t:block t:block t:id=divisionBlock t:hidden t:id=divisionId value=division / t:textfield t:id=divisionName value=divisionName / t:checkbox type=checkbox t:id=includeInactiveDivisions value=includeInactiveDivisions / /t:block /t:container Then in the actual page, I want to use it like this: div class=control-group label class=control-label Client: /label div class=controls t:delegate to=block:clientBlock / /div /div And a similar block to divisionBlock. Right now I'm getting a null pointer exception from Hidden.java when I try to get it's client id. Specifically: @Import(library = { ClientDivisionAutoComplete.js }) public void afterRender() { JSONObject specs = new JSONObject( clientId, # + clientIdField.getClientId(), clientName, # + clientNameField.getClientId(), includeInactiveClients, # + includeInactiveClientsField.getClientId(), clientNameAutoCompleteUrl, componentResources.createEventLink(clientNameAutoComplete).toURI(), divisionId, # + divisionId.getClientId(), divisionName, # + divisionNameField.getClientId(), includeInactiveDivisions, # + includeInactiveDivisionsField.getClientId(), divisionNameAutoCompleteUrl, componentResources.createEventLink(divisionNameAutoComplete).toURI() ); javaScriptSupport.addInitializerCall(clientDivisionAutoComplete, specs); } The exception I'm getting is: Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Hidden.getClientId(Hidden.java:152) at com.starpoint.instihire.web.components.ClientDivisionAutoComplete.advised$afterRender_12ecdf1ecc23b3d1(ClientDivisionAutoComplete.java:128) at com.starpoint.instihire.web.components.ClientDivisionAutoComplete$Invocation_afterRender_12ecdf1ecc23b3d0.proceedToAdvisedMethod(Unknown Source) Is my approach wrong? This all works when I put it together in a single page, but I'm not having much luck extracting it to a component. Thanks for your help in advance Tony Nelson Starpoint Solutions Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Component Problem
The real problem I'm having is an encapsulation problem. My component needs to have several html elements that work together, but where they exist on the page is driven by the page template, not the component template. So in my component template I define 2 blocks t:block t:id=blocka.../t:block t:block t:id=blockb../t:block Then in the page template I'm trying to: t:mycomponent / t:delegate to=block:blocka / If I try reversing the lines, putting the delegate before my component, I get Template .. does not contain a block with identifier blocka . When I put my component first (as above), I *think* what's happening, is that afterRender() is trying to access the clientId of a hidden component before the block has actually been rendered. It won't get rendered until the actual page is fully evaluated. Does that make sense? As a test I renamed afterRender() in the component so it would not execute. The next error I get is Template for component report/FullTimeHire does not contain a block with the identifier 'clientBlock' I guess the simple question is, does it even make sense to define a block a in a component and reference in the page template? Has anyone done that? Has anyone seen an example of it? Thanks Tony -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Tuesday, March 19, 2013 4:48 PM To: Tapestry users Subject: Re: Component Problem Taking a peek: public String getClientId() { if (clientId == null) { clientId = jsSupport.allocateClientId(resources); hiddenInputElement.forceAttributes(id, clientId); // Hidden.java, line 152 } return clientId; } An NPE there makes it look like the Hidden element has not yet rendered. It would be interesting to capture the MarkupWriter and see what markup has been written at the point your afterRender() method is invoked. Possibly, you are returned the wrong Block from clientBlock, so the Hidden component is never rendered. On Tue, Mar 19, 2013 at 9:40 AM, Tony Nelson tnel...@starpoint.com wrote: I built a page with some pieces that I want to extract to a component. The pieces are parts of a form. I'm not sure I'm taking the proper approach. My current idea is to use delegates and blocks. My component template is: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; xmlns:p=tapestry:parameter t:block t:id=clientBlock t:hidden t:id=clientId value=client / t:textfield t:id=clientName value=clientName / t:checkbox type=checkbox t:id=includeInactiveClients value=includeInactiveClients / /t:block t:block t:id=divisionBlock t:hidden t:id=divisionId value=division / t:textfield t:id=divisionName value=divisionName / t:checkbox type=checkbox t:id=includeInactiveDivisions value=includeInactiveDivisions / /t:block /t:container Then in the actual page, I want to use it like this: div class=control-group label class=control-label Client: /label div class=controls t:delegate to=block:clientBlock / /div /div And a similar block to divisionBlock. Right now I'm getting a null pointer exception from Hidden.java when I try to get it's client id. Specifically: @Import(library = { ClientDivisionAutoComplete.js }) public void afterRender() { JSONObject specs = new JSONObject( clientId, # + clientIdField.getClientId(), clientName, # + clientNameField.getClientId(), includeInactiveClients, # + includeInactiveClientsField.getClientId(), clientNameAutoCompleteUrl, componentResources.createEventLink(clientNameAutoComplete).toURI() , divisionId, # + divisionId.getClientId(), divisionName, # + divisionNameField.getClientId(), includeInactiveDivisions, # + includeInactiveDivisionsField.getClientId(), divisionNameAutoCompleteUrl, componentResources.createEventLink(divisionNameAutoComplete).toURI () ); javaScriptSupport.addInitializerCall(clientDivisionAutoComplete, specs); } The exception I'm getting is: Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Hidden.getClientId(Hidden.java:1 52) at com.starpoint.instihire.web.components.ClientDivisionAutoComplete.advise d$afterRender_12ecdf1ecc23b3d1(ClientDivisionAutoComplete.java:128) at com.starpoint.instihire.web.components.ClientDivisionAutoComplete$Invo cation_afterRender_12ecdf1ecc23b3d0.proceedToAdvisedMethod(Unknow n Source) Is my approach wrong? This all works when I put
RE: tapestry5.3 and Twitter-bootstrap disabled inputs
-Original Message- From: Ivan Khalopik [mailto:ikhalo...@gmail.com] Sent: Tuesday, March 05, 2013 3:34 AM To: Tapestry users Subject: Re: tapestry5.3 and Twitter-bootstrap disabled inputs You can use span element with .uneditable-input if you have some field that should not be modified at all. span class=input-xlarge uneditable-inputSome value here/span If you need some client-side behaviour of enable/disable component use disabled attribute as mentioned earlier. input type=text placeholder=${name} disabled=disabled/ Or: t:textfield value=someValue placeholder=prop:name disabled=true/ According to this http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#boolean-attribute disabled=true is actually invalid markup. Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
RE: html5 - input (and other void elements)
On Tue, 26 Feb 2013 09:19:53 -0300, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: The closing or not is defined by the MarkupModel (interface), probably by subclassing AbstractMarkupModel, specifically its getEndTagStyle(String element) method. You'll also need to override or decorate the MarkupWriterFactory service with an implementation that uses your MarkupModel. That's a solution while Tapestry doesn't implement it itself. I guess I wasn't clear: I do think Tapestry should implement this and there's a JIRA for that. I just outlined a solution people can use until Tapestry releases a version with this implemented. I should have said 'until', not 'while'. Thanks again! -Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it.
html5 - input (and other void elements)
I am generating html5 with Tapestry 5.3.6. Today I ran a simple form through a w3 validator. The validator complained that my input tag had a stray end tag. input class=username id=username name=username type=text/input You can see the entire page here: http://goo.gl/GnVlr After reading more about html5 than I had intended, I discovered that there are several void elements that are not supposed to be closed. http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements Is there any way to suppress the closing /input tag when creating html5 documents? Thanks Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry Session Service
I don't really want you to go all Gung Ho :). Remember I've been with you since Tapestry 3. I know how you go Gung Ho. I've just already allotted plenty of time in our schedule for the 5.3 to 5.4 upgrade under the guise of Introducing SASS/Coffee. We are heavily invested in tapestry-jquery especially the DataTables integration so any changes there are going to affect my project. As to Theo's comments about the difference between front end or back end changes, it really is immaterial what I'm editing. Java, HTML, JavaScript, heck even groovy. It's still all code that has to be changed. I was just trying to suggest that if you are going to break something, from 5.3 to 5.4 isn't a bad time to consider it. Have a great weekend guys and sorry if I inadvertently poked an old scab. -Tony On Jan 25, 2013, at 8:00 PM, Howard Lewis Ship hls...@gmail.com wrote: I think Tony wants us to go Gung Ho on the code base. Oh, so tempting, but I think we'll stay the course instead. I'm sure I could build a better IoC and framework than Tapestry 5 now, it's T5+5 years, but that wouldn't prove anything. On Fri, Jan 25, 2013 at 2:16 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Fri, 25 Jan 2013 19:45:31 -0200, Tony Nelson tnel...@starpoint.com wrote: Aren't all the javascript changes in 5.4 going to break compatibility anyways? What server-side backward compatibility has to do with client-side one? Specially in this case, in which someone expected something to be a service because it was in a package named services? The less we break backward compatibility, the better. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Tapestry Session Service
Aren't all the javascript changes in 5.4 going to break compatibility anyways? -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Friday, January 25, 2013 1:13 PM To: Tapestry users Subject: Re: Tapestry Session Service On Fri, Jan 25, 2013 at 3:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 24 Jan 2013 14:03:52 -0200, Matías Blasi matias.bl...@gmail.com wrote: Hi all! Hi! I'm a little stuck with trying to inject the Tapestry Session Service (org.apache.tapestry.services.**Session) Session is not a service nor something that can injected right now. @Inject Request and use its getSession(boolean create) method. If we cannot @Inject the Session, should it be in the .services interfaces package? Not every service is injectable. Not everything that is injectable is a service. I would love to reorganize the Tapestry package structure, but doing so would break backwards compatibility in a large way. Instead, we've taken to using lots of documentation annotations to be more precise about how interfaces are meant to be used. -- Thiago H. de Paula Figueiredo --**--**-- --- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apa che.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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Jquery Datatable ajax'd sort reverses
The problem is fixed in the snapshot I have. -Original Message- From: Emmanuel DEMEY [mailto:demey.emman...@gmail.com] Sent: Thursday, January 24, 2013 3:22 AM To: Tapestry users Subject: Re: Jquery Datatable ajax'd sort reverses Hi, I think I have already pushed the patch on the last SNAPSHOT (3.3.6-SNAPSHOT). Manu 2013/1/23 mwrohde mro...@navicure.com Excellent. Thank you. Do you happen to know a timeline? Or, a workaround? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Datatable-ajax-d-sort-rev erses-tp5719457p5719459.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 -- Emmanuel DEMEY Ingénieur Etude et Développement ATOS Worldline +33 (0)6 47 47 42 02 demey.emman...@gmail.com http://emmanueldemey.fr/ Twitter : @EmmanuelDemey Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Jquery Datatable ajax'd sort reverses
That should be fixed in an upcoming release to tapestry-jquery. I worked with Demey from their team to get that resolved, he just needs to check in and push the fix. -Original Message- From: mwrohde [mailto:mro...@navicure.com] Sent: Wednesday, January 23, 2013 12:32 PM To: users@tapestry.apache.org Subject: Jquery Datatable ajax'd sort reverses I've been struggling with the jquery datatable. I've been on this thread with some server side pagination and sorting: http://tapestry.1045711.n5.nabble.com/ANN-JumpStart-gets-jQuery-DataTables-example-td5715816.html http://tapestry.1045711.n5.nabble.com/ANN-JumpStart-gets-jQuery-DataTables-example-td5715816.html I've got that working-ish. My code correctly interprets what tapesty and the jquery tapestry code tells me is the sort column and order. However, what tapestry is telling me and what jquery is sending don't match. If I render my page then select a column heading to sort by, jquery recognizes it, tapesty tells me, and all is good. If I then click Next or another page number, tapestry reverses the sort. If I click next again, tapestry again reverses the sort, back to the original. However, if click a column heading to sort by, wait for that page to (correctly) render, then refresh my browser page, I can then click forward and backward to my heart's content and the sort order remains constant and correct. Here, I think, is the relevent got5 code, with some comments of mine inline. DefaultDataTable public void prepareResponse(GridDataSource source){ String sortingCols = request.getParameter(DataTableConstants.SORTING_COLS); if(InternalUtils.isNonBlank(sortingCols)){ int nbSortingCols = Integer.parseInt(sortingCols); String sord = request.getParameter(DataTableConstants.SORT_DIR+0); String sidx = request.getParameter(DataTableConstants.SORT_COL+0); /// nbSortingCols is, in fact, greater than zero. jquery sent iSortingCols1. I assume this means we are sorting on one, and only one, column/ if(nbSortingCols0) { ListString names = model.getPropertyNames(); int indexProperty = Integer.parseInt(sidx); String propName = names.get(indexProperty); ColumnSort colSort =sortModel.getColumnSort(propName); sortModel.updateSort(propName); /// -- This guy reverses the sort./ } } } AbstractTable public void updateSort(String columnId) { assert InternalUtils.isNonBlank(columnId); if (columnId.equals(sortColumnId)) { /// If we're sorting on this column, reverse the sort/ setSortAscending(!getSortAscending()); return; } sortColumnId = columnId; setSortAscending(true); } I understand that this code is reversing the sort if jquery sends iSortingCols with a value of greater than zero. However, the jquery documentation indicates that it *is* going to send that if we're sorting on something: /The following information is sent to the server for each draw request. Your server-side script must use this information to obtain the data required for the draw. and it includes iSortingCols in that list./ Relevent jquery page http://datatables.net/usage/server-side I do not understand why refreshing the browser page stops this behavior. More importantly, I don't know what I should to get it to behave correctly without the browser refresh. Thank you in advance for your help. Matt -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Datatable-ajax-d-sort-reverses-tp5719457.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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by
RE: @CommitAfter not committing my transaction
You should also Inject the session. @Inject private Session session; Is this method in a controller, or do you have a DAO layer? -Original Message- From: Pillar [mailto:sotodel...@hotmail.com] Sent: Wednesday, November 28, 2012 2:59 PM To: users@tapestry.apache.org Subject: @CommitAfter not committing my transaction Unless I'm understanding it wrong, the @CommitAfter on my method isn't committing the transaction. @CommitAfter public void call() { Session s = HibernateUtils.getSessionFactory().openSession(); s.beginTransaction(); User u = new User(); u.setUsername(Pillar); u.setEmail(yahoo...@yahoo.ca); u.setPassword(poof); s.save(u); } Once execution exits this method and my page is rendered, I check my database and there is no entry for the above user. I'm on Tapestry 5.3 and have all the dependencies for tapestry-hibernate. What am I doing wrong? -- View this message in context: http://tapestry.1045711.n5.nabble.com/CommitAfter-not-committing-my-transaction-tp5718364.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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: How to execute a method automatically after deployment?
In your AppModule contribute a method annotated with @Startup. http://blog.tapestry5.de/index.php/2010/06/16/registry-startup/ -Original Message- From: membersound [mailto:memberso...@web.de] Sent: Wednesday, November 28, 2012 4:14 PM To: users@tapestry.apache.org Subject: How to execute a method automatically after deployment? Hi, how can I execute a method automatically after the whole application is loaded an up running? I don't mean static blocks to initialize something. I mean just executing a method as it would be called after application deployed. With all injected services working and so on. Can Tapestry do this? Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-execute-a-method-automatically-after-deployment-tp5718368.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 Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Symbol field injection doesn't work when the symbol is used in the service class constructor
I think you need to use constructor injection for that.. http://tapestry.apache.org/symbols.html public MySeviceImpl(@Value(mySymbol) boolean mySymbolValue) { ... } I don't believe it's possible to set a property on an object before the constructor is called. Tony -Original Message- From: dragan.sahpas...@gmail.com [mailto:dragan.sahpas...@gmail.com] On Behalf Of Dragan Sahpaski Sent: Wednesday, November 14, 2012 12:14 PM To: Tapestry users Subject: Symbol field injection doesn't work when the symbol is used in the service class constructor Hi, This currently doesn't work and I can't find it documented anywhere. It doesn't fail or anything it's just that the value isn't set yet in the constructor. @Inject @Symbol(mySymbol); private boolean mySymboValue; public MyServiceImpl(){ System.out.println(mySymbolValue); // prints false } public void someMethod(){ System.out.println(mySymbolValue); // prints true } Constructor injection for the symbol on the other hand works as expected. Is this expected behavior and if yes should it be changed? Thanks Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Using Spock Mocks with PageTester
Does anyone have an example of using Spock Mocks with PageTester? I'd like to substitute Mocks for @Injected resources and I can't seem to find a way to make it happen. Has anyone figured out a good way to do this? Thanks in advance -Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Using Spock Mocks with PageTester
I'll take a look at that. Thank you very much for the suggestion. On Oct 22, 2012, at 11:10 AM, Alex Kotchnev akoch...@gmail.com wrote: Tony, I use Testify to accomplish what you describe ( http://tapestrytestify.sourceforge.net/junit4.html) . I used it w/ EasyMock mocks, but I assume it should be very similar to that. Cheers - Alex K On Mon, Oct 22, 2012 at 10:27 AM, Tony Nelson tnel...@starpoint.com wrote: Does anyone have an example of using Spock Mocks with PageTester? I'd like to substitute Mocks for @Injected resources and I can't seem to find a way to make it happen. Has anyone figured out a good way to do this? Thanks in advance -Tony Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Since 1982, Starpoint Solutions has been a trusted source of human capital and solutions. We are committed to our clients, employees, environment, community and social concerns. We foster an inclusive culture based on trust, respect, honesty and solid performance. Learn more about Starpoint and our social responsibility at http://www.starpoint.com/social_responsibility This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Opinions, conclusions and other information in this message that do not relate to the official business of Starpoint Solutions shall be understood as neither given nor endorsed by it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prototypejs is dead - time to bring t5-jquery in?
I would in fact argue in the opposite direction. I would suggest that you move all of the prototype code to a separate project just like tapestry5-jquery and let me pick by including the proper dependency. As it is right now, the core code base includes a bunch of prototype code that I will never use. Just my opinion. -Tony On Dec 14, 2011, at 1:36 PM, Thiago H. de Paula Figueiredo wrote: On Wed, 14 Dec 2011 16:30:15 -0200, Lenny Primak lpri...@hope.nyc.ny.us wrote: I would say it's better to favor better functionality rather than backwards compatibility in this case. Backward compatibility is a very strong priority for Tapestry 5. This doesn't mean we shouldn't have a T5 version based on jQuery, but we should continue providing Prototype. We could add a configuration symbol to switch from one to another. On Dec 14, 2011, at 1:27 PM, Howard Lewis Ship wrote: We are currently caught between the wrong technology (PrototypeJS) and the need for backwards compatibility. I'm not sure how that will play out in 5.4 but it will (finally!) be addressed. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: tapestry-hibernate 5.3 and spock
Hate to do this but I'm really stuck here. Anyone have any idea what I can try next here? On Dec 5, 2011, at 2:40 PM, Tony Nelson wrote: I'm trying to test my application with spock and have run into an issue. I have put a sample app on github at: https://github.com/hhubris/broken If you clone the app, and run mvn clean test, everything works just fine. In AppModule:24-28 I have the following commented out: /* public static void contributeHibernateEntityPackageManager(ConfigurationString configuration) { configuration.add(com.starpoint.helpdesk.domain); } */ This simply adds a configuration option to the hibernate module. Uncomment this and rerun the test. The result is: [-- snip --] Results : Tests in error: com.starpoint.domain.UserTest: Contribution com.starpoint.services.AppModule.contributeHibernateEntityPackageManager(Configuration) (at AppModule.java:25) is for service 'HibernateEntityPackageManager', which does not exist. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [-- snip --] To fix this, I added HibernateCoreModule to the list of SubModules used in the spock test. You can uncomment line 11 of UserTest and comment out line 12. The new result is: [-- snip --] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.385 sec FAILURE! Results : Tests in error: com.starpoint.domain.UserTest: Exception constructing service 'RegistryStartup': Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateCoreModule.contributeRegistryStartup(OrderedConfiguration, boolean, HibernateSessionSource): Exception constructing service 'FactoryDefaults': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.contributeFactoryDefaults(MappedConfiguration): Exception constructing service 'TypeCoercer': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.contributeTypeCoercer(Configuration, TypeCoercer, ThreadLocale, AssetSource, ComponentClassCache, DynamicTemplateParser): Error building service proxy for service 'ThreadLocale' (at org.apache.tapestry5.ioc.internal.services.ThreadLocaleImpl() (at ThreadLocaleImpl.java:24) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49)): Exception constructing service 'ServiceLifecycleSource': Error invoking service contribution method org.spockframework.tapestry.ExtensionModule.contributeServiceLifecycleSource(MappedConfiguration): Exception constructing service 'ServiceOverride': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.productionModeOverrides(MappedConfiguration, boolean): Exception constructing service 'TypeCoercer': Construction of service 'TypeCoercer' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl(Collection) (at TypeCoercerImpl.java:129) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49) for references to another service that is itself dependent on service 'TypeCoercer'. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [-- snip --] I'm not sure what to try next. I asked on the spock list and they suggested I ask here. Anyone have any success testing tapestry-hibernate apps with spock? Thanks in advance Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
tapestry-hibernate 5.3 and spock
I'm trying to test my application with spock and have run into an issue. I have put a sample app on github at: https://github.com/hhubris/broken If you clone the app, and run mvn clean test, everything works just fine. In AppModule:24-28 I have the following commented out: /* public static void contributeHibernateEntityPackageManager(ConfigurationString configuration) { configuration.add(com.starpoint.helpdesk.domain); } */ This simply adds a configuration option to the hibernate module. Uncomment this and rerun the test. The result is: [-- snip --] Results : Tests in error: com.starpoint.domain.UserTest: Contribution com.starpoint.services.AppModule.contributeHibernateEntityPackageManager(Configuration) (at AppModule.java:25) is for service 'HibernateEntityPackageManager', which does not exist. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [-- snip --] To fix this, I added HibernateCoreModule to the list of SubModules used in the spock test. You can uncomment line 11 of UserTest and comment out line 12. The new result is: [-- snip --] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.385 sec FAILURE! Results : Tests in error: com.starpoint.domain.UserTest: Exception constructing service 'RegistryStartup': Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateCoreModule.contributeRegistryStartup(OrderedConfiguration, boolean, HibernateSessionSource): Exception constructing service 'FactoryDefaults': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.contributeFactoryDefaults(MappedConfiguration): Exception constructing service 'TypeCoercer': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.contributeTypeCoercer(Configuration, TypeCoercer, ThreadLocale, AssetSource, ComponentClassCache, DynamicTemplateParser): Error building service proxy for service 'ThreadLocale' (at org.apache.tapestry5.ioc.internal.services.ThreadLocaleImpl() (at ThreadLocaleImpl.java:24) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49)): Exception constructing service 'ServiceLifecycleSource': Error invoking service contribution method org.spockframework.tapestry.ExtensionModule.contributeServiceLifecycleSource(MappedConfiguration): Exception constructing service 'ServiceOverride': Error invoking service contribution method org.apache.tapestry5.services.TapestryModule.productionModeOverrides(MappedConfiguration, boolean): Exception constructing service 'TypeCoercer': Construction of service 'TypeCoercer' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl(Collection) (at TypeCoercerImpl.java:129) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49) for references to another service that is itself dependent on service 'TypeCoercer'. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [-- snip --] I'm not sure what to try next. I asked on the spock list and they suggested I ask here. Anyone have any success testing tapestry-hibernate apps with spock? Thanks in advance Tony Nelson
Re: Prototype and jQuery question
Try adding this to your pom.xml dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-upload/artifactId version${tapestry-release-version}/version /dependency On Dec 5, 2011, at 5:26 PM, Chris Collins wrote: So when I actually include tapestry-jquery things blow up when the servlet container is initialized (I use an embedded jetty). This is with Tapestry 5.3 and using the mvn dependency described on the tapestry-jquery website. Any ideas what I did wrong? java.lang.NoClassDefFoundError: org/apache/tapestry5/upload/services/UploadedFile at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructors(Class.java:1459) at org.apache.tapestry5.ioc.internal.util.InternalUtils.findAutobuildConstructor(InternalUtils.java:623) at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createStandardConstructorBasedObjectCreatorSource(ServiceBinderImpl.java:143) at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createObjectCreatorSourceFromImplementationClass(ServiceBinderImpl.java:128) at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.flush(ServiceBinderImpl.java:95) at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.finish(ServiceBinderImpl.java:83) at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.bind(DefaultModuleDefImpl.java:539) at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.init(DefaultModuleDefImpl.java:123) at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:131) at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:159) at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:137) at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:107) at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77) at org.apache.tapestry5.internal.TapestryAppInitializer.init(TapestryAppInitializer.java:124) at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:103) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) On Dec 2, 2011, at 1:48 PM, François Facon wrote: Hi Chris, Tapestry Ensure Backwards Compatibility on server side and also on client side. As mention by Thiago, you can use both prototype an jQuery with Tapestry. in Tapestry-jquery we use jQuery plugin structure to make sure $ is safe. see https://github.com/got5/tapestry5-jquery/blob/master/src/main/resources/org/got5/tapestry5/jquery/assets/mixins/button/button.js for example with agnostic structure introduce in 5.3. When we have to use both jQuery an Prototype on our projects we set configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false); jQuery is then used only inside jQuery Plugin. François 2011/12/2 Thiago H. de Paula Figueiredo thiag...@gmail.com: On Fri, 02 Dec 2011 18:52:49 -0200, Chris Collins chris...@me.com wrote: jquery and prototype living together in perfect harmony == I am working on a project where I am looking at a number of open source javascript libraries. Some depend on jQuery and some depend on prototype. I apologize for my ignorance here but it seems the fundamental issue is one of namespace primarily around $. I know you can run jQuery in compatible mode but wouldn't this mean that any js library I used that depended on jQuery would need to be hacked up carefully to substitute all $() with jQuery(…)? In theory, all jQuery plugins should *not* use $() and use $jQuery instead: http://docs.jquery.com/Plugins/Authoring. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia
Re: Recommended Validation Method
On Nov 17, 2011, at 7:20 AM, Thiago H. de Paula Figueiredo wrote: On Thu, 17 Nov 2011 09:27:53 -0200, Josh Kamau joshnet2...@gmail.com wrote: Thanks. I will use them too. Hope they are supported even on the client side validation. They are. :) Does that mean that the validations provided by hibernate-validator should be enforced client side? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.3] Wot No Component Reference?
Is there any way to get the example usages back? For folks still feeling their way around, I found them invaluable. On Nov 2, 2011, at 10:35 PM, Steve Eynon wrote: I obviously like the Component Reference, for as Bob says, it includes all tapestry components, mixins and pages It gives more of a complete overview (and blends in better with the rest of documentation). Steve. On 3 November 2011 08:58, Bob Harner bobhar...@gmail.com wrote: For now at least, I have the Documentation page pointing to http://tapestry.apache.org/component-reference.html, because it includes all tapestry components, mixins and pages, not just the core components. Eventually the component search app I'm slowly working on (https://github.com/bobharner/Tapestry-finder/wiki) could replace that http://tapestry.apache.org/component-reference.html page I guess. On Wed, Nov 2, 2011 at 8:02 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 02 Nov 2011 21:55:31 -0200, Bob Harner bobhar...@gmail.com wrote: There are currently two candidates to directly replace the old Component Reference: 1) The Javadoc version (nice and compact): http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/package-summary.html 2) Categorized and manually maintained: http://tapestry.apache.org/component-reference.html What do you all think is the best one to link to? I suppose each serves a purpose. I'd link both, or at least make the package summary link to the caregorized one and vice-versa. -- 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 - 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.3] Wot No Component Reference?
Radio actually looks good. I didn't go thru them all, but none of the mixins have any example usage. AddRowLink, RemoveRowLink, Unless.. On Nov 3, 2011, at 10:39 AM, Emmanuel DEMEY wrote: Hi Tony Which exemples do you talk about ? We still have the one define in the xdoc file : http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Radio.html 2011/11/3 Tony Nelson tnel...@starpoint.com Is there any way to get the example usages back? For folks still feeling their way around, I found them invaluable. On Nov 2, 2011, at 10:35 PM, Steve Eynon wrote: I obviously like the Component Reference, for as Bob says, it includes all tapestry components, mixins and pages It gives more of a complete overview (and blends in better with the rest of documentation). Steve. On 3 November 2011 08:58, Bob Harner bobhar...@gmail.com wrote: For now at least, I have the Documentation page pointing to http://tapestry.apache.org/component-reference.html, because it includes all tapestry components, mixins and pages, not just the core components. Eventually the component search app I'm slowly working on (https://github.com/bobharner/Tapestry-finder/wiki) could replace that http://tapestry.apache.org/component-reference.html page I guess. On Wed, Nov 2, 2011 at 8:02 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 02 Nov 2011 21:55:31 -0200, Bob Harner bobhar...@gmail.com wrote: There are currently two candidates to directly replace the old Component Reference: 1) The Javadoc version (nice and compact): http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/package-summary.html 2) Categorized and manually maintained: http://tapestry.apache.org/component-reference.html What do you all think is the best one to link to? I suppose each serves a purpose. I'd link both, or at least make the package summary link to the caregorized one and vice-versa. -- 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 - 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 -- Emmanuel DEMEY Ingénieur Etude et Développement ATOS Worldline +33 (0)6 47 47 42 02 demey.emman...@gmail.com http://emmanueldemey.fr Twitter : @gillespie59 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 5.3-rc-2 Exception
On Nov 1, 2011, at 7:29 PM, Thiago H. de Paula Figueiredo wrote: On Tue, 01 Nov 2011 19:37:06 -0200, Tony Nelson tnel...@starpoint.com wrote: void setupRender() { try { response.sendRedirect(linkSource.createPageRenderLinkWithContext(ViewUser.class, userId)); } catch (IOException ioe) { // shrug? } } Why don't you do the redirection the Tapestry way by returning a ViewUser instance on onActivate() instead of using Response.sendRedirect()? The code below seems to work, and if it's the accepted way, that's great. I'll just file this away in my Tapestry5 toolkit. Thanks for setting me straight. Tony package com.starpoint.instihire.pages.view; import com.starpoint.instihire.pages.user.ViewUser; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.PageActivationContext; /** */ public class User { @PageActivationContext private com.starpoint.instihire.domain.user.User user; @InjectPage private ViewUser viewUser; ViewUser onActivate() { viewUser.setUser(user); return viewUser; } } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: pagecatalog and servicestatus
For what it's worth, I seem to be having the same problem. I assumed it was something in my authentication filter redirecting the browser back to my Index page, until I happened to read this ( http://tapestry.apache.org/error-page-recipe.html ) yesterday: An issue with an application that has a root Index page is that any invalid path, which would normally generate a 404 error, is instead routed to the Index page (because the invalid path looks like page's activation context). I see PageCatalog and ServiceStatus as well.. [INFO] TapestryModule.ComponentClassResolver Available pages (106): (blank): com.starpoint.instihire.pages.Index ExceptionReport: org.apache.tapestry5.corelib.pages.ExceptionReport Index: com.starpoint.instihire.pages.Index Logout: com.starpoint.instihire.pages.Logout PageCatalog: org.apache.tapestry5.corelib.pages.PageCatalog PropertyDisplayBlocks: org.apache.tapestry5.corelib.pages.PropertyDisplayBlocks PropertyEditBlocks: org.apache.tapestry5.corelib.pages.PropertyEditBlocks ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus Tony On Nov 2, 2011, at 12:52 AM, Chris Collins wrote: Just to add to this (which I am sure points to the fact I am doing something really stupid) I want to give a bit of a background and a validation (or an attempt at a validation). My process embeds jetty and adds the tapestry filter through web.xml (but I am not using a standard tomcat or jetty runner). I have a few of my own T5 pages that render fine though they are pretty basic (components and pages). just to take my code out of the equation I took recent project Barry Books posted for twitter-bootstrap earlier this week. I added to his little project's web.xml: context-param param-nametapestry.production-mode/param-name param-valuefalse/param-value /context-param Then I tried the demo and this particular path: http://localhost:8080/tapestry-bootstrap/servicestatus not much exciting happened. Thanks for your help and sorry this is probably described in large bold text on some main page under read this first :-} Best C On Nov 1, 2011, at 9:24 PM, Chris Collins wrote: PageCatalog: org.apache.tapestry5.corelib.pages.PageCatalog PropertyDisplayBlocks: org.apache.tapestry5.corelib.pages.PropertyDisplayBlocks PropertyEditBlocks: org.apache.tapestry5.corelib.pages.PropertyEditBlocks ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus package-info: org.apache.tapestry5.corelib.pages.package-info dont know if all these are supposed to be addressable in a meaningful way. package-info blows a classformaterror propertyeditblocks gives me div/div propertydisplayblocks gives me a runtimeexception because a file coudlnt be found during render time pagecatalog gives me a 404 servicestatus gives me a 404 On Nov 1, 2011, at 8:57 PM, Steve Eynon wrote: When you start up T5 it lists all the available page class files with their corresponding URLs, e.g: ComponentClassResolver - Available pages: ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus PageCatalog: org.apache.tapestry5.corelib.pages.PageCatalog Do you see the pages listed? Steve. On 2 November 2011 11:21, Chris Collins chris...@me.com wrote: I dont think that is the case. I had already verified that exception reporting was working. I programmatically set tapestry.production-mode=false in one of my AppModule's (I didnt do it via the web.xml): configuration.add(SymbolConstants.PRODUCTION_MODE, false); . I have a page I test to see if this property is set: @Inject @Symbol(SymbolConstants.PRODUCTION_MODE) @Property(write = false) private boolean productionMode; . t:if test=productionMode bProduction Mode/b p:else bNot production mode still/b /p:else /t:if it says it is in production mode or not (it says not production mode). Further I have in a test page something that forces the exception reporting: void onActionFromFail () { throw new RuntimeException(Failure inside action event handler.); } It blows a lovely exception report page (I love it). C On Nov 1, 2011, at 4:26 PM, Howard Lewis Ship wrote: The pages are invisible when not in development mode, so the most likely case is that you are not actually running in development mode. On Tue, Nov 1, 2011 at 12:29 PM, Chris Collins chris_j_coll...@yahoo.com wrote: I am a novice at T5 so apologize for what is surely a stupid question. I am trying out 5.3-rc-1. I am trying to get either the pagecatalog or
Re: [T5.3] Wot No Component Reference?
I was surprised when I noticed that today as well. I thought something was broken. I really preferred the old pages as well. My biggest problem is that all the examples are gone. But like most people, change is hard. If this is the new way, I'll get used to it. On Nov 2, 2011, at 10:48 AM, Steve Eynon wrote: I'm more than happy for the Component documentation to move to the JavaDocs but... Could we please have back the Component Reference page - that links to the individual component JavaDoc pages? It's a very handy page to have - and is great for perusing and scanning through. By sending everyone straight to the JavaDoc index page I'm also concerned you might scare off a lot of new-comers, for with over 100 java packages, it can look quite overwhelming. I know, I know, I'm asking you to hide all your hard work! :) But honestly, I have best interests at heart! Steve. - 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
5.3-rc-2 Exception
I have a very simple page that does nothing but redirect to another page. It works fine under jetty, but fails under tomcat 6.0.33. Any help would be greatly appreciated. My page class is: package com.starpoint.instihire.pages.view; import com.starpoint.instihire.pages.user.ViewUser; import org.apache.tapestry5.annotations.PageActivationContext; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.PageRenderLinkSource; import org.apache.tapestry5.services.Response; import java.io.IOException; /** */ public class User { @Inject private Response response; @Inject private PageRenderLinkSource linkSource; @PageActivationContext private Long userId; void setupRender() { try { response.sendRedirect(linkSource.createPageRenderLinkWithContext(ViewUser.class, userId)); } catch (IOException ioe) { // shrug? } } } The exception I get is: java.lang.NullPointerException org.apache.tapestry5.internal.services.assets.CompressionAnalyzerImpl.isCompressable(CompressionAnalyzerImpl.java:34) $CompressionAnalyzer_195e0b3cd2a3f5.isCompressable(Unknown Source) org.apache.tapestry5.internal.services.ResponseCompressionAnalyzerImpl.isCompressable(ResponseCompressionAnalyzerImpl.java:65) $ResponseCompressionAnalyzer_195e0b3cd2a3ec.isCompressable(Unknown Source) org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77) org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70) org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116) sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263) sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) java.io.OutputStreamWriter.write(OutputStreamWriter.java:190) java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111) java.io.BufferedWriter.write(BufferedWriter.java:212) java.io.PrintWriter.write(PrintWriter.java:412) java.io.PrintWriter.write(PrintWriter.java:429) java.io.PrintWriter.print(PrintWriter.java:559) org.apache.tapestry5.dom.Text.toMarkup(Text.java:59) org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:901) org.apache.tapestry5.dom.Element.toMarkup(Element.java:390) org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:901) org.apache.tapestry5.dom.Element.toMarkup(Element.java:390) org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:901) org.apache.tapestry5.dom.Element.toMarkup(Element.java:390) org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:901) org.apache.tapestry5.dom.Element.toMarkup(Element.java:390) org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:901) org.apache.tapestry5.dom.Element.toMarkup(Element.java:390) org.apache.tapestry5.dom.Document.toMarkup(Document.java:166) org.apache.tapestry5.dom.Node.toMarkup(Node.java:79) org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup(MarkupWriterImpl.java:56) org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:73) $PageResponseRenderer_195e0b3cd2a4b2.renderPageResponse(Unknown Source) org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:85) $RequestExceptionHandler_195e0b3cd2a3f9.handleRequestException(Unknown Source) org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42) $RequestHandler_195e0b3cd2a3fc.service(Unknown Source) org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902) $RequestHandler_195e0b3cd2a3fc.service(Unknown Source) org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892) $RequestHandler_195e0b3cd2a3fc.service(Unknown Source) org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90) $RequestHandler_195e0b3cd2a3fc.service(Unknown Source) org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105) org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95) org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119) $RequestHandler_195e0b3cd2a3fc.service(Unknown Source) $RequestHandler_195e0b3cd2a3ef.service(Unknown Source)
Re: Registry Shutdown - beta-21
Your implementation was simple to understand, simple to implement, and it seems to just work. Thanks Tony On Oct 14, 2011, at 5:51 PM, Howard Lewis Ship wrote: I'm about to commit changes to allow for registry will shutdown notifications. On Fri, Oct 14, 2011 at 1:20 PM, Tony Nelson tnel...@starpoint.com wrote: I have a bunch of threads that I've spawned off that I'd like to shut down gracefully. On Oct 14, 2011, at 4:14 PM, Steve Eynon wrote: Alas no, there is no other method (I'm aware of) that lets you know the registry is about to shutdown, just the one that tells you it's in the process of. There have been a couple of situations when I wished there was though! (e.g. to log the shutdown event to a database.) Steve. On 15 October 2011 03:51, Tony Nelson tnel...@starpoint.com wrote: I have successfully registered a shutdown listener as described in the document ion. It seems that registryDidShutdown() is called after the registry is done shutting down and I no longer have access to any of the services the registry previously held. Is there another method I can use to be notified just before the registry is shut down? The exception I'm seeing is this: [ERROR] TapestryIOCModule.RegistryShutdownHub Error notifying com.starpoint.instihire.services.AppModule$ThreadShutdownListener@54030e7b of registry shutdown: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. java.lang.RuntimeException: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:78) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:56) at $InstiHireQueue_124caf428070f755.delegate(Unknown Source) at $InstiHireQueue_124caf428070f755.getQueueReader(Unknown Source) at com.starpoint.instihire.services.AppModule$ThreadShutdownListener.registryDidShutdown(AppModule.java:292) at org.apache.tapestry5.ioc.internal.services.RegistryShutdownHubImpl.fireRegistryDidShutdown(RegistryShutdownHubImpl.java:57) at org.apache.tapestry5.ioc.internal.RegistryImpl.shutdown(RegistryImpl.java:384) at org.apache.tapestry5.ioc.internal.RegistryWrapper.shutdown(RegistryWrapper.java:41) at org.apache.tapestry5.TapestryFilter.destroy(TapestryFilter.java:192) at org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) at org.mortbay.jetty.servlet.FilterHolder.doStop(FilterHolder.java:107) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.servlet.ServletHandler.doStop(ServletHandler.java:176) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.servlet.SessionHandler.doStop(SessionHandler.java:125) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:592) at org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:537) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStop(Jetty6PluginWebAppContext.java:123) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.Server.doStop(Server.java:283) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.Server$ShutdownHookThread.run(Server.java:561) Caused by: java.lang.IllegalStateException: Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator$1.createObject(JustInTimeObjectCreator.java:101) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java
Re: PeriodicExecutor: services and Hibernate
Using tapestry-hibernate mine seemed to just work. I have a job that runs every 5 minutes that simply inserts a new row into a table. I inject the service, which in turn uses an injected DAO. No fussing w/ sessions as far as I can tell. Tony On Oct 17, 2011, at 12:45 PM, 9902468 wrote: Hi, I can inject services to the job that is going to be periodically executed. Do I have to manage my own transactions (using HibernateSessionManager) and clean up after each execution using PerthreadManager? If so, are you going to provide support for those in the future? Additionally, is it guaranteed that the job will execute even if it has previously thrown exception? How the executor behaves in cluster? I couldn't find documentation about this, is there any? - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/PeriodicExecutor-services-and-Hibernate-tp4910599p4910599.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
tapestry5-beta22 html5 doctype
I have added the html5 doctype to my base layout. In the base layout, I can use html entities as expected. Any page that I create that uses the layout, throw an exception that I haven't declared the entity unless I explicitly add the html5 doctype to the page. Is this the expected behavoir or should the page inherit the doctype from the layout? Thanks Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: An Appeal To Use the Latest Betas
I saw the following notification in my tomcat log after a tomcat:redeploy SEVERE: The web application [/instihire] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Oct 14, 2011 12:02:30 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/instihire] To be sure it was beta-21, I completely removed the app from webapps, did a tomcat:deploy followed by a tomcat:redeploy. The same error was logged. Hope this helps. Tony On Oct 14, 2011, at 10:35 AM, Wechsung, Wulf wrote: Awesome, thanks! Learning something new every day :) -Original Message- From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk] Sent: Freitag, 14. Oktober 2011 14:18 To: Tapestry users Subject: Re: An Appeal To Use the Latest Betas For point 3, try viewing the new PageCatalog page. e.g. http://localhost:8080/PageCatalog There's a button there to load all pages. Steve. On 14 October 2011 19:47, Wechsung, Wulf wulf.wechs...@sap.com wrote: I've taken 5 minutes to try out the beta with my integration test project and besides noticing that chenillekit doesn't declare its dependency on tapestry as provided which leads to an IncompatibleClassChangeError I found the beta-21 to be much stricter about the location of non-managed classes. In 5.2.6 you could still have an interface in the components package (now yields plastics error java.lang.ClassFormatError: Illegal field modifiers in class 0x12) or an enum in the mixin package ( gave an error stating that is should be moved to the base package). I also noticed the new event handler verification. All in all, I think these are acceptable changes if they find their way in the user docs. I also think it would be great if tapestry came repacked with a web-app validation suite that 1) attempts to realize all registered services 2) checks all classes in the managed package for the class format and tapestry-required visibility 3) checks templates of all pages and components known to tapestry Framework errors are a great way to let the developer know that he isn't making any sense or in the case of event handlers that he probably made an error in the functional implementation. However, webapps are usually user-facing and it's a little bit embarrassing to have the webapp barf all over the user just because an empty event handler isn't attached to a form or because an interface isn't in the correct package. Giving the developer a tool to avoid this before deployment would be a great way for the framework cto enhance productivity by essentially prepackaging a crash and burn test. -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Freitag, 14. Oktober 2011 01:16 To: Tapestry users Subject: An Appeal To Use the Latest Betas If you've been following the discussions here and elsewhere, you may be aware that Tapestry 5.3 is nearly done, with big improvements to every aspect of Tapestry, including speed and memory utilization. Our goal is to deliver an upgrade that is as seamless as possible. The PMC would dearly like to get a final release out and available before December (that is, within one year of the release 5.2). However, we can't do it without YOU: We need people actively using Tapestry to upgrade to the latest betas (5.3-beta-20 is the latest, but we're releasing new updates almost every day). We are looking for broken features or problems upgrading ... all the things that will get in the way of a release candidate and then a final release. Your feedback is essential ... without are community, we don't know for sure that Tapestry is ready to go to the next stage. Please budget some time, as soon as possible, to run you application under 5.3 and report back here about any problems you find. Without accurate (and hopefully, positive) feedback, we will not be able to progress to a final release ... and that means we'll be delayed adding the next layer of amazing features in Tapestry 5.4! Please see these notes on how to make use of the latest beta preview releases: http://tapestry.apache.org/2011/08/27/tapestry-53-beta-preview.html http://tapestryjava.blogspot.com/2011/10/tapestry-53-maven-archetype.html I've been posing on twitter each time a new preview is made available: http://twitter.com/#!/search/%23tapestry5 ... and note that by the time you do you upgreade, the exact version number may have changed (don't worry, beta-20 will still be available when beta-21 is made available). Your support is deeply appreciated ... now get back to coding less and delivering more! -- 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
Registry Shutdown - beta-21
I have successfully registered a shutdown listener as described in the document ion. It seems that registryDidShutdown() is called after the registry is done shutting down and I no longer have access to any of the services the registry previously held. Is there another method I can use to be notified just before the registry is shut down? The exception I'm seeing is this: [ERROR] TapestryIOCModule.RegistryShutdownHub Error notifying com.starpoint.instihire.services.AppModule$ThreadShutdownListener@54030e7b of registry shutdown: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. java.lang.RuntimeException: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:78) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:56) at $InstiHireQueue_124caf428070f755.delegate(Unknown Source) at $InstiHireQueue_124caf428070f755.getQueueReader(Unknown Source) at com.starpoint.instihire.services.AppModule$ThreadShutdownListener.registryDidShutdown(AppModule.java:292) at org.apache.tapestry5.ioc.internal.services.RegistryShutdownHubImpl.fireRegistryDidShutdown(RegistryShutdownHubImpl.java:57) at org.apache.tapestry5.ioc.internal.RegistryImpl.shutdown(RegistryImpl.java:384) at org.apache.tapestry5.ioc.internal.RegistryWrapper.shutdown(RegistryWrapper.java:41) at org.apache.tapestry5.TapestryFilter.destroy(TapestryFilter.java:192) at org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) at org.mortbay.jetty.servlet.FilterHolder.doStop(FilterHolder.java:107) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.servlet.ServletHandler.doStop(ServletHandler.java:176) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.servlet.SessionHandler.doStop(SessionHandler.java:125) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:592) at org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:537) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStop(Jetty6PluginWebAppContext.java:123) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.Server.doStop(Server.java:283) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.Server$ShutdownHookThread.run(Server.java:561) Caused by: java.lang.IllegalStateException: Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator$1.createObject(JustInTimeObjectCreator.java:101) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:68) ... 31 more Thanks in advance Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Registry Shutdown - beta-21
I have a bunch of threads that I've spawned off that I'd like to shut down gracefully. On Oct 14, 2011, at 4:14 PM, Steve Eynon wrote: Alas no, there is no other method (I'm aware of) that lets you know the registry is about to shutdown, just the one that tells you it's in the process of. There have been a couple of situations when I wished there was though! (e.g. to log the shutdown event to a database.) Steve. On 15 October 2011 03:51, Tony Nelson tnel...@starpoint.com wrote: I have successfully registered a shutdown listener as described in the document ion. It seems that registryDidShutdown() is called after the registry is done shutting down and I no longer have access to any of the services the registry previously held. Is there another method I can use to be notified just before the registry is shut down? The exception I'm seeing is this: [ERROR] TapestryIOCModule.RegistryShutdownHub Error notifying com.starpoint.instihire.services.AppModule$ThreadShutdownListener@54030e7b of registry shutdown: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. java.lang.RuntimeException: Exception constructing service 'EmailQueue': Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:78) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:56) at $InstiHireQueue_124caf428070f755.delegate(Unknown Source) at $InstiHireQueue_124caf428070f755.getQueueReader(Unknown Source) at com.starpoint.instihire.services.AppModule$ThreadShutdownListener.registryDidShutdown(AppModule.java:292) at org.apache.tapestry5.ioc.internal.services.RegistryShutdownHubImpl.fireRegistryDidShutdown(RegistryShutdownHubImpl.java:57) at org.apache.tapestry5.ioc.internal.RegistryImpl.shutdown(RegistryImpl.java:384) at org.apache.tapestry5.ioc.internal.RegistryWrapper.shutdown(RegistryWrapper.java:41) at org.apache.tapestry5.TapestryFilter.destroy(TapestryFilter.java:192) at org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) at org.mortbay.jetty.servlet.FilterHolder.doStop(FilterHolder.java:107) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.servlet.ServletHandler.doStop(ServletHandler.java:176) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.servlet.SessionHandler.doStop(SessionHandler.java:125) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:592) at org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:537) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStop(Jetty6PluginWebAppContext.java:123) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142) at org.mortbay.jetty.Server.doStop(Server.java:283) at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76) at org.mortbay.jetty.Server$ShutdownHookThread.run(Server.java:561) Caused by: java.lang.IllegalStateException: Proxy for service EmailQueue is no longer active because the IOC Registry has been shut down. at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator$1.createObject(JustInTimeObjectCreator.java:101) at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:68) ... 31 more Thanks in advance Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Bootstrap
I'm just starting the infrastructure of my project. I had settled on Blueprint CSS http://www.blueprintcss.org/ but I may have to take a closer look at this Bootstrap. It seems to have some very nice features. On Oct 13, 2011, at 9:53 AM, George Christman wrote: That's beautiful. Im a huge fan of the idea. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Bootstrap-tp4897002p4899291.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
@Scope
I have a service, that I need a new instance of every time it is referenced. In ScopeConstants I see DEFAULT, and PERTHREAD. I really need a new instance every time I request this particular service because it saves state, and yes, there are some occasions where I need several of these in the same thread (web request). For now, I can change all of my references to the service to a new instantiation of the implementing class, but that really isn't ideal. Does anyone have any idea how difficulty this type of change might be, and if it might be possible to get it into a 5.3-beta? Thanks Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: @Scope
This particular service could have just as easily been a pojo. I'm converting a tapestry4/spring application to tapestry5 and I'm trying to leave spring behind. As a spring bean this object was simply declared with scope=prototype which gave me a new instance of the object every time I accessed it. It does look like autobuild will do what I need. I'll give it a try. Thank you very much. Tony On Oct 12, 2011, at 5:21 PM, Cezary Biernacki wrote: Hi, you can inject ObjectLocator and call 'autobuild' to create a new instance when needed. So instead of @Inject private MyService myService; ... myService.doSomething(); you would have @Inject private ObjectLocator locator; locator.autobuild(MyService.class).doSomething(). However I am not sure if your design is correct - do you need really to save state in the service? It does not look like a proper service. Best regards, Cezary On Wed, Oct 12, 2011 at 11:11 PM, Tony Nelson tnel...@starpoint.com wrote: I have a service, that I need a new instance of every time it is referenced. In ScopeConstants I see DEFAULT, and PERTHREAD. I really need a new instance every time I request this particular service because it saves state, and yes, there are some occasions where I need several of these in the same thread (web request). For now, I can change all of my references to the service to a new instantiation of the implementing class, but that really isn't ideal. Does anyone have any idea how difficulty this type of change might be, and if it might be possible to get it into a 5.3-beta? Thanks Tony - 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: Accessing Registered Services - Tap 5.3-beta-16
On Oct 10, 2011, at 6:17 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 10 Oct 2011 18:51:36 -0300, Tony Nelson tnel...@starpoint.com wrote: In this scenario, are you in a web app or not? I am in a web app, however, I have a service that I need to start as a runnable. The services is registered with bind, and started with @Startup in AppModule. You can inject ObjectLocator (superinterface of Registry which declares the getService() methods) in your service which is registered by bind and pass it to your Runnable. By the way, why don't you pass the needed services themselves to the Runnable instead of passing ObjectLocator to them? Having a service that creates this Runnables would make things better organized anyway. I have in the neighborhood of 25 different services. Passing them all around seems like a workaround. If I were to use the Tapestry Registry outside of a web context, how would I get access to bound services? To give you an idea of what I'm trying to figure out how to code without spring, here is a snippet of how we did it with Spring. public abstract class InstiHireQueue { private final String queueName; private ExecutorService service = null; private final QueueReader queueReader; // private final Logger logger = Logger.getLogger(InstiHireQueue.class); private final ListRunnable jobList = SynchronizedList.decorate(new ArrayListRunnable()); private static final SystemLogic systemLogic = (SystemLogic) Context.getInstance().getObject(systemLogic); private static final EmailSender emailSender = (EmailSender) Context.getInstance().getObject(emailSender); /* snip */ } There are 5 concrete classes that extend this base class to make different types of queues. One of them is an email queue. Each e-mail message is modeled as a simple object. The email queue creates new instances of these objects and adds then executes them. I simple e-mail object looks like this: public class PasswordResetInternalNotificationEmailMessage extends EmailBuilderAbstract { private Integer userId; private Integer byWhoId; private final UserLogic userLogic = (UserLogic)Context.getInstance().getObject(userLogic); /* snip */ } The base Email class looks like this… public final class EmailMessage { private static Logger logger = Logger.getLogger(EmailMessage.class); /* private static final String SMTP_SERVER_KEY = mail.smtp.host; private static final String LOCAL_HOST_FQDN_KEY = mail.smtp.localhost; */ private static final SystemLogic systemLogic = (SystemLogic) Context.getInstance().getObject(systemLogic); private static final InstiHireProps instiHireProps = (InstiHireProps) Context.getInstance().getObject(instiHireProps); private static final AttachmentLogic attachmentLogic = (AttachmentLogic) Context.getInstance().getObject(attachmentLogic); private static final UserLogic userLogic = (UserLogic)Context.getInstance().getObject(userLogic); /* snip */ } The Context object is nothing more than the stand Spring ApplicationContextAware singleton: public class Context implements ApplicationContextAware { private static Context instance = new Context(); private static ApplicationContext applicationContext = null; public static Context getInstance() { return instance; } public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { Context.applicationContext = applicationContext; } /** * Return an object from the context * @param name The name of the object * @return The object from the context, null if it cannot be found */ public Object getObject(final String name) { return applicationContext.getBean(name); } } I understand that the Tapestry registry isn't supposed to be exactly like Spring and Tapestry isn't intended to completely replace Spring. However, my usage of Spring pretty much amounted to this type of IoC and I used spring-odbc. In my new implementation I'd like to remove Spring completely if I can because I simply don't make enough use of it's components. What I really need is a simple way to access the Registry outside of Tapestry created objects and outside of a Web request. How would I do this if I was using Tapestry outside of a web context? I have some scheduled jobs that I planned to run from cron, but reuse the existing code and services by making small, non-web Tapestry command line apps. I'm not sure what I read that lead me to believe I should be able to accomplish this, but I'm pretty sure that I should be able to use the Tapestry IoC module in a stand alone command line app. Thanks for any help Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Accessing Registered Services - Tap 5.3-beta-16
On Oct 11, 2011, at 10:20 AM, Thiago H. de Paula Figueiredo wrote: On Tue, 11 Oct 2011 11:04:22 -0300, Tony Nelson tnel...@starpoint.com wrote: I have in the neighborhood of 25 different services. Passing them all around seems like a workaround. But each Runnable needs all them? No, they don't. But I don't have a map of which ones need which, and quite honestly they can change often enough to make this a rather pain to manage. If I were to use the Tapestry Registry outside of a web context, how would I get access to bound services? You'd need to instantiate the Registry yourself. The Tapestry-IoC documentation tells how. Thanks, that I can do. I understand that the Tapestry registry isn't supposed to be exactly like Spring and Tapestry isn't intended to completely replace Spring. You're comparing apples to bananas here. :) Tapestry is a web framework. Tapestry-IoC is a dependency injection and invertion of control container, just like Spring (the core, not the other modules) is, so yes, Tapestry-IoC can be used as a complete Spring(-core) replacement. OK, maybe I let out Tapestry-IoC and just said Tapestry. My mistake. Why is it so hard to get a handle on the Registry outside of the web context? Shouldn't this be a simple service provided by the IoC container out of the box? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Accessing Registered Services - Tap 5.3-beta-16
On Oct 11, 2011, at 11:05 AM, Thiago H. de Paula Figueiredo wrote: On Tue, 11 Oct 2011 11:55:43 -0300, Tony Nelson tnel...@starpoint.com wrote: But each Runnable needs all them? No, they don't. But I don't have a map of which ones need which, and quite honestly they can change often enough to make this a rather pain to manage. Ah, ok. :) OK, maybe I let out Tapestry-IoC and just said Tapestry. My mistake. Why is it so hard to get a handle on the Registry outside of the web context? Please define web context. Is it code that is part of a web app, but isn't related to web itself (charts, data processing, etc) or non-web applications? The answer is different for each scenario. I meant code inside a web application that isn't related to a web request. Shouldn't this be a simple service provided by the IoC container out of the box? I don't think so, as you may have more than one registry at the same process. I wasn't aware you could have more than one Registry in a process. I'm not sure what use case that would solve, but I did manage to come up w/ a solution that seems to work. AppModule.java /* snip */ @Startup public static void initContext(ObjectLocator objectLocator) { Context.setObjectLocator(objectLocator); } /* snip */ Context.java -- should probably rename this public class Context { private static Context INSTANCE = new Context(); private static ObjectLocator OBJECT_LOCATOR; public static Context getInstance() { return INSTANCE; } private Context() { } public static void setObjectLocator(ObjectLocator objectLocator) { if (Context.OBJECT_LOCATOR == null) { Context.OBJECT_LOCATOR = objectLocator; } } public Object getService(final Class? clazz) { return OBJECT_LOCATOR.getService(clazz); } } Then I can use it like this.. public class SessionListener implements HttpSessionBindingListener, Serializable { private final SessionMapHolder sessionMapHolder = (SessionMapHolder) Context.getInstance().getService(SessionMapHolder.class); private final SystemLogic systemLogic = (SystemLogic) Context.getInstance().getService(SystemLogic.class); private final UserLogic userLogic = (UserLogic) Context.getInstance().getService(UserLogic.class); …. } And it seems to work just fine. Do you see anything that would make this explode in a way I wouldn't expect? Thanks again for all your help. Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Accessing Registered Services - Tap 5.3-beta-16
How is it possible to access a service registered in AppModule#bind from an object created outside of Tapestry's control? Specifically, I have a number of services created in AppModule. One of these services creates new instances of objects via reflection to solve a specific business problem. These objects then will need access to services provided by other interface implementations created by AppModule. Coming from a Spring background, I'm looking for something like ApplicationContextAware, and the ability to access beans from the context registry. Is there a simple analog to access the Registry and ask it for the registered implementation of an interface? Thanks in advance Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Accessing Registered Services - Tap 5.3-beta-16
On Oct 10, 2011, at 5:34 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 10 Oct 2011 18:14:01 -0300, Tony Nelson tnel...@starpoint.com wrote: On Oct 10, 2011, at 4:58 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 10 Oct 2011 17:18:59 -0300, Tony Nelson tnel...@starpoint.com wrote: How is it possible to access a service registered in AppModule#bind from an object created outside of Tapestry's control? You can get the Registry from servletContext.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME) and then use one of the getService() methods. Forgive my ignorance, but in an object that was created either via new or someClass.newInstance() how would I have access to the servletContext? In this scenario, are you in a web app or not? I am in a web app, however, I have a service that I need to start as a runnable. The services is registered with bind, and started with @Startup in AppModule. When the service handles an event it creates objects to service specific events. These objects that get created need access to other services that are registered via bind. That's where I'm getting stuck. Posting the code isn't really possible, there is just too much. But a simple example would be something like: A user submits a form, that causes a DB update, and an e-mail to be sent. E-Mail messages aren't sent directly, rather they are written to a table and a handler process is woken up to deal with the new data in the table. This handler process reads the send email event from the table, and creates objects as necessary to handle the event. These are the objects need access to other services that are already registered. Yes, it's rather convoluted and the e-mail example is just a simple example. We have many other events that get queued and serviced later so that users using the web application don't have to wait for things that can be processed in the background. Thanks in advance for any help. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tap-5.3-beta-16 tapestry-core v. tapestry-hibernate
I have found with the latest Tap5.3 beta that the html generated from a simple textfield differs significantly if you are using tapestry-core or tapestry-hibernate. In my .tml file I have the following simple input: t:label for=usernameUsername: /t:label t:textfield t:id=username value=username class=username / When this is run with tapestry-core I get the following html: label for=usernameUsername: /label input class=username value=f...@bar.com id=username name=username type=text When I run the same template with tapestry-hibernate I get the following html: labelUsername: /label input class=username value=f...@bar.com type=text Notice the tapestry-hibernate version is missing the id attribute which is causing my javascript to fail (and I think when the form is submitted, tap can't seem to decode the values). I've put together a small sample app that you can clone from github that demonstrates the problem: https://github.com/hhubris/broken Simply change the tapestry dependency from tapestry-core to tapestry-hibernate and restart jetty with mvn clean jetty:run to see the problem. Any help would be greatly appreciated. Thanks Tony Nelson Starpoint Solutions
Re: Tapestry 5.3 and JQuery
I've been using the tapestry-jquery project here: https://github.com/got5/tapestry5-jquery It's dead simple to use. The one issue is that it doesn't currently work with 5.3. There is a branch for it, but it probably won't be published until after 5.3 is actually released (5.3 is beta at the moment). Tony On Aug 30, 2011, at 10:18 AM, Gunnar Eketrapp wrote: I use jQuery without any hazzle. Just remember to call jQuery.noConflict() and to use jQuery instead of $ since prototype has taken that one. 2011/8/30 Julien Martin bal...@gmail.com Hello all, Can someone please tell me what are the recommended patterns or frameworks - if any - I should rely if I want to use JQuery together with Tapestry 5? For instance, can I just include the JQuery library in my template pages and go ahead and use JQuery features? Are there pitfalls I should avoid? Any clue or comment welcome. Thanks, Julien. -- [Hem: 08-715 59 57, Mobil: 070-991 86 42] Allévägen 2A, 132 42 Saltsjö-Boo
Simple validate maxlength problem
I have a very simple login form: t:form t:id=loginForm t:textfield t:id=username t:value=username t:validate=maxlength=15/ /t:form This is bound to a simple string parameter, nothing fancy. I expect that the maxlength validation would create a maxlength parameter in the html input. I've tried specifying the validation in both the tml and on the property like this: @Property @Validate(required,maxlength=64) private String username; But not matter what I try, the html never includes a maxlength attribute. What could I be doing wrong? Thanks Tony Nelson Starpoint Solutions - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.3 and JQuery
I believe that tap is going to try to be more flexible and allow you to choose whichever library you prefer by providing an integration layer. No point is forcing you to use one library over another IMO. Tony On Aug 30, 2011, at 10:35 AM, Julien Martin wrote: Thank you both. I think I once read a comment by Howard Lewis Ship stating that JQuery would become the default JS library in Tapestry 5.3. Is this indeed the case or will this be the case in some other future version of Tapestry? Julien. 2011/8/30 Tony Nelson tnel...@starpoint.com I've been using the tapestry-jquery project here: https://github.com/got5/tapestry5-jquery It's dead simple to use. The one issue is that it doesn't currently work with 5.3. There is a branch for it, but it probably won't be published until after 5.3 is actually released (5.3 is beta at the moment). Tony On Aug 30, 2011, at 10:18 AM, Gunnar Eketrapp wrote: I use jQuery without any hazzle. Just remember to call jQuery.noConflict() and to use jQuery instead of $ since prototype has taken that one. 2011/8/30 Julien Martin bal...@gmail.com Hello all, Can someone please tell me what are the recommended patterns or frameworks - if any - I should rely if I want to use JQuery together with Tapestry 5? For instance, can I just include the JQuery library in my template pages and go ahead and use JQuery features? Are there pitfalls I should avoid? Any clue or comment welcome. Thanks, Julien. -- [Hem: 08-715 59 57, Mobil: 070-991 86 42] Allévägen 2A, 132 42 Saltsjö-Boo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Simple validate maxlength problem
Found my own answer: public void render(Field field, Integer constraintValue, MessageFormatter formatter, MarkupWriter writer, FormSupport formSupport) { // TODO: write a maxlength attribute into the element? But that's only for // textfield, not for textarea. formSupport.addValidation(field, maxlength, buildMessage(formatter, field, constraintValue), constraintValue); } On Aug 30, 2011, at 10:35 AM, Tony Nelson wrote: I have a very simple login form: t:form t:id=loginForm t:textfield t:id=username t:value=username t:validate=maxlength=15/ /t:form This is bound to a simple string parameter, nothing fancy. I expect that the maxlength validation would create a maxlength parameter in the html input. I've tried specifying the validation in both the tml and on the property like this: @Property @Validate(required,maxlength=64) private String username; But not matter what I try, the html never includes a maxlength attribute. What could I be doing wrong? Thanks Tony Nelson Starpoint Solutions - 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: Ajax callback for checkbox component?
Is the ZoneUpdater mixin hosted anywhere? I grabbed the latest copy from http://tinybits.blogspot.com/2011/03/zoneupdater-jquery-edition.html because I'm using tapestry5-jquery and made two small improvements (IMHO) to it. 1 - The ability to add the mixin to a button .. that when clicked submits the value of a specified field 2 - The ability to clear the value of the input after a successful AJAX call. (Not sure what it would do for a checkbox/radiobutton) Anyways, I wanted to contribute my changes back, but I couldn't find any contact info @tinybits. I was going to contribute it to tapestry5-jquery but the original has no licensing info. Are my changes useful to anyone? What can I do to contribute them back in a useful way? Thanks - Tony On Jul 11, 2011, at 6:34 AM, Michael Gentry wrote: The ZoneUpdater mixin also works for checkboxes: t:radiogroup t:id=costType t:validate=required t:radio t:id=regularCostType t:mixins=cb/zoneUpdater t:zone=addzone t:clientEvent=click event=change / ... mrg On Mon, Jul 4, 2011 at 8:11 AM, Dmitriy Vsekhvalnov dvsekhval...@gmail.com wrote: For checkbox or for select component? :) I'm using ZoneUpdater mixin for selects, all my selects looks like: select t:id=area t:type=select value=area t:blankLabel=select area t:clientEvent=change t:event=areaChanged t:mixins=zoneUpdater t:model=areasModel t:zoneupdater.zone=contentZone / and server code is: public Object onAreaChanged() { .. } On Mon, Jul 4, 2011 at 1:35 PM, Joel Halbert j...@su3analytics.com wrote: OK np. Thanks Thiago! On Sun, 2011-07-03 at 19:53 -0300, Thiago H. de Paula Figueiredo wrote: On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. - 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: tapestry-jpa: JpaGridDataSource sort by a transient field
We solved a similar problem by creating a view that calculated the field instead of using a transient field. Then we just mapped the view as a read only object and all the sorting worked. -Tony On Jul 11, 2011, at 7:28 PM, Richard Yunhua Sang wrote: Thanks for your reply, but I do want to sort the result by transient field in Grid. It would be appreciated that the JPAGridDataSource is able to sort the result within JVM. On Mon, Jul 11, 2011 at 5:29 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 11 Jul 2011 18:06:17 -0300, Richard Yunhua Sang yunhua.s...@gmail.com wrote: Hi there, Hi! I am using a Grid with JpaGridDataSource; when I click sort icon on a transient field of an entity, I get following exception: I don't think any GridDataSource implementation backed by a database would be able to handle transient properties, so you should set their corresponding PropertyModel's as unsortable. To get the PropertyModel, create a BeanModel for you entity class using the BeanModelSource service and use its get() method. -- 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: LinkSubmit not rendering class attribute
Are you by chance using tapestry5-jquery? If so, make sure you are using 2.1.1-SNAPSHOT. The behavior you describe exists in 2.1.0. Tony On Jul 8, 2011, at 8:48 PM, Taha Hafeez wrote: Can you share the code and the generated markup On Sat, Jul 9, 2011 at 6:10 AM, Greg Pagendam-Turner g...@liftyourgame.comwrote: Taha, Strangely I'm not seeing the span despite hitting a breakpoint in the code for linksubmit that creates the span Regards, Greg On 09/07/2011, at 10:07 AM, Taha Hafeez tawus.tapes...@gmail.com wrote: Hi LinkSubmit is rendered as a span around the element you have specified as linkSubmit. So my guess is that the class attribute will be present in the span around the anchor link. regards Taha On Sat, Jul 9, 2011 at 5:30 AM, Greg Pagendam-Turner g...@liftyourgame.comwrote: Hi, I have a submit component that uses LinkSubmit. I want to set the class attribute on the generated link. a t:type=linksubmit class=btn orange t:context=${value}${value}** /a But when the link is rendered I only get: a id=linksubmit href=#/a What happened to the class attribute? The documentation states that LinkSubmit supports informal parameters. I'm using Tapestry 5.2.6 Regards, Greg. --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- regards Tawus tawus.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- regards Tawus tawus.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: a question T5 work with spring
I'm not sure what you mean by the service Id, but I use Spring with Tap5 like this: applicationContext.xml ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:context=http://www.springframework.org/schema/context; xmlns:tx=http://www.springframework.org/schema/tx; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd; default-autowire=byName !-- notice I use default-autowire byName -- !-- data source -- bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource destroy-method=close property name=driverClassName value=${dataSource.driverClass} / property name=username value=${dataSource.user} / property name=password value=${dataSource.password} / property name=url value=${dataSource.jdbcURL} / /bean !-- Hibernate session factory -- bean id=sessionFactory class=org.springframework.orm.hibernate3.LocalSessionFactoryBean property name=dataSource ref=dataSource/ property name=configLocation value=classpath:/hibernate.cfg.xml/ /bean !-- Hibernate transaction manager -- bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref=sessionFactory/ /bean !-- scan these packages, business classes are marked with @Service. DAOs are marked with @Component -- context:component-scan base-package=com.starpoint.helpdesk.business / context:component-scan base-package=com.starpoint.helpdesk.dao / context:annotation-config/ tx:annotation-driven transaction-manager=transactionManager / /beans Then in my TestNG cases I can simply Inject using the Spring annotation: @Autowired EmailGroupLogic emailGroupLogic; In my actual code, I use Tapestry to Inject the services like this: @Inject private UserLogic userLogic; I'm sure there is probably a way to get Tapestry to @Inject in test cases, but I couldn't get anything to play ball and this was sufficient for my needs. -Tony On Jul 6, 2011, at 7:26 AM, dick_hu wrote: Anyone can tell me,how can I get the serviceId from spring Integration? I try in my test,I Integrate a bean named TestService in spring xml, but I can't get the service in my Page by @InjectService(TestService). I want to catch the serviceId from spring bean,what can I do? -- View this message in context: http://tapestry.1045711.n5.nabble.com/a-question-T5-work-with-spring-tp4556498p4556498.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
Empty Zone (T5.2.6)
Still trying to build what I thought would be a simple component. My main tml looks like this: form [ input fields] t:mycomponent /form My component is very simple at the moment: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter fieldset legendEmail Aliases/legend t:zone t:id=aliasZone id=aliasZone ul li t:type=loop source=allAliases value=emailAlias ${emailAlias.alias} /li /ul /t:zone p t:textfield t:id=newAliasField value=newAlias/ t:actionlink t:id=addAlias t:zone=aliasZoneAdd Alias/t:actionlink /p /fieldset /t:container Any time I render the form, and the loop evaluates to an empty list, I get the following exception: Render queue error in AfterRender[emailuser/Edit:emailaliaseditor.aliaszone]: The rendered content did not include any elements that allow for the positioning of the hidden form field's element. It works just fine if the loop generates some output. Is tap trying to optimize the html and remove the useless ul? Added a useless hidden div seems to work around this problem. t:zone t:id=aliasZone id=aliasZone t:hidden name=useless value=literal:useless / ul li t:type=loop source=allAliases value=emailAlias ${emailAlias.alias} /li /ul /t:zone Although I'm guessing when I submit the form I'm going to run into a problem. Any other suggestions? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Looking for a sample
Hi all, I've spent as much time and brain cells as I can on this. Does anyone has a working sample of Zone update based with information input by the user? Specifically, I have a text field that a user fills in, clicks an add link/button, and I want to insert the new value in a ul in a zone. I've tried everything I can think but can't seem to pass the value from the text field to the zone update method. Thanks in advance, -Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Simple question
On Jul 1, 2011, at 12:32 PM, Howard Lewis Ship wrote: On Fri, Jul 1, 2011 at 4:37 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Fri, 01 Jul 2011 07:31:18 -0300, p.stavrini...@albourne.com wrote: Hello everyone! Hi! Is it possible to nest the output of variables, i.e.: something like: img src=${asset:context:images/${variable}/logo.gif} / No this is not supported, but you could inject the AssetSource service into your component class and construct the context:images/... string there instead. I did it like this.. [snip] @Property private LETTER selectedLetter; public LETTER[] getLetters() { return LETTER.values(); } @Inject @Path(context:images/letters/) private Asset pathPrefix; public String getImagePath() { return pathPrefix.toClientURL() + / + selectedLetter.name().toLowerCase() + .gif; } [/snip] and in my tml t:loop source=letters value=selectedLetter t:linksubmit t:id=letterSubmit context=selectedLetter border=0 defer=false img src=${imagePath} alt=${selectedLetter}/ /t:linksubmit /t:loop Hope that helps. -Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Struggling with Ajax
I'm trying to build a simple component that will be used on 2 pages. It seems like it should be simple enough. I want an unordered list of existing items, a text field that I can type a new name in, and then a link/button that adds the new name to the list. The component will be used in the context of an existing form.. so the main tml looks like: form t:id=... [normal form inputs] t:mycomponent / /form My current attempt at the component looks like this: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter fieldset legendEmail Aliases/legend t:zone t:id=aliasZone id=aliasZone t:forminjector t:id=aliasFormInjector position=below ul t:loop source=allAliases value=emailAlias li${emailAlias.alias}/li /t:loop /ul t:textfield id=newAlias value=newAlias / /t:forminjector /t:zone p t:actionlink t:id=addAlias zone=aliasZone t:context=newAliasAdd Alias/t:actionlink /p /fieldset /t:container I'm struggling with 2 problems at the moment. I can't figure out how to get the value of newAlias to be submitted with actionLink. When the zone does render after the action submit I get an error because the zone doesn't have a form context. The forminjector above is my current attempt at solving it, but that yields this error: org.apache.tapestry5.ioc.internal.util.TapestryException: No object of type org.apache.tapestry5.services.FormSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.ValidationDecorator, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.ClientBehaviorSupport, org.apache.tapestry5.services.Heartbeat, org.apache.tapestry5.services.javascript.JavaScriptSupport. [at classpath:com/starpoint/helpdesk/components/emailuser/EmailAliasEditor.tml, line 8] I've tried to google it but I can't figure out what is really expected. I've seen a lot of examples where the add button adds a whole new empty row which is fine, but for a simple input it feels more natural to provide the value and hit the add button. After I get this working, I intend on adding a delete button as well.. And then Save action will be handled by the enclosing page and persist all of the changes include the changes to the component at once. I've tried using the ajaxloop as well, but I didn't seem to get much further. Any hints or ideas would be greatly appreciated. Thanks Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Struggling with Ajax
By moving the textfield outside the zone, I managed to avoid the error on zone redisplay.. I still can't seem to pass a value into the component when I click the action link.. On Jun 30, 2011, at 11:00 AM, Tony Nelson wrote: I'm trying to build a simple component that will be used on 2 pages. It seems like it should be simple enough. I want an unordered list of existing items, a text field that I can type a new name in, and then a link/button that adds the new name to the list. The component will be used in the context of an existing form.. so the main tml looks like: form t:id=... [normal form inputs] t:mycomponent / /form My current attempt at the component looks like this: t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter fieldset legendEmail Aliases/legend t:zone t:id=aliasZone id=aliasZone t:forminjector t:id=aliasFormInjector position=below ul t:loop source=allAliases value=emailAlias li${emailAlias.alias}/li /t:loop /ul t:textfield id=newAlias value=newAlias / /t:forminjector /t:zone p t:actionlink t:id=addAlias zone=aliasZone t:context=newAliasAdd Alias/t:actionlink /p /fieldset /t:container I'm struggling with 2 problems at the moment. I can't figure out how to get the value of newAlias to be submitted with actionLink. When the zone does render after the action submit I get an error because the zone doesn't have a form context. The forminjector above is my current attempt at solving it, but that yields this error: org.apache.tapestry5.ioc.internal.util.TapestryException: No object of type org.apache.tapestry5.services.FormSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.ValidationDecorator, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.ClientBehaviorSupport, org.apache.tapestry5.services.Heartbeat, org.apache.tapestry5.services.javascript.JavaScriptSupport. [at classpath:com/starpoint/helpdesk/components/emailuser/EmailAliasEditor.tml, line 8] I've tried to google it but I can't figure out what is really expected. I've seen a lot of examples where the add button adds a whole new empty row which is fine, but for a simple input it feels more natural to provide the value and hit the add button. After I get this working, I intend on adding a delete button as well.. And then Save action will be handled by the enclosing page and persist all of the changes include the changes to the component at once. I've tried using the ajaxloop as well, but I didn't seem to get much further. Any hints or ideas would be greatly appreciated. Thanks Tony Nelson - 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: Want locale to be part of every uri
On Jun 30, 2011, at 6:30 PM, Howard Lewis Ship wrote: In Tapestry, any time your solution involves creating a base page, you are probably off on the wrong track. The best place to add cross-cutting concerns such as you describe is by contributing a filter into the ComponentRequestHandler service pipeline. This is how I do page flow, security, and many other things. Is there any suggested reading and examples that will help a new guy with this? I've been working with T5 for a few weeks now. It's a huge improvement over T4! I can do all of the simple things easily enough, but the first time I run into something that I don't already know how to do, it seems like I spend a long time trying to find the Tapestry way of getting it done. Thanks Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 5.3.0 java.lang.IncompatibleClassChangeError: Implementing class
Not sure if this helps, but I was having the same problem but only if I included the tapestry5-jquery library. There is an open issue here: https://github.com/got5/tapestry5-jquery/issues/49 On Jun 29, 2011, at 1:37 PM, Howard Lewis Ship wrote: It does seem odd, the failed line is quite innocuous. Is there any chance of a mismatch between compilation JDK and execution JDK? On Wed, Jun 29, 2011 at 10:25 AM, George Christman gchrist...@cardaddy.com wrote: Yes there was multiple versions of the Tap JARs. I was able to fix that with a clean build, however the issue still exist. -- View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-0-java-lang-IncompatibleClassChangeError-Implementing-class-tp4534951p4535833.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 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: [ANNOUNCE] Tapestry 5.3.0
That's great. I was just going to post a question about which version of Tap I should target for an internal app that's used by about 5 of us. I personally don't think 5.3.0 should be available as anything more than 5.3.0-SNAPSHOT until 5.3.0 is finalized. That being said, for my internal app, should I be using 5.3.0 or 5.3.0-SNAPSHOT for my development? Thanks for the help Tony On Jun 26, 2011, at 6:13 AM, Robert Zeigler wrote: There's an ongoing discussion about this on the dev list right now. Robert On Jun 26, 2011, at 6/265:04 AM , Christian Köberl wrote: On Fri, Jun 24, 2011 at 10:30 PM, Howard Lewis Ship wrote: Apache Tapestry version 5.3.0 is now available. This is the first alpha release of Tapestry 5.3. I have a suggestion for Tapestry version numbering. I think it's a bit confusing to give a regular version number to a alpha or beta releases - you never know which version is alpha/beta/release candidate/stable. Other open source projects use special version numbers, e.g. JBoss projects would use the following versions for a 5.3 release: 5.3.0.Alpha1 5.3.0.Beta1 5.3.0.CR1 (for release candidaten, CR because this version is smaller than Final in Maven) 5.3.0.Final What do you think? -- Chris - 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: [ANNOUNCE] Tapestry 5.3.0
Answered my own question: [ERROR] Failed to execute goal on project helpdesk: Could not resolve dependencies for project com.starpoint:helpdesk:war:1.0.0: The following artifacts could not be resolved: org.apache.tapestry:tapestry-core:jar:5.3.0-SNAPSHOT, org.apache.tapestry:tapestry-spring:jar:5.3.0-SNAPSHOT: Failure to find org.apache.tapestry:tapestry-core:jar:5.3.0-SNAPSHOT in http://repository.apache.org/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of apache-snapshots has elapsed or updates are forced - [Help 1] On Jun 26, 2011, at 10:12 AM, Tony Nelson wrote: That's great. I was just going to post a question about which version of Tap I should target for an internal app that's used by about 5 of us. I personally don't think 5.3.0 should be available as anything more than 5.3.0-SNAPSHOT until 5.3.0 is finalized. That being said, for my internal app, should I be using 5.3.0 or 5.3.0-SNAPSHOT for my development? Thanks for the help Tony On Jun 26, 2011, at 6:13 AM, Robert Zeigler wrote: There's an ongoing discussion about this on the dev list right now. Robert On Jun 26, 2011, at 6/265:04 AM , Christian Köberl wrote: On Fri, Jun 24, 2011 at 10:30 PM, Howard Lewis Ship wrote: Apache Tapestry version 5.3.0 is now available. This is the first alpha release of Tapestry 5.3. I have a suggestion for Tapestry version numbering. I think it's a bit confusing to give a regular version number to a alpha or beta releases - you never know which version is alpha/beta/release candidate/stable. Other open source projects use special version numbers, e.g. JBoss projects would use the following versions for a 5.3 release: 5.3.0.Alpha1 5.3.0.Beta1 5.3.0.CR1 (for release candidaten, CR because this version is smaller than Final in Maven) 5.3.0.Final What do you think? -- Chris - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
select component
Following the sample here: http://tapestry.apache.org/using-select-with-a-list.html I created a ValueEncoder and ValueEncoderFactory for my select model. That was simple enough. I created the actual select like this: t:select t:id=groupSelect blankLabel=[ ALL ] model=groups value=searchKeys.group / Is it possible to tell the select which attribute of my model should be used to generate the options? It seems to call toString() by default which isn't appropriate for this model. Thanks Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: select component
Thank you very much for the nicely telling me to read the entire page, not just the part I thought I needed ;) That solved everything. Thanks to the Tap team for making selects _much_ easier to work with in 5! Tony On Jun 26, 2011, at 2:57 PM, Bob Harner wrote: Tony, The menu options are determined by your SelectModel. Rather than using your groups list as the select model, use SelectModelFactory to generate a SelectModel for you, specifying the attribute to be used for the visible options. See the SelectWithListDemo.java example at http://tapestry.apache.org/using-select-with-a-list.html and let me know if anything in that page isn't clear. On Sun, Jun 26, 2011 at 1:09 PM, Tony Nelson tnel...@starpoint.com wrote: Following the sample here: http://tapestry.apache.org/using-select-with-a-list.html I created a ValueEncoder and ValueEncoderFactory for my select model. That was simple enough. I created the actual select like this: t:select t:id=groupSelect blankLabel=[ ALL ] model=groups value=searchKeys.group / Is it possible to tell the select which attribute of my model should be used to generate the options? It seems to call toString() by default which isn't appropriate for this model. Thanks Tony Nelson - 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
TAP5.3.0 onValidate
I saw in the release notes that onValidateForm has been replaced by onValidate. Should it be called 2x on form post? [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onPrepare() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onPrepare [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onValidate() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onValidate [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onValidate() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onValidate [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onSuccess() Previously I used the onValidateForm method to save my business objects and onSuccess() to redirect to the next page. What strategy should be used to convert from onValidateForm() to onValidate() ? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: TAP5.3.0 onValidate
On Jun 25, 2011, at 7:12 PM, Taha Tapestry wrote: Hi Tony If your form's name is myForm then You should call onValidateFromMyForm(). If you do not append FromMyForm then the method onValidate will be called for each form field as well as for the form itself. Other alternative is to name the method anything else and annotate with @OnEvent annotation and specify the event source Thank you very much. I'm just getting back into Tapestry (I have used 3 4) and I'm having a little trouble with the event model. So in 5.3.0 if I have a text field called userName, I could provide and onValidateFromUserName to provide validation for that field and onValidateFromMyForm to do multi field and other business rule (ie, unique column) rules I'm sure there is a value to calling onValidate() for each field, but I'm certainly struggling to imagine a use case. Thanks again. Tony Regards Taha On Jun 26, 2011, at 2:59 AM, Tony Nelson tnel...@starpoint.com wrote: I saw in the release notes that onValidateForm has been replaced by onValidate. Should it be called 2x on form post? [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onPrepare() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onPrepare [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onValidate() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onValidate [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onValidate() [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ EXIT] onValidate [1106760625@qtp-1806030550-8] DEBUG com.starpoint.helpdesk.pages.group.EditGroup - [ENTER] onSuccess() Previously I used the onValidateForm method to save my business objects and onSuccess() to redirect to the next page. What strategy should be used to convert from onValidateForm() to onValidate() ? - 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: T5 Reference page attributes from a component
On Jun 23, 2011, at 6:27 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 23 Jun 2011 18:18:39 -0300, Tony Nelson tnel...@starpoint.com wrote: In our T4 app we made a lot of use of this type of construct: parameter name=selectedColumn default-value=ognl:page.selectedColumn / This particular component is embedded 4 layers deep and was able to reach back all the way to Page class to get values. Is there a similar construct in T5 No. or am I going to have to pass these values explicitly down the components? Yes. You can also use the Environmental service. Thank you very much for your help. I was able to get my form to display properly using the Environmental Service and adding the following to my base class: void beginRender() { environment.push(SearchParameters.class, getSearchParameters()); } void afterRender() { environment.pop(SearchParameters.class); } However, when I submit the form (from an input type=image) I get the following OperationException: Failure writing parameter 'value' of component emailuser/List:pagedtable.columnsorterdata.hidden: No object of type com.starpoint.querybuilder.SearchParameters is available from the Environment. Available types are org.apache.tapestry5.TrackableComponentEventCallback, org.apache.tapestry5.ValidationTracker, org.apache.tapestry5.internal.BeanValidationContext, org.apache.tapestry5.services.ComponentEventResultProcessor, org.apache.tapestry5.services.FormSupport, org.apache.tapestry5.services.Heartbeat. The fields form search parameters are in my component as: t:hidden value=searchParameters.column encoder=valueEncoderForColumn id=selectedColumn / t:hidden value=searchParameters.sortDirection id=sortDirection / Am I missing something simple again? Thanks again for the help. Tony Nelson - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5 Reference page attributes from a component
In our T4 app we made a lot of use of this type of construct: parameter name=selectedColumn default-value=ognl:page.selectedColumn / This particular component is embedded 4 layers deep and was able to reach back all the way to Page class to get values. Is there a similar construct in T5 or am I going to have to pass these values explicitly down the components? Thanks Tony - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
onPrepare(Integer id)
I'm trying to create a simple form that will work for both Add and Edit. I'm trying to use onPrepare to setup the database object and the code works fine for an existing object. When I try to use the form with a new object (id = null) it appears that onPrepare isn't called, so I end up with null pointer exceptions trying to build the form. Here is my simple controller: package com.starpoint.helpdesk.pages.office; import com.starpoint.helpdesk.business.OfficeLogic; import com.starpoint.helpdesk.domain.Office; import com.sun.istack.internal.Nullable; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import org.slf4j.Logger; /** */ public class EditOffice { @Inject private Logger logger; @Inject private OfficeLogic officeLogic; @Persist private Integer officeId; @Property private Office office; public Integer getOfficeId() { return officeId; } @Log public void setOfficeId(@Nullable Integer officeId) { this.officeId = officeId; } @Log void onPrepare(Integer officeId) { if (office == null) { office = officeId == null ? new Office() : officeLogic.getOffice(officeId); } } void onActivate(Integer officeId) { this.officeId = officeId; } Integer onPassivate() { return officeId; } public Object onSuccess() { logger.info(**: + office.toString()); return this; } } And my form: html t:type=layout title=helpdesk Index t:sidebarTitle=Current Time xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter t:form t:id=editOfficeForm t:context=officeId t:errors/ table tr tdt:label for=officeNameOffice Name/t:label/td tdt:textfield t:id=officeName value=prop:office.officeName/t:textfield/td /tr tr td colspan=2 t:submit t:id=saveOffice class=buttonSave Office/t:submit /td /tr /table /t:form /html What am I missing? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry Hibernate Sessions
Hi all, I'm in the process of rebuilding an app that was done in Tap3 (indeed!) in Tap5. It's a small app, maybe a dozen pages used by my internal staff. This is in preparation for rebuilding the entire front of a much larger app. But that's a story for another day. Because I want to learn all the new Tap5 goodness, I started with an new project built w/ the maven archetype. I copied over my DB classes and added the Spring dependencies I needed, and wrote a test case to make sure I could read and write from my dev (h2) database. Then I created a very small page that displays a few rows from the DB in a table. The service method is trivial: @Log public ListOffice getOffices() { return officeDao.getAllOffices(); } I fired up Jetty, and opened the page. I really expected to get an exception saying that I don't have a database session because I purposely did not include the OpenSessionInView filter that I'm familiar with. In addition I didn't include the tapestry-hibernate jars because I'm not sure if it's better to have Tap of Spring handle opening and closing the sessions. I was very surprised when the page actually rendered a result from the database. I'm still not clear where the session is coming from, but that is actually my problem. I can reload my tiny test page 8 times. On the 9th time, I see: [582385532@qtp-918884489-5] DEBUG com.starpoint.helpdesk.pages.Offices - [ENTER] getOffices() And the browser spins. I can open the H2 DB in the H2 admin console and issue queries against it, so the H2 instance is fine. Obviously I'm either out of sessions or connection pool slots. My goal is to be able to use the Spring @Transactional annotation because in the larger app rewrite I have several dozen business layer Spring managed beans that depend on it. I have tried adding Springs OpenSessionInViewFilter, and I've tried adding a dependency on tapestry-hibernate-core. Neither of these solutions have helped. Can anyone offer any suggestions as to where the session is actually coming from so that I can try to figure out how to get the session closed or released? I have Spring configured like this: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd; default-autowire=byName bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value=${dataSource.driverClass} / property name=username value=${dataSource.user} / property name=password value=${dataSource.password} / property name=url value=${dataSource.jdbcURL} / /bean !-- Hibernate session factory -- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean property name=dataSource ref=dataSource/ property name=configLocation value=classpath:/hibernate.cfg.xml/ /bean !-- Hibernate transaction manager -- bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref=sessionFactory/ /bean context:component-scan base-package=com.starpoint.helpdesk.dao / context:annotation-config/ /beans and my web.xml is simply: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameStarpoint Help Desk Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuecom.starpoint.helpdesk/param-value /context-param context-param param-namecontextConfigLocation/param-name param-valueclasspath:/applicationContext.xml/param-value /context-param filter filter-nameapp/filter-name filter-classorg.apache.tapestry5.spring.TapestrySpringFilter/filter-class /filter filter-mapping filter-nameapp/filter-name url-pattern/*/url-pattern /filter-mapping /web-app Thanks in advance Tony Nelson Starpoint Solutions - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org