[5.4-beta-2] Two JavaScript Errors - Quick Fixes
Hi all, Through the alphas and now the betas we've been running with custom tapestry-core JARs given two JavaScript issues; one which cripples AjaxFormLoop and the other causing pageinit.js errors and thus interrupting script execution on IE8. These are both super quick fixes and so was wondering if I could ask that they be included in the upcoming beta-3? Both on the JIRA; https://issues.apache.org/jira/browse/TAP5-2230?filter=-2 https://issues.apache.org/jira/browse/TAP5-2272?filter=-2 Thanks again for the awesome framework! Peter
Re: [ANN] JumpStart Preview: for Tapestry 5.4
Thanks Geoff! It's pretty cool what you've done! On Tue, Jan 21, 2014 at 12:19 AM, Geoff Callender geoff.callender.jumpst...@gmail.com wrote: JumpStart 7 Preview 3 is now up. http://jumpstart.doublenegative.com.au/jumpstart7/ Forgot to mention that JumpStart 7 also embraces T5.4's new Form error handling (in which Tap doesn't redirect to display form errors) Cheers, Geoff. On 06/01/2014, at 7:43 PM, Geoff Callender wrote: Hi all, There's a new JumpStart demo, built for T5.4. It fully embraces: * Bootstrap. * jQuery. * RequireJS. * JSR-303 Bean Validation. You can use it here: http://jumpstart.doublenegative.com.au/jumpstart7/ I hope you like it. As always, your comments and corrections are encouraged. Cheers, Geoff P.S. I hope to have a final release ready when T5.4 goes final. -- Massimo Lusetti
Re: Any thoughts on Tapestry with PhoneGap?
You're not going to be able to host a tapestry app on the phone since (to my knowledge) you can't run a jvm / servlet container on IOS. I've heard that jetty has been ported to android but you still won't be able to run Tapestry on android since ASM won't work on Dalvik. So, these things taken into account, I think you are left with the phone maknig request / response calls to a remote tapestry app. I guess your choice is to generate the html serverside or to get json responses from tapestry and render the DOM clientside in javascript. Since you've already taken the performance hit of a request / response, I don't see a problem with using tapestry to generate the HTML serverside. I'm slightly biased towards generating markup serverside. I try to avoid javascript where possible which is why I love tapestry. This would mean your app is basically a glorified browser :) If you want to render the dom clientside using javascript then you might want to use tapestry-resteasy to help with the restful backend services
Re: Any thoughts on Tapestry with PhoneGap?
Hi Geoff. Think Apple guys officially don't look too kind on views(full markup, assets) created outside of app. It could mean that look'n feel - and possibly behavior may change after it's been approved as it's controlled from server. You 'may' risk a possible rejection based on that. That said, I know Exfm quite successfully and publicly have gone down similar routes so chances are you could be fine.. http://phonegap.com/blog/2013/04/23/story-behind-exfm/ Just my 2 cents :-) /magnus On Wed, Jan 22, 2014 at 11:29 AM, Lance Java lance.j...@googlemail.comwrote: You're not going to be able to host a tapestry app on the phone since (to my knowledge) you can't run a jvm / servlet container on IOS. I've heard that jetty has been ported to android but you still won't be able to run Tapestry on android since ASM won't work on Dalvik. So, these things taken into account, I think you are left with the phone maknig request / response calls to a remote tapestry app. I guess your choice is to generate the html serverside or to get json responses from tapestry and render the DOM clientside in javascript. Since you've already taken the performance hit of a request / response, I don't see a problem with using tapestry to generate the HTML serverside. I'm slightly biased towards generating markup serverside. I try to avoid javascript where possible which is why I love tapestry. This would mean your app is basically a glorified browser :) If you want to render the dom clientside using javascript then you might want to use tapestry-resteasy to help with the restful backend services
Re: Any thoughts on Tapestry with PhoneGap?
A great blog post. Mott looks like the way forward. I'm going to have to embrace javascript at some stage :(
Re: How do you unit test services with dependent services
I think it would be easy enough to create a TapestryJUnit4ClassRunner which is similar to SpringJUnit4ClassRunner. eg: @RunWith(TapestryJUnit4ClassRunner.class) @Modules({SecurityModule.class, HibernateModule.class, MyTestModule.class}) @ModuleDefs({SpringModuleDef.class}) public class MyIOCTest { public static class MyTestModule { public static Foo buildFoo() { return new FooImmpl(); } } @Inject private Foo foo; public void testFoo() { Assert.assertNotNull(fo.doStuff()); } }
Re: Any thoughts on Tapestry with PhoneGap?
I've written a few iPhone apps and tried PhoneGap for one of them. If you are only targeting iOS then I think it's easier to just write a native app. Objective C with ARC using Xcode is a more polished development environment than HTML5 (not to say Tapestry/Java/HTML5/Eclipse is bad). I would also say Bootstrap works pretty well on a phone and even web apps have access to location services and the camera. If you don't need anything else I'd stick to a real web app. If you are trying to write a cross platform app with a small team PhoneGap might be a good solution, but in my case (team of 1) I choose to just target iOS instead of trying to be cross platform. On Wed, Jan 22, 2014 at 5:23 AM, Lance Java lance.j...@googlemail.comwrote: A great blog post. Mott looks like the way forward. I'm going to have to embrace javascript at some stage :(
Re: How do you unit test services with dependent services
You can use IOCUtilities.addDefaultModules(RegistryBuilder) To scan the classpath for META-INF entries. On 21 Jan 2014 19:47, George Christman gchrist...@cardaddy.com wrote: and that is the easiest way to do it ugh lol On Tue, Jan 21, 2014 at 2:30 PM, Dragan Sahpaski dragan.sahpa...@gmail.comwrote: You have to manually add ALL the tapestry IOC modules you're using (in this case the tapestry-security module org.tynamo.security.services.SecurityModule), because you're starting only the Registry and not the entire webapp. Cheers, Dragan Sahpaski On Tue, Jan 21, 2014 at 8:22 PM, George Christman gchrist...@cardaddy.comwrote: Dmitry, I'm very confused. I use constructor injection in my services which I always thought was the correct way to do it based on the tap docs. I have the following test class where I'm trying to use a service. public class TimeSheetServiceTest { protected static TimeSheetService timeSheetService; @BeforeClass public static void setup() { Registry registry; RegistryBuilder builder = new RegistryBuilder(); builder.add(AppModule.class); registry = builder.build(); registry.performRegistryStartup(); timeSheetService = registry.getService(TimeSheetService.class); } @Test public void testService() { int result = timeSheetService.getHolidayListForPayPeriod(Calendar.getInstance()).size(); System.out.println(result + result); } } TimeSheetService injects another service called UserInfoService userInfo like so, public class TimeSheetServiceImpl implements TimeSheetService { public TimeSheetServiceImpl(UserInfoService userInfo) { this.userInfo = userInfo; } } When I try running my test class, I get the following exception. ?xml version=1.0 encoding=UTF-8? !-- Generated by org.testng.reporters.JUnitReportReporter -- -testsuite errors=0 time=0.000 timestamp=21 Jan 2014 19:18:58 GMT failures=1 tests=1 name=org.domain.etss.services.form.TimeSheetServiceTest hostname=hri185169 !-- org.domain.etss.services.form.TimeSheetServiceTest -- -testcase time=0.000 name=testService classname=org.domain.etss.services.form.TimeSheetServiceTest-failure message=Contribution org.domain.etss.services.AppModule.contributeSecurityConfiguration(Configuration, SecurityFilterChainFactory) (at AppModule.java:312) is for service 'SecurityConfiguration', which does not exist. type=java.lang.IllegalArgumentException ![CDATA[java.lang.IllegalArgumentException: Contribution org.domain.etss.services.AppModule.contributeSecurityConfiguration(Configuration, SecurityFilterChainFactory) (at AppModule.java:312) is for service 'SecurityConfiguration', which does not exist. at org.apache.tapestry5.ioc.internal.RegistryImpl.validateContributeDefs(RegistryImpl.java:236) at org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:200) at org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:170) at org.domain.etss.services.form.TimeSheetServiceTest.setup(TimeSheetServiceTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:551) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) at org.testng.TestRunner.privateRun(TestRunner.java:768) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1188) at org.testng.TestNG.runSuitesLocally(TestNG.java:1113) at org.testng.TestNG.run(TestNG.java:1025) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:72) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:88) at
Re: Any thoughts on Tapestry with PhoneGap?
On Wed, 22 Jan 2014 08:29:11 -0200, Lance Java lance.j...@googlemail.com wrote: javascript where possible which is why I love tapestry. This would mean your app is basically a glorified browser :) Well, isn't PhoneGap/Apache Cordova just a way of writing apps in HTML, JavaScrpipt and CSS, all that actually running in a browser? ;) -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [5.4-beta-2] Two JavaScript Errors - Quick Fixes
On Wed, 22 Jan 2014 06:40:19 -0200, Peter Hvass p.hv...@albourne.com wrote: Hi all, Hi! Through the alphas and now the betas we've been running with custom tapestry-core JARs given two JavaScript issues; one which cripples AjaxFormLoop and the other causing pageinit.js errors and thus interrupting script execution on IE8. These are both super quick fixes and so was wondering if I could ask that they be included in the upcoming beta-3? Both on the JIRA; https://issues.apache.org/jira/browse/TAP5-2230?filter=-2 https://issues.apache.org/jira/browse/TAP5-2272?filter=-2 I'll try to apply the fixes this week. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry Eclipse Plugin on the Eclipse Market Place
Hello all, I saw in the following thread ( http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Loving-the-eclipse-tapestry5-plugin-td5725066.html ) that there was a Tapestry Development Eclipse plugin that was initiated. Also, I would like to share with you that we had the same initiated more than a year ago, the same kind of initiative, and we delivered months ago a stable version of the Webtools for Tapestry plugin (WTT) The source code is available there : https://github.com/awltech/webtools-tapestry. It can also be installed from an Update Site, as described on http://eclipse.worldline.com, and from the Eclipse Marketplace, ( https://marketplace.eclipse.org/content/web-tools-tapestry-wtt) Don't hesitate to give it a try and to come back to me for any information/question. In behalf of the WTT developing team in Worldline by Atos, I would like to thank you all, Maxence
Fwd: Tapestry 5.4-beta-2 quickstart app
Just in from the fixed it myself dep't... It seems by generating the 5.3.7 archetype with maven from the command line changing this 1 system property at the bottom of the pom.xml to tapestry-release-version5.4-beta-2/tapestry-release-version commenting out the following dependency near the top of the pom.xml... !--dependency-- !--groupIdorg.apache.tapestry/groupId-- !--artifactIdtapestry-yuicompressor/artifactId-- !--version${tapestry-release-version}/version-- !--/dependency-- I don't care about compressing assets at this point. So that's fine. adding the slf4j binding dependency of your choice. i picked the log4j one. dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.7.5/version /dependency then you can mvn:run the jetty plugin walla, the 5.4-beta-2 quickstart is up and running. -- Forwarded message -- From: Jon Williams williams.jonat...@gmail.com Date: Sun, Jan 19, 2014 at 2:58 PM Subject: Tapestry 5.4-beta-2 quickstart app To: Tapestry users users@tapestry.apache.org Hi, I want to: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org for *5.4-beta-2* tapestry which, I've found sources for the archetype here: https://repository.apache.org/content/groups/staging/org/apache/tapestry/quickstart/5.4-beta-2/ Is it possible to generate the 5.4-beta-2 archetype simply from the command line, like something similar to the above mentioned mvn command (that only currently works for 5.3.7 Tapestry older)? Sorry if this is a short coming in my maven knowledge and has nothing to do with tapestry. Even so, this seems like knowledge other tapestry users would find useful. thanks Jon
Re: Tapestry Eclipse Plugin on the Eclipse Market Place
On Wed, 22 Jan 2014 07:49:10 -0200, Maxence Vanbesien mva...@gmail.com wrote: Hello all, Hi! Also, I would like to share with you that we had the same initiated more than a year ago, the same kind of initiative, and we delivered months ago a stable version of the Webtools for Tapestry plugin (WTT) Nice! But what are its features? What does it do? I couldn't find any documentation. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry Eclipse Plugin on the Eclipse Market Place
On Wed, 22 Jan 2014 19:08:56 -0200, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Nice! But what are its features? What does it do? I couldn't find any documentation. Ooops, I've found it: http://awltech.github.io/webtools-tapestry/. The link to this URL is a little bit hidden. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: kaptcha component reloading issues with Firefox
So I have discussed the issue with Kaptcha library author and found out that the problem is, in fact, with Tapestry implementation itself. https://code.google.com/p/kaptcha/issues/detail?id=72 Tapestry component uses response.setHeader(Cache-Control) twice, and the second call obviously overrides the first one. Is it going to be fixed? On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko ilya.obsha...@gmail.comwrote: I'm not sure if anyone else has that issue: reloading the zone containing kaptcha component does not trigger image reloading, so the whole thing becomes unusable (because internal CAPTCHA text is already different, but image is not). This affects ONLY Firefox, all the other major browsers are OK. Don't have an idea why (probably Firefox doesn't respect cache control headers because of some reasons). After spending some time to fix it, I've ended up with simple copy-and-paste versions of KaptchaField and KaptchaImage classes with only one small difference in KaptchaImage: boolean beginRender(MarkupWriter writer) { captchaText = producer.createText(); Link link = resources.createEventLink(image, RandomStringUtils.randomAlphanumeric ( 8 ) ); writer.element(img, src, link.toURI(), width, producer.getWidth(), height, producer.getHeight()); resources.renderInformalParameters(writer); writer.end(); return false; } It might be a good idea to fix it in the main branch. -- Ilya Obshadko -- Ilya Obshadko
Re: Any thoughts on Tapestry with PhoneGap?
Thanks to all of you for your thoughts. I went ahead and got my web app running in PhoneGap. For the record, here's what I found.,, My app worked without change! The only piece I had to put into the PhoneGap project was a simple home page with a link to the existing web app. I put a Sign In link on the home page. It requests the SignIn page from the server. Up it came. Magic! So PhoneGap really does act as a glorified browser. I didn't have to re-code my app to be a single web page, and I didn't have to re-architect it into JavaScript client-side making REST calls to the server. It worked without change. However, that leads to the question that Magnus posed in this thread, of whether Apple will look kindly on an app whose behaviour can change after it has been approved...? I'll pick that up in a reply to his post. On 21/01/2014, at 11:50 PM, Geoff Callender wrote: I've previously written a jQueryMobile app served up by Tapestry and found that I had to approach it by writing TML files that were pretty much just a handful of divs as placeholders for JavaScript to fill in. Tapestry handled all the events (AJAX requests) and returned JSON objects full of data for JavaScript to turn into HTML and append to the divs. I didn't get around to trying to handle input but I'd guess t wouldn't be very pleasant. Can anyone tell me whether their PhoneGap experience was similar, or is it possible to make more use of Tapestry rendering? Even better, can it make use of Tapestry form handling? Is there, perhaps, a way with PhoneGap to make use of the full, glorious, Tapestry AJAX experience? Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Any thoughts on Tapestry with PhoneGap?
Excellent point, Magnus. I wonder how Exfm got away with it? My app is actually for use within a business, ie. it's not public, but the users will be very geographically dispersed; so I will look into whether the App Store has more relaxed rules for Enterprise apps. BTW, the tips in the Exfm blog entry are great. Thanks. Geoff On 22/01/2014, at 9:42 PM, Magnus Kvalheim wrote: Hi Geoff. Think Apple guys officially don't look too kind on views(full markup, assets) created outside of app. It could mean that look'n feel - and possibly behavior may change after it's been approved as it's controlled from server. You 'may' risk a possible rejection based on that. That said, I know Exfm quite successfully and publicly have gone down similar routes so chances are you could be fine.. http://phonegap.com/blog/2013/04/23/story-behind-exfm/ Just my 2 cents :-) /magnus On Wed, Jan 22, 2014 at 11:29 AM, Lance Java lance.j...@googlemail.comwrote: You're not going to be able to host a tapestry app on the phone since (to my knowledge) you can't run a jvm / servlet container on IOS. I've heard that jetty has been ported to android but you still won't be able to run Tapestry on android since ASM won't work on Dalvik. So, these things taken into account, I think you are left with the phone maknig request / response calls to a remote tapestry app. I guess your choice is to generate the html serverside or to get json responses from tapestry and render the DOM clientside in javascript. Since you've already taken the performance hit of a request / response, I don't see a problem with using tapestry to generate the HTML serverside. I'm slightly biased towards generating markup serverside. I try to avoid javascript where possible which is why I love tapestry. This would mean your app is basically a glorified browser :) If you want to render the dom clientside using javascript then you might want to use tapestry-resteasy to help with the restful backend services - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
AjaxFormLoop Implementation
Hello, I'm having some difficulties with the AjaxFormLoop component and I'm hoping one of you guys could help me out. For the most part, I've followed the following example http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.htmlhowever, my implementation needs to be slightly different from the example. I need to be able to instantiate a new Person() object and before ever persisting the object be able to add new Phone objects to the arraylist with the ajaxformloop. Once the user finishes inputting the data, then save the changes by submitting the form and commit them all to the database. Now I'm aware you need to use a value encoder to do this, but I'm running into an issue where hibernate is trying to save the phone object before I ever call session.save() which is resulting exceptions. I'm hoping someone can provide me with a little help or an example of how to accomplish this task. Example code div t:type=ajaxformloop t:id=phones source=person.phones value=phone encoder=encoder t:textfield t:id=number value=phone.number/ t:removerowlinkremove/t:removerowlink /div public class Edit { @PageActivationContext @Property private Person person; @Property private Phone phone; @Inject private Session session; public void onPrepare() { if(person == null) { person = new Person(); } } @CommitAfter public Object onSuccess() { session.saveOrUpdate(person); return Index.class; } Object onAddRowFromPhones() { return new Phone(); } @CommitAfter void onRemoveRowFromPhones(Phone phone) { if(phone.getId() != null) { session.delete(phone); } } @SuppressWarnings(unchecked) public ValueEncoder getEncoder() { return new ValueEncoderAccessPoint() { @Override public String toClient(Phone value) { Long id = value.getId(); return id != null ? id.toString() : null; } @Override public Phone toValue(String toValue) { if(toValue != null) { System.out.println(toValue); Long id = Long.parseLong(toValue); phone = session.createCritera(Phone.class, id); } else { person.getPhones().add(phone); phone = new Phone(person); } return phone; } }; } } @Entity public class Person { @Id @GeneratedValue(strategy = GenerationType.auto) @NonVisual private long id; @OneToMany(mappedBy = person, cascade = CascadeType.ALL, orphanRemoval = true) private ListPhone phones; public ListPhone getPhones() { if(phones == null) { phones = new ArrayList(); } return phones; } public void setPhones(ListPhone phones) { this.phones = phones; } } @Entity public class Phone { @Id @GeneratedValue(strategy = GenerationType.auto) @NonVisual private long id; @ManyToOne(optional = false) private Person person; @Column(nullable = true, length = 20) @Width(20) @Validate(required,maxlength=20) private String number; public Phone(Person person) { this.person = person; } //getters and setters } Thanks in advance.
Re: Tapestry Eclipse Plugin on the Eclipse Market Place
Hey, Isn't it sad to waste effort on several eclipse plugins ? I don't know which one is the more advanced plugin but it could be great to merge both into one unique powerful tool for eclipse users. Charles 2014/1/22 Thiago H de Paula Figueiredo thiag...@gmail.com On Wed, 22 Jan 2014 19:08:56 -0200, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Nice! But what are its features? What does it do? I couldn't find any documentation. Ooops, I've found it: http://awltech.github.io/webtools-tapestry/. The link to this URL is a little bit hidden. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry Eclipse Plugin on the Eclipse Market Place
The docs are here: https://github.com/awltech/webtools-tapestry/wiki/_pages On Thu, Jan 23, 2014 at 1:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 22 Jan 2014 19:08:56 -0200, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Nice! But what are its features? What does it do? I couldn't find any documentation. Ooops, I've found it: http://awltech.github.io/webtools-tapestry/. The link to this URL is a little bit hidden. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Dmitry Gusev AnjLab Team http://anjlab.com