Interface TrashStorage


public interface TrashStorage
This service used to move documents to trash foder or restore
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<javax.jcr.Node>
    getAllLinks(javax.jcr.Node node, String linkType)
    Get all links
    List<javax.jcr.Node>
    getAllNodeInTrash(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
    Get all nodes in trash location
    List<javax.jcr.Node>
    getAllNodeInTrashByUser(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, String userName)
    Get all nodes by user in trash location
    javax.jcr.Node
    Get Node in trash folder by trashId
    javax.jcr.Node
    Get the trash hone's node
    boolean
    isInTrash(javax.jcr.Node node)
    Check whether a given node is in Trash or not
    moveToTrash(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
    Move node to trash location
    moveToTrash(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, int deep)
    Move node to trash location with deep
    void
    removeRelations(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
    Removes all 'relationable' property of nodes that have relation to this node
    void
    restoreFromTrash(String trashNodePath, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
    Restore node from trash
  • Field Details

  • Method Details

    • moveToTrash

      String moveToTrash(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws javax.jcr.RepositoryException
      Move node to trash location
      Parameters:
      node - Node will be moved to trash
      sessionProvider - User session provider which will be used to get session
      Returns:
      -1: move failed. trashId if moved succesfully
      Throws:
      javax.jcr.RepositoryException
    • moveToTrash

      String moveToTrash(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, int deep) throws javax.jcr.RepositoryException
      Move node to trash location with deep
      Parameters:
      node -
      sessionProvider -
      deep -
      Returns:
      -1: move failed. trashId if moved succesfully
      Throws:
      javax.jcr.RepositoryException
    • restoreFromTrash

      void restoreFromTrash(String trashNodePath, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws javax.jcr.RepositoryException
      Restore node from trash
      Parameters:
      trashNodePath - The path.
      sessionProvider - The session provider.
      Throws:
      javax.jcr.RepositoryException
    • getAllNodeInTrash

      List<javax.jcr.Node> getAllNodeInTrash(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws javax.jcr.RepositoryException
      Get all nodes in trash location
      Parameters:
      sessionProvider -
      Returns:
      All nodes in trash
      Throws:
      javax.jcr.RepositoryException
    • getAllNodeInTrashByUser

      List<javax.jcr.Node> getAllNodeInTrashByUser(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, String userName) throws javax.jcr.RepositoryException
      Get all nodes by user in trash location
      Parameters:
      sessionProvider -
      userName -
      Returns:
      all node in trash which moved by user
      Throws:
      javax.jcr.RepositoryException
    • removeRelations

      void removeRelations(javax.jcr.Node node, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws javax.jcr.RepositoryException
      Removes all 'relationable' property of nodes that have relation to this node
      Parameters:
      node -
      sessionProvider -
      Throws:
      javax.jcr.RepositoryException
    • isInTrash

      boolean isInTrash(javax.jcr.Node node) throws javax.jcr.RepositoryException
      Check whether a given node is in Trash or not
      Parameters:
      node - a specify node
      Returns:
      true if node is in Trash, false otherwise.
      Throws:
      javax.jcr.RepositoryException
    • getTrashHomeNode

      javax.jcr.Node getTrashHomeNode()
      Get the trash hone's node
      Returns:
      Node the node of trash home
    • getNodeByTrashId

      javax.jcr.Node getNodeByTrashId(String trashId) throws javax.jcr.RepositoryException
      Get Node in trash folder by trashId
      Parameters:
      trashId - ID of node will return
      Returns:
      Node in trash folder with thrashId, null if thrashId doesn't exist in trash folder
      Throws:
      javax.jcr.RepositoryException
    • getAllLinks

      List<javax.jcr.Node> getAllLinks(javax.jcr.Node node, String linkType)
      Get all links
      Parameters:
      node -
      linkType -
      Returns:
      List of Node