Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

DamUploadFieldDefinition  renders a field for uploading images and videos in the digital asset management system (DAM). It extends the basic upload field and adds the following enhancements to the completed view:

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

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

Here's the completed view for an uploaded image.

Here's the completed view for an uploaded video.

You can use all common field properties and the following.

PropertyDescriptionDefault value
allowedMimeTypePattern

Regular expression to filter allowed files by their MIME type. For example, to allow only Excel files set the value to application.*(excel|xls) . To allow images only, set the value to image.*. For more information about the supported pattern, see Pattern. Optional.

For digital asset management, MIME types:

  • (warning) 2.0+ are defined by the MediaType class.
  • (warning) 1.0+ are configured in /modules/dam/config/mediaTypes
.* (all types)
binaryNodeNameName of the subnode that will contain the file binary and related information.binaryNodeName
editFileFormatWhen set to true, the file extension displayed in the Format field is editable. Optional.false
editFileNameWhen set to true, the file name displayed in the Name field is editable. Optional.false
maxUploadSizeMaximum file size in bytes. Optional.2^63 (9.2 EB)

Caption properties. These are all optional properties. Values are typically retrieved from a message bundle.

PropertyDescriptionDefault text

Empty view

  
selectNewCaption Text displayed as tooltip on the upload button.Select a file to upload...
dropZoneCaption Text displayed as label for dropping invitation.or <em>drag a file into this area</em> to upload it
warningNoteCaption Text displayed in the warning note.You have aborted the upload of your file

In progress view

  
inProgressCaption Text displayed as title.Uploading file {0} ...
inProgressRatioCaption Text displayed as file upload ratio.{0} of {1} uploaded

Completed view

  
fileDetailHeaderCaption Text displayed as file detail header.File detail
fileDetailNameCaption Text displayed as file name label.Name
fileDetailSizeCaption Text displayed as file size label.Size
fileDetailFormatCaption Text displayed as file format label.Format
fileDetailSourceCaption Text displayed as file source label.Source
deleteCaption Text displayed as tooltip on the delete icon.Upload a new File...
selectAnotherCaption Text displayed on the upload button.Upload a new File...
successNoteCaption Text displayed in the success note.Your file has been uploaded successfully
errorNoteCaption Text displayed in the error note.An Error occurred while uploading your file
sizeInterruption Text displayed in the warning when file size > maxUploadSizeA file size limitation.
typeInterruption Text displayed in the warning when file type not in allowedMimeTypePatternAn unsupported upload file type.
userInterruption Text displayed in the warning when the user interrupts the upload.A user action.

Caption properties specific to the DAM upload field.

PropertyDescriptionDefault text
lightboxCaptionText displayed as tooltip when you hover over the preview action icon.View in lightbox...
editFileCaptionText displayed as tooltip when you hover over the edit action icon.Edit image...

(warning) 5.0+. The nodeDataTemplate/width properties used in 4.5 are no longer supported.