|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.jcr.business.RepositoryFileHome
public class RepositoryFileHome
Home class for JCR repository operations
Field Summary | |
---|---|
static String |
CONTEXT_NAME
|
static String |
SPRING_JSR170_JCRLIST
|
static String |
SPRING_JSR170_PREFIX
|
static String |
SPRING_REPOSITORY_FILEdao
|
static String |
SPRINGworkspaceDao
|
Constructor Summary | |
---|---|
protected |
RepositoryFileHome()
Default constructor |
Method Summary | |
---|---|
void |
addFile(AdminWorkspace workspace,
String path,
File file,
String strMimeType,
JsrUser user)
Create a file in workspace strWorkspace in directory designed by path with content file |
boolean |
canAccess(AdminWorkspace adminWorkspace,
String strAccessType,
String[] userRoles,
JsrUser user)
Tests if the workspace strWorkspace can be accessed with roles in userRoles and access of type strAccessType |
boolean |
canCreateWorkspace(String strJcrType)
This is part of admin functionalities |
void |
createFolder(AdminWorkspace workspace,
String path,
JsrUser user)
Create a directory in workspace strWorkspace at location path |
void |
createWorkspace(String strJcrType,
String strWorkspaceName)
Create a new workspace |
void |
doRecursive(AdminWorkspace adminWorkspace,
AdminView view,
String strStartPath,
INodeAction<org.apache.lucene.document.Document,Collection<org.apache.lucene.document.Document>> action,
JsrUser user)
Recursively delegates an specific action on a JCR content. |
protected void |
doRecursive(AdminWorkspace adminWorkspace,
IRepositoryFile parentFile,
INodeAction<org.apache.lucene.document.Document,Collection<org.apache.lucene.document.Document>> action)
|
Map<String,Boolean> |
getAvailableAccess(AdminWorkspace adminWorkspace,
String[] userRoles,
JsrUser user)
Get all available access, given some roles |
fr.paris.lutece.util.ReferenceList |
getAvailableJcr()
|
List<String> |
getAvailableJcrList()
|
fr.paris.lutece.util.ReferenceList |
getAvailableWorkspaces(String strJcrType)
Get all available workspaces |
List<IRepositoryFile> |
getFileHistory(AdminWorkspace adminWorkspace,
String strFileId,
JsrUser user)
Gets the file history |
static RepositoryFileHome |
getInstance()
Returns the instance of the singleton |
protected IRepositoryFileDAO |
getIRepositoryFileDAO(String strJcrType)
Returns an IRepositoryFileDAO of type strJcrType from the Spring context |
Map<String,JcrLock> |
getLocks(AdminWorkspace adminWorkspace,
AdminView view,
JsrUser user)
Returns a list of all files locked |
List<IRepositoryFile> |
getPathToFile(AdminWorkspace adminWorkspace,
String strFileId,
JsrUser user)
Gives a list of files from the root node to the given node |
String |
getPrettyAbsolutePath(AdminWorkspace adminWorkspace,
IRepositoryFile rootFile,
JsrUser jsrUser)
|
IRepositoryFile |
getRepositoryFile(AdminWorkspace workspace,
String path,
JsrUser user)
Get the file in workspace strWorkspace in directory path |
IRepositoryFile |
getRepositoryFileById(AdminWorkspace workspace,
String strFileId,
JsrUser user)
Get the file in workspace strWorkspace in directory path |
List<IRepositoryFile> |
getRepositoryFileList(AdminWorkspace workspace,
JsrUser user)
Get the files in workspace strWorkspace |
List<IRepositoryFile> |
getRepositoryFileList(AdminWorkspace workspace,
String parent,
JsrUser user)
Get the files in workspace strWorkspace in directory parent |
IRepositoryFile |
getRepositoryFileVersionById(AdminWorkspace workspace,
String strFileId,
String strVersion,
JsrUser user)
Get the file in workspace strWorkspace in directory path |
IWorkspace |
getWorkspace(AdminWorkspace workspace,
JsrUser user)
Get workspace informations |
void |
modify(AdminWorkspace adminWorkspace,
IWorkspace workspace,
JsrUser user)
Modify workspace acces rights This is part of admin functionalities |
void |
removeRepositoryFile(AdminWorkspace workspace,
String strPath,
JsrUser user)
Remove element in workspace strWorkspace at path strPath |
void |
removeWorkspace(AdminWorkspace adminWorkspace,
JsrUser user)
Removes a workspace This is part of admin functionalities |
void |
setLock(AdminWorkspace adminWorkspace,
IRepositoryFile file,
JsrUser user)
Puts a lock on a node |
void |
setVersionnable(AdminWorkspace adminWorkspace,
String strFileId,
boolean isVersionnable,
JsrUser user)
Adds a file to the version manager |
void |
unLock(AdminWorkspace adminWorkspace,
IRepositoryFile file,
JsrUser user)
Unlock a locked node |
void |
unLock(AdminWorkspace adminWorkspace,
IRepositoryFile file,
JsrUser user,
Collection<JcrLock> jcrLocks)
|
void |
update(AdminWorkspace adminWorkspace,
IRepositoryFile file,
JsrUser user)
Modifies a file in a workspace The file must not be locked by another user |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONTEXT_NAME
public static final String SPRING_JSR170_PREFIX
public static final String SPRING_JSR170_JCRLIST
public static final String SPRING_REPOSITORY_FILEdao
public static final String SPRINGworkspaceDao
Constructor Detail |
---|
protected RepositoryFileHome()
Method Detail |
---|
protected IRepositoryFileDAO getIRepositoryFileDAO(String strJcrType)
strJcrType
- the type of JCR. Available types are defined in the Spring context
public static RepositoryFileHome getInstance()
public List<IRepositoryFile> getRepositoryFileList(AdminWorkspace workspace, JsrUser user)
workspace
- the workspace name
public IRepositoryFile getRepositoryFileById(AdminWorkspace workspace, String strFileId, JsrUser user)
workspace
- the workspace namestrFileId
- an absolute path to the directoryuser
- the current user
public IRepositoryFile getRepositoryFileVersionById(AdminWorkspace workspace, String strFileId, String strVersion, JsrUser user)
workspace
- the workspace namestrFileId
- an absolute path to the directorystrVersion
- the version name to retrieveuser
- the current user
public IRepositoryFile getRepositoryFile(AdminWorkspace workspace, String path, JsrUser user)
workspace
- the workspacepath
- an absolute path to the directoryuser
- the current user
public List<IRepositoryFile> getRepositoryFileList(AdminWorkspace workspace, String parent, JsrUser user)
workspace
- the workspaceparent
- the parent directory absolute pathuser
- the current user
public void addFile(AdminWorkspace workspace, String path, File file, String strMimeType, JsrUser user)
workspace
- the workspacepath
- the parent directory absolute pathfile
- the file contentuser
- the current userpublic void createFolder(AdminWorkspace workspace, String path, JsrUser user)
workspace
- the workspacepath
- the directory absolute pathuser
- the current userpublic void removeRepositoryFile(AdminWorkspace workspace, String strPath, JsrUser user)
workspace
- the workspacestrPath
- the absolute pathuser
- the current userpublic fr.paris.lutece.util.ReferenceList getAvailableWorkspaces(String strJcrType)
strJcrType
- the type of the jcr repository
public void createWorkspace(String strJcrType, String strWorkspaceName)
strJcrType
- the type of the jcr repositorystrWorkspaceName
- the workspace namepublic IWorkspace getWorkspace(AdminWorkspace workspace, JsrUser user)
workspace
- the workspaceuser
- the current user
public void modify(AdminWorkspace adminWorkspace, IWorkspace workspace, JsrUser user)
adminWorkspace
- the admin workspaceworkspace
- the workspace instanceuser
- the current userpublic boolean canAccess(AdminWorkspace adminWorkspace, String strAccessType, String[] userRoles, JsrUser user)
adminWorkspace
- the workspacestrAccessType
- the access type, it must be in IWorkspace.AVAILABLE_ACCESSuserRoles
- an array of rolesuser
- the current user
public Map<String,Boolean> getAvailableAccess(AdminWorkspace adminWorkspace, String[] userRoles, JsrUser user)
adminWorkspace
- the workspaceuserRoles
- an array of rolesuser
- the current user
public fr.paris.lutece.util.ReferenceList getAvailableJcr()
public List<String> getAvailableJcrList()
public boolean canCreateWorkspace(String strJcrType)
strJcrType
- the type of jcr
public void removeWorkspace(AdminWorkspace adminWorkspace, JsrUser user)
adminWorkspace
- the name of the workspace to removeuser
- the current userpublic String getPrettyAbsolutePath(AdminWorkspace adminWorkspace, IRepositoryFile rootFile, JsrUser jsrUser)
adminWorkspace
- the workspace to userootFile
- the file to get the pretty path fromuser
- the current user
public void update(AdminWorkspace adminWorkspace, IRepositoryFile file, JsrUser user)
adminWorkspace
- the current workspacefile
- the new file contentuser
- the current userpublic void setVersionnable(AdminWorkspace adminWorkspace, String strFileId, boolean isVersionnable, JsrUser user)
adminWorkspace
- the current workspacestrFileId
- the id of the file to modifyisVersionnable
- true : sets the file as versionable, if false : remove the file from the file manageruser
- the current userpublic List<IRepositoryFile> getFileHistory(AdminWorkspace adminWorkspace, String strFileId, JsrUser user)
adminWorkspace
- the current workspacestrFileId
- the id of the fileuser
- the current user
public void doRecursive(AdminWorkspace adminWorkspace, AdminView view, String strStartPath, INodeAction<org.apache.lucene.document.Document,Collection<org.apache.lucene.document.Document>> action, JsrUser user)
T
- the result element typeL
- the result list typeadminWorkspace
- the workspace to work onview
- the view to browsestrStartPath
- the start point of the browsingaction
- the action to perform on each nodeuser
- the current userprotected void doRecursive(AdminWorkspace adminWorkspace, IRepositoryFile parentFile, INodeAction<org.apache.lucene.document.Document,Collection<org.apache.lucene.document.Document>> action)
T
- the type of result elementsL
- the collection typeadminWorkspace
- the workspaceparentFile
- the file to star fromaction
- the action to perform on each nodepublic void setLock(AdminWorkspace adminWorkspace, IRepositoryFile file, JsrUser user)
adminWorkspace
- the workspacefile
- the node to lockuser
- the current userpublic void unLock(AdminWorkspace adminWorkspace, IRepositoryFile file, JsrUser user)
adminWorkspace
- the workspacefile
- the file to unlockuser
- the current userpublic void unLock(AdminWorkspace adminWorkspace, IRepositoryFile file, JsrUser user, Collection<JcrLock> jcrLocks)
public List<IRepositoryFile> getPathToFile(AdminWorkspace adminWorkspace, String strFileId, JsrUser user)
adminWorkspace
- the workspacestrFileId
- the id of the nodeuser
- the current user
public Map<String,JcrLock> getLocks(AdminWorkspace adminWorkspace, AdminView view, JsrUser user)
adminWorkspace
- the workspaceview
- the vieuser
- the user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |