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

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
      extended by org.squashtest.csp.tm.internal.service.CampaignLibraryNavigationServiceImpl
All Implemented Interfaces:
CampaignLibraryNavigationService, LibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>

@Service(value="squashtest.tm.service.CampaignLibraryNavigationService")
@Transactional
public class CampaignLibraryNavigationServiceImpl
extends AbstractLibraryNavigationService<CampaignLibrary,CampaignFolder,CampaignLibraryNode>
implements CampaignLibraryNavigationService


Constructor Summary
CampaignLibraryNavigationServiceImpl()
           
 
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)
           
 Campaign createCopyCampaign(long campaignId)
           
 Iteration createCopyIteration(long iterationId)
           
 List<Long> deleteIterations(List<Long> targetIds)
          that method should delete the iterations.
 Campaign findCampaign(long reqId)
           
 Iteration findIteration(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()
           
 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.
 
Methods inherited from class org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService
addFolderToFolder, addFolderToLibrary, copyNodesToFolder, copyNodesToLibrary, createCopyFolder, createPastableCopy, deleteNodes, findFolder, findFolderContent, findLibrary, findLibraryRootContent, 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, findFolder, findFolderContent, findLibrary, findLibraryRootContent, modeNodesToFolder, moveNodesToLibrary, renameFolder, simulateDeletion
 

Constructor Detail

CampaignLibraryNavigationServiceImpl

public CampaignLibraryNavigationServiceImpl()
Method Detail

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\', \'WRITE\')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\', \'WRITE\')) 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\', \'WRITE\') 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

createCopyCampaign

@PreAuthorize(value="hasPermission(#campaignId,\'org.squashtest.csp.tm.domain.campaign.Campaign\',\'READ\') or hasRole(\'ROLE_ADMIN\')")
public Campaign createCopyCampaign(long campaignId)
Specified by:
createCopyCampaign in interface CampaignLibraryNavigationService

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\', \'WRITE\')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\', \'WRITE\')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

moveIterationToNewCampaign

@PreAuthorize(value="(hasPermission(#newCampaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\' , \'WRITE\') and hasPermission(#oldCampaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\' , \'WRITE\') 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:


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.