Class EditFileDocumentHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants
Direct Known Subclasses:
EditDBFileDocumentHandler, EditRemoteDocumentHandler

public class EditFileDocumentHandler extends EditPublicationHandler
  • Field Details

    • theContent

      protected FileDocument theContent
    • isUploadContext

      protected boolean isUploadContext
    • descriptionTFE

      protected TypeFieldEntry descriptionTFE
    • description

      protected String description
    • descriptionML

      protected HashMap<String,String> descriptionML
    • opUpload

      protected boolean opUpload
  • Constructor Details

    • EditFileDocumentHandler

      public EditFileDocumentHandler()
  • Method Details

    • getFileDocument

      public FileDocument getFileDocument()
    • getPublicationClass

      public Class getPublicationClass()
      Overrides:
      getPublicationClass in class EditPublicationHandler
    • containsHiddenFields

      protected boolean containsHiddenFields()
      Overrides:
      containsHiddenFields in class EditPublicationHandler
    • showRemoteUri

      public boolean showRemoteUri()
    • showModalEditionChange

      public boolean showModalEditionChange()
      Description copied from class: EditPublicationHandler
      Check if the "Advanced edition" or "Simple edition" button should be displayed in modal footer.

      The default implementation of this method is to check for request attribute EditPublicationHandler.SHOW_MODAL_EDITION_CHANGE. If the attribute is not set, the button is displayed only when editing an existing publication (i.e. EditPublicationHandler.getPublication() is not null), and hidden when creating a new one.

      You can set the attribute to a custom value or provide a custom FormHandler to override this behavior.

      See jcore/modalPubFormHandler.jspf for use of this method.

      Overrides:
      showModalEditionChange in class EditPublicationHandler
      Returns:
      true to display the button, false to hide it
    • 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 EditPublicationHandler
      Returns:
      false if no redirection is needed, true otherwise
      Throws:
      IOException - IO Exception
    • validateCommonCreateUpdate

      public boolean validateCommonCreateUpdate()
    • validateCreate

      public boolean validateCreate() throws IOException
      Overrides:
      validateCreate in class EditPublicationHandler
      Throws:
      IOException
    • setUseFakeFile

      public void setUseFakeFile(String str)
      Request that a fake file is used for the create operation and that create operation is not performed.

      Setting this boolean allows a complete FileDocument form to be filled (or any of its subtype), validated but not store, and dump as XML through work/lastPublicationXml.jsp

      You may still specify a content type, original filename for use by the fake file.

      You can also specify a file extension closed to the original setFakeExtension(String).

      Parameters:
      str - a boolean value as a string
      Since:
      jcms-9.0.0
      See Also:
    • setFakeExtension

      public void setFakeExtension(String str)
      Set the file extension to use for the fake file (if used).

      This will ensure that the fake file is temporarly created in the directory most closed to the final destination.

      Default to "bin".

      Parameters:
      str - a file extension without the dot, eg "doc", "jpg"
      See Also:
    • cleanFakeFile

      public void cleanFakeFile()
    • validateUpdate

      public boolean validateUpdate() throws IOException
      Overrides:
      validateUpdate in class EditPublicationHandler
      Throws:
      IOException
    • setFields

      public void setFields(Publication pub)
      Description copied from class: EditPublicationHandler
      Set the common (Publication) fields. This method is also a hook for sub-classed to fill some field (or do anything else) before a create or an update.
      Overrides:
      setFields in class EditPublicationHandler
      Parameters:
      pub - the publication to set the fields
    • getAvailableField

      public Object getAvailableField(String field)
      Description copied from class: EditDataHandler
      Get value of the given field calling getAvailable{field}(). Called by widgets and meta templates See also EditDataHandler.getEnumValues(String) and EditDataHandler.getEnumLabels(String, String)
      Overrides:
      getAvailableField in class EditPublicationHandler
      Parameters:
      field - the field name
      Returns:
      Object return by getAvailable
    • setId

      public void setId(String v)
      Description copied from class: EditPublicationHandler
      Set the value of id.
      Overrides:
      setId in class EditPublicationHandler
      Parameters:
      v - Value to assign to id.
    • setDescription

      public void setDescription(String[] v)
    • getAvailableDescription

      public String getAvailableDescription()
    • getAvailableDescriptionML

      public HashMap<String,String> getAvailableDescriptionML()
    • getAvailableDescription

      public String getAvailableDescription(String lang)
    • getAllAvailableDescriptionML

      public HashMap getAllAvailableDescriptionML()
    • setFilename

      public void setFilename(String v)
    • getAvailableFilename

      public String getAvailableFilename()
    • setOriginalFilename

      public void setOriginalFilename(String v)
    • getAvailableOriginalFilename

      public String getAvailableOriginalFilename()
    • setRemoteUri

      public void setRemoteUri(String v)
    • getAvailableRemoteUri

      public String getAvailableRemoteUri()
    • setContentType

      public void setContentType(String v)
    • getAvailableContentType

      public String getAvailableContentType()
    • setVersion

      public void setVersion(String v)
    • setOpUpload

      public void setOpUpload(String v)
    • isUploadContext

      public boolean isUploadContext()
      Returns true if the handler is used in upload context
      Returns:
      true if the handler is used in upload context
    • setUploadContext

      public void setUploadContext(boolean isUploadContext)
      set the uploadContext flag (true if the handler should be used for an upload, false for a normal update).
      Parameters:
      isUploadContext - the upload context flag