public class ProjectStorageImpl extends Object implements ProjectStorage
| Constructor and Description |
|---|
ProjectStorageImpl(DAOHandler daoHandler) |
| Modifier and Type | Method and Description |
|---|---|
ProjectDto |
cloneProject(long projectId,
boolean cloneTask)
Clone a project with given
projectId. |
int |
countCollaboratedProjects(String userName,
String keyword) |
int |
countNotEmptyProjects(List<String> memberships,
String keyword) |
int |
countProjects(List<String> memberships,
String keyword) |
int |
countProjects(ProjectQuery query) |
ProjectDto |
createProject(ProjectDto project)
Create a project with given
project model object. |
ProjectDto |
createProject(ProjectDto project,
long parentId)
Create a sub-project with given
project model object and parent project ID. |
List<ProjectDto> |
findCollaboratedProjects(String userName,
String keyword,
int offset,
int limit) |
List<ProjectDto> |
findNotEmptyProjects(List<String> memberships,
String keyword,
int offset,
int limit) |
List<ProjectDto> |
findProjects(List<String> memberships,
String keyword,
OrderBy order,
int offset,
int limit) |
List<ProjectDto> |
findProjects(ProjectQuery query,
int offset,
int limit) |
Set<String> |
getManager(long projectId) |
Set<String> |
getParticipator(long projectId) |
ProjectDto |
getProject(Long projectId)
Return the project with given
projectId. |
List<ProjectDto> |
getSubProjects(long parentId,
int offset,
int limit)
Return a list of children of a parent project with given
parentId. |
ProjectDto |
projectToDto(Project project) |
Project |
projectToEntity(ProjectDto projectDto) |
void |
removeProject(long projectId,
boolean deleteChild)
Remove the project with given
projectId,
and also its descendants if deleteChild is true. |
ProjectDto |
updateProject(ProjectDto project)
Update the project.
|
public ProjectStorageImpl(DAOHandler daoHandler)
public ProjectDto getProject(Long projectId) throws EntityNotFoundException
ProjectStorageprojectId.getProject in interface ProjectStorageprojectId - the project id.EntityNotFoundException - when user is not authorized to get project.public Set<String> getManager(long projectId)
getManager in interface ProjectStoragepublic Set<String> getParticipator(long projectId)
getParticipator in interface ProjectStoragepublic ProjectDto createProject(ProjectDto project)
ProjectStorageproject model object.createProject in interface ProjectStorageproject - the given project.public ProjectDto createProject(ProjectDto project, long parentId) throws EntityNotFoundException
ProjectStorageproject model object and parent project ID.createProject in interface ProjectStorageproject - the project metadata to create.parentId - parent project IDEntityNotFoundException - the project associated with parentId doesn't exist.public ProjectDto updateProject(ProjectDto project)
ProjectStorageIt should throws EntityNotFoundException if the project has been removed OR not existed from database.
updateProject in interface ProjectStorageproject - the given project.public void removeProject(long projectId,
boolean deleteChild)
throws EntityNotFoundException
ProjectStorageprojectId,
and also its descendants if deleteChild is true.removeProject in interface ProjectStorageprojectId - the given project id.deleteChild - delete Child.EntityNotFoundException - when user is not authorized to remove project.public ProjectDto cloneProject(long projectId, boolean cloneTask) throws EntityNotFoundException
ProjectStorageprojectId. If cloneTask is true,
it will also clone all non-completed tasks from the project.cloneProject in interface ProjectStorageprojectId - The id of a project which it copies from.cloneTask - If false, it will clone only project metadata.
Otherwise, it also clones all non-completed tasks from the project.EntityNotFoundException - when user is not authorized to clone project.public List<ProjectDto> getSubProjects(long parentId, int offset, int limit) throws Exception
ProjectStorageparentId.getSubProjects in interface ProjectStorageparentId - The parent id of a project.Exceptionpublic List<ProjectDto> findProjects(ProjectQuery query, int offset, int limit)
findProjects in interface ProjectStoragepublic int countProjects(ProjectQuery query)
countProjects in interface ProjectStoragepublic List<ProjectDto> findProjects(List<String> memberships, String keyword, OrderBy order, int offset, int limit)
findProjects in interface ProjectStoragepublic List<ProjectDto> findCollaboratedProjects(String userName, String keyword, int offset, int limit)
findCollaboratedProjects in interface ProjectStoragepublic List<ProjectDto> findNotEmptyProjects(List<String> memberships, String keyword, int offset, int limit)
findNotEmptyProjects in interface ProjectStoragepublic int countCollaboratedProjects(String userName, String keyword)
countCollaboratedProjects in interface ProjectStoragepublic int countNotEmptyProjects(List<String> memberships, String keyword)
countNotEmptyProjects in interface ProjectStoragepublic int countProjects(List<String> memberships, String keyword)
countProjects in interface ProjectStoragepublic Project projectToEntity(ProjectDto projectDto)
projectToEntity in interface ProjectStoragepublic ProjectDto projectToDto(Project project)
projectToDto in interface ProjectStorageCopyright © 2003–2021 eXo Platform SAS. All rights reserved.