Class FolderService
java.lang.Object
org.qubership.atp.itf.lite.backend.service.CrudService<Folder>
org.qubership.atp.itf.lite.backend.service.FolderService
- All Implemented Interfaces:
EntityHistoryService,IdentifiedService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPostfixIfFolderNameInDestinationIsTaken(List<Folder> destinationFolders, Folder folder) Add postfix "Copy" if folder with the same name already exists in destination folder.voidcheckThatAccessGranted(UUID projectId, Set<UUID> folderPermissionsIds, org.qubership.atp.auth.springbootstarter.entities.Operation operation) Check that access granted for operation.voidcopyFolders(FolderCopyRequest request) Copy folder.longcountFolderHeirs(FolderDeleteRequest request) Find folders heirs.createFolder(FolderUpsetRequest request) Create folder.createFolders(List<Folder> folders) Create folders from list.voiddeleteFolders(FolderDeleteRequest request) Delete folders.editFolder(UUID folderId, FolderEditRequest request) Update folder.getAllByProjectIdAndParentId(UUID projectId, UUID parentFolderId) Gets all folders by specified project id and parent folder id.getAllFolders(UUID projectId) Get all folders by specified project identifier.getByProjectIdAndSourceId(UUID projectId, UUID sourceId) Get Folder by project ID and source ID.Get folder by specified identifier.getFolderByIdAndName(UUID folderId, String folderName) getFolderRequestsTree(Boolean onlyFolders, FolderTreeSearchRequest request) Get tree for folders and requests by specified search request.getFoldersByIds(Set<UUID> folderIds) getIdByFoldersPath(UUID projectId, List<String> path) Get ids by folder's path.getParentAuth(UUID parentFolderId) Get parent auth for folder or request with specified parent folder id.getPermissionFolderIdsByFolderIds(Set<UUID> folderIds) Collects set of permission ids from folders.getRequestTreeByParentFolderId(UUID parentFolderId) Get request tree.getSettings(UUID folderId) Get folder by specified identifier.voidmoveFolders(FolderMoveRequest request) Move folder.voidorder(UUID folderId, FolderOrderChangeRequest request) Change folder order.restore(AbstractNamedEntity entity) Save folder (and update folder children).Save folders (and update folder children).voidCalculate and set order for the folder.voidupdateAuthorizationFolderId(RequestAuthorization authorization, UUID parentFolderId) Updates InheritAuthorizationRequest.voidupdateAuthorizationFolderId(Folder folder) Updates InheritAuthorizationRequest.voidupdateAuthorizationFolderId(Request request) Updates InheritAuthorizationRequest.updateFolderChildren(UUID folderId) Update folder children: child folders and child request.updateFolderChildren(Folder folder) Update folder children: child folders and child request.updateFoldersChildren(List<Folder> folders) Update folders children: child folders and child request.updateParentFolderChildren(List<Folder> folders) Update folders children (for parent folder): child folders and child request.updateParentFolderChildren(UUID folderId) Update folder children (for parent folder): child folders and child request.updateParentFolderChildren(Folder folder) Update folder children (for parent folder): child folders and child request.Methods inherited from class org.qubership.atp.itf.lite.backend.service.CrudService
delete, deleteByEntities, get, getAll, isEntityExistsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.itf.lite.backend.service.history.iface.EntityHistoryService
get
-
Constructor Details
-
FolderService
public FolderService()
-
-
Method Details
-
repository
- Specified by:
repositoryin classCrudService<Folder>
-
save
Save folder (and update folder children).- Overrides:
savein classCrudService<Folder>- Parameters:
folder- folder to save- Returns:
- saved folder
-
saveAll
Save folders (and update folder children).- Overrides:
saveAllin classCrudService<Folder>- Parameters:
folders- folders to save- Returns:
- saved folders
-
getFolder
Get folder by specified identifier.- Parameters:
folderId- folder identifier- Returns:
- folder
-
getSettings
Get folder by specified identifier.- Parameters:
folderId- folder identifier- Returns:
- folder
-
getPermissionFolderIdsByFolderIds
Collects set of permission ids from folders. Need for PreAuthorize checks- Parameters:
folderIds- set of folder ids- Returns:
- set of permission folder ids
-
getFolderByIdAndName
-
getFoldersByIds
-
getAllFolders
Get all folders by specified project identifier.- Parameters:
projectId- project identifier- Returns:
- collection of folders
-
getAllByProjectIdAndParentId
Gets all folders by specified project id and parent folder id.- Parameters:
projectId- project idparentFolderId- parent folder id- Returns:
- list of found folders
-
getFolderRequestsTree
Get tree for folders and requests by specified search request.- Parameters:
request- search request- Returns:
- tree root nodes
-
getRequestTreeByParentFolderId
Get request tree. -
restore
- Specified by:
restorein interfaceEntityHistoryService
-
createFolder
Create folder.- Parameters:
request- creation request- Returns:
- created folder
- Throws:
Exception
-
setOrder
Calculate and set order for the folder. -
createFolders
Create folders from list.- Parameters:
folders- list of folders to save- Returns:
- list of saved folders
-
editFolder
Update folder.- Parameters:
folderId- folder identifierrequest- update folder request- Throws:
Exception
-
updateAuthorizationFolderId
Updates InheritAuthorizationRequest.- Parameters:
request- request to update
-
updateAuthorizationFolderId
Updates InheritAuthorizationRequest.- Parameters:
folder- folder to update
-
updateAuthorizationFolderId
public void updateAuthorizationFolderId(@Nullable RequestAuthorization authorization, @Nullable UUID parentFolderId) Updates InheritAuthorizationRequest.- Parameters:
authorization- authorization to updateparentFolderId- parent folder id for entity with passed authorization
-
copyFolders
Copy folder.- Parameters:
request- copy folder request
-
addPostfixIfFolderNameInDestinationIsTaken
public void addPostfixIfFolderNameInDestinationIsTaken(List<Folder> destinationFolders, Folder folder) Add postfix "Copy" if folder with the same name already exists in destination folder.- Parameters:
destinationFolders- list of folders destination under folderfolder- folder
-
moveFolders
Move folder.- Parameters:
request- move folder request
-
deleteFolders
Delete folders.- Parameters:
request- delete folders request
-
checkThatAccessGranted
public void checkThatAccessGranted(UUID projectId, Set<UUID> folderPermissionsIds, org.qubership.atp.auth.springbootstarter.entities.Operation operation) Check that access granted for operation.- Parameters:
projectId- project id.folderPermissionsIds- folder permissions.operation- operation for which permissions are required (CREATE,READ,UPDATE,DELETE,EXECUTE,LOCK,UNLOCK).- Throws:
ItfLiteAccessDeniedException- if no access granted.
-
countFolderHeirs
Find folders heirs.- Parameters:
request- count folders heirs in delete request
-
order
Change folder order. -
getByProjectIdAndSourceId
Get Folder by project ID and source ID.- Parameters:
projectId- project IDsourceId- source ID- Returns:
- Folder
-
getIdByFoldersPath
Get ids by folder's path. -
getParentAuth
Get parent auth for folder or request with specified parent folder id.- Parameters:
parentFolderId- paren folder id- Returns:
- parent auth
-
updateParentFolderChildren
Update folder children (for parent folder): child folders and child request. Need for history.- Parameters:
folderId- folder ID of entity- Returns:
- updated folder or NULL folder not found
-
updateParentFolderChildren
Update folder children (for parent folder): child folders and child request. Need for history.- Parameters:
folder- folder entity- Returns:
- updated folder
-
updateParentFolderChildren
Update folders children (for parent folder): child folders and child request. Need for history.- Parameters:
folders- folder entity- Returns:
- updated folder
-
updateFolderChildren
Update folder children: child folders and child request. Need for history.- Parameters:
folderId- folder ID of entity- Returns:
- updated folder or NULL if folderId = NULL or folder not found
-
updateFolderChildren
Update folder children: child folders and child request. Need for history.- Parameters:
folder- folder entity- Returns:
- updated folder
-
updateFoldersChildren
Update folders children: child folders and child request. Need for history.- Parameters:
folders- folder entity- Returns:
- updated folder
-