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".

    • Constructor Detail

      • AssociatedPDFUploadHandler

        public AssociatedPDFUploadHandler()
    • Method Detail

      • processAction

        public boolean processAction()
                              throws java.io.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:
        java.io.IOException - IO Exception
      • validateUpload

        public boolean validateUpload()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • performUpload

        public boolean performUpload()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getControllerContext

        protected java.util.HashMap<java.lang.String,​java.lang.Object> getControllerContext()
        Description copied from class: JcmsFormHandler
        Build a controller context. I.E. add request, response and loggedMember.
        Overrides:
        getControllerContext in class JcmsFormHandler
        Returns:
        the HashMap which contains the context
      • releaseDBWorkingPub

        protected void releaseDBWorkingPub()
      • setOpUpload

        public void setOpUpload​(java.lang.String upload)
      • setId

        public void setId​(java.lang.String id)
      • getId

        public java.lang.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