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

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

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


Field Summary
 
Fields inherited from class org.squashtest.tm.service.internal.library.AbstractLibraryNavigationService
COPY_TOKEN, permissionService
 
Constructor Summary
CampaignLibraryNavigationServiceImpl()
           
 
Method Summary
 void addCampaignToCampaignFolder(long folderId, org.squashtest.tm.domain.campaign.Campaign newCampaign)
          Adds a campaign to a folder.
 void addCampaignToCampaignFolder(long folderId, org.squashtest.tm.domain.campaign.Campaign campaign, Map<Long,String> customFieldValues)
          Adds a campaign to a folder, and its initial custom field values.
 void addCampaignToCampaignLibrary(long libraryId, org.squashtest.tm.domain.campaign.Campaign newCampaign)
          Adds a Campaign to the root of the library.
 void addCampaignToCampaignLibrary(long libraryId, org.squashtest.tm.domain.campaign.Campaign campaign, Map<Long,String> customFieldValues)
          Adds a Campaign to the root of the Library, and its initial custom field values.
 int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration, long campaignId, boolean copyTestPlan)
          Adds a new iteration to a campaign.
 int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration, long campaignId, boolean copyTestPlan, Map<Long,String> customFieldValues)
          Adds a new iteration to a campaign.
 List<org.squashtest.tm.domain.campaign.Iteration> copyIterationsToCampaign(long campaignId, Long[] iterationsIds)
           
 OperationReport deleteIterations(List<Long> targetIds)
          that method should delete the iterations.
 OperationReport deleteSuites(List<Long> targetIds)
          that method should delete test suites, and remove its references in iteration and iteration test plan item
 org.squashtest.tm.domain.campaign.CampaignExportCSVModel exportCampaignToCSV(Long campaignId, String exportType)
          given a campaign Id, returns a model.
 org.squashtest.tm.domain.campaign.Campaign findCampaign(long reqId)
           
 org.squashtest.tm.domain.campaign.Iteration findIteration(long iterationId)
           
 List<org.squashtest.tm.domain.campaign.TestSuite> findIterationContent(long iterationId)
           
 List<org.squashtest.tm.domain.campaign.Iteration> findIterationsByCampaignId(long campaignId)
           
 List<org.squashtest.tm.domain.campaign.CampaignLibrary> findLinkableCampaignLibraries()
           
protected  NodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder> getDeletionHandler()
           
protected  CampaignFolderDao getFolderDao()
           
protected  CampaignLibraryDao getLibraryDao()
           
protected  LibraryNodeDao<org.squashtest.tm.domain.campaign.CampaignLibraryNode> getLibraryNodeDao()
           
 List<String> getParentNodesAsStringList(Long nodeId)
           
protected  PasteStrategy<org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getPasteToFolderStrategy()
           
protected  PasteStrategy<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getPasteToLibraryStrategy()
           
 String getPathAsString(long entityId)
          Returns the path of a CampaignLibraryNode given its id.
 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)
          that method should investigate the consequences of the deletion request of tes suites, and return a report about what will happen.
 
Methods inherited from class org.squashtest.tm.service.internal.library.AbstractLibraryNavigationService
addFolderToFolder, addFolderToLibrary, checkPermission, copyNodesToFolder, copyNodesToLibrary, createCustomFieldValues, createCustomFieldValues, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, generateUniqueCopyNumber, initCustomFieldValues, makeCopierStrategy, makeMoverStrategy, moveNodesToFolder, moveNodesToLibrary, renameFolder, setFullFolderPath, 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.tm.service.library.LibraryNavigationService
addFolderToFolder, addFolderToLibrary, copyNodesToFolder, copyNodesToLibrary, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, moveNodesToFolder, moveNodesToLibrary, renameFolder, simulateDeletion
 

Constructor Detail

CampaignLibraryNavigationServiceImpl

public CampaignLibraryNavigationServiceImpl()
Method Detail

getDeletionHandler

protected NodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder> getDeletionHandler()
Specified by:
getDeletionHandler in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

getPasteToFolderStrategy

protected PasteStrategy<org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getPasteToFolderStrategy()
Specified by:
getPasteToFolderStrategy in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

getPasteToLibraryStrategy

protected PasteStrategy<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getPasteToLibraryStrategy()
Specified by:
getPasteToLibraryStrategy in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

copyIterationsToCampaign

@PreAuthorize(value="(hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\', \'CREATE\')) or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.campaign.Iteration> copyIterationsToCampaign(long campaignId,
                                                                                               Long[] iterationsIds)
Specified by:
copyIterationsToCampaign in interface CampaignLibraryNavigationService

findCampaign

@PostAuthorize(value="hasPermission(returnObject,\'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.campaign.Campaign findCampaign(long reqId)
Specified by:
findCampaign in interface CampaignLibraryNavigationService
Returns:

addIterationToCampaign

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration,
                                               long campaignId,
                                               boolean copyTestPlan)
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:

addIterationToCampaign

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration,
                                               long campaignId,
                                               boolean copyTestPlan,
                                               Map<Long,String> customFieldValues)
Description copied from interface: CampaignLibraryNavigationService
Adds a new iteration to a campaign. Returns the index of the new iteration. The initial custom field values are passed as a Map, that maps the id of the CustomField to the values of the corresponding CustomFieldValue. Read that last sentence again.

Specified by:
addIterationToCampaign in interface CampaignLibraryNavigationService
Returns:

getLibraryDao

protected final CampaignLibraryDao getLibraryDao()
Specified by:
getLibraryDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

getFolderDao

protected final CampaignFolderDao getFolderDao()
Specified by:
getFolderDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

getLibraryNodeDao

protected final LibraryNodeDao<org.squashtest.tm.domain.campaign.CampaignLibraryNode> getLibraryNodeDao()
Specified by:
getLibraryNodeDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.campaign.CampaignLibrary,org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode>

findIterationsByCampaignId

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

addCampaignToCampaignLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.tm.domain.campaign.CampaignLibrary\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignLibrary(long libraryId,
                                                      org.squashtest.tm.domain.campaign.Campaign newCampaign)
Description copied from interface: CampaignLibraryNavigationService
Adds a Campaign to the root of the library. The custom fields will be created with their default value.

Specified by:
addCampaignToCampaignLibrary in interface CampaignLibraryNavigationService

addCampaignToCampaignLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.tm.domain.campaign.CampaignLibrary\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignLibrary(long libraryId,
                                                      org.squashtest.tm.domain.campaign.Campaign campaign,
                                                      Map<Long,String> customFieldValues)
Description copied from interface: CampaignLibraryNavigationService
Adds a Campaign to the root of the Library, and its initial custom field values. The initial custom field values are passed as a Map, that maps the id of the CustomField to the values of the corresponding CustomFieldValue. Read that last sentence again.

Specified by:
addCampaignToCampaignLibrary in interface CampaignLibraryNavigationService

addCampaignToCampaignFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.tm.domain.campaign.CampaignFolder\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignFolder(long folderId,
                                                     org.squashtest.tm.domain.campaign.Campaign newCampaign)
Description copied from interface: CampaignLibraryNavigationService
Adds a campaign to a folder. The custom fields will be created with their default value.

Specified by:
addCampaignToCampaignFolder in interface CampaignLibraryNavigationService

addCampaignToCampaignFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.tm.domain.campaign.CampaignFolder\', \'CREATE\')or hasRole(\'ROLE_ADMIN\')")
public void addCampaignToCampaignFolder(long folderId,
                                                     org.squashtest.tm.domain.campaign.Campaign campaign,
                                                     Map<Long,String> customFieldValues)
Description copied from interface: CampaignLibraryNavigationService
Adds a campaign to a folder, and its initial custom field values. The initial custom field values are passed as a Map, that maps the id of the CustomField to the values of the corresponding CustomFieldValue. Read that last sentence again.

Specified by:
addCampaignToCampaignFolder in interface CampaignLibraryNavigationService

findIteration

@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.campaign.Iteration findIteration(long iterationId)
Specified by:
findIteration in interface CampaignLibraryNavigationService
Returns:

findIterationContent

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.campaign.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.

findLinkableCampaignLibraries

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.campaign.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 OperationReport 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)
Description copied from interface: CampaignLibraryNavigationService
that method should investigate the consequences of the deletion request of tes suites, and return a report about what will happen.

Specified by:
simulateSuiteDeletion in interface CampaignLibraryNavigationService
Returns:

deleteSuites

public OperationReport 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:

exportCampaignToCSV

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\' ,\'EXPORT\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.campaign.CampaignExportCSVModel exportCampaignToCSV(Long campaignId,
                                                                                                 String exportType)
Description copied from interface: CampaignLibraryNavigationService
given a campaign Id, returns a model. It's made of rows and cell, and have a row header, check the relevant methods. Note that the actual model will differ according to the export type : "L" (light), "S" (standard), "F" (full).

Specified by:
exportCampaignToCSV in interface CampaignLibraryNavigationService
Returns:

getParentNodesAsStringList

public List<String> getParentNodesAsStringList(Long nodeId)
Specified by:
getParentNodesAsStringList in interface CampaignLibraryNavigationService


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