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

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

@Service(value="CustomGenericProjectManager")
@Transactional
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, org.squashtest.tm.domain.testautomation.TestAutomationProject taProject)
          Will bind the TM project to a TA project.
 void changeBugTracker(org.squashtest.tm.domain.project.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)
           
 void disableWizardForWorkspace(long projectId, org.squashtest.tm.api.workspace.WorkspaceType workspace, String wizardId)
          enables the given wizard for the given workspace of the given project
 void enableWizardForWorkspace(long projectId, org.squashtest.tm.api.workspace.WorkspaceType workspace, String wizardId)
          enables the given wizard for the given workspace of the given project
 org.squashtest.tm.domain.project.AdministrableProject findAdministrableProjectById(long projectId)
           
 List<org.squashtest.tm.security.acls.PermissionGroup> findAllPossiblePermission()
           
 List<org.squashtest.tm.domain.testautomation.TestAutomationProject> findBoundTestAutomationProjects(long projectId)
           
 org.squashtest.tm.domain.users.Party findPartyById(long partyId)
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.PartyProjectPermissionsBean>> findPartyPermissionsBeanByProject(org.squashtest.tm.core.foundation.collection.PagingAndSorting sorting, org.squashtest.tm.core.foundation.collection.Filtering filtering, long projectId)
           
 List<org.squashtest.tm.domain.users.PartyProjectPermissionsBean> findPartyPermissionsBeansByProject(long projectId)
           
 List<org.squashtest.tm.domain.users.Party> findPartyWithoutPermissionByProject(long projectId)
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.project.GenericProject>> findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting, org.squashtest.tm.core.foundation.collection.Filtering filter)
          Will find all Projects and Templates to which the user has management access to and return them ordered according to the given params.
 org.squashtest.tm.domain.testautomation.TestAutomationServer getLastBoundServerOrDefault(long projectId)
          Returns a TestAutomationServer instance.
 void persist(org.squashtest.tm.domain.project.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<org.squashtest.tm.domain.project.GenericProject>> findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting,
                                                                                                                                                                               org.squashtest.tm.core.foundation.collection.Filtering filter)
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 PagedCollectionHolder containing all projects the user has management access to, ordered according to the given params.
See Also:
org.squashtest.tm.service.project.CustomGenericProjectManager#findSortedProjects(org.squashtest.tm.core.foundation.collection.PagingAndSorting)

persist

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

coerceTemplateIntoProject

@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public void coerceTemplateIntoProject(long templateId)
Specified by:
coerceTemplateIntoProject in interface CustomGenericProjectManager
See Also:
CustomGenericProjectManager.coerceTemplateIntoProject(long)

deleteProject

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

findAdministrableProjectById

public org.squashtest.tm.domain.project.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

findPartyPermissionsBeansByProject

public List<org.squashtest.tm.domain.users.PartyProjectPermissionsBean> findPartyPermissionsBeansByProject(long projectId)
Specified by:
findPartyPermissionsBeansByProject in interface CustomGenericProjectFinder

findPartyPermissionsBeanByProject

public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.PartyProjectPermissionsBean>> findPartyPermissionsBeanByProject(org.squashtest.tm.core.foundation.collection.PagingAndSorting sorting,
                                                                                                                                                                              org.squashtest.tm.core.foundation.collection.Filtering filtering,
                                                                                                                                                                              long projectId)
Specified by:
findPartyPermissionsBeanByProject in interface CustomGenericProjectFinder

findAllPossiblePermission

public List<org.squashtest.tm.security.acls.PermissionGroup> findAllPossiblePermission()
Specified by:
findAllPossiblePermission in interface CustomGenericProjectFinder

findPartyWithoutPermissionByProject

public List<org.squashtest.tm.domain.users.Party> findPartyWithoutPermissionByProject(long projectId)
Specified by:
findPartyWithoutPermissionByProject in interface CustomGenericProjectFinder

findPartyById

public org.squashtest.tm.domain.users.Party findPartyById(long partyId)
Specified by:
findPartyById in interface CustomGenericProjectManager

bindTestAutomationProject

public void bindTestAutomationProject(long projectId,
                                      org.squashtest.tm.domain.testautomation.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 org.squashtest.tm.domain.testautomation.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<org.squashtest.tm.domain.testautomation.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(org.squashtest.tm.domain.project.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

enableWizardForWorkspace

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void enableWizardForWorkspace(long projectId,
                                                  org.squashtest.tm.api.workspace.WorkspaceType workspace,
                                                  String wizardId)
Description copied from interface: CustomGenericProjectManager
enables the given wizard for the given workspace of the given project

Specified by:
enableWizardForWorkspace in interface CustomGenericProjectManager

disableWizardForWorkspace

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void disableWizardForWorkspace(long projectId,
                                                   org.squashtest.tm.api.workspace.WorkspaceType workspace,
                                                   String wizardId)
Description copied from interface: CustomGenericProjectManager
enables the given wizard for the given workspace of the given project

Specified by:
disableWizardForWorkspace in interface CustomGenericProjectManager


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