Class ProjectStorageImpl
- java.lang.Object
-
- org.exoplatform.task.storage.impl.ProjectStorageImpl
-
- All Implemented Interfaces:
ProjectStorage
public class ProjectStorageImpl extends Object implements ProjectStorage
-
-
Constructor Summary
Constructors Constructor Description ProjectStorageImpl(DAOHandler daoHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectDtocloneProject(long projectId, boolean cloneTask)Clone a project with givenprojectId.intcountCollaboratedProjects(String userName, String keyword)intcountNotEmptyProjects(List<String> memberships, String keyword)intcountProjects(List<String> memberships, String keyword)intcountProjects(ProjectQuery query)ProjectDtocreateProject(ProjectDto project)Create a project with givenprojectmodel object.ProjectDtocreateProject(ProjectDto project, long parentId)Create a sub-project with givenprojectmodel 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)ProjectDtogetProject(Long projectId)Return the project with givenprojectId.List<ProjectDto>getSubProjects(long parentId, int offset, int limit)Return a list of children of a parent project with givenparentId.voidremoveProject(long projectId, boolean deleteChild)Remove the project with givenprojectId, and also its descendants ifdeleteChildis true.ProjectDtoupdateProject(ProjectDto project)voidupdateProjectNoReturn(ProjectDto project)
-
-
-
Constructor Detail
-
ProjectStorageImpl
public ProjectStorageImpl(DAOHandler daoHandler)
-
-
Method Detail
-
getProject
public ProjectDto getProject(Long projectId) throws EntityNotFoundException
Description copied from interface:ProjectStorageReturn the project with givenprojectId.- Specified by:
getProjectin interfaceProjectStorage- Parameters:
projectId- the project id.- Returns:
- get the given project.
- Throws:
EntityNotFoundException- when user is not authorized to get project.
-
getManager
public Set<String> getManager(long projectId)
- Specified by:
getManagerin interfaceProjectStorage
-
getParticipator
public Set<String> getParticipator(long projectId)
- Specified by:
getParticipatorin interfaceProjectStorage
-
createProject
public ProjectDto createProject(ProjectDto project)
Description copied from interface:ProjectStorageCreate a project with givenprojectmodel object.- Specified by:
createProjectin interfaceProjectStorage- Parameters:
project- the given project.- Returns:
- create the given project.
-
createProject
public ProjectDto createProject(ProjectDto project, long parentId) throws EntityNotFoundException
Description copied from interface:ProjectStorageCreate a sub-project with givenprojectmodel object and parent project ID.- Specified by:
createProjectin interfaceProjectStorage- Parameters:
project- the project metadata to create.parentId- parent project ID- Returns:
- Create a sub-project.
- Throws:
EntityNotFoundException- the project associated withparentIddoesn't exist.
-
updateProject
public ProjectDto updateProject(ProjectDto project)
- Specified by:
updateProjectin interfaceProjectStorage
-
updateProjectNoReturn
public void updateProjectNoReturn(ProjectDto project)
- Specified by:
updateProjectNoReturnin interfaceProjectStorage
-
removeProject
public void removeProject(long projectId, boolean deleteChild) throws EntityNotFoundExceptionDescription copied from interface:ProjectStorageRemove the project with givenprojectId, and also its descendants ifdeleteChildis true.- Specified by:
removeProjectin interfaceProjectStorage- Parameters:
projectId- the given project id.deleteChild- delete Child.- Throws:
EntityNotFoundException- when user is not authorized to remove project.
-
cloneProject
public ProjectDto cloneProject(long projectId, boolean cloneTask) throws EntityNotFoundException
Description copied from interface:ProjectStorageClone a project with givenprojectId. IfcloneTaskis true, it will also clone all non-completed tasks from the project.- Specified by:
cloneProjectin interfaceProjectStorage- Parameters:
projectId- 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.- Returns:
- The cloned project.
- Throws:
EntityNotFoundException- when user is not authorized to clone project.
-
getSubProjects
public List<ProjectDto> getSubProjects(long parentId, int offset, int limit) throws Exception
Description copied from interface:ProjectStorageReturn a list of children of a parent project with givenparentId.- Specified by:
getSubProjectsin interfaceProjectStorage- Parameters:
parentId- The parent id of a project.offset- term to offset results.limit- term to limit results.- Returns:
- The list of children of a parent project.
- Throws:
Exception- when can't get sub projects.
-
findProjects
public List<ProjectDto> findProjects(ProjectQuery query, int offset, int limit)
- Specified by:
findProjectsin interfaceProjectStorage
-
countProjects
public int countProjects(ProjectQuery query)
- Specified by:
countProjectsin interfaceProjectStorage
-
findProjects
public List<ProjectDto> findProjects(List<String> memberships, String keyword, OrderBy order, int offset, int limit)
- Specified by:
findProjectsin interfaceProjectStorage
-
findCollaboratedProjects
public List<ProjectDto> findCollaboratedProjects(String userName, String keyword, int offset, int limit)
- Specified by:
findCollaboratedProjectsin interfaceProjectStorage
-
findNotEmptyProjects
public List<ProjectDto> findNotEmptyProjects(List<String> memberships, String keyword, int offset, int limit)
- Specified by:
findNotEmptyProjectsin interfaceProjectStorage
-
countCollaboratedProjects
public int countCollaboratedProjects(String userName, String keyword)
- Specified by:
countCollaboratedProjectsin interfaceProjectStorage
-
countNotEmptyProjects
public int countNotEmptyProjects(List<String> memberships, String keyword)
- Specified by:
countNotEmptyProjectsin interfaceProjectStorage
-
countProjects
public int countProjects(List<String> memberships, String keyword)
- Specified by:
countProjectsin interfaceProjectStorage
-
-