You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

DEPRECATED

This basic upload field definition has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework.

For the updated implementation, see Upload field for Magnolia 6 UI instead.

BasicUploadFieldDefinition renders a field to upload a file to a Magnolia JCR workspace. The file is stored on the node of the current context of the form (within a dialog or subApp), which could be a content app item, a page or a component of a page.

class: info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition

fieldType: basicUpload

The basic upload field has three states. You can set properties for each.

  • Empty is the starting point where no file has been selected. You can select a file with the button or drag it into the box.

  • In progress displays a progress bar and incremental percentages and uploaded/total ratio.

  • Completed displays a success notification and summary of file info.

Basic upload field properties

Simple basic upload field definition:

form:
  tabs:
    - name: tabUpload
      label: Upload
      fields:
        - name: upload
          fieldType: basicUpload
          label: Upload
          allowedMimeTypePattern: text/xml
          binaryNodeName: import

Node name

Value

 
form


 
tabs


 
tabUpload


 
fields


 
upload


 
allowedMimeTypePattern

text/xml

 
binaryNodeName

import

 
fieldType

basicUpload

 
label

Import XML file

Unable to render {include} The included page could not be found.

allowedMimeTypePattern

optional, default is .* (all types)

Regular expression to filter allowed files by MIME type. For example, to allow images only, set the value to image\/.*.

For more information about the supported pattern, see the Pattern class.

maxUploadSize

optional, default is 2^63 (9.2 EB)

Maximum file size in bytes.

The following are label properties. Their values are typically retrieved from a message bundle.

Before upload

dropZoneLabel

optional, default is translated field.upload.basic.drop.hint key

Text displayed for the drop zone.

selectNewLabel

optional, default is translated field.upload.basic.select.new key

Text displayed on the upload button.

warningNoteLabel

optional, default is translated field.upload.basic.note.warning key

Text displayed when the upload is aborted.

During upload

inProgressLabel

optional, default is translated field.upload.basic.uploading.file key

Text showing how many files have been uploaded.

inProgressRatioLabel

optional, default is translated field.upload.basic.uploaded.file key

Text showing how many files have been uploaded in relation to the total number of files.

After upload

deleteLabel

optional, default is translated field.upload.basic.select.delete key

Text displayed on the delete icon.

errorNoteLabel

optional, default is translated field.upload.basic.note.error key

Text displayed when an error occurs during the upload.

fileDetailFormatLabel

optional, default is translated field.upload.basic.file.detail.format key

Text displayed for the file format.

fileDetailHeaderLabel

optional, default is translated field.upload.basic.file.detail.header key

Text displayed for the file header.

fileDetailNameLabel

optional, default is translated field.upload.basic.file.detail.name key

Text displayed for the file name.

fileDetailSizeLabel

optional, default is translated field.upload.basic.file.detail.size key

Text displayed for the file size.

fileDetailSourceLabel

optional, default is translated field.upload.basic.file.detail.source key

Text displayed for the file source.

selectAnotherLabel

optional, default is translated field.upload.basic.select.another key

Text displayed on the upload button.

sizeInterruption

optional, default is translated field.upload.interupted.size key

Text displayed when the file size is greater than maxUploadSize.

successNoteLabel

optional, default is translated field.upload.basic.note.success key

Text displayed when the upload is successful.

typeInterruption

optional, default is translated field.upload.interupted.type key

Text displayed when the file type is not set in allowedMimeTypePattern.

userInterruption

optional, default is translated field.upload.interupted.user key

Text displayed when the upload is interrupted.

Common field properties:

Unable to render {include} The included page could not be found.

When using the basic upload field in a composite or multivalue field, use the DelegatingCompositeFieldTransformer. The other transformer classes do not work.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels