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

java.lang.Object
  extended by fr.paris.lutece.plugins.jcr.business.RepositoryFileHome

public class RepositoryFileHome
extends java.lang.Object


Field Summary
static java.lang.String CONTEXT_NAME
           
static java.lang.String SPRING_JSR170_JCRLIST
           
static java.lang.String SPRING_REPOSITORY_FILE_DAO
           
static java.lang.String SPRING_WORKSPACE_DAO
           
 
Constructor Summary
protected RepositoryFileHome()
           
 
Method Summary
 void addFile(AdminWorkspace adminWorkspace, java.lang.String path, java.io.File file)
          Create a file in workspace strWorkspace in directory designed by path with content file
 boolean canAccess(AdminWorkspace adminWorkspace, java.lang.String strAccessType, java.lang.String[] userRoles)
          Tests if the workspace strWorkspace can be accessed with roles in userRoles and access of type strAccessType
 boolean canCreateWorkspace(java.lang.String strJcrType)
           
 void createFolder(AdminWorkspace adminWorkspace, java.lang.String path)
          Create a directory in workspace strWorkspace at location path
 void createWorkspace(java.lang.String strJcrType, java.lang.String strWorkspaceName)
          Create a new workspace
 java.util.Map<java.lang.String,java.lang.Boolean> getAvailableAccess(AdminWorkspace adminWorkspace, java.lang.String[] userRoles)
          Get all available access, given some roles
 fr.paris.lutece.util.ReferenceList getAvailableJcr()
           
 java.util.List<java.lang.String> getAvailableJcrList()
           
 fr.paris.lutece.util.ReferenceList getAvailableWorkspaces(java.lang.String strJcrType)
          Get all available workspaces
static RepositoryFileHome getInstance()
          Returns the instance of the singleton
 IRepositoryFile getRepositoryFile(AdminWorkspace workspace, java.lang.String path)
          Get the file in workspace strWorkspace in directory path
 IRepositoryFile getRepositoryFileById(AdminWorkspace workspace, java.lang.String strFileId)
          Get the file in workspace strWorkspace in directory path
 java.util.List<IRepositoryFile> getRepositoryFileList(AdminWorkspace workspace)
          Get the files in workspace strWorkspace
 java.util.List<IRepositoryFile> getRepositoryFileList(AdminWorkspace adminWorkspace, java.lang.String parent)
          Get the files in workspace strWorkspace in directory parent
 IWorkspace getWorkspace(AdminWorkspace adminWorkspace)
          Get workspace informations
 void modify(AdminWorkspace adminWorkspace, IWorkspace workspace)
          Modify workspace acces rights
 void removeRepositoryFile(AdminWorkspace adminWorkspace, java.lang.String strPath)
          Remove element in workspace strWorkspace at path strPath
 void removeWorkspace(AdminWorkspace adminWorkspace)
          Removes a workspace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_NAME

public static final java.lang.String CONTEXT_NAME
See Also:
Constant Field Values

SPRING_JSR170_JCRLIST

public static final java.lang.String SPRING_JSR170_JCRLIST
See Also:
Constant Field Values

SPRING_REPOSITORY_FILE_DAO

public static final java.lang.String SPRING_REPOSITORY_FILE_DAO
See Also:
Constant Field Values

SPRING_WORKSPACE_DAO

public static final java.lang.String SPRING_WORKSPACE_DAO
See Also:
Constant Field Values
Constructor Detail

RepositoryFileHome

protected RepositoryFileHome()
Method Detail

getInstance

public static RepositoryFileHome getInstance()
Returns the instance of the singleton

Parameters:
context - the context to use, must match a declared JCR
Returns:
The instance of the singleton

getRepositoryFileList

public java.util.List<IRepositoryFile> getRepositoryFileList(AdminWorkspace workspace)
Get the files in workspace strWorkspace

Parameters:
workspace - the workspace name
Returns:
a list of IRepositoryFile

getRepositoryFileById

public IRepositoryFile getRepositoryFileById(AdminWorkspace workspace,
                                             java.lang.String strFileId)
Get the file in workspace strWorkspace in directory path

Parameters:
workspace - the workspace name
strFileId - an absolute path to the directory
Returns:
the IRepositoryFile

getRepositoryFile

public IRepositoryFile getRepositoryFile(AdminWorkspace workspace,
                                         java.lang.String path)
Get the file in workspace strWorkspace in directory path

Parameters:
strWorkspace - the workspace name
path - an absolute path to the directory
Returns:
the IRepositoryFile

getRepositoryFileList

public java.util.List<IRepositoryFile> getRepositoryFileList(AdminWorkspace adminWorkspace,
                                                             java.lang.String parent)
Get the files in workspace strWorkspace in directory parent

Parameters:
strWorkspace - the workspace name
parent - the parent directory absolute path
Returns:
a list of IRepositoryFile

addFile

public void addFile(AdminWorkspace adminWorkspace,
                    java.lang.String path,
                    java.io.File file)
Create a file in workspace strWorkspace in directory designed by path with content file

Parameters:
strWorkspace - the workspace name
path - the parent directory absolute path
file - the file content

createFolder

public void createFolder(AdminWorkspace adminWorkspace,
                         java.lang.String path)
Create a directory in workspace strWorkspace at location path

Parameters:
strWorkspace - the workspace name
path - the directory absolute path

removeRepositoryFile

public void removeRepositoryFile(AdminWorkspace adminWorkspace,
                                 java.lang.String strPath)
Remove element in workspace strWorkspace at path strPath

Parameters:
strWorkspace - the workspace name
strPath - the absolute path

getAvailableWorkspaces

public fr.paris.lutece.util.ReferenceList getAvailableWorkspaces(java.lang.String strJcrType)
Get all available workspaces

Returns:
a ReferenceList with all workspace names

createWorkspace

public void createWorkspace(java.lang.String strJcrType,
                            java.lang.String strWorkspaceName)
Create a new workspace

Parameters:
strWorkspaceName - the workspace name

getWorkspace

public IWorkspace getWorkspace(AdminWorkspace adminWorkspace)
Get workspace informations

Parameters:
strWorkspace - the workspace name
Returns:
the workspace

modify

public void modify(AdminWorkspace adminWorkspace,
                   IWorkspace workspace)
Modify workspace acces rights

Parameters:
workspace - the workspace

canAccess

public boolean canAccess(AdminWorkspace adminWorkspace,
                         java.lang.String strAccessType,
                         java.lang.String[] userRoles)
Tests if the workspace strWorkspace can be accessed with roles in userRoles and access of type strAccessType

Parameters:
strWorkspace - the workspace name
strAccessType - the access type, it must be in IWorkspace.AVAILABLE_ACCESS
userRoles - an array of roles
Returns:
true if it is accessible, false otherwise

getAvailableAccess

public java.util.Map<java.lang.String,java.lang.Boolean> getAvailableAccess(AdminWorkspace adminWorkspace,
                                                                            java.lang.String[] userRoles)
Get all available access, given some roles

Parameters:
strWorkspace - the workspace name
userRoles - an array of roles
Returns:
a map containing access types associated with access value

getAvailableJcr

public fr.paris.lutece.util.ReferenceList getAvailableJcr()
Returns:
jcr defined in Spring context

getAvailableJcrList

public java.util.List<java.lang.String> getAvailableJcrList()

canCreateWorkspace

public boolean canCreateWorkspace(java.lang.String strJcrType)
Returns:
true if workspace can be created in this jcr

removeWorkspace

public void removeWorkspace(AdminWorkspace adminWorkspace)
Removes a workspace

Parameters:
strWorkspaceName - the name of the workspace to remove


Copyright © 2007 Mairie de Paris. All Rights Reserved.