Re: Tapestry-Spring and Spring 3.X

2009-07-01 Thread Lubor Gajda
Hi Geoffrey,

I've tried T5.1.0.5 in combination with Spring 3.0.0.M3 and it works fine
for me. The only issue I came across is that T5.1 and Spring 3 are using two
incompatible versions of Antlr library, but injection of spring beans works
fine for me.

Could you please send us more information about your runtime environment
(e.g. list of jars on your classpath, your web.xml configuration, what
application server you are using, etc.)?

Thanks,
Lubor

On Mon, Jun 29, 2009 at 2:48 PM, Geoffrey Wiseman <
geoffrey.wise...@gmail.com> wrote:

> On Mon, Jun 29, 2009 at 9:42 AM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Was it already released? Is it backward-compatible with Spring 1 and 2?
> >
>
> Spring 3.0 is up to Milestone 3.X; I gather a release candidate is due in
> the near future, so it might be a good time to start looking at it if T5.1
> wants to be compatible at the time of release.
>
>  - Geoffrey
> --
> Geoffrey Wiseman
> http://www.geoffreywiseman.ca/
>


T5.1 & Spring 3.0 dependency mismatch

2009-05-03 Thread Lubor Gajda
I just downloaded Spring 3.0 M2 and ran into some strange dependency issues
when I tried to use it together with T5.1. It seems that T5.1 requires Antlr
3.1.1 and  doesn't work with 3.0.1, but Spring 3.0 requires Antlr 3.0.1 and
doesn't work with 3.1.1.

Did anybody else run into this issue? Is there any workaround?

There is of course slight possibility that this will change in Spring 3
final release (RC1 should be available in few weeks). But if not, T5 won't
be compatible with Spring 3.


Re: [T5] .tml files not recognized in IntelliJ

2009-01-22 Thread Lubor Gajda
IntelliJ resource patterns can be defined in Settings/Compiler/Resource
patterns (just add ?*.tml). But I'm not sure if this will work in
combination with Maven (I'm not using it).

On Fri, Jan 23, 2009 at 12:04 AM, manuel aldana  wrote:

> hi,
>
> sorry if I am posting framework-unrelated ide related stuff, but I guess
> you can help more and I am sure some of you are IntelliJ users  and maybe
> have had similar problem.
>
> Unfortunately IntelliJ does not recognize my .tml files in
> src/main/resouces and they aren't copied to output folder. Other resources
> (e.g. properties are copied to output correctly). I looked at setting
> whether I accidently set a filter, but did not find any.
>
> I am using IntelliJ 8.0.1 with maven setup, .tml files are bound to
> XML-type.
>
> --
> manuel aldana
> ald...@gmx.de
> software-engineering blog: http://www.aldana-online.de
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Using javascript onsubmit event on a Tapestry form

2009-01-21 Thread Lubor Gajda
Have you tried prototype Event.observe() function? For instance you could
use something like this:

Event.observe(formId, 'submit', function() {
// your onsubmit actions
});

I'm not sure if this is the best way to do this, but it could work.

On Wed, Jan 21, 2009 at 5:45 PM, Hugo Palma  wrote:

> I'd like to execute some javascript on form submit but it seems that
> Tapestry is setting the onsubmit event of the form for performing client
> side validation so whatever i place on the "onsubmit" attribute gets
> ignored.
>
> Any idea how i can execute some javascript on submit right after the
> Tapestry stuff gets executed ?
> Thanks.
>


Re: How to specify onUnload in ?

2009-01-15 Thread Lubor Gajda
You can observe browser events also by using prototype Event.observe
function. For instance you can use this javascript code in your page:

Event.observe(window, 'unload', function() {
  // your unload actions
});

In this case you don't need direct access to html body element what will
simplify your situation.

On Thu, Jan 15, 2009 at 11:28 AM, tapestryphoto wrote:

> Hi,
>
>
> I have a template component that is used by all my pages.  I'd like to be
> able to specify  for one of those pages. Unfortunately
> it doesn't seem to matter what way I try I cannot get it to work.
>
> I can't include a  in the page because then there will be two such
> tags (Firefox doesn't mind, but IE doesn't recognise the second body tag -
> plus it is poor form anyway).
>
> I can't include onUnload in the template  because it appears to just
> be replaced with a standard  tag when the page is rendered.
>
> I can't use any form of  ...  (which I would have liked to do -
> passing the onUnload string into my template and then choosing a single
>  or parameterised version depending on whether the value was null)
> because  has to match with  and the  tag obviously
> screws this up.
>
> I can't use t:outputRaw to generate my tag because it won't generate
> special characters properly ("<" and ">").
>
>
> I don't recall having these sorts of problems with Tapestry 3 when I used
> it many moons ago.  It seems T5 is really rather limited in this respect.
>
> Is there any way to do what I want? It is rather critical that I can
> perform onUnload.
>
> thanks,
> p.
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Tapestry-IoC: binding service without code, just convention over configuration

2008-11-19 Thread Lubor Gajda
> I'm thinking of not even have that binder.bind() call, automatically
binding services located in packages defined by some convention.

Very interesting idea. This mechanism could be something similar to Spring's
classpath scanning for managed components:

http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-classpath-scanning

It would allow us auto-bind services based on regex, annotation or any
custom strategy with zero additional configuration. We could for instance
use this annotation based strategy:

@Service
public class MyService implements MyServiceImpl {
...
}

And IOC registry would be able during startup automatically detect all
classes with @Service annotation in some specific package and bind them. I
would really like it.

On Wed, Nov 19, 2008 at 7:12 PM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Hi!
>
> I have been wondering about some ways to write even less configuration with
> Tapestry-IoC and yet more convention over configuration.
>
> At first we had:
>
> public static void bind(ServiceBinder binder) {
>binder.bind(Service.class, ServiceImplementation.class);
> }
>
> Then, if ServiceImplementation is in the same package, we can write:
>
> public static void bind(ServiceBinder binder) {
>binder.bind(Service.class);
> }
>
> I'm thinking of not even have that binder.bind() call, automatically
> binding services located in packages defined by some convention. How could I
> implement that? Can we add services to a Registry or use ServiceBinder just
> like we can use add objects to a service distributed configuration? I spent
> some time looking at the Tapestry sources, but I couldn't find an answer.
>
> Another related funcionality I was thinking was to automatically provide
> some well-know service implementations when no one was explicitly
> providaded. Example: suppose we have the convention that every entity class
> must a corresponding controller class. Then I want to provide a default
> controller implementation for it if none is provided, because some
> components and pages expect one controller instance for each entity class.
> How could I do that?
>
> My goal is to to have non-trivial zero configuration (or almost zero
> configuration) applications in Tapestry, provided that they follow the
> conventions.
>
> Thanks in advance. :)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [T5] Something like GORM for Tapestry?

2008-11-07 Thread Lubor Gajda
Otho, don't forget that Grails allows you to use alternative view rendering
technologies on top of GORM. So, maybe you should be looking for some kind
of Tapestry - Grails integration.


On Fri, Nov 7, 2008 at 8:50 AM, Otho <[EMAIL PROTECTED]> wrote:

> That is not the same, since you don't only have the AND operator at hand.
>
> def books = Book.findAllByPublisheddateBetween(lastyear, today)
>
> with lastyear and today being Date instances is also possible and a lot
> more.
>
> Sure it is possible to construct queries from arbitrary length method
> calls.
> But in the above example there would be much to do in analyzing and it
> doesn't help readybility either.
>
> But of course, something like this in Java is probably out of the way.
>
> Maybe something along the lines of
>
> GenericDao bookDao = new GenericDao(Book.class).
>
> List books = dao.findAllBy("publishedDate").between(Date.class,
> lastYear, today);
>
> would be possible.
>
> Regards,
> Otho
>


Re: [T5-IOC] How to detect annotation on service implementation class?

2008-11-06 Thread Lubor Gajda
I've created new JIRA to cover this issue:
https://issues.apache.org/jira/browse/TAP5-335

On Wed, Nov 5, 2008 at 1:23 AM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Em Tue, 04 Nov 2008 20:57:33 -0300, Lubor Gajda <[EMAIL PROTECTED]>
> escreveu:
>
>  The only feasible solutions I can think of are:
>>
>> 1. Modify ServiceDef to hold information about service implementation
>> class.
>>
>
> That's a good solution, IMHO.
>
>  2. Service proxy could inherit all annotations from service implementation
>> class, then we would be able to check annotations directly on service proxy.
>>
>
> That's the best solution, IMHO.
>
>  3. Use annotations on service interface instead of service implementation
>> (this is workaround I'm currently using).
>>
>
> This solution is void when you can't change the service interface.
>
> Do we file a JIRA?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [T5-IOC] How to detect annotation on service implementation class?

2008-11-04 Thread Lubor Gajda
Hi Howard,

Thanks for the prompt answer. My understanding is that service markers are
meant to be used to distinguish between different implementations of the
same service interface and I'm not sure if it would be good idea to mix them
with meta information related directly to application logic. Moreover, there
are few issues with the approach based on service markers:

1. Markers usage is less elegant and user friendly than direct usage of
annotations because instead of this simple form:

@Destination
public class MyServiceImpl implements MyService {
  ...
}

we would have to use something like this:

@Marker(Destination.class)
public class MyServiceImpl implements MyService {
  ...
}

2. With markers we would loose possibility to use annotation attributes and
something like this would not be possible:

@Destination(channel="amf")
public class MyServiceImpl implements MyService {
  ...
}

3. Markers can be used on service classes only, but in some situations it
would be quite handy to be able to detect annotated methods. For instance
I've got in my mind tapestry-quartz integration based on simple declarative
principle where it would be possible to use something like this:

public class MyServiceImpl implements MyService {

  @Scheduled(cronExpression="0/5 * * * * ?")
  public void myMethod() {
...
  }

}

and framework would be able automatically detect all methods annotated by
@Scheduled annotation and register them in scheduler.

Solution based on decorators is also not feasible because services are
decorated only when they are instantiated and I'm looking for some solution
that would allow us to detect annotations without service instantiation.

The only feasible solutions I can think of are:

1. Modify ServiceDef to hold information about service implementation class.


2. Service proxy could inherit all annotations from service implementation
class, then we would be able to check annotations directly on service proxy.

3. Use annotations on service interface instead of service implementation
(this is workaround I'm currently using).

Regards,
Lubor


On Tue, Nov 4, 2008 at 4:48 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

> It would be nice if there was a method on Registry or ObjectLocator:
> List findServicesWithMarker(Class
> annotationClass);
>
> Alternately, adding a way to expose the ServiceDefs for all services (they
> are immutable).  You can collect service interface and marker information
> there.
>
> Also, some kind of post-construction callback would be nice; you could do
> this using a decorator method.
>
>
> On Tue, Nov 4, 2008 at 8:06 AM, Lubor Gajda <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I'm currently working on T5-IOC and BlazeDS integration and I'm looking
> for
> > some simple declarative way how to automatically register application
> > services as BlazeDS destinations.
> >
> > What I want to achieve is to be able to automatically detect all services
> > in
> > T5-IOC registry annotated by my custom @Destination annotation and
> register
> > them using BlazeDS API. To implement this logic I'm using following
> > algorithm:
> >
> > 1. First of all I need to get list of all service definitions available
> in
> > the T5-IOC registry. The only solution how to do this, I've found so far,
> > is
> > to use ServiceActivityScoreboard.getServiceActivity().
> >
> > Is ServiceActivityScoreboard really the only way how to list all services
> > available in T5-IOC registry or is there any better way how to do this?
> >
> > 2. Once I have the list of all available services I need to check
> > annotations on implementation class of each of them. The problem here is
> > that service definition provides information about service interface only
> > and not about service implementation class.
> >
> > Is there any way how to do this and detect if any of service
> > implementations
> > (or any of its methods) is annotated  by some specific annotation
> (without
> > service instantiation)?
> >
> > Thanks,
> > Lubor
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>


[T5-IOC] How to detect annotation on service implementation class?

2008-11-04 Thread Lubor Gajda
Hi,

I'm currently working on T5-IOC and BlazeDS integration and I'm looking for
some simple declarative way how to automatically register application
services as BlazeDS destinations.

What I want to achieve is to be able to automatically detect all services in
T5-IOC registry annotated by my custom @Destination annotation and register
them using BlazeDS API. To implement this logic I'm using following
algorithm:

1. First of all I need to get list of all service definitions available in
the T5-IOC registry. The only solution how to do this, I've found so far, is
to use ServiceActivityScoreboard.getServiceActivity().

Is ServiceActivityScoreboard really the only way how to list all services
available in T5-IOC registry or is there any better way how to do this?

2. Once I have the list of all available services I need to check
annotations on implementation class of each of them. The problem here is
that service definition provides information about service interface only
and not about service implementation class.

Is there any way how to do this and detect if any of service implementations
(or any of its methods) is annotated  by some specific annotation (without
service instantiation)?

Thanks,
Lubor


Re: Tapestry 5 Integration with Spring Web Flow 2?

2008-10-16 Thread Lubor Gajda
I agree that, at the moment, the most important is to concentrate on T5 RC
finalization. However, I think that T5-SWF integration shouldn't be
underestimated because it could be wise marketing move. Spring users
community is much bigger than Tapestry community and for Spring centric
developers and managers is SWF framework of first choice. They usually start
project with decision that service layer will be based on Spring Framework
and application logic flow on SWF. Just then they start looking for the most
suitable web framework (frameworks without SWF integration are usually
skipped). So, if T5-SWF integration existed more developers would give T5 a
try.


On Thu, Oct 16, 2008 at 7:36 AM, Peter Stavrinides <
[EMAIL PROTECTED]> wrote:

> This is an interesting discussion, but I tend to agree with Howard's view
> that Tapestry should be focused towards Tapestry centric applications and
> later on integration with web flow and others... a side note on
> compatibility, Tapestry is such a progressive platform yet it has not been
> tested officially with Java 6? I know it works, as I have been using it for
> over a year now, so why the delay in moving to JDK 6?
>
> cheers
> Peter
> - Original Message -
> From: "Howard Lewis Ship" <[EMAIL PROTECTED]>
> To: "Tapestry users" 
> Sent: Wednesday, 15 October, 2008 8:23:00 PM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: Re: Tapestry 5 Integration with Spring Web Flow 2?
>
> No, actually, Keith Donald and I have discussed this repeatedly, and I
> think it would be a good thing to add in 5.1.  We also have ideas
> about how to make Spring/Tapestry IoC integration better and more
> symmetric.
>
> We're stumbling one one thing, Keith doesn't know much Tapestry and
> sees it as a view technology; he wants SWF to "run the show".  He does
> have a point in terms of legacy apps that want to be implemented
> partly in Struts/JSF/Craptaculous and partly in T5.
>
> I'm more concerned with new projects that are more purely T5 and I
> want T5 to be in the driver's seat; my vision for truly seamless SWF
> integration requires it.
>
> Right now I'm most concerned with getting a stable, useful 5.0 release
> out the door.
>
> On Wed, Oct 15, 2008 at 9:03 AM, John Jimmy Dondapati
> <[EMAIL PROTECTED]> wrote:
> > I got some answers here supporting what Thiago and Geoff ranted about.
> >  http://tapestry.apache.org/tapestry5/tapestry-ioc/
> >
> > Quote :
> >
> > " *The core concept of Tapestry IoC is that the Java language itself is
> the
> > easiest and most succinct way to describe object creation and method
> > invocation. Any approximation in XML is ultimately more verbose and
> > unwieldy. As the
> > examples<
> http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html#injection
> >show,
> > a small amount of Java code and a handful of naming conventions and
> > annotations is far simpler and easier than a big chunk of XML.*
> >
> > *In addition, moving from XML to Java code encourages testing; you can
> unit
> > test the service builder methods of your module builder class, but you
> can't
> > realistically unit test an XML descriptor. "
> > *
> >
> > Looks like the fundamental idea of Tapestry is moving away from xml and
> > putting the IOC into code. I guess, same goes for navigation.
> >
> > So, I guess there will not be a Spring Web Flow integration from Tapestry
> > side unless Spring takes the effort.
> >
> > On Wed, Oct 15, 2008 at 11:54 AM, John Jimmy Dondapati <
> [EMAIL PROTECTED]
> >> wrote:
> >
> >>
> >>
> >> On Wed, Oct 15, 2008 at 9:21 AM, Lubor Gajda <[EMAIL PROTECTED]
> >wrote:
> >>
> >>> > Don't forget you can add new object scopes to Tapestry.
> >>>
> >>> The main problem here is not definition of conversation scope, but
> >>> specification of conversation boundaries (when the conversation should
> >>> start
> >>> and when it should end and release all objects associated with
> >>> conversation
> >>> scope). This mechanism should be as simple and user friendly as
> possible
> >>> (all third party implementations I've seen so far are quite verbose in
> >>> this
> >>> point).
> >>>
> >>> > It doesn't support this feature out-of-the-box, but it was built in
> such
> >>> a
> >>> flexible and intelligent way that this can be added as an add-on
> >>> > package without rewriting Tapestry its

Re: Tapestry 5 Integration with Spring Web Flow 2?

2008-10-15 Thread Lubor Gajda
escriptor. "
> > *
> >
> > Looks like the fundamental idea of Tapestry is moving away from xml and
> > putting the IOC into code. I guess, same goes for navigation.
> >
> > So, I guess there will not be a Spring Web Flow integration from Tapestry
> > side unless Spring takes the effort.
> >
> > On Wed, Oct 15, 2008 at 11:54 AM, John Jimmy Dondapati <
> [EMAIL PROTECTED]
> >> wrote:
> >
> >>
> >>
> >> On Wed, Oct 15, 2008 at 9:21 AM, Lubor Gajda <[EMAIL PROTECTED]
> >wrote:
> >>
> >>> > Don't forget you can add new object scopes to Tapestry.
> >>>
> >>> The main problem here is not definition of conversation scope, but
> >>> specification of conversation boundaries (when the conversation should
> >>> start
> >>> and when it should end and release all objects associated with
> >>> conversation
> >>> scope). This mechanism should be as simple and user friendly as
> possible
> >>> (all third party implementations I've seen so far are quite verbose in
> >>> this
> >>> point).
> >>>
> >>> > It doesn't support this feature out-of-the-box, but it was built in
> such
> >>> a
> >>> flexible and intelligent way that this can be added as an add-on
> >>> > package without rewriting Tapestry itself. You could use page class
> >>> transformations to do that, for example.
> >>>
> >>> I agree that Tapestry is amazingly flexible framework that allows you
> >>> modify
> >>> it's internal behaviour if you need it. However, I also think that
> >>> conversation support is so common requirement (each nontrivial web
> >>> application needs it) that it should be supported out-of-the-box.
> >>>
> >>
> >> Couldnt agree more. In fact thats the other main reason that made us go
> for
> >> JSF + SWF combo apart from the client requirement to specify navigation
> >> outside the code.
> >>
> >>
> >>
> >>>
> >>> On Wed, Oct 15, 2008 at 1:30 PM, Thiago H. de Paula Figueiredo <
> >>> [EMAIL PROTECTED]> wrote:
> >>>
> >>> > Em Wed, 15 Oct 2008 08:51:33 -0300, Lubor Gajda <
> [EMAIL PROTECTED]>
> >>> > escreveu:
> >>> >
> >>> >  Hi Thiago/Geoff,
> >>> >>
> >>> >
> >>> > Hi!
> >>> >
> >>> >  However, when you are using page based approach your flow definition
> is
> >>> >> scattered across whole application
> >>> >> and you have to edit and analyze all those hundreds of pages to
> gather
> >>> all
> >>> >> information pieces, what is much more time consuming and less user
> >>> friendly
> >>> >> approach.
> >>> >>
> >>> >
> >>> > There's always the possibility of writing an analyzer using JavaCC or
> >>> ANTLR
> >>> > or even as a Tapestry service that does what you're describing by
> >>> looking at
> >>> > @InjectPage annotations. It wouldn't be as complete as a SWF
> >>> configuration,
> >>> > but I think it would cover most situations. ;)
> >>> >
> >>> >  Moreover, Spring Web Flow is not only about flow definition. Its
> >>> another
> >>> >> important feature is that it introduces new object scopes that allow
> >>> you
> >>> >> easily share objects between pages in the same flow/conversation.
> How
> >>> >> would you implement this in Tapestry? Would you use ASO objects and
> >>> manually
> >>> >> clean them when flow/conversation ends? Or would you just use
> 'bucket
> >>> >> brigade
> >>> >> pattern' and manually set the object to following page instance?
> Each
> >>> of
> >>> >> these two approaches is less productive and less user friendly than
> >>> >> directly using flow/conversation scope.
> >>> >>
> >>> >
> >>> > I would use an ASO and clean up manually.
> >>> >
> >>> > Don't forget you can add new object scopes to Tapestry. This has been
> >>> done
> >>> > before, even with conversation scope, even not using Seam or SWF:
> >>> >

Re: Tapestry 5 Integration with Spring Web Flow 2?

2008-10-15 Thread Lubor Gajda
> What implementations? Any Tapestry-related one?

For instance in Geoff's JumpStart are some examples how to implement
conversations in Tapestry.


On Wed, Oct 15, 2008 at 2:24 PM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Em Wed, 15 Oct 2008 10:21:39 -0300, Lubor Gajda <[EMAIL PROTECTED]>
> escreveu:
>
>  The main problem here is not definition of conversation scope, but
>> specification of conversation boundaries (when the conversation should
>> start and when it should end and release all objects associated with
>> conversation scope). This mechanism should be as simple and user friendly as
>> possible
>> (all third party implementations I've seen so far are quite verbose in
>> this point).
>>
>
> What implementations? Any Tapestry-related one?
>
>  I agree that Tapestry is amazingly flexible framework that allows you
>> modify it's internal behaviour if you need it.
>>
>
> Not just modify internal behaviour, add new behaviour too. ;)
>
>  However, I also think that
>> conversation support is so common requirement (each nontrivial web
>> application needs it) that it should be supported out-of-the-box.
>>
>
> That's a good point.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Tapestry 5 Integration with Spring Web Flow 2?

2008-10-15 Thread Lubor Gajda
> Don't forget you can add new object scopes to Tapestry.

The main problem here is not definition of conversation scope, but
specification of conversation boundaries (when the conversation should start
and when it should end and release all objects associated with conversation
scope). This mechanism should be as simple and user friendly as possible
(all third party implementations I've seen so far are quite verbose in this
point).

> It doesn't support this feature out-of-the-box, but it was built in such a
flexible and intelligent way that this can be added as an add-on
> package without rewriting Tapestry itself. You could use page class
transformations to do that, for example.

I agree that Tapestry is amazingly flexible framework that allows you modify
it's internal behaviour if you need it. However, I also think that
conversation support is so common requirement (each nontrivial web
application needs it) that it should be supported out-of-the-box.


On Wed, Oct 15, 2008 at 1:30 PM, Thiago H. de Paula Figueiredo <
[EMAIL PROTECTED]> wrote:

> Em Wed, 15 Oct 2008 08:51:33 -0300, Lubor Gajda <[EMAIL PROTECTED]>
> escreveu:
>
>  Hi Thiago/Geoff,
>>
>
> Hi!
>
>  However, when you are using page based approach your flow definition is
>> scattered across whole application
>> and you have to edit and analyze all those hundreds of pages to gather all
>> information pieces, what is much more time consuming and less user friendly
>> approach.
>>
>
> There's always the possibility of writing an analyzer using JavaCC or ANTLR
> or even as a Tapestry service that does what you're describing by looking at
> @InjectPage annotations. It wouldn't be as complete as a SWF configuration,
> but I think it would cover most situations. ;)
>
>  Moreover, Spring Web Flow is not only about flow definition. Its another
>> important feature is that it introduces new object scopes that allow you
>> easily share objects between pages in the same flow/conversation. How
>> would you implement this in Tapestry? Would you use ASO objects and manually
>> clean them when flow/conversation ends? Or would you just use 'bucket
>> brigade
>> pattern' and manually set the object to following page instance? Each of
>> these two approaches is less productive and less user friendly than
>> directly using flow/conversation scope.
>>
>
> I would use an ASO and clean up manually.
>
> Don't forget you can add new object scopes to Tapestry. This has been done
> before, even with conversation scope, even not using Seam or SWF:
> http://www.nabble.com/T5%3A-Persistence-pains-tt17027697.html#a17080018.
>
> Looking at this list archives, some people were trying to integerate Seam
> into Tapestry to provide what you're describing here (conversation scope).
>
>  I completely agree that XML programming is nonsense, but XML flow
>> definition is not the only choice. You can use java based flow definitions
>> or
>> eventually create your own custom flow builders (for instance grails
>> framework uses SWF with groovy based flow builder).
>>
>
> That's nice. I use Spring, but with JavaConfig, so I almost don't have to
> write XML.
>
>  Tapestry is by its concept strictly page based framework and it doesn't
>> support grouping pages to flows/conversations.
>>
>
> It doesn't support this feature out-of-the-box, but it was built in such a
> flexible and intelligent way that this can be added as an add-on package
> without rewriting Tapestry itself. You could use page class transformations
> to do that, for example.
>
>  I think that this would be
>> good opportunity to start discussion in Tapestry community about
>> advantages/disadvantages of flow/conversation concept to clarify if it
>> would  be useful to introduce this concept in future Tapestry releases or
>> not. So, what do you think?
>>
>
> Discussions are always a good thing. :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Tapestry 5 Integration with Spring Web Flow 2?

2008-10-15 Thread Lubor Gajda
Hi Thiago/Geoff,

In my opinion centralized flow definition can be quite useful in some
circumstances, especially in complex applications. Imagine for instance that
you have to analyze/understand application that consists of hundreds of
pages and you are not familiar with the code because it was implemented by
somebody else. If you are using centralized flow definition it's quite easy
because the only thing you have to do is to check your flow definitions and
you immediately get an overview what is going on (what view, action and
decision states you have in the application, what transitions are possible
between those states, how is defined overall application logic flow, how is
defined global exception handling, etc.). However, when you are using page
based approach your flow definition is scattered across whole application
and you have to edit and analyze all those hundreds of pages to gather all
information pieces, what is much more time consuming and less user friendly
approach.

Moreover, Spring Web Flow is not only about flow definition. Its another
important feature is that it introduces new object scopes that allow you
easily share objects between pages in the same flow/conversation. How would
you implement this in Tapestry? Would you use ASO objects and manually clean
them when flow/conversation ends? Or would you just use 'bucket brigade
pattern' and manually set the object to following page instance? Each of
these two approaches is less productive and less user friendly than directly
using flow/conversation scope.

I completely agree that XML programming is nonsense, but XML flow definition
is not the only choice. You can use java based flow definitions or
eventually create your own custom flow builders (for instance grails
framework uses SWF with groovy based flow builder).

Tapestry is by its concept strictly page based framework and it doesn't
support grouping pages to flows/conversations. I think that this would be
good opportunity to start discussion in Tapestry community about
advantages/disadvantages of flow/conversation concept to clarify if it would
be useful to introduce this concept in future Tapestry releases or not. So,
what do you think?

Regards
Lubor


On Wed, Oct 15, 2008 at 11:38 AM, Geoff Callender <
[EMAIL PROTECTED]> wrote:

> Good rant.  I completely agree.
>
>
> On 15/10/2008, at 12:31 PM, Thiago H. de Paula Figueiredo wrote:
>
>  Em Tue, 14 Oct 2008 20:51:10 -0300, John Jimmy Dondapati <
>> [EMAIL PROTECTED]> escreveu:
>>
>>  I am sorry if this has already been asked but is there anyway to
>>> integrate Spring Web Flow 2.x with Tapestry 5.x?
>>>
>>
>> Nabble has a very good archive of this mailing list:
>> http://www.nabble.com/Tapestry---User-f340.html
>>
>>  Reasons :
>>> 1. I like the way SWF organizes the flow outside the code.
>>> 2. please add your own reasons.
>>>
>>
>> 
>> I don't really get why would I like keep the flow outside the code. Flow
>> is application logic, and the best place to write logic, in my humble
>> opinion, is code. Disclaimer: I am a former, very disgruntled Struts user.
>> One of the reasons I have to not use JSF is that faces-config.xml is
>> struts-config.xml (that is a pain) with some tags renamed. I hope XML
>> programming dies quickly.
>> 
>>
>> When learning Tapestry, I strongly suggest you to not try to find how you
>> can map some other framework concept or feature into Tapestry: try to learn
>> its concepts. Think that every page is an ordinary object and that pages can
>> interact with other just like objects interact with other objects.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> Consultor, desenvolvedor e instrutor em Java
>> http://www.arsmachina.com.br/thiago
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: t5: starting a service automatically

2008-10-11 Thread Lubor Gajda
Angelo,

How are you instantiating scheduler in your application? Are you using
tapestry IOC module?

/lubor

On Sat, Oct 11, 2008 at 10:55 AM, Angelo Chen <[EMAIL PROTECTED]>wrote:

>
> Hi Lubor,
>
> Thanks for the quick reply, is the scheduler here Quartz? I can't
> understand
> fully how to use this, any more details? Thanks.
>
> Angelo
>
>
> Lubor Gajda wrote:
> >
> > Hi Angelo,
> >
> > You can try this:
> >
> > public static void
> > contributeRegistryStartup(OrderedConfiguration
> > configuration, final Scheduler scheduler) {
> > configuration.add("SchedulerStartup", new Runnable() {
> >public void run() {
> >scheduler.start()
> >}
> >});
> > }
> >
> > Regards
> > Lubor
> >
> > On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen
> > <[EMAIL PROTECTED]>wrote:
> >
> >>
> >> Hi,
> >>
> >> I have a service that uses Quartz to fire an event every minute, I'd
> like
> >> to
> >> know how to start this service once the application is loaded? thanks.
> >>
> >> Angelo
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931178.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: t5: starting a service automatically

2008-10-11 Thread Lubor Gajda
Hi Angelo,

You can try this:

public static void contributeRegistryStartup(OrderedConfiguration
configuration, final Scheduler scheduler) {
configuration.add("SchedulerStartup", new Runnable() {
   public void run() {
   scheduler.start()
   }
   });
}

Regards
Lubor

On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen <[EMAIL PROTECTED]>wrote:

>
> Hi,
>
> I have a service that uses Quartz to fire an event every minute, I'd like
> to
> know how to start this service once the application is loaded? thanks.
>
> Angelo
> --
> View this message in context:
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: AW: T5: ApplicationStateObject is misleading

2008-09-17 Thread Lubor Gajda
By my original post I didn't want to say that current implementation of ASO
objects and persistent page properties is illogical or utterly wrong. I
understand that it has its internal logic and historical genesis. I just
wanted to point out few issues I came across when I was implementing
Tapestry & Spring Web Flow integration.

It's probably not a big deal in default Tapestry implementation where we
have only two scopes, session (ASO) and page/flash (Persist). However, when
you try to integrate Tapestry with something like SWF, which introduces
plethora of additional scopes, you will very soon find this mechanism too
inflexible and confusing.

>From users perspective it should be absolutely transparent what scope is
used to determine life-cycle of scoped object and users shouldn't waste
development time to meditate on what annotation should be used for a page
property (ApplicationState, Persist or something else?). They should
automatically choose simple generic strategy and framework should take care
of the rest.

I think that main historical reason, why we have this framework specific
terminology, is that in previous versions of Tapestry there was some
intention to absolutely shield users from underlying servlet API and related
terminology was replaced by Tapestry specific (session objects were replaced
by Visit objects, page scoped objects by persisted objects, etc.). There is
nothing wrong with this approach but we have to face the fact that majority
of Java developers is more familiar with terms such as session,
conversation, flash scope than with ApplicationState and Persist. Try for
instance to show following two code snippets to non-tapestry java
developers:

@ApplicationState
private User user;

@Scope(SESSION)
private User user;

Which one do you think will be more confusing for them?

Regards
Lubor


On Wed, Sep 17, 2008 at 6:30 PM, Jonathan Barker <
[EMAIL PROTECTED]> wrote:

>
> There is some logic to what is proposed by Geoff, so it at least merits
> consideration and exploration.
>
> I could see problems arising in the area of uniqueness. We know there's
> only
> one ASO of a specific class in a T5 app.  That's a nice simplification. It
> gets fuzzy moving to conversations, and blurry moving to pages.  I
> routinely
> persist more than one of a given class of object on a page, and definitely
> don't want to be restricted across pages.
>
> Are we creating a new set of headaches for the sake of naming consistency?
>
> Geoff: Perhaps I don't find ASO misleading because I started with T3, so
> it's just the evolution of the Visit object.
>
> Jonathan
>
>
> > -Original Message-
> > From: Filip S. Adamsen [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, September 17, 2008 12:20
> > To: Tapestry users
> > Subject: Re: AW: T5: ApplicationStateObject is misleading
> >
> > There are still dozens of Tapestry services that will need to be
> > changed/rewritten, though. I'm not against this, just saying it's a huge
> > change at this point - the way I see it, anyway.
> >
> > -Filip
> >
> > On 2008-09-17 18:12, Hilco Wijbenga wrote:
> > > On Wed, Sep 17, 2008 at 09:03, Filip S. Adamsen <[EMAIL PROTECTED]>
> wrote:
> > >> @Scope does, indeed, make more sense than @Persist and
> > >> @ApplicationStateObject. I wouldn't mind that change, but is it
> > feasible at
> > >> this point in Tapestry 5's development cycle?
> > >
> > > Sure, just deprecate @Persist and @ApplicationStateObject and
> > > introduce @Scope as their replacement. All old code will still work
> > > and new code can use @Scope. (It's even relatively easy to automate
> > > [i.e. script] the move from the old code to the new.)
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to call service during startup?

2008-05-30 Thread Lubor Gajda
Hi,

Just inject your service to the 'contributeRegistryStartup' method as final
parameter and directly use in Runnable inner class. For instance:

public static void contributeRegistryStartup(OrderedConfiguration
configuration, final Scheduler scheduler) {
   configuration.add("SchedulerStartup", new Runnable() {
   public void run() {
   scheduler.start()
   }
   });
}

Regards,
Lubor


On Fri, May 30, 2008 at 2:11 PM, 9902468 <[EMAIL PROTECTED]> wrote:

>
> Hi!
>
> My parameter service needs to connect to database, inspect that all
> parameters are inplace, and if there are missing (new) parameters I have to
> create them and assign default values. This should occur every time that
> the
> application is started.
>
> How do I do it? I read the IoC Registry startup, but I don't know how to
> inject services to the Runnable. I have following code that is working in
> my
> Tapestry Module:
>
> static Log log = LogFactory.getLog(EblanketterModule.class);
>
>public static void
> contributeRegistryStartup(OrderedConfiguration configuration) {
>configuration.add("InitializeDatabaseParams", new Runnable() {
>
>public void run(){
>
>
>
>log.info("At startup");
>}
>
>});
>}
> --
> View this message in context:
> http://www.nabble.com/How-to-call-service-during-startup--tp17558546p17558546.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>