Hi,
The documentation is obsolete. I'm going to review it but it will take time.
the class PersistenceManager was renamed into ObjectContentManager. The
ObjectContentManager is the main component in Jackrabbit OCM. It can be used
to make some CRUD operations on pojos. Thanks to this component, you can
add, delete, update or retrieve pojos from a JCR repository. For doing this,
it has to know how to map a pojo into jcr nodes & properties. This kind of
mapping is done with the annotations defined on the pojos or in a XML
descriptor.
1/ If you want to instantiate a ObjectContentManager with the annotation
support :
Session session = .... // get a JCR session
List<Class> classes = new ArrayList<Classes>();
classes.add(...); // Call this method for each pojo to register
Mapper mapper = new AnnotationMapperImpl(classes).
ObjectContentManager ocm = new ObjectContentManagerImpl(session, mapper);
2/ If you want to instantiate an ObjectContentManager with the XML file
support :
Session session = .... // get a JCR session
String[] files = { "mappingfile1.xml", "mappingfile2.xml"}
ObjectContentManager ocm = new ObjectContentManagerImpl(session, files);
Now, you can chek the ObjectContentManager interface to see the complete
API.
I advise you to review the unit tests which contain many examples. Let's
start with the classes AnnotationTestBase & DigesterTestBase.
Hope this help until the doc is better.
Christophe
On Jan 28, 2008 10:07 AM, muriel elhaik <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I think there is something wrong in the code to initialize correctly the
> Object Manager find in this page :
> http://jackrabbit.apache.org/ocm/engine-introduction.html
>
> // 3. Initialize the PersistenceManager dependencies
> Mapper mapper = new DigesterMapperImpl(files).buildMapper();
>
> But as it is in the src, buildMapper is returning a void and not a Mapper
>
> Has anybody already noticed it?
>
> Regards
> Muriel
>
>
>