tapestry-routing 0.0.1 released!

Here comes yet another beautiful little module called tapestry-routing.

In a nutshell, tapestry-routing allows you to provide your own custom mapping between Tapestry pages and URLs.

Did you ever wanted to change the order of the path params in an URL? now you can!

Let's say you have a page: pages.projects.Members which have 2 parameters in its activation context: (Long projectId, Long memberId) and you want the URL for that page to look like /projects/1/members/1 Just add the @At annotation to you page, like this:

package ...pages.projects;
@At(" /projects/{0}/members/{1}")
public class Members {
void onActivate(Long projectId, Long memberId)

That's it!
tapestry-routing Dispatcher will take care of recognizing incoming requests and dispatching the proper render request
tapestry-routing PageRenderLinkTransformer will do the rest of the work, it will transform every Link for a page render request formatting it according to your route rule.

We really need some feedback, so please give it a try:http://tynamo.org/tapestry-routing+guide

Enjoy!

Tynamo, JPA & GAE

Today I was playing with Tynamo & JPA and I found two things that I would like to share.

1) I wanted to check what was the simplest jpa configuration possible and I wanted to see how difficult is to migrate from tapestry-model-hibernate to tapestry-model-jpa using that configuration. It turns out that's really really easy.

  • Change your dependency from tapestry-model-hibernate to tapestry-model-jpa
  • Add hibernate-entitymanager as a dependency (don't forget to exclude slf4j-api)
  • Then configure your persistence.xml using org.hibernate.ejb.HibernatePersistence as a provider. You can even copy the properties from your hibernate.cfg.xml
  • Configure your persistence unit: configuration.add(JPASymbols.PERSISTENCE_UNIT, "nameOfPersistenceUnit");


THAT'S IT!!
More info: http://tynamo.org/tapestry-jpa+guide

2) I struggled with Google App Engine trying to run a very simple tapestry-model-jpa project. It took me a couple of painful tries to realize that GAE supports only JPA 1.0 (I knowwww!!! I should have RTFM!!!!).

Anyway, I'm not giving up on GAE, so next step: tapestry-model-objectify !

Click here to download:
persistence.xml (0 Bytes)
(download)