Class AbstractFileFieldDisplayer

    • Constructor Detail

      • AbstractFileFieldDisplayer

        public AbstractFileFieldDisplayer()
    • Method Detail

      • deleteAttachment

        protected void deleteAttachment​(String attachmentId,
                                        PagesContext pageContext)
        Deletes the specified attachment, identified by its unique identifier.?
        Parameters:
        attachmentId - the unique identifier of the attachment to delete.
        pageContext - the context of the page.
      • getManagedTypes

        public String[] getManagedTypes()
        Returns the name of the managed types.
      • displayScripts

        public void displayScripts​(PrintWriter out,
                                   FieldTemplate template,
                                   PagesContext pageContext)
        Prints the javascripts which will be used to control the new value given to the named field. The error messages may be adapted to a local language. The FieldTemplate gives the field type and constraints. The FieldTemplate gives the local labeld too. Never throws an Exception but log a silvertrace and writes an empty string when :
        • the fieldName is unknown by the template.
        • the field type is not a managed type.
      • update

        public List<String> update​(String attachmentId,
                                   FileField field,
                                   FieldTemplate template,
                                   PagesContext pagesContext)
                            throws FormException
        Description copied from interface: FieldDisplayer
        Updates the value of the field. The fieldName must be used to retrieve the HTTP parameter from the request. @throw FormException if the field type is not a managed type. @throw FormException if the field doesn't accept the new value.
        Throws:
        FormException
      • isDeletion

        protected boolean isDeletion​(AbstractFileFieldDisplayer.Operation operation,
                                     String attachmentId)
        Is the specified operation is a deletion?
        Parameters:
        operation - the operation.
        attachmentId - the identifier of the attachment on which the operation is.
        Returns:
        true if the operation is a deletion, false otherwise.
      • isUpdate

        protected boolean isUpdate​(AbstractFileFieldDisplayer.Operation operation,
                                   String attachmentId)
        Is the specified operation is an update?
        Parameters:
        operation - the operation.
        attachmentId - the identifier of the attachment on which the operation is.
        Returns:
        true if the operation is an update, false otherwise.
      • isDisplayedMandatory

        public boolean isDisplayedMandatory()
      • checkFieldType

        protected void checkFieldType​(String typeName,
                                      String contextCall)
        Checks the type of the field is as expected. The field must be of type file.
        Parameters:
        typeName - the name of the type.
        contextCall - the context of the call: which is the caller of this method. This parameter is used for trace purpose.