jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Lukin <lu...@stu.cn.ua>
Subject OCM: why not to hide ugly init code?
Date Tue, 11 Mar 2008 21:32:53 GMT
Hi, All, Hi, Christophe!

I just took a look at new OCM docs at http://jackrabbit.apache.org/5-with-jackrabbit-ocm.html

I must say taht ugly init code for annotation based OCM may be and must be hidden.

In my application I  created needed xml file and placed it in same package where OCM init
code is.
Then I read it directly from jar using simple code below:

            InputStream xml = this.getClass().getResourceAsStream("nodetypes-ocm.xml"); 
            NodeTypeDef[] types = NodeTypeReader.read(xml);

Rest of init code needs Session object with superuser rights (Oh! rights on jackrabbit! :)
) but it is not a big problem to
create one built-in OCM method with session as parameter.

In my opinion, current init code is conerproductive and creates bad attitude of user just
by the first look of new OCM user.
I can not imagine any reason to leave such code for end user.

BTW, you forgot to mention in docs 3 not trivial dependencies for OCM: cglib-2.1_3.jar , asm-1.5.3.jar,
I forgot to put libs for yet next OCM project so I just made a big sticker with shuch message
on my desctop :)

As allways, should I create Jira issue with this?
SY, Alex Lukin

View raw message