Re: T5: Examples for Cayenne integration?
A little late, and a little less than promised. Rudimentary code is available at: http://code.google.com/p/tapestry5-cayenne/ Note that the code there is based on working application code, but the actual code is currently untested. Maybe I will have a bit of time this weekend to hack on this some more and put together a real release. Robert On Mar 5, 2008, at 3/53:19 PM , Robert Zeigler wrote: I'll do one better a little later today (or possibly tomorrow): I'll clean up my code and package it as a standalone cayenne integration module. Cheers, Robert On Mar 5, 2008, at 3/53:05 PM , Borut Bolčina wrote: +1 good carma if you share points 2 and 3. ;-) Cheers, bob 2008/3/5, David Marko [EMAIL PROTECTED]: Can you share some code example of the integration? Thanks, David Robert Zeigler wrote: Hi Andreas, I'm using T5 + cayenne (2.x) right now. 1: There are a variety of ways you could go about obtaining a data context in your services. 1) You could use the Cayenne-supplied servlet filter and obtain the thread-local copy of the context 2) You could use a RequestFilter to duplicate the functionality of the Cayenne's servlet filter 3) You could write a ContextProvider service, which provides the context. In my case, I did a combination of 2 3. I use a request filter to check associate a data context with a request + current thread, (either on a session-by-session basis or on a request-by-request basis). I also have a ContextProvider service which I inject into other services (by specifying it as a parameter in the service's constructor). Ultimately, my context provider grabs the (thread local) context set by the request filter. 2: I would advocate having a method like: getReadonlyContext() in your context provider service, which would contain your single, app-wide context. Then in your pages and components, you can @Inject your ContextProvider and grab the context. 3: You can contribute ValueEncoders, PrimaryKeyEncoders, etc. into tapestry to handle your data objects. 4: Cayenne handles transactions for you transparently, unless you explicitly handle them yourself. So, in general, you have your form; your form submits; you perform your object manipulations, and then you dataContext.commitChanges(); and all of those object manipulations will be wrapped in a db transaction. Robert On Mar 5, 2008, at 3/56:05 AM , Andreas Pardeike wrote: Hi, I have several T4 projects that use Cayenne successfully but now I would like to start a new project in T5. Though I think I got my head wrapped around the new IoC concept in T5, I still don't see the big picture. Maybe someone can provide me with pointers to examples or simply explain how I would set up the following: - My application *mostly* does data mining, that is, read-only access to a couple of databases - At a few places, I would need to have write access but it's simple and probably does not need transaction management (i.e. allow customers to update their email address) - In my old projects, I have a shopping basket that builds temporary dao objects until the user logs in. At that time, I merge those with the actual dao's from the database - At a single point in the app (submitting the order), I actually need transaction management - I would also love to go with Cayenne 3 and pojo dao's. My questions: 1) How do I provide an DataContext/ObjectContext to my services? Is it as simple as injecting a ContextProvider into the service constructors? 2) Since I don't need transaction management most of the time, can I simply use a global ASO that has a DataContext/ObjectContext which I then use in my page classes if necessary? 3) How do I solve the serialization problem that arises when I submit forms that contain dao's? 4) How do I handle my submit order where I *do* need transaction management? Any help appreciated, Andreas Pardeike - 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] -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15860055.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] - 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: Examples for Cayenne integration?
Hi, I have the same complaints when I started using Tapestry5, a few months later now, I read the online doc of Tapestry5 and I found those documents are complete and informative, far better than most of open source projects, maybe what needed are some getting started ones or some best practice things for certain tasks. A.C. Andreas Pardeike-2 wrote: I do believe that the need for such example(s) is quite high. What hinders T5 most from success is the lack of examples and documentation. I tried the really good hibernate(-annotations) support but it fails to map our legacy iSeries DB2 databases without primary keys and other horrible things. -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15891197.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]
AW: T5: Examples for Cayenne integration?
I think the best way to support Tapestry is a comprehensive single PDF-Document. I know how I started with Spring some years ago. Just a single PDF explaining most things you ever need. Reading it from first page to last page you are a well trained Spring user. 100 pages or so. I loved it. :-) But Spring is quite different. If howard ever goes the extrem to start a Tapestry 5 in Action a stripped down version of 100 pages might have a huge effect on tapestry. ;-) But I am into it, I love it and so in the end we all use it :-) Cheers, Martin (Kerste) -Ursprüngliche Nachricht- Von: Angelo Chen [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 7. März 2008 13:12 An: users@tapestry.apache.org Betreff: Re: T5: Examples for Cayenne integration? Hi, I have the same complaints when I started using Tapestry5, a few months later now, I read the online doc of Tapestry5 and I found those documents are complete and informative, far better than most of open source projects, maybe what needed are some getting started ones or some best practice things for certain tasks. A.C. Andreas Pardeike-2 wrote: I do believe that the need for such example(s) is quite high. What hinders T5 most from success is the lack of examples and documentation. I tried the really good hibernate(-annotations) support but it fails to map our legacy iSeries DB2 databases without primary keys and other horrible things. -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15891197.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Examples for Cayenne integration?
On 7 mar 2008, at 13.11, Angelo Chen wrote: I have the same complaints when I started using Tapestry5, a few months later now, I read the online doc of Tapestry5 and I found those documents are complete and informative, far better than most of open source projects, maybe what needed are some getting started ones or some best practice things for certain tasks. True. Maybe my comment went into the wrong direction. I use the source, the javadocs and all nightly documentation with quite some success. It's as you say, best practice or code snippets for common use cases. Especially those that involve abstract concepts (i.e. persisting dao's in forms) or concepts that are easily done wrong (i.e. are not thread safe). There, a roadmap would actually be sufficient as it gets one started and assures that I as a develop spend time on figuring out the *right* things. I don't need someone to hold my hand when I code a class to an interface. /Andreas Pardeike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Examples for Cayenne integration?
On Mar 7, 2008, at 6:11 AM, Angelo Chen wrote: I read the online doc of Tapestry5 and I found those documents are complete and informative, far better than most of open source projects, maybe what needed are some getting started ones or some best practice things for certain tasks. I agree that most of the T5 documentation is very good -- especially considering it hasn't been released yet. I think a lot of people struggle with very basic things in the beginning. I would highly recommend Alexander Kolesnikov's Tapestry 5 book for someone starting with Tapestry. It really helps smooth out the steepness at the beginning of the learning curve. Another thing that I think would really help with the adoption of Tapestry 5 is some additional maven archetypes. The current archetype is great. You can have a running Tapestry application in a matter of minutes and it gives you a pretty good idea of what you need to get started. However if it were possible to choose a Hibernate/Tapestry or Cayenne/Tapestry archetype, it would make things a lot easier for someone checking things out for the first time. Maybe something along the lines of AppFuse--just enough functionality to get you started and some examples of how to create a login and get things in and out of the database. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Examples for Cayenne integration?
On 5 mar 2008, at 22.19, Robert Zeigler wrote: I'll do one better a little later today (or possibly tomorrow): I'll clean up my code and package it as a standalone cayenne integration module. I do believe that the need for such example(s) is quite high. What hinders T5 most from success is the lack of examples and documentation. I tried the really good hibernate(-annotations) support but it fails to map our legacy iSeries DB2 databases without primary keys and other horrible things. If you toss up some code I could actually take some of my time to put it up in the Tapestry Wiki so everyone can benefit from this. /Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Examples for Cayenne integration?
The problem is not just tapestry, the framework it self deals with it's own area... but what users really need is guide on making applications in tapestry, and that includes knowledge of an ORM. Hibernate is great, but has many caveats, and you can not make a decent application without hibernate or something similar. Davor Hrg On Thu, Mar 6, 2008 at 10:34 AM, Andreas Pardeike [EMAIL PROTECTED] wrote: On 5 mar 2008, at 22.19, Robert Zeigler wrote: I'll do one better a little later today (or possibly tomorrow): I'll clean up my code and package it as a standalone cayenne integration module. I do believe that the need for such example(s) is quite high. What hinders T5 most from success is the lack of examples and documentation. I tried the really good hibernate(-annotations) support but it fails to map our legacy iSeries DB2 databases without primary keys and other horrible things. If you toss up some code I could actually take some of my time to put it up in the Tapestry Wiki so everyone can benefit from this. /Andreas - 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: Examples for Cayenne integration?
Hi Andreas, I'm using T5 + cayenne (2.x) right now. 1: There are a variety of ways you could go about obtaining a data context in your services. 1) You could use the Cayenne-supplied servlet filter and obtain the thread-local copy of the context 2) You could use a RequestFilter to duplicate the functionality of the Cayenne's servlet filter 3) You could write a ContextProvider service, which provides the context. In my case, I did a combination of 2 3. I use a request filter to check associate a data context with a request + current thread, (either on a session-by-session basis or on a request-by-request basis). I also have a ContextProvider service which I inject into other services (by specifying it as a parameter in the service's constructor). Ultimately, my context provider grabs the (thread local) context set by the request filter. 2: I would advocate having a method like: getReadonlyContext() in your context provider service, which would contain your single, app-wide context. Then in your pages and components, you can @Inject your ContextProvider and grab the context. 3: You can contribute ValueEncoders, PrimaryKeyEncoders, etc. into tapestry to handle your data objects. 4: Cayenne handles transactions for you transparently, unless you explicitly handle them yourself. So, in general, you have your form; your form submits; you perform your object manipulations, and then you dataContext.commitChanges(); and all of those object manipulations will be wrapped in a db transaction. Robert On Mar 5, 2008, at 3/56:05 AM , Andreas Pardeike wrote: Hi, I have several T4 projects that use Cayenne successfully but now I would like to start a new project in T5. Though I think I got my head wrapped around the new IoC concept in T5, I still don't see the big picture. Maybe someone can provide me with pointers to examples or simply explain how I would set up the following: - My application *mostly* does data mining, that is, read-only access to a couple of databases - At a few places, I would need to have write access but it's simple and probably does not need transaction management (i.e. allow customers to update their email address) - In my old projects, I have a shopping basket that builds temporary dao objects until the user logs in. At that time, I merge those with the actual dao's from the database - At a single point in the app (submitting the order), I actually need transaction management - I would also love to go with Cayenne 3 and pojo dao's. My questions: 1) How do I provide an DataContext/ObjectContext to my services? Is it as simple as injecting a ContextProvider into the service constructors? 2) Since I don't need transaction management most of the time, can I simply use a global ASO that has a DataContext/ObjectContext which I then use in my page classes if necessary? 3) How do I solve the serialization problem that arises when I submit forms that contain dao's? 4) How do I handle my submit order where I *do* need transaction management? Any help appreciated, Andreas Pardeike - 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: Examples for Cayenne integration?
Can you share some code example of the integration? Thanks, David Robert Zeigler wrote: Hi Andreas, I'm using T5 + cayenne (2.x) right now. 1: There are a variety of ways you could go about obtaining a data context in your services. 1) You could use the Cayenne-supplied servlet filter and obtain the thread-local copy of the context 2) You could use a RequestFilter to duplicate the functionality of the Cayenne's servlet filter 3) You could write a ContextProvider service, which provides the context. In my case, I did a combination of 2 3. I use a request filter to check associate a data context with a request + current thread, (either on a session-by-session basis or on a request-by-request basis). I also have a ContextProvider service which I inject into other services (by specifying it as a parameter in the service's constructor). Ultimately, my context provider grabs the (thread local) context set by the request filter. 2: I would advocate having a method like: getReadonlyContext() in your context provider service, which would contain your single, app-wide context. Then in your pages and components, you can @Inject your ContextProvider and grab the context. 3: You can contribute ValueEncoders, PrimaryKeyEncoders, etc. into tapestry to handle your data objects. 4: Cayenne handles transactions for you transparently, unless you explicitly handle them yourself. So, in general, you have your form; your form submits; you perform your object manipulations, and then you dataContext.commitChanges(); and all of those object manipulations will be wrapped in a db transaction. Robert On Mar 5, 2008, at 3/56:05 AM , Andreas Pardeike wrote: Hi, I have several T4 projects that use Cayenne successfully but now I would like to start a new project in T5. Though I think I got my head wrapped around the new IoC concept in T5, I still don't see the big picture. Maybe someone can provide me with pointers to examples or simply explain how I would set up the following: - My application *mostly* does data mining, that is, read-only access to a couple of databases - At a few places, I would need to have write access but it's simple and probably does not need transaction management (i.e. allow customers to update their email address) - In my old projects, I have a shopping basket that builds temporary dao objects until the user logs in. At that time, I merge those with the actual dao's from the database - At a single point in the app (submitting the order), I actually need transaction management - I would also love to go with Cayenne 3 and pojo dao's. My questions: 1) How do I provide an DataContext/ObjectContext to my services? Is it as simple as injecting a ContextProvider into the service constructors? 2) Since I don't need transaction management most of the time, can I simply use a global ASO that has a DataContext/ObjectContext which I then use in my page classes if necessary? 3) How do I solve the serialization problem that arises when I submit forms that contain dao's? 4) How do I handle my submit order where I *do* need transaction management? Any help appreciated, Andreas Pardeike - 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] -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15860055.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: Examples for Cayenne integration?
+1 good carma if you share points 2 and 3. ;-) Cheers, bob 2008/3/5, David Marko [EMAIL PROTECTED]: Can you share some code example of the integration? Thanks, David Robert Zeigler wrote: Hi Andreas, I'm using T5 + cayenne (2.x) right now. 1: There are a variety of ways you could go about obtaining a data context in your services. 1) You could use the Cayenne-supplied servlet filter and obtain the thread-local copy of the context 2) You could use a RequestFilter to duplicate the functionality of the Cayenne's servlet filter 3) You could write a ContextProvider service, which provides the context. In my case, I did a combination of 2 3. I use a request filter to check associate a data context with a request + current thread, (either on a session-by-session basis or on a request-by-request basis). I also have a ContextProvider service which I inject into other services (by specifying it as a parameter in the service's constructor). Ultimately, my context provider grabs the (thread local) context set by the request filter. 2: I would advocate having a method like: getReadonlyContext() in your context provider service, which would contain your single, app-wide context. Then in your pages and components, you can @Inject your ContextProvider and grab the context. 3: You can contribute ValueEncoders, PrimaryKeyEncoders, etc. into tapestry to handle your data objects. 4: Cayenne handles transactions for you transparently, unless you explicitly handle them yourself. So, in general, you have your form; your form submits; you perform your object manipulations, and then you dataContext.commitChanges(); and all of those object manipulations will be wrapped in a db transaction. Robert On Mar 5, 2008, at 3/56:05 AM , Andreas Pardeike wrote: Hi, I have several T4 projects that use Cayenne successfully but now I would like to start a new project in T5. Though I think I got my head wrapped around the new IoC concept in T5, I still don't see the big picture. Maybe someone can provide me with pointers to examples or simply explain how I would set up the following: - My application *mostly* does data mining, that is, read-only access to a couple of databases - At a few places, I would need to have write access but it's simple and probably does not need transaction management (i.e. allow customers to update their email address) - In my old projects, I have a shopping basket that builds temporary dao objects until the user logs in. At that time, I merge those with the actual dao's from the database - At a single point in the app (submitting the order), I actually need transaction management - I would also love to go with Cayenne 3 and pojo dao's. My questions: 1) How do I provide an DataContext/ObjectContext to my services? Is it as simple as injecting a ContextProvider into the service constructors? 2) Since I don't need transaction management most of the time, can I simply use a global ASO that has a DataContext/ObjectContext which I then use in my page classes if necessary? 3) How do I solve the serialization problem that arises when I submit forms that contain dao's? 4) How do I handle my submit order where I *do* need transaction management? Any help appreciated, Andreas Pardeike - 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] -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15860055.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: Examples for Cayenne integration?
I'll do one better a little later today (or possibly tomorrow): I'll clean up my code and package it as a standalone cayenne integration module. Cheers, Robert On Mar 5, 2008, at 3/53:05 PM , Borut Bolčina wrote: +1 good carma if you share points 2 and 3. ;-) Cheers, bob 2008/3/5, David Marko [EMAIL PROTECTED]: Can you share some code example of the integration? Thanks, David Robert Zeigler wrote: Hi Andreas, I'm using T5 + cayenne (2.x) right now. 1: There are a variety of ways you could go about obtaining a data context in your services. 1) You could use the Cayenne-supplied servlet filter and obtain the thread-local copy of the context 2) You could use a RequestFilter to duplicate the functionality of the Cayenne's servlet filter 3) You could write a ContextProvider service, which provides the context. In my case, I did a combination of 2 3. I use a request filter to check associate a data context with a request + current thread, (either on a session-by-session basis or on a request-by-request basis). I also have a ContextProvider service which I inject into other services (by specifying it as a parameter in the service's constructor). Ultimately, my context provider grabs the (thread local) context set by the request filter. 2: I would advocate having a method like: getReadonlyContext() in your context provider service, which would contain your single, app-wide context. Then in your pages and components, you can @Inject your ContextProvider and grab the context. 3: You can contribute ValueEncoders, PrimaryKeyEncoders, etc. into tapestry to handle your data objects. 4: Cayenne handles transactions for you transparently, unless you explicitly handle them yourself. So, in general, you have your form; your form submits; you perform your object manipulations, and then you dataContext.commitChanges(); and all of those object manipulations will be wrapped in a db transaction. Robert On Mar 5, 2008, at 3/56:05 AM , Andreas Pardeike wrote: Hi, I have several T4 projects that use Cayenne successfully but now I would like to start a new project in T5. Though I think I got my head wrapped around the new IoC concept in T5, I still don't see the big picture. Maybe someone can provide me with pointers to examples or simply explain how I would set up the following: - My application *mostly* does data mining, that is, read-only access to a couple of databases - At a few places, I would need to have write access but it's simple and probably does not need transaction management (i.e. allow customers to update their email address) - In my old projects, I have a shopping basket that builds temporary dao objects until the user logs in. At that time, I merge those with the actual dao's from the database - At a single point in the app (submitting the order), I actually need transaction management - I would also love to go with Cayenne 3 and pojo dao's. My questions: 1) How do I provide an DataContext/ObjectContext to my services? Is it as simple as injecting a ContextProvider into the service constructors? 2) Since I don't need transaction management most of the time, can I simply use a global ASO that has a DataContext/ObjectContext which I then use in my page classes if necessary? 3) How do I solve the serialization problem that arises when I submit forms that contain dao's? 4) How do I handle my submit order where I *do* need transaction management? Any help appreciated, Andreas Pardeike - 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] -- View this message in context: http://www.nabble.com/T5%3A-Examples-for-Cayenne-integration--tp15848762p15860055.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]