Class AssociatedPDFUploadHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants

public class AssociatedPDFUploadHandler extends JcmsFormHandler
Upload and attach a .pdf file to the specified FileDocument.

The upload file must be sent using fieldname "pdffile".

  • Field Details

  • Constructor Details

    • AssociatedPDFUploadHandler

      public AssociatedPDFUploadHandler()
  • Method Details

    • processAction

      public boolean processAction() throws IOException
      Description copied from class: JcmsFormHandler
      Method to be implemented to check/validate action to be performed and process them.

      Default implementation is to return false. No need to call super method.

      This method may NOT be invoked at all if security validation are not met.

      You must ensure your handler and JSP can work properly without any code invoked in this method.

      Overrides:
      processAction in class JcmsFormHandler
      Returns:
      false if no redirection is needed, true otherwise
      Throws:
      IOException - IO Exception
    • validateUpload

      public boolean validateUpload() throws IOException
      Throws:
      IOException
    • performUpload

      public boolean performUpload() throws IOException
      Throws:
      IOException
    • setOpUpload

      public void setOpUpload(String upload)
    • setId

      public void setId(String id)
    • getId

      public String getId()
    • getFileDocument

      public FileDocument getFileDocument()
      Retrieve the FileDocument for which upload is being requested
      Returns:
      a FileDocument instance. never return null if validate returned false.
    • isPDFUploadAuthorized

      public static boolean isPDFUploadAuthorized(FileDocument doc)
      Check if the PDF upload should be proposed for the specified document kind.

      This method does not check member authorization.

      Parameters:
      doc - the FileDocument to check
      Returns:
      true if PDF upload can be proposed, false otherwise
      Since:
      jcms-9.0.1 - JCMS-3982