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

Compare with Current View Page History

Version 1 Next »

DEPRECATED

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

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

DamUploadFieldDefinition renders a field that is used by the Assets app for uploading assets to the DAM workspace. It extends the basic upload field as follows:

  • The uploaded file is mapped to a media type based on its MIME type.
  • Default field labels are overridden by media-type labels such as Upload new image.
  • Actions for editing images in the media editor.
  • Actions for previewing images.
  • Thumbnail preview.

It is possible to configure DamUploadFieldDefinition in dialogs or other apps, but keep in mind that the file will be placed in the workspace for which the field has been configured. For example, if you use the field in a dialog for a component template, that file (when uploaded using the field) will be stored in the website, not the DAM, workspace. It is best practice to keep your assets in the DAM whenever possible and link to them using a link field.

class: info.magnolia.dam.app.ui.field.definition.DamUploadFieldDefinition

fieldType: damUpload

DAM upload field properties

Simple DAM upload field definition:

form:
  tabs:
    - name: tabUpload
      label: Upload
      fields:
        - name: upload
          fieldType: damUpload
          label: Upload asset
          binaryNodeName: jcr:content
          editFileName: true

Node name

Value

 
form


 
tabs


 
tabUpload


 
fields


 
upload


 
binaryNodeName

jcr:content

 
fieldType

damUpload

 
label

Upload asset

 
editFileName

true

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.

Caption properties specific to the DAM upload field:

<field name>

required

Name of the field.

editFileCaption

optional, default is Edit image ...

Text displayed as a tooltip when you hover over the edit action icon.

lightboxCaption

optional, default is View in lightbox ...

Text displayed as a tooltip when you hover over the preview action icon.

Common field properties:

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

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

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