org.squashtest.csp.tm.internal.service
Class CampaignLibraryNavigationServiceImpl
java.lang.Object
org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
org.squashtest.csp.tm.internal.service.CampaignLibraryNavigationServiceImpl
- All Implemented Interfaces:
- CampaignLibraryFinderService, CampaignLibraryNavigationService, LibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
@Service(value="squashtest.tm.service.CampaignLibraryNavigationService")
@Transactional
public class CampaignLibraryNavigationServiceImpl
- extends AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
- implements CampaignLibraryNavigationService
|
Method Summary |
void |
addCampaignToCampaignFolder(long folderId,
Campaign newCampaign)
|
void |
addCampaignToCampaignLibrary(long libraryId,
Campaign newCampaign)
|
int |
addIterationToCampaign(Iteration iteration,
long campaignId)
Adds a new iteration to a campaign. |
List<Iteration> |
copyIterationsToCampaign(long campaignId,
Long[] iterationsIds)
|
int |
copyIterationToCampaign(long campaignId,
long iterationId)
|
Iteration |
createCopyIteration(long iterationId)
|
protected CampaignLibraryNode |
createPastableCopy(CampaignLibraryNode original)
this is done here because content of campaigns is to be persisted first |
List<Long> |
deleteIterations(List<Long> targetIds)
that method should delete the iterations. |
List<Long> |
deleteSuites(List<Long> targetIds)
that method should delete test suites, and remove its references in iteration and iteration test plan item |
Campaign |
findCampaign(long reqId)
|
Iteration |
findIteration(long iterationId)
|
List<TestSuite> |
findIterationContent(long iterationId)
|
List<Iteration> |
findIterationsByCampaignId(long campaignId)
|
List<CampaignLibrary> |
findLinkableCampaignLibraries()
|
protected NodeDeletionHandler<CampaignLibraryNode,CampaignFolder> |
getDeletionHandler()
|
protected CampaignFolderDao |
getFolderDao()
|
protected CampaignLibraryDao |
getLibraryDao()
|
protected LibraryNodeDao<CampaignLibraryNode> |
getLibraryNodeDao()
|
String |
getPathAsString(long entityId)
Returns the path of a CampaignLibraryNode given its id. |
int |
moveIterationToNewCampaign(long newCampaignId,
long oldCampaignId,
long iterationId)
|
List<SuppressionPreviewReport> |
simulateIterationDeletion(List<Long> targetIds)
that method should investigate the consequences of the deletion request of iterations, and return a report about
what will happen. |
List<SuppressionPreviewReport> |
simulateSuiteDeletion(List<Long> targetIds)
|
| Methods inherited from class org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService |
addFolderToFolder, addFolderToLibrary, checkPermission, copyNodesToFolder, copyNodesToLibrary, createCopyFolder, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, generateUniqueCopyNumber, modeNodesToFolder, moveNodesToLibrary, renameFolder, setPermissionService, simulateDeletion |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.squashtest.csp.tm.service.LibraryNavigationService |
addFolderToFolder, addFolderToLibrary, copyNodesToFolder, copyNodesToLibrary, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, modeNodesToFolder, moveNodesToLibrary, renameFolder, simulateDeletion |
CampaignLibraryNavigationServiceImpl
public CampaignLibraryNavigationServiceImpl()
getDeletionHandler
protected NodeDeletionHandler<CampaignLibraryNode,CampaignFolder> getDeletionHandler()
- Specified by:
getDeletionHandler in class AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
copyIterationToCampaign
@PreAuthorize(value="(hasPermission(#campaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\', \'CREATE\')and hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'READ\'))or hasRole(\'ROLE_ADMIN\')")
public int copyIterationToCampaign(long campaignId,
long iterationId)
- Specified by:
copyIterationToCampaign in interface CampaignLibraryNavigationService
copyIterationsToCampaign
@PreAuthorize(value="(hasPermission(#campaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\', \'CREATE\')) or hasRole(\'ROLE_ADMIN\')")
public List<Iteration> copyIterationsToCampaign(long campaignId,
Long[] iterationsIds)
- Specified by:
copyIterationsToCampaign in interface CampaignLibraryNavigationService
findCampaign
@PostAuthorize(value="hasPermission(returnObject,\'READ\') or hasRole(\'ROLE_ADMIN\')")
public Campaign findCampaign(long reqId)
- Specified by:
findCampaign in interface CampaignLibraryNavigationService
addIterationToCampaign
@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public int addIterationToCampaign(Iteration iteration,
long campaignId)
- Description copied from interface:
CampaignLibraryNavigationService
- Adds a new iteration to a campaign. Returns the index of the new iteration.
- Specified by:
addIterationToCampaign in interface CampaignLibraryNavigationService
- Returns:
getLibraryDao
protected final CampaignLibraryDao getLibraryDao()
- Specified by:
getLibraryDao in class AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
getFolderDao
protected final CampaignFolderDao getFolderDao()
- Specified by:
getFolderDao in class AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
getLibraryNodeDao
protected final LibraryNodeDao<CampaignLibraryNode> getLibraryNodeDao()
- Specified by:
getLibraryNodeDao in class AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
findIterationsByCampaignId
@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<Iteration> findIterationsByCampaignId(long campaignId)
- Specified by:
findIterationsByCampaignId in interface CampaignLibraryNavigationService
createPastableCopy
protected CampaignLibraryNode createPastableCopy(CampaignLibraryNode original)
- this is done here because content of campaigns is to be persisted first
- Overrides:
createPastableCopy in class AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
createCopyIteration
@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
public Iteration createCopyIteration(long iterationId)
addCampaignToCampaignLibrary
@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.csp.tm.domain.campaign.CampaignLibrary\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignLibrary(long libraryId,
Campaign newCampaign)
- Specified by:
addCampaignToCampaignLibrary in interface CampaignLibraryNavigationService
addCampaignToCampaignFolder
@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.csp.tm.domain.campaign.CampaignFolder\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignFolder(long folderId,
Campaign newCampaign)
- Specified by:
addCampaignToCampaignFolder in interface CampaignLibraryNavigationService
findIteration
@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public Iteration findIteration(long iterationId)
- Specified by:
findIteration in interface CampaignLibraryNavigationService
findIterationContent
@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<TestSuite> findIterationContent(long iterationId)
- Specified by:
findIterationContent in interface CampaignLibraryNavigationService
getPathAsString
public String getPathAsString(long entityId)
- Description copied from interface:
CampaignLibraryFinderService
- Returns the path of a CampaignLibraryNode given its id. The format is standard, beginning with /<project-name>
- Specified by:
getPathAsString in interface CampaignLibraryFinderService
- Parameters:
entityId - the id of the node.
- Returns:
- the path of that node.
moveIterationToNewCampaign
@PreAuthorize(value="(hasPermission(#newCampaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\' , \'CREATE\') and hasPermission(#oldCampaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\' , \'DELETE\') and hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\' , \'READ\' ) ) or hasRole(\'ROLE_ADMIN\')")
public int moveIterationToNewCampaign(long newCampaignId,
long oldCampaignId,
long iterationId)
- Specified by:
moveIterationToNewCampaign in interface CampaignLibraryNavigationService
findLinkableCampaignLibraries
@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<CampaignLibrary> findLinkableCampaignLibraries()
- Specified by:
findLinkableCampaignLibraries in interface CampaignLibraryNavigationService
simulateIterationDeletion
public List<SuppressionPreviewReport> simulateIterationDeletion(List<Long> targetIds)
- Description copied from interface:
CampaignLibraryNavigationService
- that method should investigate the consequences of the deletion request of iterations, and return a report about
what will happen.
- Specified by:
simulateIterationDeletion in interface CampaignLibraryNavigationService
- Returns:
deleteIterations
public List<Long> deleteIterations(List<Long> targetIds)
- Description copied from interface:
CampaignLibraryNavigationService
- that method should delete the iterations. It still takes care of non deletable iterations so the implementation
should filter out the ids who can't be deleted.
- Specified by:
deleteIterations in interface CampaignLibraryNavigationService
- Returns:
simulateSuiteDeletion
public List<SuppressionPreviewReport> simulateSuiteDeletion(List<Long> targetIds)
- Specified by:
simulateSuiteDeletion in interface CampaignLibraryNavigationService
deleteSuites
public List<Long> deleteSuites(List<Long> targetIds)
- Description copied from interface:
CampaignLibraryNavigationService
- that method should delete test suites, and remove its references in iteration and iteration test plan item
- Specified by:
deleteSuites in interface CampaignLibraryNavigationService
- Returns:
Copyright © 2010-2012 Henix, henix.fr. All Rights Reserved.