cancel
Showing results for 
Search instead for 
Did you mean: 

Java Annotations for Your Alfresco Content Model

rmonteiro
Champ in-the-making
Champ in-the-making
The purpose of this article is to present a very easy and handy way of mapping your Alfresco content model in Java Classes through usage of Java Annotations. This way the access to the properties of your node is much more transparent than through direct usage of the Alfresco Java api. You will be able to get your node, transform it in your own business entiy Java class instance and work with it directly, and at the end map it again on your Alfresco content node.

http://rmonteiro.wordpress.com/2009/02/01/java-annotations-for-your-alfresco-content-model/
4 REPLIES 4

dhalupa
Champ on-the-rise
Champ on-the-rise
NIce work, although annotation seems a bit redundant in this case. Height getter method should map itself to height property by convention, without the need for additional annotation. You might also consider injecting a reference to ServiceRegistry on instantiation and make a bean repository aware.

Anyhow, great idea Smiley Happy

rmonteiro
Champ in-the-making
Champ in-the-making
The idea is that the method on your class java doesn't have to use the same name that it's used on the model. In this case is the same for simplicity, but the annotation is made more generic than that. So it's not exactly redundant… The bean aware is of course the next extension idea after you see the thing, but I prefer having both methods for doing the thing. I am glad you like it.

jpfi
Champ in-the-making
Champ in-the-making
hehe, nice idea & well done!

rmonteiro
Champ in-the-making
Champ in-the-making
I put it a new version of the pdf avilable. Most of the changes are related with english errors of the (let's call it) draft version. There are no changes on code. But I clarified the topic pointed by dhalupa in case it was not clear by the code itself.