|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.platform.repository2.unified.DefaultUnifiedRepository
public class DefaultUnifiedRepository
Default implementation of IUnifiedRepository
. Delegates to IRepositoryFileDao
and
IRepositoryFileAclDao
.
Constructor Summary | |
---|---|
DefaultUnifiedRepository(IRepositoryFileDao contentDao,
IRepositoryFileAclDao aclDao)
|
Method Summary | ||
---|---|---|
boolean |
canUnlockFile(Serializable fileId)
Returns true if the current user can unlock the file. |
|
RepositoryFile |
createFile(Serializable parentFolderId,
RepositoryFile file,
IRepositoryFileData data,
RepositoryFileAcl acl,
String versionMessage)
Creates a file. |
|
RepositoryFile |
createFile(Serializable parentFolderId,
RepositoryFile file,
IRepositoryFileData data,
String versionMessage)
Creates a file. |
|
RepositoryFile |
createFolder(Serializable parentFolderId,
RepositoryFile file,
RepositoryFileAcl acl,
String versionMessage)
Creates a folder. |
|
RepositoryFile |
createFolder(Serializable parentFolderId,
RepositoryFile file,
String versionMessage)
Creates a folder. |
|
void |
deleteFile(Serializable fileId,
boolean permanent,
String versionMessage)
Deletes a file. |
|
void |
deleteFile(Serializable fileId,
String versionMessage)
Deletes a file in a recoverable manner. |
|
void |
deleteFileAtVersion(Serializable fileId,
Serializable versionId)
Permanently deletes a specific version of a file. |
|
RepositoryFileAcl |
getAcl(Serializable fileId)
Returns ACL for file. |
|
List<RepositoryFile> |
getChildren(Serializable folderId)
Returns the children of this folder. |
|
List<RepositoryFile> |
getChildren(Serializable folderId,
String filter)
Returns the children of this folder that match the specified filter. |
|
|
getDataAtVersionForExecute(Serializable fileId,
Serializable versionId,
Class<T> dataClass)
Gets data at given version for read. |
|
|
getDataAtVersionForRead(Serializable fileId,
Serializable versionId,
Class<T> dataClass)
Gets data at given version for read. |
|
|
getDataForExecute(Serializable fileId,
Class<T> dataClass)
Gets data at base version for execute. |
|
|
getDataForRead(Serializable fileId,
Class<T> dataClass)
Gets data at base version for read. |
|
List<RepositoryFile> |
getDeletedFiles()
Gets all deleted files for the current user. |
|
List<RepositoryFile> |
getDeletedFiles(Serializable folderId)
Gets all deleted files for the current user in this folder. |
|
List<RepositoryFile> |
getDeletedFiles(Serializable folderId,
String filter)
Gets all deleted files for the current user in this folder. |
|
List<RepositoryFileAce> |
getEffectiveAces(Serializable fileId)
Returns the list of access control entries (ACEs) that will be used to make an access control decision. |
|
List<RepositoryFileAce> |
getEffectiveAces(Serializable fileId,
boolean forceEntriesInheriting)
Returns the list of access control entries (ACEs) that will be used to make an access control decision. |
|
RepositoryFile |
getFile(String path)
Gets file. |
|
RepositoryFile |
getFile(String path,
boolean loadMaps)
Same as IUnifiedRepository.getFile(String) except that if loadMaps is true , the maps for localized strings
will be loaded as well. |
|
RepositoryFile |
getFileAtVersion(Serializable fileId,
Serializable versionId)
Gets file as it was at the given version. |
|
RepositoryFile |
getFileById(Serializable fileId)
Gets file. |
|
RepositoryFile |
getFileById(Serializable fileId,
boolean loadMaps)
Same as IUnifiedRepository.getFile(String) except that if loadMaps is true , the maps for localized strings
will be loaded as well. |
|
RepositoryFileTree |
getTree(String path,
int depth,
String filter)
Gets a tree rooted at path. |
|
List<VersionSummary> |
getVersionSummaries(Serializable fileId)
Returns a list of version summary instances. |
|
VersionSummary |
getVersionSummary(Serializable fileId,
Serializable versionId)
Returns a version summary for the given file id and version id. |
|
boolean |
hasAccess(String path,
EnumSet<RepositoryFilePermission> permissions)
Returns true if user has all permissions given. |
|
void |
lockFile(Serializable fileId,
String message)
Locks a file. |
|
void |
moveFile(Serializable fileId,
String destAbsPath,
String versionMessage)
Moves and/or renames file. |
|
void |
restoreFileAtVersion(Serializable fileId,
Serializable versionId,
String versionMessage)
Makes a file, as it was at the given version, the latest version. |
|
void |
undeleteFile(Serializable fileId,
String versionMessage)
Recovers a deleted file if it was not permanently deleted. |
|
void |
unlockFile(Serializable fileId)
Unlocks a file. |
|
RepositoryFileAcl |
updateAcl(RepositoryFileAcl acl)
Updates an ACL. |
|
RepositoryFile |
updateFile(RepositoryFile file,
IRepositoryFileData data,
String versionMessage)
Updates a file and/or the data of a file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultUnifiedRepository(IRepositoryFileDao contentDao, IRepositoryFileAclDao aclDao)
Method Detail |
---|
public List<RepositoryFileAce> getEffectiveAces(Serializable fileId)
getEffectiveAces
in interface IUnifiedRepository
fileId
- file id
public List<RepositoryFileAce> getEffectiveAces(Serializable fileId, boolean forceEntriesInheriting)
getEffectiveAces
in interface IUnifiedRepository
fileId
- file idforceEntriesInheriting
- true
to treat ACL as if isEntriesInheriting
was true; this avoids
having the caller fetch the parent of ACL belonging to file with fileId
; no change is persisted to the ACL
public boolean hasAccess(String path, EnumSet<RepositoryFilePermission> permissions)
true
if user has all permissions given.
hasAccess
in interface IUnifiedRepository
path
- path to file or folderpermissions
- permissions to check
true
if user has all permissions givenpublic RepositoryFile getFile(String path)
getFile
in interface IUnifiedRepository
path
- path to file
null
if the file does not exist or access is deniedpublic RepositoryFile getFileById(Serializable fileId)
getFileById
in interface IUnifiedRepository
fileId
- file id
null
if the file does not exist or access is deniedpublic RepositoryFile getFile(String path, boolean loadMaps)
IUnifiedRepository.getFile(String)
except that if loadMaps
is true
, the maps for localized strings
will be loaded as well. (Normally these are not loaded.) Use true
in editing tools that can show the maps
for editing purposes.
getFile
in interface IUnifiedRepository
path
- path to fileloadMaps
- true
to load localized string maps
null
if the file does not exist or access is deniedpublic RepositoryFile getFileById(Serializable fileId, boolean loadMaps)
IUnifiedRepository.getFile(String)
except that if loadMaps
is true
, the maps for localized strings
will be loaded as well. (Normally these are not loaded.) Use true
in editing tools that can show the maps
for editing purposes.
getFileById
in interface IUnifiedRepository
fileId
- file idloadMaps
- true
to load localized string maps
null
if the file does not exist or access is deniedpublic RepositoryFile createFile(Serializable parentFolderId, RepositoryFile file, IRepositoryFileData data, String versionMessage)
createFile
in interface IUnifiedRepository
parentFolderId
- parent folder idfile
- file to createdata
- file dataversionMessage
- optional version comment to be applied to parentFolder
public RepositoryFile createFolder(Serializable parentFolderId, RepositoryFile file, String versionMessage)
createFolder
in interface IUnifiedRepository
parentFolderId
- parent folder idfile
- file to createversionMessage
- optional version comment to be applied to parentFolder
public RepositoryFile createFile(Serializable parentFolderId, RepositoryFile file, IRepositoryFileData data, RepositoryFileAcl acl, String versionMessage)
createFile
in interface IUnifiedRepository
parentFolderId
- parent folder idfile
- file to createdata
- file dataacl
- file aclversionMessage
- optional version comment to be applied to parentFolder
public RepositoryFile createFolder(Serializable parentFolderId, RepositoryFile file, RepositoryFileAcl acl, String versionMessage)
createFolder
in interface IUnifiedRepository
parentFolderId
- parent folder idfile
- file to createacl
- file aclversionMessage
- optional version comment to be applied to parentFolder
public <T extends IRepositoryFileData> T getDataForExecute(Serializable fileId, Class<T> dataClass)
Delegates to #getStreamForRead(RepositoryFile)
but assumes that some external system (e.g. Spring Security)
is protecting this method with different authorization rules than #getStreamForRead(RepositoryFile)
.
In a direct contradiction of the previous paragraph, this implementation is not currently protected by Spring Security.
getDataForExecute
in interface IUnifiedRepository
fileId
- file iddataClass
- class that implements IRepositoryFileData
#getDataForRead(RepositoryFile, Class)
public <T extends IRepositoryFileData> T getDataAtVersionForExecute(Serializable fileId, Serializable versionId, Class<T> dataClass)
getDataAtVersionForExecute
in interface IUnifiedRepository
fileId
- file idversionId
- version iddataClass
- class that implements IRepositoryFileData
public <T extends IRepositoryFileData> T getDataForRead(Serializable fileId, Class<T> dataClass)
getDataForRead
in interface IUnifiedRepository
fileId
- file iddataClass
- class that implements IRepositoryFileData
public <T extends IRepositoryFileData> T getDataAtVersionForRead(Serializable fileId, Serializable versionId, Class<T> dataClass)
getDataAtVersionForRead
in interface IUnifiedRepository
fileId
- file idversionId
- version iddataClass
- class that implements IRepositoryFileData
public List<RepositoryFile> getChildren(Serializable folderId)
getChildren
in interface IUnifiedRepository
folderId
- id of folder whose children to fetch
null
)public List<RepositoryFile> getChildren(Serializable folderId, String filter)
getChildren
in interface IUnifiedRepository
folderId
- id of folder whose children to fetchfilter
- filter may be a full name or a partial name with one or more wildcard characters ("*"), or a
disjunction (using the "|" character to represent logical OR) of these
null
)public RepositoryFile updateFile(RepositoryFile file, IRepositoryFileData data, String versionMessage)
updateFile
in interface IUnifiedRepository
file
- updated file (not a folder); must have non-null iddata
- updated data
public void deleteFile(Serializable fileId, boolean permanent, String versionMessage)
deleteFile
in interface IUnifiedRepository
fileId
- file idpermanent
- if true
, once file is deleted, it cannot be undeletedversionMessage
- optional version commentpublic void deleteFile(Serializable fileId, String versionMessage)
deleteFile
in interface IUnifiedRepository
fileId
- file idversionMessage
- optional version commentpublic void deleteFileAtVersion(Serializable fileId, Serializable versionId)
deleteFileAtVersion
in interface IUnifiedRepository
fileId
- file idversionId
- version id (MUST not be null)public List<RepositoryFile> getDeletedFiles(Serializable folderId)
getDeletedFiles
in interface IUnifiedRepository
folderId
- folder id
public List<RepositoryFile> getDeletedFiles(Serializable folderId, String filter)
getDeletedFiles
in interface IUnifiedRepository
folderId
- folder idfilter
- filter may be a full name or a partial name with one or more wildcard characters ("*"), or a
disjunction (using the "|" character to represent logical OR) of these
public List<RepositoryFile> getDeletedFiles()
getDeletedFiles
in interface IUnifiedRepository
public void undeleteFile(Serializable fileId, String versionMessage)
undeleteFile
in interface IUnifiedRepository
fileId
- deleted file idversionMessage
- optional version comment to be applied to original parent folderpublic RepositoryFileAcl getAcl(Serializable fileId)
getAcl
in interface IUnifiedRepository
fileId
- file id
public void lockFile(Serializable fileId, String message)
lockFile
in interface IUnifiedRepository
fileId
- file idpublic void unlockFile(Serializable fileId)
unlockFile
in interface IUnifiedRepository
fileId
- file idpublic VersionSummary getVersionSummary(Serializable fileId, Serializable versionId)
getVersionSummary
in interface IUnifiedRepository
fileId
- file idversionId
- version id (if null
, returns the last version)
public List<VersionSummary> getVersionSummaries(Serializable fileId)
getVersionSummaries
in interface IUnifiedRepository
fileId
- file id
null
)public RepositoryFile getFileAtVersion(Serializable fileId, Serializable versionId)
getFileAtVersion
in interface IUnifiedRepository
fileId
- file idversionId
- version id
public RepositoryFileAcl updateAcl(RepositoryFileAcl acl)
updateAcl
in interface IUnifiedRepository
acl
- ACL to set; must have non-null id
IUnifiedRepository.getAcl(Serializable)
public void moveFile(Serializable fileId, String destAbsPath, String versionMessage)
moveFile
in interface IUnifiedRepository
fileId
- if of file or folder to move and/or renamedestAbsPath
- path to destination; if only moving then destAbsPath will be an existing pathpublic void restoreFileAtVersion(Serializable fileId, Serializable versionId, String versionMessage)
IUnifiedRepository.updateFile(RepositoryFile, IRepositoryFileData, String)
with a file and data that matched the state
of the file and data at the given version.
restoreFileAtVersion
in interface IUnifiedRepository
fileId
- file idversionId
- version idversionMessage
- optional version commentpublic boolean canUnlockFile(Serializable fileId)
true
if the current user can unlock the file. This might be a function of access control.
canUnlockFile
in interface IUnifiedRepository
fileId
- file id
true
if the current user can unlock the filepublic RepositoryFileTree getTree(String path, int depth, String filter)
getTree
in interface IUnifiedRepository
path
- path to filedepth
- 0 fetches just file at path; positive integer n fetches node at path plus n levels of children;
negative integer fetches all childrenfilter
- filter may be a full name or a partial name with one or more wildcard characters ("*"), or a
disjunction (using the "|" character to represent logical OR) of these; filter does not apply to root node
null
if the file does not exist or access is denied
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |