Tapestry gets a face lift

Tapestry, the definite java component web framework, just got a nice face lift. The new website that was in the works for some months is now online.

In it, you will find the updated Tapestry Tutorial, the new and detailed FAQ, a quick reference to commonly used annotations within Tapestry 5 and much more documentation.

The Tapestry home page is also full of exciting new reasons of why you’d be interested in using Tapestry, so if this is the first time you’ve heard of this component based framework or if it’s been a while since you last reviewed it, then I gladly welcome you to take a look.

Tapestry-4.1.6 maven archetype

There’s an updated archetype for Tapestry-4.1.6-SNAPSHOT over at (the well known snapshot repo)
http://people.apache.org/repo/m2-snapshot-repository

All the hard work was done by Ulrich Stärk, so big thanks to him

For the record, here’s how to quickly generate a Tapestry project

mvn archetype:create -DarchetypeGroupId=org.apache.tapestry \
 -DarchetypeArtifactId=tapestry-archetype \
 -DarchetypeVersion=4.1.6-SNAPSHOT -DgroupId=org.example -DartifactId=myapp \
 -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository

Tapestry for Nonbelievers

InfoQ has just released an article on Tapestry 5.

It’s a well written article that manages to cover many of the new features introduced in Tapestry. It goes through:

  • Setting up a Tapestry application
  • Creating a page and a component
  • Using the awesome Grid component for easy display of your data
  • Using BeanEditForm for one-line pojo editing!!!
  • Ajax and ajax components

So, go ahead and read it.

And now, moving on to the exclusive content of this entry…During my last trip to Germany (Emi and I were supposed to fly for Dubai, but we ended up in Frankfurt – that is another story) i got to meet the two authors of this article, Renat Zubairov and Igor Drobiazko.

So, here’s a photo of the three of us drinking beer:

Tapestry 5 book

Tapestry 5 book

Yeap, written by Alexander Kolesnikov, it’s been out for a while now: Tapestry 5: Building Web Applications

Here are some first comments from the mailing list:

Andy Huhn

I guess I’ll be the first to mention…my copy of the book arrived last
week! (Thursday) I’ve already read a good chunk of it, and skimmed
what I didn’t read. Excellent!

Even though I’ve been plowing my way through learning Tapestry for the
past few months, I found the book to be an excellent, rigorous treatment
of a lot of the details that I haven’t been able to find put together
all in one place so far. It’s definitely written to be simple enough
for someone who doesn’t know Tapestry at all to get started, but even
though I’m familiar with all of the basics, I still found it wonderfully
enlightening to read through it. It’s helping me pull together some of
the basics that I haven’t been able to get a handle on yet.

Alexander…excellent job!

Mahen Parera

I also received my book last week, and liked it very much. I was looking
for more sort of internals about the T5 framework tho.
Anyway, the book is great, i learned some stuff that i didnt know about.
Hopefully there will be some books coming along in the future which
explain more details about components and how the framework really
works,, more in to the internals of the framework.

Mark Shead

I will second this opinion. The book is great! I’m working through
all the examples and it is by far the fastest way (I’ve found) to get
up to speed on T5. Alexander did an excellent job of keeping things
simple enough to work through, while hi-lighting the different ways of
accomplishing the same thing.

Peter Stavrinides

Also received mine yesterday, a job well done Alexander! … it’s
simple, concise and to the point… no blabber, but as you said its a
quickstart, not so much for experienced Tapestry users.

A small tacos update

No announcements yet, just this:

 [INFO] Tacos ................................................. SUCCESS [20.973s]
 [INFO] Tacos Site Skin ....................................... SUCCESS [1:39.694s]
 [INFO] Tacos Core ............................................ SUCCESS [1:16.806s]
 [INFO] Tacos Annotations ..................................... SUCCESS [9.568s]
 [INFO] Tacos Cometd .......................................... SUCCESS [8.425s]
 [INFO] Tacos Demo ............................................ SUCCESS [25.451s]
 [INFO] BeanForm .............................................. SUCCESS [0.169s]
 [INFO] BeanForm Core ......................................... SUCCESS [25.614s]
 [INFO] BeanForm Examples ..................................... SUCCESS [17.668s]
 [INFO] Tacos Dojo ............................................ SUCCESS [2.079s]
 [INFO] Tacos jQuery .......................................... SUCCESS [2.934s]
 [INFO] Tacos-Seam ............................................ SUCCESS [0.116s]
 [INFO] Tacos-Seam Core ....................................... SUCCESS [44.754s]
 [INFO] Tacos-Seam Demo ....................................... SUCCESS [8.213s]

More Tapestry sites

Here’s 3 more public Tapestry sites (using Dojo for ajax + javascript):

  • http://www.sourcekibitzer.org/ is … sourcekibitzer! It provides detailed programming metrics into the relevant code quality, member activity, individual developer know-how, and scope of open source projects. It’s using Tapestry 4.0.2 and Tacos and it has recently been open-sourced. You can have it running locally in 5 mins!
  • http://freebookie.org is a free internet bookmaker that uses the js effects and ajax that Tapestry 4.1.2 provides (via Dojo 0.4.3). The complete project is open-source, available from http://code.google.com/p/bookie and quite easy to setup and play with locally.
  • http://news247.gr is a high volume greek news site that’s constantly updated. It’s on Tapestry 4.1.3 and does persistence with iBatis

So, if you’re interesting in having a look at Tapestry, why not grab the source of freebookie or sourcekibitzer and hack’em around?

Using Groovy for Tacos-Demo & Tapestry

So, since groovy compiles down to bytecode, it can be used anywhere… That’s how i did a test tapestry page a month ago.

But this time i took some time off to play with groovy and the tacos demo app (Shing is hosting it for us right now) and the JetGroovy plugin of IntelliJ Idea 7.0M2. My findings are really nothing new and mostly deal with java vs. groovy … things!

So, the ajax tree demo uses a TreeData bean for its data… here it is in java:

 public class TreeData {
  private String name;
     private List<TreeData> children;
 
     public TreeData() {this(null);}
 
     public TreeData(String name) {
         this.name = name;
         children = new ArrayList<TreeData> ();
     }
 
     public String getName() { return name; }
 
     public void setName(String name) { this.name = name; }
 
     public List getChildren() { return children; }
 
     public void setChildren(List<TreeData> children) { this.children = children; }
 
     public void addChild(TreeData value) {
         String name = value.getName();
         for (int i = 0; i < children.size(); i++) {
             TreeData treeData = children.get(i);
             if (name.compareTo(treeData.getName()) < 0) {
                 children.add(i, value);
                 return;
             }
         }
         children.add(value);
     }
 
     public TreeData getOrCreateChild(String value) {
         for (TreeData treeData : children) {
             if (treeData.getName().equals(value))
                 return treeData;
         }
         TreeData data = new TreeData(value);
         addChild(data);
         return data;
     }
 }

and here it is in groovy:

 class TreeDataGroovy {
     String name
     List<TreeDataGroovy> children
 
     def addChild(TreeDataGroovy value) {
         if (children==null) children = [];
         int pos = children.findIndexOf { value.name < it.name }
         children.add(pos, value)
     }
 
     TreeDataGroovy getOrCreateChild(String value) {
         TreeDataGroovy data = children.find {it.name==value};
         if (data==null) {
             data = new TreeDataGroovy(name:value)
             addChild(data)
         }
         return data;
     }
 }

On the other hand, I ended up dealing with exceptions and errors quite more often that i do in java (perhaps due to my lack of knowledge for groovy) so it did force me in more unit tests, which some say is a good thing and others the opposite.

Tacos 4.1.0 released

Here’s the announcement:

Hi all,
It’s a pleasure for me to announce the release of Tacos 4.1.0
(http://tacos.sourceforge.net/tacos4.1/) – the first stable tacos
release supporting Tapestry 4.1.x and offering:
  • Dojo Widget – Generic component for (almost) all dojo widgets.

  • script.aculo.us – brand new components based on script.aculo.us

  • Comet component

  • New Annotations – allow you to inject ILinks and easily check if
    component parameters are bound.

  • New binding prefixes – including ‘template’ that makes string
    related ognl expressions easier, and ‘absoluteAsset’ which works like
    the asset binding but makes sure that the created url is absolute.

  • BeanForm – All-in-one, flexible bean editor BeanForm has become a
    major part of Tacos. This update offers complete compatibility with
    Tapestry 4.1.2.

  • Tapdoc – though not yet properly released from within tacos, it
    offers a maven plugin for component reference generation.

Furthermore:

  • The jars have already been deployed over at ibiblio.org – more
    installation instructions can be found at
    http://tacos.sourceforge.net/tacos4.1/tacos-core/quick-start/downloading.html

  • Beanform (http://beanform.sourceforge.net/) and Tapdoc
    (http://www.erinors.com/developer/project/tapdoc/) have merged
    with Tacos.

  • Huge thanks to our latest committer Igor Drobiazko whose excitement
    has shed new life to the project.

  • Extra special thanks to all the people that contributed code, esp.
    Daniel Gredler, Norbert Sandor, Patrick Moore, Ming Jiang and Craig Spry

Have fun with it!