Re: [T5.2] Constructor issue
Hi, Am Dienstag, den 05.10.2010, 09:22 -0700 schrieb Howard Lewis Ship: > Remember that you can place @Inject on the constructor that should be > used if there's any ambiguity. I think, this would make a great FAQ entry. I can only speak for myself, but I wasn't aware that this was already possible. I even thought about proposing an annotation for that purpose while reading this thread. Regards, Jochen > On Tue, Oct 5, 2010 at 9:22 AM, Howard Lewis Ship wrote: > > Your are correct and this has been the behavior since at least 5.1. > > > > On Tue, Oct 5, 2010 at 9:21 AM, Josh Canfield > > wrote: > >>> > >>> BeanEditor (used internally for BeanEditForm) uses the no-args constructor > >>> if it exists. I apologize for not making this distinction clear. > >>> > >> > >> I'm looking at the 5.2 source and BeanEditor uses the BeanModel to get > >> the instance, calls "newInstance()" which also uses the > >> ObjectLocator.autobuild > >> > >> On Tue, Oct 5, 2010 at 8:32 AM, Thiago H. de Paula Figueiredo > >> wrote: > >>> On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca > >>> wrote: > >>> > I must disagree. > But first to clarify. I described two cases. > 1. BeanEditForm that cannot instantiate my object > >>> > >>> BeanEditor (used internally for BeanEditForm) uses the no-args constructor > >>> if it exists. I apologize for not making this distinction clear. > >>> > 2. Same issue for SSO creating java.util.Date > >>> > >>> ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct > >>> instances. > >>> > Ad 2. > Quote from linked documentation: > "The first time you access an SSO, it is created automatically. > Typically, > the SSO will have a public no-args constructor ... but you may inject > dependencies into the SSO via its constructor, as you can with a Tapestry > IoC service implementation." > In this case I wanted to use Date. Maybe not some real case scenario, so > let's think about shoping basket for example. It may have default no args > for T5 and second one if I want to instantiate it with some products. If > T5 always takes constructor with most arguments it will fail on that > scenario > also, meaning that I will have to check boolean variable companion exist > on every page on which I wan't to use my object. > >>> > >>> In this case, use @SessionState(create = false) so the field is null when > >>> it's not in the session. and you don't need to declare a boolean variable. > >>> > >>> -- > >>> 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 > >>> > >>> > >> > >> > >> > >> -- > >> -- > >> http://www.bodylabgym.com - a private, by appointment only, one-on-one > >> health and fitness facility. > >> -- > >> http://www.ectransition.com - Quality Electronic Cigarettes at a > >> reasonable price! > >> -- > >> TheDailyTube.com. Sign up and get the best new videos on the internet > >> delivered fresh to your inbox. > >> > >> - > >> 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
Re: [T5.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
Back home 15 minutes ago, couldn't wait to try this and you are correct Howard. A jar I'm using needs commons-lang to operate. Thank you all for your time..and pardon me for such a silly mistake :) On Tue, Oct 5, 2010 at 4:55 PM, Howard Lewis Ship wrote: > Tapestry doesn't use commons-lang, but some code in your application > apparently does. > > On Tue, Oct 5, 2010 at 5:41 AM, Muhammad Mohsen > wrote: > > Thanks a lot. I think Haward is correct but I can't confirm as I have no > > access to that code at the moment. I'll make sure to get back to you > about > > that :) > > It's the "*commons-lang-2.1.jar*" that is mussing from the class path. I > > thought that this is the exception thrown. Not that its not actually a > > ClassNotFoundException. It's just because it's called "NestableRuntime* > > Exception*" I thought that this is the exception ! > > > > Which brings one more thing. What are the basic jars needed for tapestry > to > > operate ? > > And another question please (but this may change the scope of this thread > > i'm afraid) why doesn't eclipse copy all included libraries in my > project's > > class path to my lib folder *web-inf\lib* automatically !? > > > > Thanks again :) > > > > On Tue, Oct 5, 2010 at 9:40 AM, Howard Lewis Ship > wrote: > > > >> You'll find more information in the console log, but from the little > >> bit you've shown me, it looks like your classpath is missing a > >> referenced library, the one that provided class > >> NestableRuntimeException. > >> > >> On Tue, Oct 5, 2010 at 12:17 AM, Muhammad Mohsen > >> wrote: > >> > Thanks for the advice you are totally correct. > >> > > >> > But this error also occurs on jetty. > >> > > >> > I made a mistake putting GAE in the subject. The error actually > happens > >> on > >> > both GAE and local jetty. I took my development locally to speed up > the > >> > development process. > >> > > >> > Thank you for your time. > >> > > >> > On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < > >> > thiag...@gmail.com> wrote: > >> > > >> >> On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen < > >> m.gelb...@gmail.com> > >> >> wrote: > >> >> > >> >> Hi All, > >> >>> > >> >> > >> >> Hi! > >> >> > >> >> I strongly suggest you to try to make your application work on Jetty > or > >> >> Tomcat first, specially if you're still learning Tapestry, and after > >> that > >> >> try the GAE, as it is a different environment. > >> >> > >> >> -- > >> >> 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 > >> >> > >> >> > >> > > >> > > >> > -- > >> > Muhammad Mohsen Hussien > >> > Jr. Java Software Engineer > >> > > >> > >> > >> > >> -- > >> 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 > >> > >> > > > > > > -- > > Muhammad Mohsen Hussien > > Jr. Java Software Engineer > > > > > > -- > 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 > > -- Muhammad Mohsen Hussien Jr. Java Software Engineer
Re: Injecting Tapestry Services into Spring beans
Ok please ignore that it was just me being stupid. I got it working now. Thanks. --- On Tue, 10/5/10, Jeshurun Daniel wrote: From: Jeshurun Daniel Subject: Injecting Tapestry Services into Spring beans To: "Tapestry users" Received: Tuesday, October 5, 2010, 1:25 PM Would someone please enlighten me on how to achieve this? Tapestry 5.1 release notes state that "Tapestry Services can now be injected into Spring Beans, when using the Tapestry/Spring integration library." Integration of spring beans into tapestry pages works fine, but injecting Tapestry services into spring beans only gives me a null object. I read a mailing list thread where one user had succeeded in this by using Spring's and then @autowired on the beans, but when I tried this I got errors "No service implements the interface org.apache.tapestry5.services.Session" or any other service I'm trying to inject I have not enabled legacy mode in my web.xml. Here is my web.xml http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> My App tapestry.app-package ca.my.app contextConfigLocation /WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml /WEB-INF/securityContext.xml HibernateFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter sessionFactoryBeanName assessmentSessionFactory HibernateFilter /* app org.apache.tapestry5.spring.TapestrySpringFilter app /* FORWARD REQUEST I would really appreciate if someone could give me a heads up on where my problem might be. Thanks.
RE: [T5.2] Constructor issue
I thought you should annotate the constructor you want the BEF to use with: @Inject ... to let Tap know which constructor to use. Regards, Jim. -Original Message- From: Michal Gruca [mailto:michalgr...@gmail.com] Sent: 05 October 2010 14:09 To: users@tapestry.apache.org Subject: [T5.2] Constructor issue Hi all. While preparing small showcase app, odd problem came out. When I created domain object with two constructors (first was default NOOP, second one had two parameters string and enum, it was meant for manual initialization only) and tried to use it with beaneditform I received exception that tapestry cannot handle my object creation. After removing parametrized constructor, error disappeared. It's bit odd IMHO. Tapestry should be capable to instantiate objects that have more than one constructor. Also @SessionState behaved weirdly. I was annotating java.util.Date. Error came up if I haven't instantiate object manually. Date has default constructor so Tapestry should be fine with constructing new Date on it's own. Maybe there are some reasons for that kind of behavior, but as I see it those are bugs. Should I create jira ticket for that? Tested on tapestry 5.2.1-snapshot. Link to application sources: https://bitbucket.org/mgruca/tjug_tapestry_30.09.10/downloads (last revision or two were stripped out from additional constructors. Content may be in Polish, but code should be all in En) -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p560 3058.html Sent from the Tapestry Users 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
Injecting Tapestry Services into Spring beans
Would someone please enlighten me on how to achieve this? Tapestry 5.1 release notes state that "Tapestry Services can now be injected into Spring Beans, when using the Tapestry/Spring integration library." Integration of spring beans into tapestry pages works fine, but injecting Tapestry services into spring beans only gives me a null object. I read a mailing list thread where one user had succeeded in this by using Spring's and then @autowired on the beans, but when I tried this I got errors "No service implements the interface org.apache.tapestry5.services.Session" or any other service I'm trying to inject I have not enabled legacy mode in my web.xml. Here is my web.xml http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> My App tapestry.app-package ca.my.app contextConfigLocation /WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml /WEB-INF/securityContext.xml HibernateFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter sessionFactoryBeanName assessmentSessionFactory HibernateFilter /* app org.apache.tapestry5.spring.TapestrySpringFilter app /* FORWARD REQUEST I would really appreciate if someone could give me a heads up on where my problem might be. Thanks.
Re: [T5.2] Principle 1, Static Structure Dynamic Behaviour
Thank you Howard, Thank you Thiago -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-Principle-1-Static-Structure-Dynamic-Behaviour-tp3198357p3199978.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2] Constructor issue
Remember that you can place @Inject on the constructor that should be used if there's any ambiguity. On Tue, Oct 5, 2010 at 9:22 AM, Howard Lewis Ship wrote: > Your are correct and this has been the behavior since at least 5.1. > > On Tue, Oct 5, 2010 at 9:21 AM, Josh Canfield wrote: >>> >>> BeanEditor (used internally for BeanEditForm) uses the no-args constructor >>> if it exists. I apologize for not making this distinction clear. >>> >> >> I'm looking at the 5.2 source and BeanEditor uses the BeanModel to get >> the instance, calls "newInstance()" which also uses the >> ObjectLocator.autobuild >> >> On Tue, Oct 5, 2010 at 8:32 AM, Thiago H. de Paula Figueiredo >> wrote: >>> On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca >>> wrote: >>> I must disagree. But first to clarify. I described two cases. 1. BeanEditForm that cannot instantiate my object >>> >>> BeanEditor (used internally for BeanEditForm) uses the no-args constructor >>> if it exists. I apologize for not making this distinction clear. >>> 2. Same issue for SSO creating java.util.Date >>> >>> ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct >>> instances. >>> Ad 2. Quote from linked documentation: "The first time you access an SSO, it is created automatically. Typically, the SSO will have a public no-args constructor ... but you may inject dependencies into the SSO via its constructor, as you can with a Tapestry IoC service implementation." In this case I wanted to use Date. Maybe not some real case scenario, so let's think about shoping basket for example. It may have default no args for T5 and second one if I want to instantiate it with some products. If T5 always takes constructor with most arguments it will fail on that scenario also, meaning that I will have to check boolean variable companion exist on every page on which I wan't to use my object. >>> >>> In this case, use @SessionState(create = false) so the field is null when >>> it's not in the session. and you don't need to declare a boolean variable. >>> >>> -- >>> 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 >>> >>> >> >> >> >> -- >> -- >> http://www.bodylabgym.com - a private, by appointment only, one-on-one >> health and fitness facility. >> -- >> http://www.ectransition.com - Quality Electronic Cigarettes at a >> reasonable price! >> -- >> TheDailyTube.com. Sign up and get the best new videos on the internet >> delivered fresh to your inbox. >> >> - >> 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 > -- 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
Re: [T5.2] Constructor issue
Your are correct and this has been the behavior since at least 5.1. On Tue, Oct 5, 2010 at 9:21 AM, Josh Canfield wrote: >> >> BeanEditor (used internally for BeanEditForm) uses the no-args constructor >> if it exists. I apologize for not making this distinction clear. >> > > I'm looking at the 5.2 source and BeanEditor uses the BeanModel to get > the instance, calls "newInstance()" which also uses the > ObjectLocator.autobuild > > On Tue, Oct 5, 2010 at 8:32 AM, Thiago H. de Paula Figueiredo > wrote: >> On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca >> wrote: >> >>> I must disagree. >>> But first to clarify. I described two cases. >>> 1. BeanEditForm that cannot instantiate my object >> >> BeanEditor (used internally for BeanEditForm) uses the no-args constructor >> if it exists. I apologize for not making this distinction clear. >> >>> 2. Same issue for SSO creating java.util.Date >> >> ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct >> instances. >> >>> Ad 2. >>> Quote from linked documentation: >>> "The first time you access an SSO, it is created automatically. Typically, >>> the SSO will have a public no-args constructor ... but you may inject >>> dependencies into the SSO via its constructor, as you can with a Tapestry >>> IoC service implementation." >>> In this case I wanted to use Date. Maybe not some real case scenario, so >>> let's think about shoping basket for example. It may have default no args >>> for T5 and second one if I want to instantiate it with some products. If >>> T5 always takes constructor with most arguments it will fail on that >>> scenario >>> also, meaning that I will have to check boolean variable companion exist >>> on every page on which I wan't to use my object. >> >> In this case, use @SessionState(create = false) so the field is null when >> it's not in the session. and you don't need to declare a boolean variable. >> >> -- >> 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 >> >> > > > > -- > -- > http://www.bodylabgym.com - a private, by appointment only, one-on-one > health and fitness facility. > -- > http://www.ectransition.com - Quality Electronic Cigarettes at a > reasonable price! > -- > TheDailyTube.com. Sign up and get the best new videos on the internet > delivered fresh to your inbox. > > - > 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
Re: [T5.2] Constructor issue
> > BeanEditor (used internally for BeanEditForm) uses the no-args constructor > if it exists. I apologize for not making this distinction clear. > I'm looking at the 5.2 source and BeanEditor uses the BeanModel to get the instance, calls "newInstance()" which also uses the ObjectLocator.autobuild On Tue, Oct 5, 2010 at 8:32 AM, Thiago H. de Paula Figueiredo wrote: > On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca > wrote: > >> I must disagree. >> But first to clarify. I described two cases. >> 1. BeanEditForm that cannot instantiate my object > > BeanEditor (used internally for BeanEditForm) uses the no-args constructor > if it exists. I apologize for not making this distinction clear. > >> 2. Same issue for SSO creating java.util.Date > > ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct > instances. > >> Ad 2. >> Quote from linked documentation: >> "The first time you access an SSO, it is created automatically. Typically, >> the SSO will have a public no-args constructor ... but you may inject >> dependencies into the SSO via its constructor, as you can with a Tapestry >> IoC service implementation." >> In this case I wanted to use Date. Maybe not some real case scenario, so >> let's think about shoping basket for example. It may have default no args >> for T5 and second one if I want to instantiate it with some products. If >> T5 always takes constructor with most arguments it will fail on that >> scenario >> also, meaning that I will have to check boolean variable companion exist >> on every page on which I wan't to use my object. > > In this case, use @SessionState(create = false) so the field is null when > it's not in the session. and you don't need to declare a boolean variable. > > -- > 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 > > -- -- http://www.bodylabgym.com - a private, by appointment only, one-on-one health and fitness facility. -- http://www.ectransition.com - Quality Electronic Cigarettes at a reasonable price! -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2] Constructor issue
> "Often, the BeanEditForm can create the object as needed (assuming a public, > no arguments constructor). " I believe the java docs are out of date. The change happened in a dependent class and the docs don't reflect the change. As Thiago said, the current strategy is to try to make the most complete object is built based on the available constructors. This lets you build beans that have access to services via constructor injection (like a service). I think failing to pick the correct constructor is a defect that Tapestry *should* solve. Principle 2 is Adaptive API, which should "adapt to your code". One option is to try them until you get one that works... this could lead to frustration during development if it's not obvious which constructor is getting called... Date has multiple constructors, so this is essentially the same problem. Josh On Tue, Oct 5, 2010 at 8:17 AM, Michal Gruca wrote: > > I must disagree. > But first to clarify. I described two cases. > 1. BeanEditForm that cannot instantiate my object > 2. Same issue for SSO creating java.util.Date > > AD 1. > Quote from BeanEditForm doc: > "Often, the BeanEditForm can create the object as needed (assuming a public, > no arguments constructor). " > So i provided such constructor in my entity (public no agrs) + I added > another one that taken String and custom enum. What I assumed was that T5 > will just use the one that it can use and leave other one alone. Due to that > behavior no object handled to BeanEditForm should have more constructors > than default one, or should be always created manually, and that is bit more > than user need to do. > > Ad 2. > Quote from linked documentation: > "The first time you access an SSO, it is created automatically. Typically, > the SSO will have a public no-args constructor ... but you may inject > dependencies into the SSO via its constructor, as you can with a Tapestry > IoC service implementation." > In this case I wanted to use Date. Maybe not some real case scenario, so > let's think about shoping basket for example. It may have default no args > for T5 and second one if I want to instantiate it with some products. If T5 > always takes constructor with most arguments it will fail on that scenario > also, meaning that I will have to check boolean variable companion exist on > every page on which I wan't to use my object. > IMHO the best would be try to use no-args constructor or use one with most > args and if You fail try another one and another till You succeed (meaning > reach default no-args or error when there is no default no-args > constructor). > > Regards > Michał > -- > View this message in context: > http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p5603560.html > Sent from the Tapestry Users 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 > > -- -- http://www.bodylabgym.com - a private, by appointment only, one-on-one health and fitness facility. -- http://www.ectransition.com - Quality Electronic Cigarettes at a reasonable price! -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 - authenticating page access & contributing a sevice
Hi Thiago, That's tremendous, thanks for the help. R. -Original Message- From: Thiago H. de Paula Figueiredo Reply-to: "Tapestry users" To: Tapestry users Subject: Re: T5.1 - authenticating page access & contributing a sevice Date: Tue, 05 Oct 2010 12:28:41 -0300 On Tue, 05 Oct 2010 12:01:57 -0300, Richard Hill wrote: > Hi All, Hi! > Now my question is two-fold: > > 1) How do I define and contribute a service in tapestry? Using Tapestry IoC: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html. > 2) How does this guy know that the user _is_ authenticated? Should my > service cache logged-in users itself, or can it access the session? Both options sound the same to me. In your RequestFilter (or any other class that isn't a page, component or mixin), use the ApplicationStateManager service to get or set the value of a given class persisted using @SessionState. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2] Constructor issue
On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca wrote: I must disagree. But first to clarify. I described two cases. 1. BeanEditForm that cannot instantiate my object BeanEditor (used internally for BeanEditForm) uses the no-args constructor if it exists. I apologize for not making this distinction clear. 2. Same issue for SSO creating java.util.Date ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct instances. Ad 2. Quote from linked documentation: "The first time you access an SSO, it is created automatically. Typically, the SSO will have a public no-args constructor ... but you may inject dependencies into the SSO via its constructor, as you can with a Tapestry IoC service implementation." In this case I wanted to use Date. Maybe not some real case scenario, so let's think about shoping basket for example. It may have default no args for T5 and second one if I want to instantiate it with some products. If T5 always takes constructor with most arguments it will fail on that scenario also, meaning that I will have to check boolean variable companion exist on every page on which I wan't to use my object. In this case, use @SessionState(create = false) so the field is null when it's not in the session. and you don't need to declare a boolean variable. -- 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: T5.1 - authenticating page access & contributing a sevice
On Tue, 05 Oct 2010 12:01:57 -0300, Richard Hill wrote: Hi All, Hi! Now my question is two-fold: 1) How do I define and contribute a service in tapestry? Using Tapestry IoC: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html. 2) How does this guy know that the user _is_ authenticated? Should my service cache logged-in users itself, or can it access the session? Both options sound the same to me. In your RequestFilter (or any other class that isn't a page, component or mixin), use the ApplicationStateManager service to get or set the value of a given class persisted using @SessionState. -- 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: [T5.2] Constructor issue
I must disagree. But first to clarify. I described two cases. 1. BeanEditForm that cannot instantiate my object 2. Same issue for SSO creating java.util.Date AD 1. Quote from BeanEditForm doc: "Often, the BeanEditForm can create the object as needed (assuming a public, no arguments constructor). " So i provided such constructor in my entity (public no agrs) + I added another one that taken String and custom enum. What I assumed was that T5 will just use the one that it can use and leave other one alone. Due to that behavior no object handled to BeanEditForm should have more constructors than default one, or should be always created manually, and that is bit more than user need to do. Ad 2. Quote from linked documentation: "The first time you access an SSO, it is created automatically. Typically, the SSO will have a public no-args constructor ... but you may inject dependencies into the SSO via its constructor, as you can with a Tapestry IoC service implementation." In this case I wanted to use Date. Maybe not some real case scenario, so let's think about shoping basket for example. It may have default no args for T5 and second one if I want to instantiate it with some products. If T5 always takes constructor with most arguments it will fail on that scenario also, meaning that I will have to check boolean variable companion exist on every page on which I wan't to use my object. IMHO the best would be try to use no-args constructor or use one with most args and if You fail try another one and another till You succeed (meaning reach default no-args or error when there is no default no-args constructor). Regards Michał -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p5603560.html Sent from the Tapestry Users 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
T5.1 - authenticating page access & contributing a sevice
Hi All, I know there has been some discussion on best approaches in tapestry for authenticating access to web pages, so apologies if i have missed the answer to this: Initially I was tempted by the simplest approach - that is just store some "UserState" in the session via @SessionState and check this in onActivate(). However I feel using a "@RequiresLogin" annotation approach is a little more robust. I've been following Howard's tutorial here: http://tapestryjava.blogspot.com/2009/12/securing-tapestry-pages-with.html Now my question is two-fold: 1) How do I define and contribute a service in tapestry? 2) How does this guy know that the user _is_ authenticated? Should my service cache logged-in users itself, or can it access the session? Thanks for help, Richard. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: TapX / YUI / Tap 5.2.0
Thanks Laurent just what I was looking for. Regards, Jim. -Original Message- From: Guerin Laurent [mailto:lgue...@sopragroup.com] Sent: 05 October 2010 10:11 To: Tapestry users Subject: RE: TapX / YUI / Tap 5.2.0 Hi, You can look at the demo page of the tapx-yui component itself : http://github.com/hlship/tapx/blob/692195d119d6beda1b664bcd1e268f0f6944c447/ tapx-yui/src/test/resources/yui/demo/pages/RichTextEditorDemo.tml http://github.com/hlship/tapx/blob/692195d119d6beda1b664bcd1e268f0f6944c447/ tapx-yui/src/test/java/yui/demo/pages/RichTextEditorDemo.java If you want more options, you have to customize it and add some config toolbar options : http://developer.yahoo.com/yui/editor/ Regards, Laurent GUÉRIN -Message d'origine- De : Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk] Envoyé : mardi 5 octobre 2010 10:56 À : 'Tapestry users' Objet : TapX / YUI / Tap 5.2.0 Can anyone point to an online example of using the YUI Editor with Tap 5.2.0 - thanks. Regards, Jim. - 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.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
Tapestry doesn't use commons-lang, but some code in your application apparently does. On Tue, Oct 5, 2010 at 5:41 AM, Muhammad Mohsen wrote: > Thanks a lot. I think Haward is correct but I can't confirm as I have no > access to that code at the moment. I'll make sure to get back to you about > that :) > It's the "*commons-lang-2.1.jar*" that is mussing from the class path. I > thought that this is the exception thrown. Not that its not actually a > ClassNotFoundException. It's just because it's called "NestableRuntime* > Exception*" I thought that this is the exception ! > > Which brings one more thing. What are the basic jars needed for tapestry to > operate ? > And another question please (but this may change the scope of this thread > i'm afraid) why doesn't eclipse copy all included libraries in my project's > class path to my lib folder *web-inf\lib* automatically !? > > Thanks again :) > > On Tue, Oct 5, 2010 at 9:40 AM, Howard Lewis Ship wrote: > >> You'll find more information in the console log, but from the little >> bit you've shown me, it looks like your classpath is missing a >> referenced library, the one that provided class >> NestableRuntimeException. >> >> On Tue, Oct 5, 2010 at 12:17 AM, Muhammad Mohsen >> wrote: >> > Thanks for the advice you are totally correct. >> > >> > But this error also occurs on jetty. >> > >> > I made a mistake putting GAE in the subject. The error actually happens >> on >> > both GAE and local jetty. I took my development locally to speed up the >> > development process. >> > >> > Thank you for your time. >> > >> > On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < >> > thiag...@gmail.com> wrote: >> > >> >> On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen < >> m.gelb...@gmail.com> >> >> wrote: >> >> >> >> Hi All, >> >>> >> >> >> >> Hi! >> >> >> >> I strongly suggest you to try to make your application work on Jetty or >> >> Tomcat first, specially if you're still learning Tapestry, and after >> that >> >> try the GAE, as it is a different environment. >> >> >> >> -- >> >> 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 >> >> >> >> >> > >> > >> > -- >> > Muhammad Mohsen Hussien >> > Jr. Java Software Engineer >> > >> >> >> >> -- >> 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 >> >> > > > -- > Muhammad Mohsen Hussien > Jr. Java Software Engineer > -- 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
Re: [T5.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
On Tue, Oct 5, 2010 at 16:41, Muhammad Mohsen wrote: > Thanks a lot. I think Haward is correct but I can't confirm as I have no > access to that code at the moment. I'll make sure to get back to you about > that :) > It's the "*commons-lang-2.1.jar*" that is mussing from the class path. I > thought that this is the exception thrown. Not that its not actually a > ClassNotFoundException. It's just because it's called "NestableRuntime* > Exception*" I thought that this is the exception ! > > Which brings one more thing. What are the basic jars needed for tapestry to > operate ? > I believe this ones: org.apache.tapestry tapestry-ioc 5.2.0 org.apache.tapestry tapestry5-annotations 5.2.0 org.apache.tapestry tapestry-core 5.2.0 > And another question please (but this may change the scope of this thread > i'm afraid) why doesn't eclipse copy all included libraries in my project's > class path to my lib folder *web-inf\lib* automatically !? > > Because Eclipse is not a packaging tool. (best way) Try to use maven2 for this purpose. (bad way) Or just create "web-inf\lib" folder in your project, put all your jars there and setup project classpath to use these jars. Then you should probably configure output of your source folders so that they compile classes to "web-inf\classes", etc. > Thanks again :) > > On Tue, Oct 5, 2010 at 9:40 AM, Howard Lewis Ship > wrote: > > > You'll find more information in the console log, but from the little > > bit you've shown me, it looks like your classpath is missing a > > referenced library, the one that provided class > > NestableRuntimeException. > > > > On Tue, Oct 5, 2010 at 12:17 AM, Muhammad Mohsen > > wrote: > > > Thanks for the advice you are totally correct. > > > > > > But this error also occurs on jetty. > > > > > > I made a mistake putting GAE in the subject. The error actually happens > > on > > > both GAE and local jetty. I took my development locally to speed up the > > > development process. > > > > > > Thank you for your time. > > > > > > On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < > > > thiag...@gmail.com> wrote: > > > > > >> On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen < > > m.gelb...@gmail.com> > > >> wrote: > > >> > > >> Hi All, > > >>> > > >> > > >> Hi! > > >> > > >> I strongly suggest you to try to make your application work on Jetty > or > > >> Tomcat first, specially if you're still learning Tapestry, and after > > that > > >> try the GAE, as it is a different environment. > > >> > > >> -- > > >> 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 > > >> > > >> > > > > > > > > > -- > > > Muhammad Mohsen Hussien > > > Jr. Java Software Engineer > > > > > > > > > > > -- > > 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 > > > > > > > -- > Muhammad Mohsen Hussien > Jr. Java Software Engineer > -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: [T5.2] Constructor issue
On Tue, 05 Oct 2010 10:09:09 -0300, Michal Gruca wrote: Hi all. Hi! After removing parametrized constructor, error disappeared. It's bit odd IMHO. That's documented behavior: http://tapestry.apache.org/tapestry5.1/guide/appstate.html. This page is for 5.1, but it should be the same for 5.2. Summary: Tapestry uses the same logic for choosing a constructor used by Tapestry IoC. That page shows you how to control the way you classes are instantiated. Tapestry should be capable to instantiate objects that have more than one constructor. The problem here is: which constructor should be used? Tapestry IoC chooses the one with the most parameters. -- 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
[T5.2] Constructor issue
Hi all. While preparing small showcase app, odd problem came out. When I created domain object with two constructors (first was default NOOP, second one had two parameters string and enum, it was meant for manual initialization only) and tried to use it with beaneditform I received exception that tapestry cannot handle my object creation. After removing parametrized constructor, error disappeared. It's bit odd IMHO. Tapestry should be capable to instantiate objects that have more than one constructor. Also @SessionState behaved weirdly. I was annotating java.util.Date. Error came up if I haven't instantiate object manually. Date has default constructor so Tapestry should be fine with constructing new Date on it's own. Maybe there are some reasons for that kind of behavior, but as I see it those are bugs. Should I create jira ticket for that? Tested on tapestry 5.2.1-snapshot. Link to application sources: https://bitbucket.org/mgruca/tjug_tapestry_30.09.10/downloads (last revision or two were stripped out from additional constructors. Content may be in Polish, but code should be all in En) -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p5603058.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: [T5.2] Live class reloading not working with jetty
Using 1.6 entire time. > -Original Message- > From: Christian Köberl [mailto:tapestry.christian.koeb...@gmail.com] > Sent: 05 October 2010 13:29 > To: users@tapestry.apache.org > Subject: Re: [T5.2] Live class reloading not working with jetty > > > Are you using Java 1.5? The classes are not GCed by 1.5 - with 1.6 it > works > for us. > > Cheers, > Chris > -- > View this message in context: http://tapestry- > users.832.n2.nabble.com/T5-2-Live-class-reloading-not-working-with- > jetty-tp5602647p5602934.html > Sent from the Tapestry Users 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
Re: Is there any way to render the "get" method of form?
Here's a mixin, implement activation context and one GET request with the search terms in the context will be done: Search /** * Replace the context of a link with a value from a textfield */ @IncludeJavaScriptLibrary({"context:/js/mixins.js"}) public class LiveLinkContext { @InjectContainer private ClientElement element; @Inject private RenderSupport renderSupport; @Parameter(defaultPrefix="literal") private String linkId; @Parameter(defaultPrefix="literal") private String placeholder; void afterRender() { renderSupport.addScript(String.format("new LiveLinkContext('%s','%s','%s');", element.getClientId(), linkId, placeholder)); } } var LiveLinkContext = Class.create({ initialize : function(textfieldId,linkId,placeholder) { try { this.textfield = $(textfieldId); this.link = $(linkId); this.oldhref = this.link.href; this.regex = new RegExp(placeholder, "g"); Event.observe(this.textfield, 'keyup', this.updateContext.bindAsEventListener(this)); this.updateContext(); } catch (ex) { //log(ex); } }, updateContext : function() { this.link.href = this.oldhref.replace(this.regex, this.textfield.value); } }); -- View this message in context: http://tapestry-users.832.n2.nabble.com/Is-there-any-way-to-render-the-get-method-of-form-tp5449243p5603046.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
Thanks a lot. I think Haward is correct but I can't confirm as I have no access to that code at the moment. I'll make sure to get back to you about that :) It's the "*commons-lang-2.1.jar*" that is mussing from the class path. I thought that this is the exception thrown. Not that its not actually a ClassNotFoundException. It's just because it's called "NestableRuntime* Exception*" I thought that this is the exception ! Which brings one more thing. What are the basic jars needed for tapestry to operate ? And another question please (but this may change the scope of this thread i'm afraid) why doesn't eclipse copy all included libraries in my project's class path to my lib folder *web-inf\lib* automatically !? Thanks again :) On Tue, Oct 5, 2010 at 9:40 AM, Howard Lewis Ship wrote: > You'll find more information in the console log, but from the little > bit you've shown me, it looks like your classpath is missing a > referenced library, the one that provided class > NestableRuntimeException. > > On Tue, Oct 5, 2010 at 12:17 AM, Muhammad Mohsen > wrote: > > Thanks for the advice you are totally correct. > > > > But this error also occurs on jetty. > > > > I made a mistake putting GAE in the subject. The error actually happens > on > > both GAE and local jetty. I took my development locally to speed up the > > development process. > > > > Thank you for your time. > > > > On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < > > thiag...@gmail.com> wrote: > > > >> On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen < > m.gelb...@gmail.com> > >> wrote: > >> > >> Hi All, > >>> > >> > >> Hi! > >> > >> I strongly suggest you to try to make your application work on Jetty or > >> Tomcat first, specially if you're still learning Tapestry, and after > that > >> try the GAE, as it is a different environment. > >> > >> -- > >> 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 > >> > >> > > > > > > -- > > Muhammad Mohsen Hussien > > Jr. Java Software Engineer > > > > > > -- > 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 > > -- Muhammad Mohsen Hussien Jr. Java Software Engineer
Re: [T5.2] Live class reloading not working with jetty
Are you using Java 1.5? The classes are not GCed by 1.5 - with 1.6 it works for us. Cheers, Chris -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-2-Live-class-reloading-not-working-with-jetty-tp5602647p5602934.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2] Principle 1, Static Structure Dynamic Behaviour
My Tapx library includes a component that reads an external template file (as XML) and can render it as part of a Tapestry page, including delegating parts of it to blocks, and processing expansions. Documentation coming (but lower priority than T5.2 docs, so be patient). On Tue, Oct 5, 2010 at 4:18 AM, Thiago H. de Paula Figueiredo wrote: > On Tue, 05 Oct 2010 07:46:22 -0300, iberck wrote: > >> But I have another question? >> From this principle of static structure dynamic behaviour, can I create >> with T5 a CRM based on plugins like drupal/jomla ? > > Yes. I can think of two approaches: > > 1) Override or advise the Tapestry template loading service, so users can > edit templates. > > 2) (Strongly preferred) Use some templating engine like Freemarker to let > the users edit content and Tapestry for anything else. Tapestry templates > were always meant to be used by developers only, not end users, while > Freemarker and similar tools are way more suited for this task. Search the > mailing list for CMS for more discussions about this. > > -- > 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 > > -- 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
Re: Dynamically loading a component
Hi Omar, > I am trying to dynamically load a component which must be determined at > run time Do you need to define the component at runtime, or simply choose the component at runtime? For most cases, and I suspect yours too, all you need to do is choose from a number of existing components, if so then it is possible to do exactly what you require, but with a different approach. If you get your head around how composition works in Tapestry then its not so daunting. Blocks don't need to be defined in any particular order, they can be reused any number of times and precise rendering can be controlled. The solution I used was to create an 'assembly component' that assembles components via a tree, it works great and eliminates all those if / else's. But for any solution consider that somewhere you need to define components, and somehow choose them, whatever approach you use, you can't really escape this, so why not do this all in the same place? If you require recursion then do it in Java and assemble a tree to iterate over in your UI. Its not very much more work, just a different approach that also has the advantage that most of the core logic is done in Java so can be examined with a debugger. If you need more control over rendering then use the HeartBeat Environmental service, though I don't know of many good examples. cheers, Peter - Original Message - From: "Omar Carvajal" To: "Tapestry users" Sent: Tuesday, 5 October, 2010 07:19:27 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Dynamically loading a component This is horrible news since I have no way of knowing the components that needs to be called at design time (other wise I would use a ). There is no magic that can be done to achieve this at all? Even if I have to use the internal services. Thanks for your quick response. Omar On Oct 4, 2010, at 18:41, "Thiago H. de Paula Figueiredo" wrote: > On Mon, 04 Oct 2010 19:35:38 -0300, Omar Carvajal > wrote: > >> Hey all, > > Hi! > >> I am trying to dynamically load a component which must be determined at >> run time, I figured I must use a t:delegate to render the component. >> On the Java side of things I cannot figure out how to instantiate the >> actual component. I saw the @Component annotation with the "type" parameter >> but this does not let me dynamically load a component from a function. >> Does anybody have any idea on how to do this? > > Declare the components inside a . are not rendered unless > you pass it to a Delegate or return it to update a Zone. You cannot > instantiate components in Java code, as Tapestry is static structure, dynamic > behavior (including rendering). Take a look at > http://tapestry.apache.org/tapestry5.1/cookbook/switch.html. It shows you how > to render blocks dynamically, but the same approach can be used for > components as well. You'll use @InjectComponent to get access in your Java > code to the component instances declared in templates. > > -- > 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.2] Live class reloading not working with jetty
What kind of memory settings are you using? This works fine for me (on a Mac of course), but with -Xmx600M ... and you may need to extend permspace as well. Long pauses sound like GC to me ... On Tue, Oct 5, 2010 at 3:52 AM, Blower, Andy wrote: > Since we upgraded to T5.2, live class reloading has not worked correctly, > however if we downgrade it works fine. We're using Jetty kicked off using the > runjettyrun plugin for Eclipse. > > When making just a simple tml change, using the running application again has > a long pause before it does anything, and after a few requests it falls over > out of permgen space. > > All of our developers are experiencing this, and it's a real shame that one > of the major strengths of Tapestry is not working for us anymore. Is there > something I need to change to get live class reloading working with T5.2? > > Thanks, > > Andy > -- 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
Re: [T5.2] Principle 1, Static Structure Dynamic Behaviour
On Tue, 05 Oct 2010 07:46:22 -0300, iberck wrote: But I have another question? From this principle of static structure dynamic behaviour, can I create with T5 a CRM based on plugins like drupal/jomla ? Yes. I can think of two approaches: 1) Override or advise the Tapestry template loading service, so users can edit templates. 2) (Strongly preferred) Use some templating engine like Freemarker to let the users edit content and Tapestry for anything else. Tapestry templates were always meant to be used by developers only, not end users, while Freemarker and similar tools are way more suited for this task. Search the mailing list for CMS for more discussions about this. -- 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: [T5.2] Principle 1, Static Structure Dynamic Behaviour
On Tue, 05 Oct 2010 02:41:18 -0300, iberck wrote: Hi, thank you for the response Hi! So I don't understand the principle 1. What happend if I add a html element in the tree dom and I get the value from the request after submit ? I'm violating the principle? You are not violating the principle. The static structure we're talking about is the page and component instances, not the result of their rendering. Is there a problem if I do that? No problem at all. :) -- 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
[T5.2] Live class reloading not working with jetty
Since we upgraded to T5.2, live class reloading has not worked correctly, however if we downgrade it works fine. We're using Jetty kicked off using the runjettyrun plugin for Eclipse. When making just a simple tml change, using the running application again has a long pause before it does anything, and after a few requests it falls over out of permgen space. All of our developers are experiencing this, and it's a real shame that one of the major strengths of Tapestry is not working for us anymore. Is there something I need to change to get live class reloading working with T5.2? Thanks, Andy
Re: [T5.2] Principle 1, Static Structure Dynamic Behaviour
Thank you all for your answers The concept is more clear for me... But I have another question? >From this principle of static structure dynamic behaviour, can I create with T5 a CRM based on plugins like drupal/jomla ? Thanks in advance -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-Principle-1-Static-Structure-Dynamic-Behaviour-tp3198357p3199239.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Dynamically loading a component
hi omar, this is not as horrible as it sounds ... testing gets a lot easier i have a fairly big T5 application with many modules. within this application i have many master - detail views where the detail view depends on the type of object within the master list and those types can be deployed as needed. ie. if i also deploy my order module my master view might show some order entry and if i dont deploy it it wont show up. if i click on this entry i want to be directed to a order specific page that is defined in another (web) module. therefore i created a service that contains a contribution of pages to the specific detail view which is used to render / create the appropriate links. i also have a BlockService (...Registry) where i can contribute blocks that should be reused in multiple pages and modules. so you always know in advance what you are gonna render. even the possible combinations. for more details take a look at the BeanEditor implementation. g, kris Von:Omar Carvajal An: Tapestry users Datum: 05.10.2010 06:19 Betreff:Re: Dynamically loading a component This is horrible news since I have no way of knowing the components that needs to be called at design time (other wise I would use a ). There is no magic that can be done to achieve this at all? Even if I have to use the internal services. Thanks for your quick response. Omar On Oct 4, 2010, at 18:41, "Thiago H. de Paula Figueiredo" wrote: > On Mon, 04 Oct 2010 19:35:38 -0300, Omar Carvajal wrote: > >> Hey all, > > Hi! > >> I am trying to dynamically load a component which must be determined at >> run time, I figured I must use a t:delegate to render the component. >> On the Java side of things I cannot figure out how to instantiate the >> actual component. I saw the @Component annotation with the "type" parameter but this does not let me dynamically load a component from a function. >> Does anybody have any idea on how to do this? > > Declare the components inside a . are not rendered unless you pass it to a Delegate or return it to update a Zone. You cannot instantiate components in Java code, as Tapestry is static structure, dynamic behavior (including rendering). Take a look at http://tapestry.apache.org/tapestry5.1/cookbook/switch.html. It shows you how to render blocks dynamically, but the same approach can be used for components as well. You'll use @InjectComponent to get access in your Java code to the component instances declared in templates. > > -- > 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: TapX / YUI / Tap 5.2.0
Hi, You can look at the demo page of the tapx-yui component itself : http://github.com/hlship/tapx/blob/692195d119d6beda1b664bcd1e268f0f6944c447/tapx-yui/src/test/resources/yui/demo/pages/RichTextEditorDemo.tml http://github.com/hlship/tapx/blob/692195d119d6beda1b664bcd1e268f0f6944c447/tapx-yui/src/test/java/yui/demo/pages/RichTextEditorDemo.java If you want more options, you have to customize it and add some config toolbar options : http://developer.yahoo.com/yui/editor/ Regards, Laurent GUÉRIN -Message d'origine- De : Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk] Envoyé : mardi 5 octobre 2010 10:56 À : 'Tapestry users' Objet : TapX / YUI / Tap 5.2.0 Can anyone point to an online example of using the YUI Editor with Tap 5.2.0 - thanks. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [t5] Problems with grid in a loop
Problem was due to the static -structure of tapestry. When re-rendering after a pager-link was pressed , the grid-source was always the source of last rendered grid. Solved by decorating Grid so that onInPlaceUpdate() triggers an event handled by the embedding component which thereby ensures that the right "source" is used for re-rendering the grid. I guess that there are better solutions for this, any recommendation appreciated Thanks Peter Hi, On a page i have a grid in a loop. When inPlace="true" clicking on a grids Pager-link always results in displaying the content of the last edited grid on the page, so i`m not able to move through the pages of the grids, and all grids display same information after clicking eachs grid-page-link. I assign unique id`s to each grid in the loop, but a look at the generated html reveals, that the id are assigned to the table of the grid, not to the sourroundig div. Is there a way to use grids in loops while inPlace=true? Thanks Peter - 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.2] Principle 1, Static Structure Dynamic Behaviour
terrific response Thank you very much -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-Principle-1-Static-Structure-Dynamic-Behaviour-tp3198357p3198975.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
You'll find more information in the console log, but from the little bit you've shown me, it looks like your classpath is missing a referenced library, the one that provided class NestableRuntimeException. On Tue, Oct 5, 2010 at 12:17 AM, Muhammad Mohsen wrote: > Thanks for the advice you are totally correct. > > But this error also occurs on jetty. > > I made a mistake putting GAE in the subject. The error actually happens on > both GAE and local jetty. I took my development locally to speed up the > development process. > > Thank you for your time. > > On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < > thiag...@gmail.com> wrote: > >> On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen >> wrote: >> >> Hi All, >>> >> >> Hi! >> >> I strongly suggest you to try to make your application work on Jetty or >> Tomcat first, specially if you're still learning Tapestry, and after that >> try the GAE, as it is a different environment. >> >> -- >> 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 >> >> > > > -- > Muhammad Mohsen Hussien > Jr. Java Software Engineer > -- 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
Re: [T5.2] Principle 1, Static Structure Dynamic Behaviour
Hi Actually, there is no problem if you do that since you generate a valid action URL of your form and use request service to read parameter values. But this is not how Tapestry has been designed, Tapestry is a component oriented framework, not an action oriented framework. Static structure simply means that you cannot create *new* instances of component at runtime. That does not mean that you as a developer can't go beyond this principle and use Request.getParameter() method or even generate plain HTML in dom tree But if you use Tapestry components, you must be aware that even if you put a component inside a loop, the inner component will be 'rendered' n-times but ultimately there is only ONE instance of this component. 2010/10/5 iberck : > > Hi, thank you for the response > > So I don't understand the principle > > 1. What happend if I add a html element in the tree dom and I get the value > from the request after submit ? > I'm violating the principle? > > Is there a problem if I do that? > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/T5-2-Principle-1-Static-Structure-Dynamic-Behaviour-tp3198357p3198857.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 > > -- Regards, Christophe Cordenier. Committer on Apache Tapestry 5 Co-creator of wooki @wookicentral.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.2, Google Application Engine] Can't get a method to be realized (i.e. invoke a method)
Thanks for the advice you are totally correct. But this error also occurs on jetty. I made a mistake putting GAE in the subject. The error actually happens on both GAE and local jetty. I took my development locally to speed up the development process. Thank you for your time. On Tue, Oct 5, 2010 at 12:10 AM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 04 Oct 2010 18:29:26 -0300, Muhammad Mohsen > wrote: > > Hi All, >> > > Hi! > > I strongly suggest you to try to make your application work on Jetty or > Tomcat first, specially if you're still learning Tapestry, and after that > try the GAE, as it is a different environment. > > -- > 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 > > -- Muhammad Mohsen Hussien Jr. Java Software Engineer