Jahia in English > Creating Content...

0 (0 Good)
0 (0 Bad)

Creating Content Type thanks to annotations in jahia modules

by  faissah »  2012/07/06 13:52

ORGINALLY POSTED BY: echavet

Hello,

I'm using english langage because it seems to be the standard in his forum. But actually I'm french.

I'm about to use Jahia 6.6 as a CMS and a portal in my organisation. I also intend to use it for developping small applications. As a development environement.

Unfortunately, I think some of the way to define contents de not match my design quality requirements:

          Using CND to define content type.

          Using naming conventions to select a the good view to display contents or to define pickers...

So I'm working on eventual different ways to define views, and content. Being able to be detached from the JCR specific technology.

For content definition:

I'm thinking of creating a Spring AnnotationBeanPostProcessor with a set of Annotations  that will act as the org.jahia.services.content.nodetypes.JahiaCndReader class does. JahiaCndReader is a cnd parser that builds ExtendedNodeType metadata infos and that does register new types calling NodeTypeRegistry.getInstance().addNodeType(newNode).

My AnnotationBeanPostProcessor would parse the new module classes searching for annotations. All beans annotated with the corresponding annotation (for example @JCRPersistent) will be processed and registered as new content types.

To each cnd attribute will correspond an annotation. Mixin, Options, superTypes...

For the views... I will talk about it  later. But il would be great to be able to access JCR nodes using el language with the bean and the properties name. Preventing us from using currentNode.properties.... 

The idear is to match the JPA way of defining content, mapping and to build querries. And to match Spring WebFlow and JSF way of adressing beans and views...

 

Anybody would help, comment?

 

ORGINALLY POSTED BY: echavet

Fabrice  (faissah)

Number of messages  262
Registration date
0 (0 Good)
0 (0 Bad)

Re: Creating Content Type thanks to annotations in jahia modules

by  echavet »  2012/07/17 11:57

Hello Fabrice,

you must be a very good architect to have such good idea!!!!

Seriously, Fabrice, what do you think of the idea? Did I make myself clear?

Anybody has an opinion?

 

Eric

 

  (echavet)

Number of messages  1
Registration date
0 (0 Good)
0 (0 Bad)

Re: Re: Creating Content Type thanks to annotations in jahia modules

by  shuber »  2012/07/18 13:44

Hello Fabrice,

you must be a very good architect to have such good idea!!!!

Seriously, Fabrice, what do you think of the idea? Did I make myself clear?

Anybody has an opinion?

 

Eric

 

Hello Eric, 

Fabrice had moved the topic since you had posted it in another topic, but he copied it instead of moving, sorry about that.

Concerning your question, I think this is an interesting idea, although it is not really easy to integrate with Jahia's UI since it is really integrated with the JCR API. Maybe you might be interested in the OCM project on top of Jackrabbit : http://jackrabbit.apache.org/object-content-mapping.html . This project is still under development but might be interesting to you. 

From another point of view, although you might be more familiar with annotations and POJOs I do suggest you give the existing Jahia model a try. You will see that it is indeed quite flexible especially when using REST/JSON APIs for which it matches quite well. Using large graphs of objects and their OCM mapping is usually a complex problem, especially when handling collections and lazy loading, so I'm not recommending it for large projects (and for small one the benefit might offset the integration work). This is similar to ORM technologies such as Hibernate that despite their power and features do introduce complexities and especially makes some operations such as caching a little difficult to integrate.

Best regards,

  Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page