org.squashtest.csp.tm.internal.service.project
Class CustomGenericProjectManagerImpl

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.project.CustomGenericProjectManagerImpl
All Implemented Interfaces:
CustomGenericProjectFinder, CustomGenericProjectManager

@Service(value="CustomGenericProjectManager")
public class CustomGenericProjectManagerImpl
extends Object
implements CustomGenericProjectManager

Author:
Gregory Fouquet

Constructor Summary
CustomGenericProjectManagerImpl()
           
 
Method Summary
 void addNewPermissionToProject(long userId, long projectId, String permission)
           
 void bindTestAutomationProject(long projectId, TestAutomationProject taProject)
          Will bind the TM project to a TA project.
 void changeBugTracker(GenericProject project, org.squashtest.csp.core.bugtracker.domain.BugTracker newBugtracker)
          Change the Bugtracker the Project is associated-to.
 void changeBugTracker(long projectId, Long newBugtrackerId)
          Change the Bugtracker the Project is associated-to.
 void changeBugTrackerProjectName(long projectId, String projectBugTrackerName)
          Will change a bugtracker connexion parameter : the name of the bugtracker's project it's associated to.
 void coerceTemplateIntoProject(long templateId)
           
 void deleteProject(long projectId)
           
 AdministrableProject findAdministrableProjectById(long projectId)
           
 List<org.squashtest.csp.core.security.acls.PermissionGroup> findAllPossiblePermission()
           
 List<TestAutomationProject> findBoundTestAutomationProjects(long projectId)
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<GenericProject>> findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
          Will find all Projects and Templates to which the user has management access to and return them ordered according to the given params.
 User findUserByLogin(String userLogin)
           
 List<UserProjectPermissionsBean> findUserPermissionsBeansByProject(long projectId)
           
 List<User> findUserWithoutPermissionByProject(long projectId)
           
 TestAutomationServer getLastBoundServerOrDefault(long projectId)
          Returns a TestAutomationServer instance.
 void persist(GenericProject project)
           
 void removeBugTracker(long projectId)
          Will remove the association the Project has to it's Bugtracker.
 void removeProjectPermission(long userId, long projectId)
           
 void unbindTestAutomationProject(long projectId, long taProjectId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomGenericProjectManagerImpl

public CustomGenericProjectManagerImpl()
Method Detail

findSortedProjects

@Transactional(readOnly=true)
@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<GenericProject>> findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
Description copied from interface: CustomGenericProjectManager
Will find all Projects and Templates to which the user has management access to and return them ordered according to the given params.

Specified by:
findSortedProjects in interface CustomGenericProjectManager
Parameters:
pagingAndSorting - the PagingAndSorting that holds order and paging params
Returns:
a FilteredCollectionHolder containing all projects the user has management access to, ordered according to the given params.
See Also:
CustomGenericProjectManager.findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting)

persist

@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public void persist(GenericProject project)
Specified by:
persist in interface CustomGenericProjectManager

coerceTemplateIntoProject

public void coerceTemplateIntoProject(long templateId)
Specified by:
coerceTemplateIntoProject in interface CustomGenericProjectManager
See Also:
CustomGenericProjectManager.coerceTemplateIntoProject(long)

deleteProject

@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public void deleteProject(long projectId)
Specified by:
deleteProject in interface CustomGenericProjectManager

findAdministrableProjectById

public AdministrableProject findAdministrableProjectById(long projectId)
Specified by:
findAdministrableProjectById in interface CustomGenericProjectFinder

addNewPermissionToProject

public void addNewPermissionToProject(long userId,
                                      long projectId,
                                      String permission)
Specified by:
addNewPermissionToProject in interface CustomGenericProjectManager

removeProjectPermission

public void removeProjectPermission(long userId,
                                    long projectId)
Specified by:
removeProjectPermission in interface CustomGenericProjectManager

findUserPermissionsBeansByProject

public List<UserProjectPermissionsBean> findUserPermissionsBeansByProject(long projectId)
Specified by:
findUserPermissionsBeansByProject in interface CustomGenericProjectManager

findAllPossiblePermission

public List<org.squashtest.csp.core.security.acls.PermissionGroup> findAllPossiblePermission()
Specified by:
findAllPossiblePermission in interface CustomGenericProjectManager

findUserWithoutPermissionByProject

public List<User> findUserWithoutPermissionByProject(long projectId)
Specified by:
findUserWithoutPermissionByProject in interface CustomGenericProjectManager

findUserByLogin

public User findUserByLogin(String userLogin)
Specified by:
findUserByLogin in interface CustomGenericProjectManager

bindTestAutomationProject

public void bindTestAutomationProject(long projectId,
                                      TestAutomationProject taProject)
Description copied from interface: CustomGenericProjectManager
Will bind the TM project to a TA project. Will persist it if necessary.

Specified by:
bindTestAutomationProject in interface CustomGenericProjectManager

getLastBoundServerOrDefault

public TestAutomationServer getLastBoundServerOrDefault(long projectId)
Description copied from interface: CustomGenericProjectFinder
Returns a TestAutomationServer instance. Either it is a persisted instance that the tm project was bound to lastly (through a ta project), either it will be the default server configuration.

Specified by:
getLastBoundServerOrDefault in interface CustomGenericProjectFinder

findBoundTestAutomationProjects

public List<TestAutomationProject> findBoundTestAutomationProjects(long projectId)
Specified by:
findBoundTestAutomationProjects in interface CustomGenericProjectFinder

unbindTestAutomationProject

public void unbindTestAutomationProject(long projectId,
                                        long taProjectId)
Specified by:
unbindTestAutomationProject in interface CustomGenericProjectManager

changeBugTracker

public void changeBugTracker(long projectId,
                             Long newBugtrackerId)
Description copied from interface: CustomGenericProjectManager
Change the Bugtracker the Project is associated-to.
If the Project had no Bugtracker, will add a new association.
If the Project had a already a Bugtracker, it will keep the project-Name information

Specified by:
changeBugTracker in interface CustomGenericProjectManager

changeBugTracker

public void changeBugTracker(GenericProject project,
                             org.squashtest.csp.core.bugtracker.domain.BugTracker newBugtracker)
Description copied from interface: CustomGenericProjectManager
Change the Bugtracker the Project is associated-to.
If the Project had no Bugtracker, will add a new association.
If the Project had a already a Bugtracker, it will keep the project-Name information

Specified by:
changeBugTracker in interface CustomGenericProjectManager
Parameters:
project - : the concerned GenericProject
newBugtracker - : the bugtracker to bind the project to

removeBugTracker

public void removeBugTracker(long projectId)
Description copied from interface: CustomGenericProjectManager
Will remove the association the Project has to it's Bugtracker.

Specified by:
removeBugTracker in interface CustomGenericProjectManager

changeBugTrackerProjectName

public void changeBugTrackerProjectName(long projectId,
                                        String projectBugTrackerName)
Description copied from interface: CustomGenericProjectManager
Will change a bugtracker connexion parameter : the name of the bugtracker's project it's associated to.

Specified by:
changeBugTrackerProjectName in interface CustomGenericProjectManager
Parameters:
projectId - the concerned project
projectBugTrackerName - the name of the bugtracker's project, the Project is connected to


Copyright © 2010-2012 Henix, henix.fr. All Rights Reserved.