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:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.logicaldoc.gui.frontend.client.services.FolderService

    FolderService.Instance
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyGridLayout(long folderId)
    Replicates the folder's grid layout to all the subtree
    void
    applyMetadata(long parentId)
    Applies all extended attributes to a sub-tree
    void
    applyOCR(long parentId)
    Applies all OCR settings to a sub-tree
    void
    applyStore(long parentId)
    Applies the store setting to a sub-tree
    void
    applyTags(long parentId)
    Applies all tags to a sub-tree
    void
    applyTemplate(long folderId, long templateId, boolean inheritSecurity)
    Applies a template to a folder
    computeStats(long folderId)
    Counts the docs and subfolders of a given parent
    void
    copyFolders(List<Long> folderIds, long targetId, boolean foldersOnly, String securityOption, GUIFolder model)
    Copies a folder under a target folder
    create(GUIFolder newFolder, boolean inheritSecurity)
    Creates a new folder
    createAlias(long parentId, long foldRef)
    Creates a new folder alias
    void
    delete(List<Long> folderIds)
    Deletes the folders and the subtrees
    void
    Deletes a selection of folders from trash
    fromFolder(Folder folder, boolean computePath)
     
    Gets the allowed permissions on a set of folders in regards of the current user
    getFolder(long folderId, boolean computePath, boolean computeDocs, boolean computeSubfolders)
    Gets the Folder initializing the permissions.
    getFolder(Session session, long folderId)
     
    getFolder(Session session, long folderId, boolean computePath)
     
    inheritACL(long folderId, long rightsFolderId)
    Inherits the ACL of another folder
    Loads the folders templates
    void
    merge(List<Long> folderIds, long targetId)
    Merges some folders to a target folder
    void
    move(List<Long> folderIds, long targetId)
    Moves some folders under a target folder
    void
    paste(List<Long> docIds, long folderId, String action, boolean links, boolean notes, boolean security)
    Pastes documents into the target folder
    void
    pasteAsAlias(List<Long> docIds, long folderId, String type)
     
    Read the uploaded image and converts it into Base64
    void
    rename(long folderId, String name)
    Renames the given folder
    void
    restore(List<Long> folderIds, long parentId)
    Restores a given folder
    save(GUIFolder guiFolder)
    Saves the folder in the DB
    void
    saveACL(GUIFolder guiFolder, boolean subtree)
    Applies all security settings to folder
    void
    Saves the passed folder templates
    void
    setFolderPagination(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

    Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

    doPost

    Methods inherited from class javax.servlet.http.HttpServlet

    service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FolderServiceImpl

      public FolderServiceImpl()
  • Method Details

    • inheritACL

      public GUIFolder inheritACL(long folderId, long rightsFolderId) throws ServerException
      Description copied from interface: FolderService
      Inherits the ACL of another folder
      Specified by:
      inheritACL in interface FolderService
      Parameters:
      folderId - The folder that has to be updated
      rightsFolderId - the folder that defines the rights
      Returns:
      The updated Folder
      Throws:
      ServerException - an error happened in the server application
    • saveACL

      public void saveACL(GUIFolder guiFolder, boolean subtree) throws ServerException
      Description copied from interface: FolderService
      Applies all security settings to folder
      Specified by:
      saveACL in interface FolderService
      Parameters:
      guiFolder - The folder that contains the new security settings
      subtree - 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 ServerException
      Description copied from interface: FolderService
      Applies all extended attributes to a sub-tree
      Specified by:
      applyMetadata in interface FolderService
      Parameters:
      parentId - The parent folder containing the metadata
      Throws:
      ServerException - an error happened in the server application
    • delete

      public void delete(List<Long> folderIds) throws ServerException
      Description copied from interface: FolderService
      Deletes the folders and the subtrees
      Specified by:
      delete in interface FolderService
      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 List<Long> computeStats(long folderId) throws ServerException
      Description copied from interface: FolderService
      Counts the docs and subfolders of a given parent
      Specified by:
      computeStats in interface FolderService
      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: FolderService
      Gets the Folder initializing the permissions.
      Specified by:
      getFolder in interface FolderService
      Parameters:
      folderId - The folder identifier
      computePath - True if the complete path must be retrieved
      computeDocs - True if the number of contained documents must be computed
      computeSubfolders - 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(List<Long> folderIds, long targetId, boolean foldersOnly, String securityOption, GUIFolder model) throws ServerException
      Description copied from interface: FolderService
      Copies a folder under a target folder
      Specified by:
      copyFolders in interface FolderService
      Parameters:
      folderIds - identifiers of the folders
      targetId - identifier of the folder that will receive the copy
      foldersOnly - flag to copy just the folders and not the documents
      securityOption - 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(List<Long> folderIds, long targetId) throws ServerException
      Description copied from interface: FolderService
      Moves some folders under a target folder
      Specified by:
      move in interface FolderService
      Parameters:
      folderIds - identifiers of the folders
      targetId - 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 ServerException
      Description copied from interface: FolderService
      Renames the given folder
      Specified by:
      rename in interface FolderService
      Parameters:
      folderId - identifier of the folder
      name - 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: FolderService
      Saves the folder in the DB
      Specified by:
      save in interface FolderService
      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: FolderService
      Creates a new folder
      Specified by:
      create in interface FolderService
      Parameters:
      newFolder - The folder to be created
      inheritSecurity - 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: FolderService
      Creates a new folder alias
      Specified by:
      createAlias in interface FolderService
      Parameters:
      parentId - The folder in which the alias must be created
      foldRef - The original folder
      Returns:
      The created alias
      Throws:
      ServerException - an error happened in the server application
    • paste

      public void paste(List<Long> docIds, long folderId, String action, boolean links, boolean notes, boolean security) throws ServerException
      Description copied from interface: FolderService
      Pastes documents into the target folder
      Specified by:
      paste in interface FolderService
      Parameters:
      docIds - the documents identifiers
      folderId - the target folder identifier
      action - the selected action(Clipboard.COPY or Clipboard.COPY)
      links - if the links must be copied too
      notes - if the notes and annotations must be copied too
      security - if the security settings must be copied too
      Throws:
      ServerException - an error happened in the server application
    • pasteAsAlias

      public void pasteAsAlias(List<Long> docIds, long folderId, String type) throws ServerException
      Specified by:
      pasteAsAlias in interface FolderService
      Throws:
      ServerException
    • loadTemplates

      public List<GUIValue> loadTemplates() throws ServerException
      Description copied from interface: FolderService
      Loads the folders templates
      Specified by:
      loadTemplates in interface FolderService
      Returns:
      the folder templates
      Throws:
      ServerException - an error happened in the server application
    • saveTemplates

      public void saveTemplates(List<GUIValue> templates) throws ServerException
      Description copied from interface: FolderService
      Saves the passed folder templates
      Specified by:
      saveTemplates in interface FolderService
      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 ServerException
      Description copied from interface: FolderService
      Applies a template to a folder
      Specified by:
      applyTemplate in interface FolderService
      Parameters:
      folderId - identifier of the folder to use as root
      templateId - identifier of the template to use
      inheritSecurity - if the new folders mus inherit the security from folderId
      Throws:
      ServerException - an error happened in the server application
    • restore

      public void restore(List<Long> folderIds, long parentId) throws ServerException
      Description copied from interface: FolderService
      Restores a given folder
      Specified by:
      restore in interface FolderService
      Parameters:
      folderIds - identifiers of the folders
      parentId - identifier of the folder that will receive the restore
      Throws:
      ServerException - an error happened in the server application
    • deleteFromTrash

      public void deleteFromTrash(List<Long> ids) throws ServerException
      Description copied from interface: FolderService
      Deletes a selection of folders from trash
      Specified by:
      deleteFromTrash in interface FolderService
      Parameters:
      ids - identifiers of the folders
      Throws:
      ServerException - an error happened in the server application
    • applyTags

      public void applyTags(long parentId) throws ServerException
      Description copied from interface: FolderService
      Applies all tags to a sub-tree
      Specified by:
      applyTags in interface FolderService
      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 ServerException
      Description copied from interface: FolderService
      Sets the pagination informations for the visualization of the folders tree
      Specified by:
      setFolderPagination in interface FolderService
      Parameters:
      folderId - ID of the folder
      startRecord - Start rec index
      pageSize - Current page size
      Throws:
      ServerException - an error happened in the server application
    • applyGridLayout

      public void applyGridLayout(long folderId) throws ServerException
      Description copied from interface: FolderService
      Replicates the folder's grid layout to all the subtree
      Specified by:
      applyGridLayout in interface FolderService
      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 ServerException
      Description copied from interface: FolderService
      Applies all OCR settings to a sub-tree
      Specified by:
      applyOCR in interface FolderService
      Parameters:
      parentId - The parent folder containing the settings
      Throws:
      ServerException - an error happened in the server application
    • applyStore

      public void applyStore(long parentId) throws ServerException
      Description copied from interface: FolderService
      Applies the store setting to a sub-tree
      Specified by:
      applyStore in interface FolderService
      Parameters:
      parentId - The parent folder containing the tags
      Throws:
      ServerException - an error happened in the server application
    • merge

      public void merge(List<Long> folderIds, long targetId) throws ServerException
      Description copied from interface: FolderService
      Merges some folders to a target folder
      Specified by:
      merge in interface FolderService
      Parameters:
      folderIds - identifiers of the folders
      targetId - 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: FolderService
      Read the uploaded image and converts it into Base64
      Specified by:
      readImage in interface FolderService
      Returns:
      the string conversion of the uploaded image
      Throws:
      ServerException - an error happened in the server application
    • getAllowedPermissions

      public GUIAccessControlEntry getAllowedPermissions(List<Long> folderIds) throws ServerException
      Description copied from interface: FolderService
      Gets the allowed permissions on a set of folders in regards of the current user
      Specified by:
      getAllowedPermissions in interface FolderService
      Parameters:
      folderIds - collection of the folders
      Throws:
      ServerException