Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread IcedDante
Sorry if this question is a bit basic, but I'm having a hard time wrapping my head around a few concepts with IOC and how it works in general and with Tap specifically. Basically, I get held up with simple stuff like creating a new Entity instance for an object (like a Hotel Reservation) that belo

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread antalk
This has not so much to do with IOC as more with settting up your database and business logic and tie them together. If you have a logged in user, i assume you'll have some database record of this user ? Then the user will have a unique key (most likely an id). Now when creating a hotel booking y

Re: Make Report PDF

2012-03-20 Thread Lance Java
I urge anyone considering using XSLT to STOP and take a look at freemarker. Freemarker has excellent support for XML inputs http://freemarker.sourceforge.net/docs/xgui_imperative_learn.html including XPath You can push java objects into the freemarker context including config and helper classes.

Re: Why not setter injection or thread-safe field @Inject?

2012-03-20 Thread Denis Stepanov
Where did you read about fields injection not being thread safe? It's definitely not true. Some developers like to use constructor injection because of better testing etc. personally I'm using mostly field injection. Setter injection is just not implemented, IMHO IOC should support method injec

Re: Dependencies in a parent service, repeated in children constructors

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Mon, 19 Mar 2012 18:47:18 -0300, fmaylinch wrote: Thank you Thiago, :) I think I can also wrap those 3 services inside a "facade" service so there is only one injected service in each child and not 3. But I wonder whether there is a solution with less code repetition and where I can

Re: Why not setter injection or thread-safe field @Inject?

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 06:01:32 -0300, Ferran Maylinch wrote: Hello, Hi! is not thread-safe so constructor injection or build* methods are the recommended ways. I wonder why Tapestry does not allow setter injection and thread-safe @Inject if build* methods are already thread-safe (aren't the

Re: Make Report PDF

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 06:39:49 -0300, Lance Java wrote: I urge anyone considering using XSLT to STOP and take a look at freemarker. I like FreeMarker too. The best standalone templating engine I've used. Way better than Velocity. If I go for a job interview and find out that they use XSL

Re: Make Report PDF

2012-03-20 Thread Chris Mylonas
Mr Diplomatic Thiago...you just poured a bucket of cold water over a nice fresh flame war :) On 20/03/2012, at 10:40 PM, Thiago H. de Paula Figueiredo wrote: > On Tue, 20 Mar 2012 06:39:49 -0300, Lance Java > wrote: > >> I urge anyone considering using XSLT to STOP and take a look at freemar

Re: Make Report PDF

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 08:42:14 -0300, Chris Mylonas wrote: Mr Diplomatic Thiago...you just poured a bucket of cold water over a nice fresh flame war :) Sorry, Lance, my flame war detector failed to detect it in this thread. Sorry for the inconvenience. :P Funny enough, I work for a company

Fwd: Make Report PDF

2012-03-20 Thread Lance Java
> Actually, XSLT makes sense when the source document is XML already. I disagree, both freemarker and XSLT need to parse the XML input into some form of DOM object before applying a transformation to it. Do you agree that XSLT templates are far more verbose than Freemarker templates? > Sorry, La

Re: Fwd: Make Report PDF

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 09:28:39 -0300, Lance Java wrote: Actually, XSLT makes sense when the source document is XML already. I disagree, both freemarker and XSLT need to parse the XML input into some form of DOM object before applying a transformation to it. Do you agree that XSLT templat

Re: Why not setter injection or thread-safe field @Inject?

2012-03-20 Thread fmaylinch
Denis Stepanov-2 wrote > > Where did you read about fields injection not being thread safe? It's > definitely not true. Some developers like to use constructor injection > because of better testing etc. personally I'm using mostly field > injection. > Here: http://tapestry.apache.org/defining-

Fwd: Make Report PDF

2012-03-20 Thread Lance Java
Sorry for the off topic conversation but I can't resist :) > On the other hand, I'm not sure it has support for XPath selectors in the FreeMarker declarative XML processing, which is usually the best approach for more complex XML structures. Freemarker supports XPath selectors... see here http://

Re: Forms require that the request method be POST....

2012-03-20 Thread David Canteros
I forgot to say that I'm using tapestry 5.3.2 running on tomcat 6, and the exceptions happens which users who use Firefox 3... -- David Germán Canteros 2012/3/20 David Canteros > Hi guys! > Lately I detected a lot of this excepti

Re: Fwd: Make Report PDF

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 09:55:43 -0300, Lance Java wrote: Sorry for the off topic conversation but I can't resist :) Me neither . . . And don't forget that I actually like FreeMarker very much. :) On the other hand, I'm not sure it has support for XPath selectors in the FreeMarker decla

Re: Draft version of Light weight TapestryTools GSoC 2012 project prposal

2012-03-20 Thread Gavin Lei
Hi all, In order to reduce users' install difficulty, after discussion with Igor, we decide to supply Eclipse Marketplace support as well as individual update center once this XML editor based lightweight TapestryTools get stable release version. I have updated my project proposal already[1]. Aft

Re: Draft version of Light weight TapestryTools GSoC 2012 project prposal

2012-03-20 Thread Ulrich Stärk
I don't know whether this has come up before or already is in the planning. Something that I'd find useful would be if opening a component class automatically also opened the component template and you'd have something similar to the tabs at the bottom of the XML editor window where you can swit

Re: Draft version of Light weight TapestryTools GSoC 2012 project prposal

2012-03-20 Thread Gavin Lei
Hi Uli, I know what is your mean, you would like a multi-tab editor with both Java class tab and .tml tab. This is a good solution to switch between Tapestry's page/component class file and .tml tempate file. But in my current plan, we would like to supply another solution, it will also supply co

Re: Make Report PDF

2012-03-20 Thread trsvax
I'm always up for a good flame war. I do admit XSLT is an acquired taste. In my particular case things like Freemarker are not versatile enough. My first problem is only part of my project is Java so I need something that does not require Java. For better or worse I can use XSLT in Cobol on a mai

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
Thanks for your help Lance, I'm sure it could work that way. I am a bit suprised that there is no direct solution to this. It's common to have some libraries or default CSS and override them on specific pages / layouts. Making CSS special cases or writing an own MarkupRendererFilter for an issue t

Re: Make Report PDF

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 10:51:05 -0300, trsvax wrote: In my particular case things like Freemarker are not versatile enough. My first problem is only part of my project is Java so I need something that does not require Java. For better or worse I can use XSLT in Cobol on a mainframe. Next I send/re

Re: Define stylesheet import order

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 10:52:11 -0300, Beat Durrer wrote: Thanks for your help Lance, I'm sure it could work that way. I am a bit suprised that there is no direct solution to this. It's common to have some libraries or default CSS and override them on specific pages / layouts. Tapestry already

Re: Why not setter injection or thread-safe field @Inject?

2012-03-20 Thread Denis Stepanov
Calling setAcessible on the same field from different threads is not thread-safe, but it's a special case, don't be affraid to use field injection. Denis Mar 20, 2012 v 1:49 PM, fmaylinch: > > Denis Stepanov-2 wrote >> >> Where did you read about fields injection not being thread safe? It's >

Re: Forms require that the request method be POST....

2012-03-20 Thread Lenny Primak
I am the author of that fix and it definitely works correctly. It strips out the form from the request and redirects it to the page that the client was actually looking for. On Mar 20, 2012, at 9:04 AM, David Canteros wrote: > Hi guys! > Lately I detected a lot of this exception in the logs of my

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
For each component, Tapestry includes the stylesheets and javascript for each making sure to only include each unique file once. I'm not 100% but I guess that the order in which the components appear in the page probably defines the order in which they appear in the page. What would be nice is if

Re: Draft version of Light weight TapestryTools GSoC 2012 project prposal

2012-03-20 Thread Ulrich Stärk
I saw that in your proposal and I'd also keep the shortcut. In fact the shortcut could be used to switch between the tabs. But opening the class and the template in the same window would emphasis that they belong together and in most cases they are also edited together. It's just an additional i

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
I did some tests and the order of the stylesheets is actually reversed to what I expected it to be... Here is an example: Let's say we define a RootLayout, which has all the basics ( tag, meta stuff, the tag). Then we have a SimpleLayout which uses the RootLayout but adds a top navigation to it

Re: Draft version of Light weight TapestryTools GSoC 2012 project prposal

2012-03-20 Thread Gavin Lei
Agree with your point :-) Last year, i built an Eclipse WTP based TapestryTools, i think i have finished much features, it may be powerful and welcome, but it has not many users at last. I am some kind of disappoint. After discuss with Igor, we thought we should change the way, give up much *heav

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
I agree that tapestry could be a bit smarter when components/layouts extend each other. This improvement could be made without adding a priority/order to the @Import annotation. I think this is worthy of a Jira issue. As I mentioned before, adding a priority/order to the @Import annotation could h

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread IcedDante
Right, well I understand that. In fact that is how I would do it traditionally in a J2EE environment but my understanding is that some of this should be done auto-magically with the Tapestry/Hibernate combination. So for example, let's say we have a game application where a User can start a game a

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
Yeah, you're probably right about the priority having it's own issues. I wonder if there is a case, in which the current ordering (reversed to my needs) is actually required? In my opinion the innermost element is the most specific one and therefore should have the last word (and be the last one to

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
I have a hunch that the reverse order that you are seeing is a direct result of tapestry's RenderQueueImpl which iterates tail first. Perhaps you could write a MarkupRendererFilter that gets the "html/head" element and loops through all of the "link" elements calling moveToTop() on each (thus reve

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread Beat Durrer
Since T5 still can't predict the future (pfff!), you need to set the reference to the user yourself :) There are several ways to do this... So, all your CreateGame page needs is the user - right? Then let's add an page activation context: @Property private Game game; private User user; onActivat

Re: Define stylesheet import order

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 13:37:26 -0300, Lance Java wrote: Perhaps you could write a MarkupRendererFilter that gets the "html/head" element and loops through all of the "link" elements calling moveToTop() on each (thus reversing the order). You could do that in a mixin added to the root layout

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread Kalle Korhonen
On Tue, Mar 20, 2012 at 9:44 AM, Beat Durrer wrote: > Since T5 still can't predict the future (pfff!), you need to set the > reference to the user yourself :) > There are several ways to do this... > So, all your CreateGame page needs is the user - right? > Then let's add an page activation contex

Boolean Return Values in Custom Component Events

2012-03-20 Thread Steve Eynon
Hi, I wish to raise an event from a component and abort further processing if true is returned from any event handlers - only I don't know how! ComponentResources.triggerEvent() returns true if *any* event handler was invoked, regardless of what it returns. Passing a ComponentEventCallback doesn