org.squashtest.tm.service.internal.testcase
Class TestCaseLibraryNavigationServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.library.AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>
      extended by org.squashtest.tm.service.internal.testcase.TestCaseLibraryNavigationServiceImpl
All Implemented Interfaces:
LibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>, TestCaseLibraryFinderService, TestCaseLibraryNavigationService

@Service(value="squashtest.tm.service.TestCaseLibraryNavigationService")
@Transactional
public class TestCaseLibraryNavigationServiceImpl
extends AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>
implements TestCaseLibraryNavigationService


Field Summary
 
Fields inherited from class org.squashtest.tm.service.internal.library.AbstractLibraryNavigationService
COPY_TOKEN, permissionService
 
Constructor Summary
TestCaseLibraryNavigationServiceImpl()
           
 
Method Summary
 void addTestCaseToFolder(long folderId, org.squashtest.tm.domain.testcase.TestCase testCase)
          Adds a TestCase to a folder.
 void addTestCaseToFolder(long folderId, org.squashtest.tm.domain.testcase.TestCase testCase, Map<Long,String> customFieldValues)
          Adds a TestCase to a folder, and its initial custom field values.
 void addTestCaseToLibrary(long libraryId, org.squashtest.tm.domain.testcase.TestCase testCase)
          Adds a TestCase to the root of the library.
 void addTestCaseToLibrary(long libraryId, org.squashtest.tm.domain.testcase.TestCase testCase, Map<Long,String> customFieldValues)
          Adds a TestCase to the root of the Library, and its initial custom field values.
 List<org.squashtest.tm.domain.testcase.TestCaseLibrary> findLinkableTestCaseLibraries()
          Returns the collection of TestCaseLibrarys which TestCases can be linked by a TestCase via a CallTestStep
 org.squashtest.tm.domain.testcase.TestCase findTestCase(long testCaseId)
           
 Collection<Long> findTestCaseIdsFromSelection(Collection<Long> libraryIds, Collection<Long> nodeIds)
          Passing the ids of some selected TestCaseLibrary and TestCaseLibraryNodes (in separate collections), will return the ids of the TestCases encompassed by this selection.
 List<org.squashtest.tm.domain.testcase.ExportTestCaseData> findTestCasesToExportFromLibrary(List<Long> ids)
          Will find all test cases found in the given projects and return their information as a list of ExportTestCaseData
 List<org.squashtest.tm.domain.testcase.ExportTestCaseData> findTestCasesToExportFromNodes(List<Long> nodesIds)
          Will find all test cases of the given ids and contained in folders of the given ids, and return their information as a list of ExportTestCaseData
protected  NodeDeletionHandler<org.squashtest.tm.domain.testcase.TestCaseLibraryNode,org.squashtest.tm.domain.testcase.TestCaseFolder> getDeletionHandler()
           
protected  FolderDao<org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getFolderDao()
           
protected  LibraryDao<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getLibraryDao()
           
protected  LibraryNodeDao<org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getLibraryNodeDao()
           
 List<String> getParentNodesAsStringList(Long nodeId)
           
protected  PasteStrategy<org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getPasteToFolderStrategy()
           
protected  PasteStrategy<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getPasteToLibraryStrategy()
           
 String getPathAsString(long entityId)
          Returns the path of a TestCaseLibraryNode given its id.
 TestCaseStatisticsBundle getStatisticsForSelection(Collection<Long> libraryIds, Collection<Long> nodeIds)
          Passing the ids of some selected TestCaseLibrary and TestCaseLibraryNodes (in separate collections), will return the statistics covering all the TestCases encompassed by this selection.
 ImportSummary importExcelTestCase(InputStream archiveStream, long libraryId, String encoding)
          Accepts a stream to a .zip file containing regular folders or excel files and nothing else.
 
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

TestCaseLibraryNavigationServiceImpl

public TestCaseLibraryNavigationServiceImpl()
Method Detail

getDeletionHandler

protected NodeDeletionHandler<org.squashtest.tm.domain.testcase.TestCaseLibraryNode,org.squashtest.tm.domain.testcase.TestCaseFolder> getDeletionHandler()
Specified by:
getDeletionHandler in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

getLibraryDao

protected LibraryDao<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getLibraryDao()
Specified by:
getLibraryDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

getFolderDao

protected FolderDao<org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getFolderDao()
Specified by:
getFolderDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

getLibraryNodeDao

protected final LibraryNodeDao<org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getLibraryNodeDao()
Specified by:
getLibraryNodeDao in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

findTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.testcase.TestCase findTestCase(long testCaseId)
Specified by:
findTestCase in interface TestCaseLibraryNavigationService
Returns:

getPasteToFolderStrategy

protected PasteStrategy<org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getPasteToFolderStrategy()
Specified by:
getPasteToFolderStrategy in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

getPasteToLibraryStrategy

protected PasteStrategy<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseLibraryNode> getPasteToLibraryStrategy()
Specified by:
getPasteToLibraryStrategy in class AbstractLibraryNavigationService<org.squashtest.tm.domain.testcase.TestCaseLibrary,org.squashtest.tm.domain.testcase.TestCaseFolder,org.squashtest.tm.domain.testcase.TestCaseLibraryNode>

getPathAsString

public String getPathAsString(long entityId)
Description copied from interface: TestCaseLibraryFinderService
Returns the path of a TestCaseLibraryNode given its id. The format is standard, beginning with /<project-name>

Specified by:
getPathAsString in interface TestCaseLibraryFinderService
Parameters:
entityId - the id of the node.
Returns:
the path of that node.

addTestCaseToLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.tm.domain.testcase.TestCaseLibrary\' , \'CREATE\' )or hasRole(\'ROLE_ADMIN\')")
public void addTestCaseToLibrary(long libraryId,
                                              org.squashtest.tm.domain.testcase.TestCase testCase)
Description copied from interface: TestCaseLibraryNavigationService
Adds a TestCase to the root of the library. The custom fields will be created with their default value.

Specified by:
addTestCaseToLibrary in interface TestCaseLibraryNavigationService

addTestCaseToLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.tm.domain.testcase.TestCaseLibrary\' , \'CREATE\' )or hasRole(\'ROLE_ADMIN\')")
public void addTestCaseToLibrary(long libraryId,
                                              org.squashtest.tm.domain.testcase.TestCase testCase,
                                              Map<Long,String> customFieldValues)
Description copied from interface: TestCaseLibraryNavigationService
Adds a TestCase 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:
addTestCaseToLibrary in interface TestCaseLibraryNavigationService

addTestCaseToFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.tm.domain.testcase.TestCaseFolder\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public void addTestCaseToFolder(long folderId,
                                             org.squashtest.tm.domain.testcase.TestCase testCase)
Description copied from interface: TestCaseLibraryNavigationService
Adds a TestCase to a folder. The custom fields will be created with their default value.

Specified by:
addTestCaseToFolder in interface TestCaseLibraryNavigationService

addTestCaseToFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.tm.domain.testcase.TestCaseFolder\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public void addTestCaseToFolder(long folderId,
                                             org.squashtest.tm.domain.testcase.TestCase testCase,
                                             Map<Long,String> customFieldValues)
Description copied from interface: TestCaseLibraryNavigationService
Adds a TestCase 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:
addTestCaseToFolder in interface TestCaseLibraryNavigationService

importExcelTestCase

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.tm.domain.testcase.TestCaseLibrary\', \'IMPORT\') or hasRole(\'ROLE_ADMIN\')")
public ImportSummary importExcelTestCase(InputStream archiveStream,
                                                      long libraryId,
                                                      String encoding)
Description copied from interface: TestCaseLibraryNavigationService
Accepts a stream to a .zip file containing regular folders or excel files and nothing else. Will convert the test cases from excel to squash.

Specified by:
importExcelTestCase in interface TestCaseLibraryNavigationService
libraryId - the identifier of the library we are importing test cases into.
encoding - the encoding
Returns:
a summary of the operations.

findLinkableTestCaseLibraries

@PostFilter(value="hasPermission(filterObject, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.testcase.TestCaseLibrary> findLinkableTestCaseLibraries()
Description copied from interface: TestCaseLibraryFinderService
Returns the collection of TestCaseLibrarys which TestCases can be linked by a TestCase via a CallTestStep

Specified by:
findLinkableTestCaseLibraries in interface TestCaseLibraryFinderService
Returns:

findTestCasesToExportFromLibrary

public List<org.squashtest.tm.domain.testcase.ExportTestCaseData> findTestCasesToExportFromLibrary(List<Long> ids)
Description copied from interface: TestCaseLibraryNavigationService
Will find all test cases found in the given projects and return their information as a list of ExportTestCaseData

Specified by:
findTestCasesToExportFromLibrary in interface TestCaseLibraryNavigationService
Returns:
a list of ExportTestCaseData

findTestCasesToExportFromNodes

public List<org.squashtest.tm.domain.testcase.ExportTestCaseData> findTestCasesToExportFromNodes(List<Long> nodesIds)
Description copied from interface: TestCaseLibraryNavigationService
Will find all test cases of the given ids and contained in folders of the given ids, and return their information as a list of ExportTestCaseData

Specified by:
findTestCasesToExportFromNodes in interface TestCaseLibraryNavigationService
Parameters:
nodesIds - ids of TestCaseLibraryNode
Returns:
a list of ExportTestCaseData

getStatisticsForSelection

public TestCaseStatisticsBundle getStatisticsForSelection(Collection<Long> libraryIds,
                                                          Collection<Long> nodeIds)
Description copied from interface: TestCaseLibraryFinderService
Passing the ids of some selected TestCaseLibrary and TestCaseLibraryNodes (in separate collections), will return the statistics covering all the TestCases encompassed by this selection. The test case ids that cannot be accessed for security reason will be filtered out.

Specified by:
getStatisticsForSelection in interface TestCaseLibraryFinderService
Returns:
TestcaseStatisticsBundle

findTestCaseIdsFromSelection

public Collection<Long> findTestCaseIdsFromSelection(Collection<Long> libraryIds,
                                                     Collection<Long> nodeIds)
Description copied from interface: TestCaseLibraryFinderService
Passing the ids of some selected TestCaseLibrary and TestCaseLibraryNodes (in separate collections), will return the ids of the TestCases encompassed by this selection. The test case ids that cannot be accessed for security reason will be filtered out.

Specified by:
findTestCaseIdsFromSelection in interface TestCaseLibraryFinderService
Returns:

getParentNodesAsStringList

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


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