Interface IAttachmentService

All Known Implementing Classes:
AttachmentService

public interface IAttachmentService
Author:
Chris Waymire (chris@waymire.net)
  • Method Details

    • get

      Attachment get​(long attachmentId)
    • get

      Attachment get​(String guid)
    • find

      List<Attachment> find​(String creator)
    • find

      List<Attachment> find​(String creator, String filename)
    • findAll

      List<Attachment> findAll​(int offset, int maxresults)
    • save

      Attachment save​(Attachment attachment, String username, javax.servlet.http.HttpServletRequest request)
      Saves the metadata about the attachment to the database and persists the attachment to the configured documentPersistenceStrategy store.
      Parameters:
      attachment - Attachment to persist
      username - username of the user uploading the document
      request - HttpServlet request. Will be null with a data import operation
      Returns:
      Updated attachment object
    • delete

      void delete​(Attachment attachment)
    • delete

      void delete​(long attachmentId)
    • isPersistenceIntoDatabaseRequired

      boolean isPersistenceIntoDatabaseRequired()
      Boolean indicating whether or not attachment data is stored into the database. Some persistence stores, such as the local filesystem, would want the data stored into the database to allow for hydrating the data from the database in case it is not on the local file system. This is used when you have a cluster of portal servers and a server may not have the content hydrated locally. Other persistence stores, such as a network share or S3, store their data external to the portal server so there is no need to have the file data stored into a database.
      Returns:
      True if the file data is stored in the database, else false.