Class ProjectServiceImpl
- java.lang.Object
-
- org.exoplatform.task.service.impl.ProjectServiceImpl
-
- All Implemented Interfaces:
ProjectService
@Singleton public class ProjectServiceImpl extends Object implements ProjectService
-
-
Field Summary
Fields Modifier and Type Field Description static StringPREFIX_CLONE
-
Constructor Summary
Constructors Constructor Description ProjectServiceImpl()ProjectServiceImpl(StatusService statusService, TaskService taskService, DAOHandler daoHandler, ProjectStorage projectStorage, org.exoplatform.services.listener.ListenerService listenerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectDtocloneProject(long id, 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 id)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 id, boolean deleteChild)Remove the project with givenprojectId, and also its descendants ifdeleteChildis true.ProjectDtoupdateProject(ProjectDto proj)Update the project.voidupdateProjectNoReturn(ProjectDto proj)Update the project.
-
-
-
Field Detail
-
PREFIX_CLONE
public static final String PREFIX_CLONE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProjectServiceImpl
public ProjectServiceImpl()
-
ProjectServiceImpl
public ProjectServiceImpl(StatusService statusService, TaskService taskService, DAOHandler daoHandler, ProjectStorage projectStorage, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Detail
-
createProject
public ProjectDto createProject(ProjectDto project)
Description copied from interface:ProjectServiceCreate a project with givenprojectmodel object.- Specified by:
createProjectin interfaceProjectService- Parameters:
project- the given project.- Returns:
- create the given project.
-
createProject
public ProjectDto createProject(ProjectDto project, long parentId) throws EntityNotFoundException
Description copied from interface:ProjectServiceCreate a sub-project with givenprojectmodel object and parent project ID.- Specified by:
createProjectin interfaceProjectService- 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 proj)
Description copied from interface:ProjectServiceUpdate the project.It should throws EntityNotFoundException if the project has been removed OR not existed from database.
- Specified by:
updateProjectin interfaceProjectService- Parameters:
proj- the given project.- Returns:
- The updated project.
-
updateProjectNoReturn
public void updateProjectNoReturn(ProjectDto proj)
Description copied from interface:ProjectServiceUpdate the project.It should throws EntityNotFoundException if the project has been removed OR not existed from database.
- Specified by:
updateProjectNoReturnin interfaceProjectService- Parameters:
proj- the given project.
-
removeProject
public void removeProject(long id, boolean deleteChild) throws EntityNotFoundExceptionDescription copied from interface:ProjectServiceRemove the project with givenprojectId, and also its descendants ifdeleteChildis true.- Specified by:
removeProjectin interfaceProjectService- Parameters:
id- the given project id.deleteChild- delete Child.- Throws:
EntityNotFoundException- when user is not authorized to remove project.
-
cloneProject
public ProjectDto cloneProject(long id, boolean cloneTask) throws Exception
Description copied from interface:ProjectServiceClone a project with givenprojectId. IfcloneTaskis true, it will also clone all non-completed tasks from the project.- Specified by:
cloneProjectin interfaceProjectService- Parameters:
id- 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.Exception
-
getProject
public ProjectDto getProject(Long id) throws EntityNotFoundException
Description copied from interface:ProjectServiceReturn the project with givenprojectId.- Specified by:
getProjectin interfaceProjectService- Parameters:
id- the project id.- Returns:
- get the given project.
- Throws:
EntityNotFoundException- when user is not authorized to get project.
-
getSubProjects
public List<ProjectDto> getSubProjects(long parentId, int offset, int limit)
Description copied from interface:ProjectServiceReturn a list of children of a parent project with givenparentId.- Specified by:
getSubProjectsin interfaceProjectService- 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.
-
findProjects
public List<ProjectDto> findProjects(ProjectQuery query, int offset, int limit)
- Specified by:
findProjectsin interfaceProjectService
-
countProjects
public int countProjects(ProjectQuery query)
- Specified by:
countProjectsin interfaceProjectService
-
findProjects
public List<ProjectDto> findProjects(List<String> memberships, String keyword, OrderBy order, int offset, int limit)
- Specified by:
findProjectsin interfaceProjectService
-
findCollaboratedProjects
public List<ProjectDto> findCollaboratedProjects(String userName, String keyword, int offset, int limit)
- Specified by:
findCollaboratedProjectsin interfaceProjectService
-
findNotEmptyProjects
public List<ProjectDto> findNotEmptyProjects(List<String> memberships, String keyword, int offset, int limit)
- Specified by:
findNotEmptyProjectsin interfaceProjectService
-
countCollaboratedProjects
public int countCollaboratedProjects(String userName, String keyword)
- Specified by:
countCollaboratedProjectsin interfaceProjectService
-
countNotEmptyProjects
public int countNotEmptyProjects(List<String> memberships, String keyword)
- Specified by:
countNotEmptyProjectsin interfaceProjectService
-
countProjects
public int countProjects(List<String> memberships, String keyword)
- Specified by:
countProjectsin interfaceProjectService
-
getManager
public Set<String> getManager(long projectId)
- Specified by:
getManagerin interfaceProjectService
-
getParticipator
public Set<String> getParticipator(long projectId)
- Specified by:
getParticipatorin interfaceProjectService
-
-