Package com.logicaldoc.web.service
Class FolderServiceImpl
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
-
- com.google.gwt.user.server.rpc.RemoteServiceServlet
-
- com.logicaldoc.web.service.AbstractRemoteService
-
- com.logicaldoc.web.service.FolderServiceImpl
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService,com.google.gwt.user.server.rpc.SerializationPolicyProvider,FolderService,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class FolderServiceImpl extends AbstractRemoteService implements FolderService
Implementation of the FolderService- Since:
- 6.0
- Author:
- Matteo Caruso - LogicalDOC
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.logicaldoc.gui.frontend.client.services.FolderService
FolderService.Instance
-
-
Constructor Summary
Constructors Constructor Description FolderServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyGridLayout(long folderId)Replicates the folder's grid layout to all the subtreevoidapplyMetadata(long parentId)Applies all extended attributes to a sub-treevoidapplyOCR(long parentId)Applies all OCR settings to a sub-treevoidapplyRights(GUIFolder folder, boolean subtree)Applies all security settings to foldervoidapplyStorage(long parentId)Applies the storage setting to a sub-treevoidapplyTags(long parentId)Applies all tags to a sub-treevoidapplyTemplate(long folderId, long templateId, boolean inheritSecurity)Applies a template to a folderlong[]computeStats(long folderId)Counts the docs and subfolders of a given parentvoidcopyFolders(long[] folderIds, long targetId, boolean foldersOnly, String securityOption, GUIFolder model)Copies a folder under a target folderGUIFoldercreate(GUIFolder newFolder, boolean inheritSecurity)Creates a new folderGUIFoldercreateAlias(long parentId, long foldRef)Creates a new folder aliasvoiddelete(long[] folderIds)Deletes the folders and the subtreesvoiddeleteFromTrash(Long[] ids)Deletes a selection of folders from trashGUIFolderfromFolder(Folder folder, boolean computePath)GUIFoldergetFolder(long folderId, boolean computePath, boolean computeDocs, boolean computeSubfolders)Gets the Folder initializing the permissions.GUIFoldergetFolder(Session session, long folderId)GUIFoldergetFolder(Session session, long folderId, boolean computePath)GUIFolderinheritRights(long folderId, long rightsFolderId)Inherits the rights of another folderGUIValue[]loadTemplates()Loads the folders templatesvoidmerge(long[] folderIds, long targetId)Merges some folders to a target foldervoidmove(long[] folderIds, long targetId)Moves some folders under a target foldervoidpaste(long[] docIds, long folderId, String action)Pastes documents into the target foldervoidpasteAsAlias(long[] docIds, long folderId, String type)StringreadImage()Read the uploaded image and converts it into Base64voidrename(long folderId, String name)Renames the given foldervoidrestore(Long[] folderIds, long parentId)Restores a given folderGUIFoldersave(GUIFolder guiFolder)Saves the folder in the DBvoidsaveTemplates(GUIValue[] templates)Saves the passed folder templatesvoidsetFolderPagination(long folderId, Integer startRecord, Integer pageSize)Sets the pagination informations for the visualization of the folders tree-
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
getSerializationPolicy, init, processCall, processCall, processPost
-
-
-
-
Method Detail
-
inheritRights
public GUIFolder inheritRights(long folderId, long rightsFolderId) throws ServerException
Description copied from interface:FolderServiceInherits the rights of another folder- Specified by:
inheritRightsin interfaceFolderService- Parameters:
folderId- The folder that has to be updatedrightsFolderId- the folder that defines the rights- Returns:
- The updated Folder
- Throws:
ServerException- an error happened in the server application
-
applyRights
public void applyRights(GUIFolder folder, boolean subtree) throws ServerException
Description copied from interface:FolderServiceApplies all security settings to folder- Specified by:
applyRightsin interfaceFolderService- Parameters:
folder- The folder that contains the new security settingssubtree- If true, the current security settings will be applied to the sub-folders- Throws:
ServerException- an error happened in the server application
-
applyMetadata
public void applyMetadata(long parentId) throws ServerExceptionDescription copied from interface:FolderServiceApplies all extended attributes to a sub-tree- Specified by:
applyMetadatain interfaceFolderService- Parameters:
parentId- The parent folder containing the metadata- Throws:
ServerException- an error happened in the server application
-
delete
public void delete(long[] folderIds) throws ServerExceptionDescription copied from interface:FolderServiceDeletes the folders and the subtrees- Specified by:
deletein interfaceFolderService- Parameters:
folderIds- identifiers of the folders- Throws:
ServerException- an error happened in the server application
-
fromFolder
public GUIFolder fromFolder(Folder folder, boolean computePath) throws PersistenceException
- Throws:
PersistenceException
-
computeStats
public long[] computeStats(long folderId) throws ServerExceptionDescription copied from interface:FolderServiceCounts the docs and subfolders of a given parent- Specified by:
computeStatsin interfaceFolderService- Parameters:
folderId- identifier of the folder- Returns:
- the statistics (total number of documents, total number of subfolders, total size
- Throws:
ServerException- an error happened in the server application
-
getFolder
public GUIFolder getFolder(Session session, long folderId) throws ServerException
- Throws:
ServerException
-
getFolder
public GUIFolder getFolder(Session session, long folderId, boolean computePath) throws ServerException
- Throws:
ServerException
-
getFolder
public GUIFolder getFolder(long folderId, boolean computePath, boolean computeDocs, boolean computeSubfolders) throws ServerException
Description copied from interface:FolderServiceGets the Folder initializing the permissions.- Specified by:
getFolderin interfaceFolderService- Parameters:
folderId- The folder identifiercomputePath- True if the complete path must be retrievedcomputeDocs- True if the number of contained documents must be computedcomputeSubfolders- True if the number of contained subfolders must be computed- Returns:
- The Folder bean
- Throws:
ServerException- an error happened in the server application
-
copyFolders
public void copyFolders(long[] folderIds, long targetId, boolean foldersOnly, String securityOption, GUIFolder model) throws ServerExceptionDescription copied from interface:FolderServiceCopies a folder under a target folder- Specified by:
copyFoldersin interfaceFolderService- Parameters:
folderIds- identifiers of the folderstargetId- identifier of the folder that will receive the copyfoldersOnly- flag to copy just the folders and not the documentssecurityOption- how to setup the security for the new folder'none', 'inherit' or 'replicate'model- a model to use for creating the new folder- Throws:
ServerException- an error happened in the server application
-
move
public void move(long[] folderIds, long targetId) throws ServerExceptionDescription copied from interface:FolderServiceMoves some folders under a target folder- Specified by:
movein interfaceFolderService- Parameters:
folderIds- identifiers of the folderstargetId- identifier of the folder that will receive the move- Throws:
ServerException- an error happened in the server application
-
rename
public void rename(long folderId, String name) throws ServerExceptionDescription copied from interface:FolderServiceRenames the given folder- Specified by:
renamein interfaceFolderService- Parameters:
folderId- identifier of the foldername- the new folder's name- Throws:
ServerException- an error happened in the server application
-
save
public GUIFolder save(GUIFolder guiFolder) throws ServerException
Description copied from interface:FolderServiceSaves the folder in the DB- Specified by:
savein interfaceFolderService- Parameters:
guiFolder- The folder to save- Returns:
- The saved folder
- Throws:
ServerException- an error happened in the server application
-
create
public GUIFolder create(GUIFolder newFolder, boolean inheritSecurity) throws ServerException
Description copied from interface:FolderServiceCreates a new folder- Specified by:
createin interfaceFolderService- Parameters:
newFolder- The folder to be createdinheritSecurity- True if the new folder has to inherit the security policies from the parent- Returns:
- The saved folder
- Throws:
ServerException- an error happened in the server application
-
createAlias
public GUIFolder createAlias(long parentId, long foldRef) throws ServerException
Description copied from interface:FolderServiceCreates a new folder alias- Specified by:
createAliasin interfaceFolderService- Parameters:
parentId- The folder in which the alias must be createdfoldRef- The original folder- Returns:
- The created alias
- Throws:
ServerException- an error happened in the server application
-
paste
public void paste(long[] docIds, long folderId, String action) throws ServerExceptionDescription copied from interface:FolderServicePastes documents into the target folder- Specified by:
pastein interfaceFolderService- Parameters:
docIds- the documents identifiersfolderId- the target folder identifieraction- the selected action(Clipboard.COPYorClipboard.COPY)- Throws:
ServerException- an error happened in the server application
-
pasteAsAlias
public void pasteAsAlias(long[] docIds, long folderId, String type) throws ServerException- Specified by:
pasteAsAliasin interfaceFolderService- Throws:
ServerException
-
loadTemplates
public GUIValue[] loadTemplates() throws ServerException
Description copied from interface:FolderServiceLoads the folders templates- Specified by:
loadTemplatesin interfaceFolderService- Returns:
- the folder templates
- Throws:
ServerException- an error happened in the server application
-
saveTemplates
public void saveTemplates(GUIValue[] templates) throws ServerException
Description copied from interface:FolderServiceSaves the passed folder templates- Specified by:
saveTemplatesin interfaceFolderService- Parameters:
templates- the folder templates- Throws:
ServerException- an error happened in the server application
-
applyTemplate
public void applyTemplate(long folderId, long templateId, boolean inheritSecurity) throws ServerExceptionDescription copied from interface:FolderServiceApplies a template to a folder- Specified by:
applyTemplatein interfaceFolderService- Parameters:
folderId- identifier of the folder to use as roottemplateId- identifier of the template to useinheritSecurity- if the new folders mus inherit the security fromfolderId- Throws:
ServerException- an error happened in the server application
-
restore
public void restore(Long[] folderIds, long parentId) throws ServerException
Description copied from interface:FolderServiceRestores a given folder- Specified by:
restorein interfaceFolderService- Parameters:
folderIds- identifiers of the foldersparentId- identifier of the folder that will receive the restore- Throws:
ServerException- an error happened in the server application
-
deleteFromTrash
public void deleteFromTrash(Long[] ids) throws ServerException
Description copied from interface:FolderServiceDeletes a selection of folders from trash- Specified by:
deleteFromTrashin interfaceFolderService- Parameters:
ids- identifiers of the folders- Throws:
ServerException- an error happened in the server application
-
applyTags
public void applyTags(long parentId) throws ServerExceptionDescription copied from interface:FolderServiceApplies all tags to a sub-tree- Specified by:
applyTagsin interfaceFolderService- Parameters:
parentId- The parent folder containing the tags- Throws:
ServerException- an error happened in the server application
-
setFolderPagination
public void setFolderPagination(long folderId, Integer startRecord, Integer pageSize) throws ServerExceptionDescription copied from interface:FolderServiceSets the pagination informations for the visualization of the folders tree- Specified by:
setFolderPaginationin interfaceFolderService- Parameters:
folderId- ID of the folderstartRecord- Start rec indexpageSize- Current page size- Throws:
ServerException- an error happened in the server application
-
applyGridLayout
public void applyGridLayout(long folderId) throws ServerExceptionDescription copied from interface:FolderServiceReplicates the folder's grid layout to all the subtree- Specified by:
applyGridLayoutin interfaceFolderService- Parameters:
folderId- identifier of the root folder whose setting will be replicated- Throws:
ServerException- error generated in the server application
-
applyOCR
public void applyOCR(long parentId) throws ServerExceptionDescription copied from interface:FolderServiceApplies all OCR settings to a sub-tree- Specified by:
applyOCRin interfaceFolderService- Parameters:
parentId- The parent folder containing the settings- Throws:
ServerException- an error happened in the server application
-
applyStorage
public void applyStorage(long parentId) throws ServerExceptionDescription copied from interface:FolderServiceApplies the storage setting to a sub-tree- Specified by:
applyStoragein interfaceFolderService- Parameters:
parentId- The parent folder containing the tags- Throws:
ServerException- an error happened in the server application
-
merge
public void merge(long[] folderIds, long targetId) throws ServerExceptionDescription copied from interface:FolderServiceMerges some folders to a target folder- Specified by:
mergein interfaceFolderService- Parameters:
folderIds- identifiers of the folderstargetId- identifier of the folder that will receive the merge- Throws:
ServerException- an error happened in the server application
-
readImage
public String readImage() throws ServerException
Description copied from interface:FolderServiceRead the uploaded image and converts it into Base64- Specified by:
readImagein interfaceFolderService- Returns:
- the string conversion of the uploaded image
- Throws:
ServerException- an error happened in the server application
-
-