jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: OCM: why not to hide ugly init code?
Date Tue, 11 Mar 2008 22:34:27 GMT
Just one comment :

The OCM has to be completely independent of Jackrabbit core. By this
way, it can be used with other JCR implementation. As you can see,
Jackrabbit core is only used for the unit tests.
That's why the code is so ugly ... until there is a standard way to
add new node types.


On Tue, Mar 11, 2008 at 10:32 PM, Alex Lukin <lukin@stu.cn.ua> wrote:
> 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,  commons-beanutils-1.7.0.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