fr.paris.lutece.plugins.jcr.business
Class AbstractRepositoryDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO
All Implemented Interfaces:
IJsr170DAO
Direct Known Subclasses:
AbstractRepositoryContentDAO, AlfrescoRepositoryWorkspaceDAO, JcrRepositoryWorkspaceDAO

public abstract class AbstractRepositoryDAO
extends Object
implements IJsr170DAO

Abstract class for common jcr operations like :

Author:
lutecer

Field Summary
protected  org.springmodules.jcr.JcrTemplate _jcrTemplate
           
protected  IRepositoryInitializer _repositoryInitializer
           
protected  String _strDefaultWorkspaceName
           
 
Constructor Summary
AbstractRepositoryDAO()
           
 
Method Summary
protected  Object execute(org.springmodules.jcr.JcrCallback callback)
          Run a JcrCallback on the current workspace
protected  Object execute(String strWorkspace, org.springmodules.jcr.JcrCallback callback)
          Run a JcrCallback on the workspace specified by strWorkspace
 void free()
          does some cleaning
protected  void init(org.springmodules.jcr.JcrTemplate jcrTemplate, IRepositoryInitializer repositoryInitializer, String strDefaultWorkspaceName)
          Constructor that MUST be called by derivated classes.
 boolean isAlive()
           
 void releaseSession(javax.jcr.Session session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_jcrTemplate

protected org.springmodules.jcr.JcrTemplate _jcrTemplate

_strDefaultWorkspaceName

protected String _strDefaultWorkspaceName

_repositoryInitializer

protected IRepositoryInitializer _repositoryInitializer
Constructor Detail

AbstractRepositoryDAO

public AbstractRepositoryDAO()
Method Detail

init

protected void init(org.springmodules.jcr.JcrTemplate jcrTemplate,
                    IRepositoryInitializer repositoryInitializer,
                    String strDefaultWorkspaceName)
Constructor that MUST be called by derivated classes. Get Spring beans for JcrTemplate, JcrSessionFactory and IRepositoryInitializer, then run the initializer.

Parameters:
jcrTemplate - the jcrTemplate used to execute jcr operations
repositoryInitializer - the repositoryInitializer used to init some specific repository operations
strDefaultWorkspaceName - the name of the default workspace to use (can be null in order to use the default workspace repository)

execute

protected Object execute(org.springmodules.jcr.JcrCallback callback)
Run a JcrCallback on the current workspace

Parameters:
callback - a JcrCallback
Returns:
the result of the JcrCallback
See Also:
Spring module manual (JcrCallback)

execute

protected Object execute(String strWorkspace,
                         org.springmodules.jcr.JcrCallback callback)
Run a JcrCallback on the workspace specified by strWorkspace

Parameters:
strWorkspace - the name of the workspace
callback - a JcrCallback
Returns:
the result of the JcrCallback
See Also:
Spring module manual (JcrCallback)

isAlive

public boolean isAlive()
Specified by:
isAlive in interface IJsr170DAO
Returns:
true if the connection is alive

free

public void free()
Description copied from interface: IJsr170DAO
does some cleaning

Specified by:
free in interface IJsr170DAO

releaseSession

public void releaseSession(javax.jcr.Session session)


Copyright © 2014 Mairie de Paris. All Rights Reserved.