Skip to main content

Liferay Jackrabbit Oracle integration

Follow these steps to integrate Liferay, Jackrabbit, and Oracle.

Step 1 :

Copy the below lines into portal-ext.properties

dl.hook.impl=com.liferay.documentlibrary.util.JCRHook
jcr.initialize.on.startup=true
jcr.workspace.name=liferay
jcr.node.documentlibrary=documentlibrary
jcr.jackrabbit.repository.root=${liferay.home}/data/jackrabbit
jcr.jackrabbit.config.file.path=${jcr.jackrabbit.repository.root}/repository.xml
jcr.jackrabbit.repository.home=${jcr.jackrabbit.repository.root}/home
jcr.jackrabbit.credentials.username=none
jcr.jackrabbit.credentials.password=none



Step 2 :

Replace the content of liferay-installation/data/jackrabbit/repository.xml with below xml text and then restart

<?xml version="1.0"?> <Repository> <!--<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${rep.home}/repository" /> </FileSystem>--> <!-- Database File System (Cluster Configuration) This is sample configuration for oracle persistence that can be used for clustering Jackrabbit. For other databases, change the connection, credentials, and schema settings. --> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_R_FS_"/> </FileSystem> <Security appName="Jackrabbit"> <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager" /> <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule"> <param name="anonymousId" value="anonymous" /> </LoginModule> </Security> <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="liferay" /> <Workspace name="${wsp.name}"> <!--<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${wsp.home}" /> </FileSystem> <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager" />--> <!-- Database File System and Persistence (Cluster Configuration) This is sample configuration for mysql persistence that can be used for clustering Jackrabbit. For other databases, change the connection, credentials, and schema settings. --> <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager"> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_PM_${wsp.name}_" /> <param name="externalBLOBs" value="false" /> </PersistenceManager> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_FS_${wsp.name}_"/> </FileSystem> </Workspace> <Versioning rootPath="${rep.home}/version"> <!--<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${rep.home}/version" /> </FileSystem> <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager" />--> <!-- Database File System and Persistence (Cluster Configuration) This is sample configuration for mysql persistence that can be used for clustering Jackrabbit. For other databases, change the connection, credentials, and schema settings. --> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_V_FS_"/> </FileSystem> <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager"> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_V_PM_" /> <param name="externalBLOBs" value="false" /> </PersistenceManager> </Versioning> <!-- Cluster Configuration This is sample configuration for mysql persistence that can be used for clustering Jackrabbit. For other databases, change the connection, credentials, and schema settings. --> <!--<Cluster id="node_1" syncDelay="5"> <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal"> <param name="revision" value="${rep.home}/revision"/> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/> <param name="url" value="" /> <param name="user" value="" /> <param name="password" value="" /> <param name="schema" value="oracle"/> <param name="schemaObjectPrefix" value="J_C_"/> </Journal> </Cluster>--> </Repository>

Comments

Anonymous said…
Did you find that after configuring Jackrabbit to use Oracle, Lucene stopped indexing files? I wondered if that was the reason for you using Solr in your next post.
We never had issues with Lucene after doing this. SOLR was necessary since we had a Cluster environment.
Anonymous said…
This comment has been removed by a blog administrator.
Luca said…
I have a cluster environment, but I have some issue regarding JackRabbit. I have quite your configuration (in repository.xml I uncommented also the Cluster TAG), but I see that the binary data is written to the file system. The problem is that binary file is written only in the cluster node where I uploaded it. Did you use a shared folder for JackRabbit workspaces?
Anonymous said…
This comment has been removed by a blog administrator.
Anonymous said…
Hi Mohammed,

Have you done clustering on jackrabbit with MS SQL server 2008 for storing documents and images?

I am getting row lock error.

Your help is appreciated.
Tnaks
Sorry, never used MS SQL Server,
BTW you can checkout this thread http://www.liferay.com/community/forums/-/message_boards/view_message/10315622
tuba falopi said…
This is information nice, and very detail, Useful for me and all, thank you so much :)

Popular posts from this blog

JPA 2 new feature @ElementCollection explained

@ElementCollection is new annotation introduced in JPA 2.0, This will help us get rid of One-Many and Many-One shitty syntax. Example 1: Stores list of Strings in an Entity @Entity public class Users implements Serializable {     private static final long serialVersionUID = 1L;     @Id     @GeneratedValue(strategy = GenerationType.AUTO)     private Long id;     @ElementCollection     private List<String> certifications = new ArrayList <String> ();     public Long getId() {         return id;     }     public void setId(Long id) {         this.id = id;     }     public List <String> getCertifications() {         return certifications;     }     pub...

Validating CSV Files

What is CsvValidator ?   A Java framework which validates any CSV files something similar to XML validation using XSD. Why should I use this ?   You don't have to use this and in fact its easy to write something your own and also checkout its source code for reference. Why did I write this ?   Some of our projects integrate with third party application which exchanges information in CSV files so I thought of writing a generic validator which can be hooked in multiple projects or can be used by QA for integration testing. What is the license clause ?   GNU GPL v2 Are there any JUnit test cases for me checkout ?  Yes,  source How to integrate in my existing project ? Just add the Jar which can be downloaded from here  CsvValidator.jar  and you are good. Instantiate  CsvValidator c onstructor which takes these 3 arguements          // filename is the the file to be validated and here ...

Reuse JPA Entities as DTO

Note : Major design advantages of JPA Entities are they can detached and used across tiers and networks and later can by merged. Checkout this new way of querying entities in JPA 2.0 String ql = " SELECT new prepclass2.Employee (e.firstname, e.lastname) FROM Employee e "; List<Employee> dtos = em.createQuery(ql).getResultList(); The above query loads all Employee entities but with subset of data i.e. firstname, lastname. Employee entity looks like this. @Entity @Table(name="emp") public class Employee implements Serializable {     private static final long serialVersionUID = 1L;     @Id     @GeneratedValue(strategy = GenerationType.AUTO)     private Long id;     @Column     private String firstname;     @Column     private String lastname;     @Column     private String username;     @Column ...