You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by co...@apache.org on 2008/03/03 14:09:01 UTC

[CONF] Apache Jackrabbit: A simple OCM project with Maven & Eclipse (page created)

A simple OCM project with Maven & Eclipse (JCR) created by Christophe Lombart
   http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=78374

Content:
---------------------------------------------------------------------

This tutorial explains how to start a new OCM project with Maven 2 & Eclipse. It is based on the tutorial [5' with Jackrabbit OCM].

h2. Install Maven 2 & Eclipse

This tutorial assumes that you have install correctly Maven 2 & Eclipse.

If it is not the case, here is the instructions to install both products :
- Download Maven 2 ([http://maven.apache.org/download.html]). See the installation instructions on this page.
- Dowload Eclipse from [http://www.eclipse.org]
- In Eclipse, you have to create a new classpath variable called M2_REPO which references the maven 2 repository (by default, it is the directory _$user home/.m2/repository_).

h2. Download the OCM project

You can download the OCM project from [here].

h2. Install the project

- Extract the project distribution anywhere on your local machine.
- Open a command terminal and change the current directory to the project root folder.
- Execute "mvn clean compile". This is an optional step to check if the code can be compiled correctly.

h2. Get ready for Eclipse

- Execute "mvn eclipse:eclipse" from the project root folder. By this way, you project can be imported into Eclipse.
- Start Eclipse and import the project (menu File/import, select general/existing project in the workspace, than select the project root directory).

Now you are ready to modify the project from Eclipse.

h2. Review the project

This project is a standalone java application (see the class org.apache.jackrabbit.ocm.Main) which is creating, retrieving and deleting a PressRelease (see the class org.apache.jackrabbit.ocm.model.PressRelease).The main method is quite simple, it contains the following code :

{code} 
main.registerRepository();
main.startTutorial();
main.unRegisterRepository();
{code} 

The first line registers a local Jackrabbit repository, the second will create a new [Object Content Manager] and start the tutorial and the last one unregisters the local repository before ending the application.

You can read the tutorial [5' with Jackrabbit OCM] to get more information on how to persist a PressRelease object.
{info:title=Useful Information}
We will add other tutorials that will explain how to initialize correctly an [Object Content Manager] within a web application and a Spring based application.
{info}

---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences
   http://cwiki.apache.org/confluence/users/viewnotifications.action

If you think it was sent incorrectly contact one of the administrators
   http://cwiki.apache.org/confluence/administrators.action

If you want more information on Confluence, or have a bug to report see
   http://www.atlassian.com/software/confluence