org.squashtest.tm.service.library
Interface LibraryNavigationService<LIBRARY extends org.squashtest.tm.domain.library.Library<? extends NODE>,FOLDER extends org.squashtest.tm.domain.library.Folder<? extends NODE>,NODE extends org.squashtest.tm.domain.library.LibraryNode>

All Known Subinterfaces:
CampaignLibraryNavigationService, RequirementLibraryNavigationService, TestCaseLibraryNavigationService
All Known Implementing Classes:
AbstractLibraryNavigationService, CampaignLibraryNavigationServiceImpl, RequirementLibraryNavigationServiceImpl, TestCaseLibraryNavigationServiceImpl

public interface LibraryNavigationService<LIBRARY extends org.squashtest.tm.domain.library.Library<? extends NODE>,FOLDER extends org.squashtest.tm.domain.library.Folder<? extends NODE>,NODE extends org.squashtest.tm.domain.library.LibraryNode>

Defines common methods for a library navigation service, mainly library access and folder manipulation. TODO Move all methods which modify a folder's content to another service

Author:
Gregory Fouquet

Method Summary
 void addFolderToFolder(long destinationId, FOLDER newFolder)
           
 void addFolderToLibrary(long destinationId, FOLDER newFolder)
           
 List<NODE> 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<NODE> copyNodesToLibrary(long destinationId, Long[] targetId)
          same, when the destination is a Library.
 OperationReport deleteNodes(List<Long> targetIds)
          that method should delete the nodes.
 LIBRARY findCreatableLibrary(long libraryId)
           
 FOLDER findFolder(long folderId)
           
 List<NODE> findFolderContent(long folderId)
          Returns the content of the folder designated by its id.
 LIBRARY findLibrary(long libraryId)
           
 LIBRARY findLibraryOfRootNodeIfExist(NODE node)
          That method should find the library of the root node
 List<NODE> findLibraryRootContent(long libraryId)
           
 FOLDER findParentIfExists(org.squashtest.tm.domain.library.LibraryNode node)
          That method should find the parentFolder of the library Node if it has one
 void moveNodesToFolder(long destinationId, Long[] targetId)
           
 void moveNodesToLibrary(long destinationId, Long[] targetId)
           
 void renameFolder(long folderId, String newName)
          Deprecated. 
 List<SuppressionPreviewReport> simulateDeletion(List<Long> targetIds)
          that method should investigate the consequences of the deletion request, and return a report about what will happen.
 

Method Detail

copyNodesToFolder

List<NODE> copyNodesToFolder(long destinationId,
                             Long[] sourceNodesIds)
will create a deep copy of the given LibraryNodes, paste them in the destination folder, and return the copies.

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

List<NODE> copyNodesToLibrary(long destinationId,
                              Long[] targetId)
same, when the destination is a Library.

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.

moveNodesToFolder

void moveNodesToFolder(long destinationId,
                       Long[] targetId)

moveNodesToLibrary

void moveNodesToLibrary(long destinationId,
                        Long[] targetId)

addFolderToLibrary

void addFolderToLibrary(long destinationId,
                        FOLDER newFolder)

addFolderToFolder

void addFolderToFolder(long destinationId,
                       FOLDER newFolder)

findFolder

FOLDER findFolder(long folderId)

findLibraryRootContent

List<NODE> findLibraryRootContent(long libraryId)

findFolderContent

List<NODE> findFolderContent(long folderId)
Returns the content of the folder designated by its id.

Parameters:
folderId -
Returns:

renameFolder

@Deprecated
void renameFolder(long folderId,
                             String newName)
Deprecated. 


findLibrary

LIBRARY findLibrary(long libraryId)

findCreatableLibrary

LIBRARY findCreatableLibrary(long libraryId)

simulateDeletion

List<SuppressionPreviewReport> simulateDeletion(List<Long> targetIds)
that method should investigate the consequences of the deletion request, and return a report about what will happen.

Parameters:
targetIds -
Returns:

deleteNodes

OperationReport deleteNodes(List<Long> targetIds)
that method should delete the nodes. It still takes care of non deletable nodes so the implementation should filter out the ids who can't be deleted.

Parameters:
targetIds -
Returns:

findParentIfExists

FOLDER findParentIfExists(org.squashtest.tm.domain.library.LibraryNode node)
That method should find the parentFolder of the library Node if it has one

Parameters:
node -
Returns:
the parent node or null if do not exists

findLibraryOfRootNodeIfExist

LIBRARY findLibraryOfRootNodeIfExist(NODE node)
That method should find the library of the root node

Parameters:
id -
Returns:
the library or null


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