org.squashtest.csp.tm.internal.service
Class CustomProjectModificationServiceImpl

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.CustomProjectModificationServiceImpl
All Implemented Interfaces:
CustomProjectModificationService, ProjectFinder

@Service(value="CustomProjectModificationService")
@Transactional
public class CustomProjectModificationServiceImpl
extends Object
implements CustomProjectModificationService

Author:
mpagnon

Constructor Summary
CustomProjectModificationServiceImpl()
           
 
Method Summary
 void addNewPermissionToProject(long userId, long projectId, String permission)
           
 void bindTestAutomationProject(long TMprojectId, TestAutomationProject TAproject)
          Will bind the TM project to a TA project.
 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 deleteProject(long projectId)
           
 AdministrableProject findAdministrableProjectById(long projectId)
           
 List<Project> findAllOrderedByName()
           
 List<org.squashtest.csp.core.security.acls.PermissionGroup> findAllPossiblePermission()
           
 List<Project> findAllReadable()
           
 List<TestAutomationProject> findBoundTestAutomationProjects(long projectId)
           
 Project findById(long projectId)
           
 FilteredCollectionHolder<List<Project>> findSortedProjects(CollectionSorting filter)
           
 User findUserByLogin(String userLogin)
           
 List<UserProjectPermissionsBean> findUserPermissionsBeansByProject(long projectId)
           
 List<User> findUserWithoutPermissionByProject(long projectId)
           
 TestAutomationServer getLastBoundServerOrDefault(long projectId)
          Returns a TestAutomationServer instance.
 void removeBugTracker(long projectId)
          Will remove the association the Project has to it's Bugtracker.
 void removeProjectPermission(long userId, long projectId)
           
 void unbindTestAutomationProject(long TMprojectId, long TAProjectId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomProjectModificationServiceImpl

public CustomProjectModificationServiceImpl()
Method Detail

findById

@Transactional(readOnly=true)
@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public Project findById(long projectId)
Specified by:
findById in interface ProjectFinder

deleteProject

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

findAdministrableProjectById

@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public AdministrableProject findAdministrableProjectById(long projectId)
Specified by:
findAdministrableProjectById in interface CustomProjectModificationService

addNewPermissionToProject

@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public void addNewPermissionToProject(long userId,
                                                   long projectId,
                                                   String permission)
Specified by:
addNewPermissionToProject in interface CustomProjectModificationService

removeProjectPermission

@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public void removeProjectPermission(long userId,
                                                 long projectId)
Specified by:
removeProjectPermission in interface CustomProjectModificationService

findUserPermissionsBeansByProject

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

findAllPossiblePermission

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

findUserWithoutPermissionByProject

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

findUserByLogin

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

bindTestAutomationProject

@PreAuthorize(value="hasPermission(#TMprojectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public void bindTestAutomationProject(long TMprojectId,
                                                   TestAutomationProject TAproject)
Description copied from interface: CustomProjectModificationService
Will bind the TM project to a TA project. Will persist it if necessary.

Specified by:
bindTestAutomationProject in interface CustomProjectModificationService

getLastBoundServerOrDefault

@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public TestAutomationServer getLastBoundServerOrDefault(long projectId)
Description copied from interface: CustomProjectModificationService
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 CustomProjectModificationService

findBoundTestAutomationProjects

@PreAuthorize(value="hasPermission(#projectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public List<TestAutomationProject> findBoundTestAutomationProjects(long projectId)
Specified by:
findBoundTestAutomationProjects in interface CustomProjectModificationService

unbindTestAutomationProject

@PreAuthorize(value="hasPermission(#TMprojectId, \'org.squashtest.csp.tm.domain.project.Project\', \'MANAGEMENT\') or hasRole(\'ROLE_ADMIN\')")
public void unbindTestAutomationProject(long TMprojectId,
                                                     long TAProjectId)
Specified by:
unbindTestAutomationProject in interface CustomProjectModificationService

changeBugTracker

public void changeBugTracker(long projectId,
                             Long newBugtrackerId)
Description copied from interface: CustomProjectModificationService
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 CustomProjectModificationService

removeBugTracker

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

Specified by:
removeBugTracker in interface CustomProjectModificationService

changeBugTrackerProjectName

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

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

findAllOrderedByName

@PostFilter(value="hasPermission(filterObject, \'READ\') or  hasRole(\'ROLE_ADMIN\')")
public List<Project> findAllOrderedByName()
Specified by:
findAllOrderedByName in interface ProjectFinder

findSortedProjects

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public FilteredCollectionHolder<List<Project>> findSortedProjects(CollectionSorting filter)
Specified by:
findSortedProjects in interface ProjectFinder

findAllReadable

@PostFilter(value="hasPermission(filterObject, \'READ\') or  hasRole(\'ROLE_ADMIN\')")
public List<Project> findAllReadable()
Specified by:
findAllReadable in interface ProjectFinder


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