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

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
      extended by org.squashtest.csp.tm.internal.service.RequirementLibraryNavigationServiceImpl
All Implemented Interfaces:
LibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>, RequirementLibraryFinderService, RequirementLibraryNavigationService

@Service(value="squashtest.tm.service.RequirementLibraryNavigationService")
@Transactional
public class RequirementLibraryNavigationServiceImpl
extends AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
implements RequirementLibraryNavigationService, RequirementLibraryFinderService


Field Summary
 
Fields inherited from class org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService
COPY_TOKEN, customFieldValuesService
 
Constructor Summary
RequirementLibraryNavigationServiceImpl()
           
 
Method Summary
 Requirement addRequirementToRequirementFolder(long folderId, NewRequirementVersionDto firstVersion)
           
 Requirement addRequirementToRequirementFolder(long folderId, Requirement requirement)
           
 Requirement addRequirementToRequirementLibrary(long libraryId, NewRequirementVersionDto newVersion)
           
 Requirement addRequirementToRequirementLibrary(long libraryId, Requirement requirement)
           
 List<RequirementLibraryNode> copyNodesToFolder(long destinationId, Long[] sourceNodesIds)
          will create a deep copy of the given LibraryNodes, paste them in the destination folder, and return the copies.
 List<RequirementLibraryNode> copyNodesToLibrary(long destinationId, Long[] targetId)
          same, when the destination is a Library.
 List<RequirementLibrary> findLinkableRequirementLibraries()
          Returns the collection of RequirementLibrary which Requirements can be linked by a TestCase
 Requirement findRequirement(long reqId)
           
 List<ExportRequirementData> findRequirementsToExportFromNodes(List<Long> folderIds)
          Will find all requirements of the given ids and contained in folders of the given ids, and return their information as a list of ExportRequirementData
 List<ExportRequirementData> findRequirementsToExportFromProject(List<Long> libraryIds)
          Will find all requirements found in the given projects and return their information as a list of ExportRequirementData
protected  NodeDeletionHandler<RequirementLibraryNode,RequirementFolder> getDeletionHandler()
           
protected  RequirementFolderDao getFolderDao()
           
protected  RequirementLibraryDao getLibraryDao()
           
protected  LibraryNodeDao<RequirementLibraryNode> getLibraryNodeDao()
           
protected  PasteStrategy<RequirementFolder,RequirementLibraryNode> getPasteToFolderStrategy()
           
protected  PasteStrategy<RequirementLibrary,RequirementLibraryNode> getPasteToLibraryStrategy()
           
 String getPathAsString(long entityId)
          Returns the path of a RequirementLibraryNode given its id.
 ImportSummary importExcel(InputStream stream, long libraryId)
          Accepts a stream to a .xls / .xlsx file info for requirement folders and requirements.
 ImportRequirementTestCaseLinksSummary importLinksExcel(InputStream stream)
          Accepts a stream to a .xls / .xlsx file info for requirement and test-case links.
 
Methods inherited from class org.squashtest.csp.tm.internal.service.AbstractLibraryNavigationService
addFolderToFolder, addFolderToLibrary, checkPermission, createCopyFolder, createCustomFieldsValues, createCustomFieldValues, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, generateUniqueCopyNumber, initCustomFieldValues, modeNodesToFolder, moveNodesToLibrary, renameFolder, setFullFolderPath, 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, deleteNodes, findCreatableLibrary, findFolder, findFolderContent, findLibrary, findLibraryOfRootNodeIfExist, findLibraryRootContent, findParentIfExists, modeNodesToFolder, moveNodesToLibrary, renameFolder, simulateDeletion
 

Constructor Detail

RequirementLibraryNavigationServiceImpl

public RequirementLibraryNavigationServiceImpl()
Method Detail

getDeletionHandler

protected NodeDeletionHandler<RequirementLibraryNode,RequirementFolder> getDeletionHandler()
Specified by:
getDeletionHandler in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

findRequirement

@PostAuthorize(value="hasPermission(returnObject,\'READ\') or hasRole(\'ROLE_ADMIN\')")
public Requirement findRequirement(long reqId)
Specified by:
findRequirement in interface RequirementLibraryNavigationService

getLibraryDao

protected final RequirementLibraryDao getLibraryDao()
Specified by:
getLibraryDao in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

getFolderDao

protected final RequirementFolderDao getFolderDao()
Specified by:
getFolderDao in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

getLibraryNodeDao

protected final LibraryNodeDao<RequirementLibraryNode> getLibraryNodeDao()
Specified by:
getLibraryNodeDao in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

getPasteToFolderStrategy

protected PasteStrategy<RequirementFolder,RequirementLibraryNode> getPasteToFolderStrategy()
Specified by:
getPasteToFolderStrategy in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

getPasteToLibraryStrategy

protected PasteStrategy<RequirementLibrary,RequirementLibraryNode> getPasteToLibraryStrategy()
Specified by:
getPasteToLibraryStrategy in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>

getPathAsString

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

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

addRequirementToRequirementLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.csp.tm.domain.requirement.RequirementLibrary\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public Requirement addRequirementToRequirementLibrary(long libraryId,
                                                                   @NotNull
                                                                   NewRequirementVersionDto newVersion)
Specified by:
addRequirementToRequirementLibrary in interface RequirementLibraryNavigationService

addRequirementToRequirementLibrary

@PreAuthorize(value="hasPermission(#libraryId, \'org.squashtest.csp.tm.domain.requirement.RequirementLibrary\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public Requirement addRequirementToRequirementLibrary(long libraryId,
                                                                   @NotNull
                                                                   Requirement requirement)
Specified by:
addRequirementToRequirementLibrary in interface RequirementLibraryNavigationService

addRequirementToRequirementFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.csp.tm.domain.requirement.RequirementFolder\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public Requirement addRequirementToRequirementFolder(long folderId,
                                                                  @NotNull
                                                                  NewRequirementVersionDto firstVersion)
Specified by:
addRequirementToRequirementFolder in interface RequirementLibraryNavigationService

addRequirementToRequirementFolder

@PreAuthorize(value="hasPermission(#folderId, \'org.squashtest.csp.tm.domain.requirement.RequirementFolder\' , \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public Requirement addRequirementToRequirementFolder(long folderId,
                                                                  @NotNull
                                                                  Requirement requirement)
Specified by:
addRequirementToRequirementFolder in interface RequirementLibraryNavigationService

findRequirementsToExportFromProject

public List<ExportRequirementData> findRequirementsToExportFromProject(List<Long> libraryIds)
Description copied from interface: RequirementLibraryNavigationService
Will find all requirements found in the given projects and return their information as a list of ExportRequirementData

Specified by:
findRequirementsToExportFromProject in interface RequirementLibraryNavigationService
Parameters:
libraryIds - ids of Project
Returns:
a list of ExportRequirementData

findRequirementsToExportFromNodes

public List<ExportRequirementData> findRequirementsToExportFromNodes(List<Long> folderIds)
Description copied from interface: RequirementLibraryNavigationService
Will find all requirements of the given ids and contained in folders of the given ids, and return their information as a list of ExportRequirementData

Specified by:
findRequirementsToExportFromNodes in interface RequirementLibraryNavigationService
Parameters:
folderIds - ids of RequirementLibraryNode
Returns:
a list of ExportRequirementData

findLinkableRequirementLibraries

@PostFilter(value="hasPermission(filterObject, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public List<RequirementLibrary> findLinkableRequirementLibraries()
Description copied from interface: RequirementLibraryFinderService
Returns the collection of RequirementLibrary which Requirements can be linked by a TestCase

Specified by:
findLinkableRequirementLibraries in interface RequirementLibraryFinderService
Returns:

importExcel

public ImportSummary importExcel(InputStream stream,
                                 long libraryId)
Description copied from interface: RequirementLibraryNavigationService
Accepts a stream to a .xls / .xlsx file info for requirement folders and requirements. Will convert the requirements from excel to squash.

Specified by:
importExcel in interface RequirementLibraryNavigationService
Returns:
a summary of the operations.

importLinksExcel

public ImportRequirementTestCaseLinksSummary importLinksExcel(InputStream stream)
Description copied from interface: RequirementLibraryNavigationService
Accepts a stream to a .xls / .xlsx file info for requirement and test-case links. Will convert the links from excel to squash.

Specified by:
importLinksExcel in interface RequirementLibraryNavigationService
Returns:
a summary of the operations.

copyNodesToFolder

public List<RequirementLibraryNode> copyNodesToFolder(long destinationId,
                                                      Long[] sourceNodesIds)
Description copied from interface: LibraryNavigationService
will create a deep copy of the given LibraryNodes, paste them in the destination folder, and return the copies.

Specified by:
copyNodesToFolder in interface LibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
Overrides:
copyNodesToFolder in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
Parameters:
destinationId - the id of the folder where you need to copy to.
sourceNodesIds - the list of the librarynodes we want copies of.
Returns:
the list of the copies themselves.

copyNodesToLibrary

public List<RequirementLibraryNode> copyNodesToLibrary(long destinationId,
                                                       Long[] targetId)
Description copied from interface: LibraryNavigationService
same, when the destination is a Library.

Specified by:
copyNodesToLibrary in interface LibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
Overrides:
copyNodesToLibrary in class AbstractLibraryNavigationService<RequirementLibrary,RequirementFolder,RequirementLibraryNode>
Parameters:
destinationId - the id of the library where you need to copy to.
targetId - the list of the librarynodes we want copies of.
Returns:
the list of the copies themselves.


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