Package com.logicaldoc.core.automation
Class FolderTool
java.lang.Object
com.logicaldoc.core.automation.FolderTool
Utility methods to handle folders from within the Automation
- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidapplyTemplate(long rootId, String templateName, boolean inheritSecurity, String username) Applies a folder templateCopies a folder into another foldercreatePath(Folder folder, String targetPath, String username) Creates a path, all existing nodes in the specified path will be reusedvoidDelete a folderdisplayUrl(long tenantId, long folderId) Prints the URL to display the folder inside the User InterfacedisplayUrl(Folder folder) Prints the URL to display the folder inside the User InterfacedisplayUrl(FolderHistory history) Prints the URL to display the folder inside the User InterfacefindById(long id) Finds the folder by it's identifierfindByPath(String path) Finds the folder by it's pathfindByPath(String path, Long tenantId) Finds the folder by it's pathCalculates the full path of a foldervoidinitialize(Folder folder) Initializes lazy loaded collectionsvoidMerges a folder into another foldervoidMoves a folder into a target foldervoidSaves / updates a folder into the databasevoidSaves / updates a folder into the database
- 
Constructor Details- 
FolderToolpublic FolderTool()
 
- 
- 
Method Details- 
displayUrlPrints the URL to display the folder inside the User Interface- Parameters:
- tenantId- identifier of the tenant
- folderId- identifier of the folder
- Returns:
- the display URL
 
- 
displayUrlPrints the URL to display the folder inside the User Interface- Parameters:
- folder- the folder to display
- Returns:
- the display URL
 
- 
displayUrlPrints the URL to display the folder inside the User Interface- Parameters:
- history- event from which to get the folder's to display
- Returns:
- the display URL
 
- 
getPathCalculates the full path of a folder- Parameters:
- folderId- identifier of the folder
- Returns:
- the path
- Throws:
- PersistenceException- error at database level
 
- 
findByPathFinds the folder by it's path- Parameters:
- path- the path to process
- Returns:
- the found folder
 
- 
findByPathFinds the folder by it's path- Parameters:
- path- the path to process
- tenantId- identifier of the tenant
- Returns:
- the found folder
 
- 
findByIdFinds the folder by it's identifier- Parameters:
- id- the unique identifier
- Returns:
- the found folder
 
- 
storeSaves / updates a folder into the database- Parameters:
- folder- the folder to save
 
- 
storeSaves / updates a folder into the database- Parameters:
- folder- the folder to save
- username- the user in whose name the method is run
 
- 
initializeInitializes lazy loaded collections- Parameters:
- folder- the folder to initialize
 
- 
deleteDelete a folder- Parameters:
- folderId- identifier of the folder
- username- the user in whose name the method is run
- Throws:
- PersistenceException- Error in the persistence layers
 
- 
moveMoves a folder into a target folder- Parameters:
- folder- the folder to move
- targetPath- the full path of the target folder(if it does not exist it will be created)
- username- the user in whose name the method is run
- Throws:
- PersistenceException- Error in the persistence layer
 
- 
copypublic Folder copy(Folder source, String targetPath, boolean foldersOnly, String securityOption, String username) throws PersistenceException Copies a folder into another folder- Parameters:
- source- the folder to copy
- targetPath- the full path of the target folder(if it does not exist it will be created)
- foldersOnly- true if only the folders tree has to be copied; if false, the documents will also be copied
- securityOption- How to assign the security policies to the newly created folders:- null or none: empty security policies
- inherit: the new folder will point to the parent for the security policies
- replicate: the new folder will have a copy of the security policies of the source folder
 
- username- the user in whose name the method is run
- Returns:
- The new folder created
- Throws:
- PersistenceException- Error in the persistence layer
 
- 
mergeMerges a folder into another folder- Parameters:
- source- the folder to merge into the target
- target- the final container
- username- the user in whose name the method is run
- Throws:
- PersistenceException- Error in the persistence layer
 
- 
createPathCreates a path, all existing nodes in the specified path will be reused- Parameters:
- folder- folder used to take the root folder in case the- targetPathrepresents a relative path
- targetPath- absolute or relative(in relation to the document's parent folder) path to be created
- username- the user in whose name the method is run
- Returns:
- the folder leaf of the path
 
- 
applyTemplatepublic void applyTemplate(long rootId, String templateName, boolean inheritSecurity, String username) throws PersistenceException Applies a folder template- Parameters:
- rootId- Id of the root where the template must be applied to
- templateName- Identifier of the folder template
- inheritSecurity- If the created folders must inherit the security from the root
- username- the user in whose name the method is run
- Throws:
- PersistenceException- Error in the data layer
 
 
-