tapesty5-cayenne provides features on par with tapestry-jpa and 
tapestry-hibernate.

The really short list, for those in a hurry:

1) You get a ValueEncoder for your cayenne objects for free.
2) You get smarter handling of cayenne objects when creating BeanModels 
(automatic handling of entity relationships; automatic exclusion of various 
"undesirable" super-class properties)
3) Additional goodies that go a long way (in my experience, at least) to 
speeding up the implementation (esp. the prototyping) of Tapestry + Cayenne 
applications.


The long list for the select few who care:

1) No filter configuration required*
2) ValueEncoder implementation provided for you.
3) DI-based access to the ObjectContext (you can @Inject ObjectContextProvider 
into services; you can @Inject ObjectContext directly into pages and components)
4) DataType analyzer (and corresponding components) for handling relationships 
in beaneditor and grid, as well as automatic determination of whether the 
"String" property is a "text" or "longtext" based on the DbEntity metadata. 
5) Cayenne-oriented BeanModelSource that automatically excludes properties from 
the superclass that you typically don't want showing up in grids and 
beaneditors by default. 
6) Some additional annotations so tapestry/cayenne can be smarter about how to 
handle, eg, relationship (for instance, you can @Label a method on a Cayenne 
object, and also @DefaultOrder entities; then when tapestry5-cayenne builds a 
select list of objects for you, you get the label you want for the objects, in 
the order you want them)
7) EntityPersistence (ala tapestry-hibernate): persist only the entity id into 
the session when using @Persist in pages and components
8) @CommitAfter (also modeled on the corresponding annotation for 
tapestry-hibernate/tapestry-jpa)
9) CayenneConstraintGenerator - examines the metadata from the cayenne model 
and uses it to determine validation constraints for entities. Eg: it can tell 
that a property is required based on the database nullability of the property. 
It also picks up on char and varchar limits and uses those to add "maxlength" 
constraints to properties.
10) two additional binding types; "ent" (for object entity) and "ejbql" for 
ejbql queries. These are intended primarily for rapid prototyping of 
applications. When used in conjunction with @Label and @DefaultOrder, you can 
achieve some very nice behavior very quickly. For instance:

User.java:

@DefaultOrder({User.LAST_NAME_PROPERTY, User.FIRST_NAME_PROPERTY})
public class User extends _User {}

<t:grid source="ent:user"/>

Or, if you prefer:
<table t:id="userTable"/>

.java:

@Component(parameters={"source=ent:user"})
private Grid userTable;

Voila. That's it. You now have a grid of user objects, sorted by default by 
lastName, firstName.  The underlying GridDataSource is doing things like 
performing a count query + only pulling out the current page of data from the 
db for you. It also supports multiple grid orderings (at the query level), so 
your grid can be sorted on multiple columns.

I've used tapestry5 + cayenne + tapestry5 cayenne to build a page that let's me 
select the type of object I'm interested in, the display a grid of that object 
type dynamically, including "edit" and "add new" links. Click on edit, get an 
ajax window with an editor for that entry in the row.  Keep in mind... it's 
/one/ page with /one/ grid. And it's /one/ page with /one/ beaneditform. 

The amount of application code required to support that is fairly miniscule 
(although the amount of code in Tapestry5, Cayenne, and tapestry5-cayenne that 
makes that sort of thing possible is substantial!)

Cheers,

Robert

* Version 3.1 of cayenne changed the naming setup of cayenne configuration 
files. Accordingly, you will usually need to contribute one symbol in 
contributeApplicationDefaults for cayenne to be "happy".


On Dec 6, 2011, at 12/610:01 PM , Seamus Minogue wrote:

> So I dont get it. I have used Tapestry/Cayenne in several projects and 
> integration is basically nothing. Just a filter and making sure you drop the 
> xml files into src/main/resources if I remember correctly. I was looking at 
> the project page for tapestry5-cayenne 
> (http://code.google.com/p/tapestry5-cayenne/ & 
> http://t5cayenne.saiwai-solutions.com/tutorial/) and its just not very clear 
> to me exactly what this project buys me. 
> 
> Anyone used this that can point me at what using this gets me?
> 
> -Seamus
> 
> 
> ----- Original Message -----
> From: Hugi Thordarson <[email protected]>
> To: Tapestry users <[email protected]>
> Cc: 
> Sent: Monday, December 5, 2011 7:55 AM
> Subject: Re: Tapestry 5.3 and tapestry5-cayenne
> 
> Hi Dragan.
> Thank you, this will definitely be useful for us.
> 
> Cheers,
> - hugi
> 
> PS: I'm impressed with the helpfulness of the community!
> 
> 
> On 5.12.2011, at 10:41, Dragan Sahpaski wrote:
> 
>> Hi,
>> I haven't used  tapestry5-cayenne, but I'd like to point you to another
>> project that uses Cayenne with tapestry, if you like to browse it and see
>> how cayenne is used in this project.
>> 
>> https://github.com/bobharner/Tapestry-finder
>> 
>> Hope it helps.
>> 
>> Cheers,
>> Dragan Sahpaski
>> 
>> 
>> 
>> On Mon, Dec 5, 2011 at 11:31 AM, Hugi Thordarson <[email protected]> wrote:
>> 
>>> Hi all!
>>> 
>>> First time Tapestry user here, just started coding this weekend and liking
>>> it so far.
>>> 
>>> Now, for my first question: I'm using Cayenne (3.0.2) so I just downloaded
>>> the tapestry5-cayenne extension (0.5-snapshot) and installed it. Now, when
>>> I start my application, I get the following exception:
>>> 
>>> ----------------------
>>> 
>>> 2011-12-05 10:29:57.846::WARN:  Failed startup of context
>>> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@7817bcd4
>>> {/tap,/Users/hugi/Documents/workspace/tap/src/main/webapp}
>>> java.lang.RuntimeException: Exception loading module(s) from manifest
>>> jar:file:/Users/hugi/.m2/repository/com/googlecode/tapestry5-cayenne/tapestry5-cayenne-server/0.5-SNAPSHOT/tapestry5-cayenne-server-0.5-SNAPSHOT.jar!/META-INF/MANIFEST.MF:
>>> Failure loading Tapestry IoC module class
>>> com.googlecode.tapestry5cayenne.services.TapestryCayenneModule: Error
>>> invoking service binder method
>>> com.googlecode.tapestry5cayenne.services.TapestryCayenneCoreModule.bind(ServiceBinder)
>>> (at TapestryCayenneCoreModule.java:93):
>>> org/apache/tapestry5/PrimaryKeyEncoder
>>>        at
>>> org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:123)
>>>        at
>>> org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77)
>>>        at
>>> org.apache.tapestry5.internal.TapestryAppInitializer.<init>(TapestryAppInitializer.java:124)
>>> 
>>> [ … ]
>>> 
>>> Caused by: java.lang.RuntimeException: Failure loading Tapestry IoC module
>>> class com.googlecode.tapestry5cayenne.services.TapestryCayenneModule: Error
>>> invoking service binder method
>>> com.googlecode.tapestry5cayenne.services.TapestryCayenneCoreModule.bind(ServiceBinder)
>>> (at TapestryCayenneCoreModule.java:93):
>>> org/apache/tapestry5/PrimaryKeyEncoder
>>>        at
>>> org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:162)
>>>        at
>>> org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:137)
>>>        at
>>> org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:107)
>>> 
>>> ----------------------
>>> 
>>> Any ideas what might be happening?
>>> 
>>> Cheers,
>>> - hugi
>>> ---------------------------------------------------------------------
>>> 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]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to