Class WorkspaceExplorerTrashDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceDAO
org.ametys.plugins.workspaces.documents.WorkspaceExplorerTrashDAO
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,Serviceable
DAO for handling trash in document workspaces
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord to hold trash document information -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRights to handle trashstatic final StringAvalon RoleFields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectRightHelper, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_extractTrashedFileData(WorkspaceExplorerTrashDAO.TrashDocument trashDocument) Internal method to extract the valuable data of a trashed file_extractTrashedFolderData(WorkspaceExplorerTrashDAO.TrashDocument trashDocument) Internal method to extract the valuable data of a trashed folderdeleteFromTrash(String trashElementId) Delete an object from trashEmpty all file and folders from trashGet the child folders and fileslonggetUsedTrashStorageSpace(Project project) Get the used space size (in bytes) for the current projectrestoreFromTrash(String trashElementId, String mergeComputationModeId) Restore an object from trashvoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkReadAccess, _checkUserReadingRights, _checkUserRights, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, getProjectName, getSitemapLanguage, getSiteName, likeOrUnlikeCommentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
RIGHTS_HANDLE_TRASH
Rights to handle trash- See Also:
-
-
Constructor Details
-
WorkspaceExplorerTrashDAO
public WorkspaceExplorerTrashDAO()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractWorkspaceDAO- Throws:
ServiceException
-
getTrashFoldersAndFiles
Get the child folders and files- Returns:
- the child folders and files
-
restoreFromTrash
Restore an object from trash- Parameters:
trashElementId- the trash element idmergeComputationModeId- the merge computation mode, used to know how to behave when restoring an existing element. May be null.- Returns:
- the result map
-
deleteFromTrash
Delete an object from trash- Parameters:
trashElementId- the trash element id- Returns:
- the result map
-
getUsedTrashStorageSpace
Get the used space size (in bytes) for the current project- Parameters:
project- the project- Returns:
- the used space size (in bytes)
-
_extractTrashedFolderData
protected Map<String,Object> _extractTrashedFolderData(WorkspaceExplorerTrashDAO.TrashDocument trashDocument) Internal method to extract the valuable data of a trashed folder- Parameters:
trashDocument- the trash document- Returns:
- the valuable folder data
-
_extractTrashedFileData
protected Map<String,Object> _extractTrashedFileData(WorkspaceExplorerTrashDAO.TrashDocument trashDocument) Internal method to extract the valuable data of a trashed file- Parameters:
trashDocument- the trash document- Returns:
- the valuable file data
-
emptyTrash
Empty all file and folders from trash- Returns:
- the result map
-