info.magnolia.dam.asset.field
Class DamUploadField<D extends DamFileItemWrapper>

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractField<T>
              extended by com.vaadin.ui.CustomField<Byte[]>
                  extended by info.magnolia.ui.form.field.upload.AbstractUploadField<D>
                      extended by info.magnolia.ui.form.field.upload.basic.BasicUploadField<D>
                          extended by info.magnolia.dam.asset.field.DamUploadField<D>
Type Parameters:
D - DamFileItemWrapper implemented class.
All Implemented Interfaces:
com.vaadin.data.Buffered, com.vaadin.data.BufferedValidatable, com.vaadin.data.Property<Byte[]>, com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer, com.vaadin.data.Validatable, com.vaadin.event.Action.ShortcutNotifier, com.vaadin.event.dd.DropHandler, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Field<Byte[]>, com.vaadin.ui.HasComponents, com.vaadin.ui.Upload.FailedListener, com.vaadin.ui.Upload.FinishedListener, com.vaadin.ui.Upload.ProgressListener, com.vaadin.ui.Upload.StartedListener, info.magnolia.ui.form.field.upload.UploadField, Serializable, Iterable<com.vaadin.ui.Component>

public class DamUploadField<D extends DamFileItemWrapper>
extends info.magnolia.ui.form.field.upload.basic.BasicUploadField<D>

Dam implementation of BasicUploadField.
Override default Layout components of the CompletedLayout:

An Uploaded file is mapped to a mediaType (based on the MimeType).
The mediaType define upload configuration like: Check UploadConfig for additional informations regarding MediaEditor configuration

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class info.magnolia.ui.form.field.upload.AbstractUploadField
info.magnolia.ui.form.field.upload.AbstractUploadField.InterruptionReason
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
com.vaadin.ui.AbstractField.FocusShortcut, com.vaadin.ui.AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Field
com.vaadin.ui.Field.ValueChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered
com.vaadin.data.Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
 
Field Summary
 
Fields inherited from class info.magnolia.ui.form.field.upload.basic.BasicUploadField
captionExtension, deleteCaption, dropZoneCaption, errorNoteCaption, fileDetailFormatCaption, fileDetailHeaderCaption, fileDetailNameCaption, fileDetailSizeCaption, fileDetailSourceCaption, imageProvider, inProgressCaption, inProgressRatioCaption, selectAnotherCaption, selectNewCaption, successNoteCaption, uiContext, warningNoteCaption
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
DamUploadField(D fileWrapper, File tmpUploadDirectory, info.magnolia.ui.imageprovider.ImageProvider imageProvider, info.magnolia.ui.api.context.UiContext uiContext, info.magnolia.ui.mediaeditor.MediaEditorPresenterFactory mediaEditorFactory, info.magnolia.objectfactory.ComponentProvider componentProvider, DamUploadFieldDefinition definition, info.magnolia.i18nsystem.SimpleTranslator i18n)
           
 
Method Summary
protected  com.vaadin.ui.Layout createCompletedActionLayout()
          Override of CompletedLayout section.
Used the configuration in order to define the action to perform and Thumbnail component to display.
protected  com.vaadin.ui.Component createThumbnailComponent()
          Create a preview image with a button if configured: in lower-left to open the media in a lightbox a button in the lower-right to open the MediaEditor.
protected  com.vaadin.ui.Component getFileDetailSize()
          Add File Info.
protected  void populateFromDefinition(DamUploadFieldDefinition definition)
           
protected  void setCaptionExtension(String mimeType)
          Caption section.
 void setEditFileCaption(String editFileCaption)
           
 void setLightboxCaption(String lightboxCaption)
           
 
Methods inherited from class info.magnolia.ui.form.field.upload.basic.BasicUploadField
attach, buildCompletedLayout, buildEmptyLayout, buildInProgressLayout, createDeleteButton, createIconStyleName, displayUploadFailedNote, displayUploadFinishedNote, displayUploadInterruptNote, getCaption, getCssLayout, getFileDetailFileFormat, getFileDetailFileName, getFileDetailHeader, initContent, isEmpty, populateFromDefinition, refreshInProgressLayout, setDeteteCaption, setDropZoneCaption, setEditFileFormat, setEditFileName, setErrorNoteCaption, setFileDetailFormatCaption, setFileDetailHeaderCaption, setFileDetailNameCaption, setFileDetailSizeCaption, setFileDetailSourceCaption, setInProgressCaption, setInProgressRatioCaption, setReadOnly, setSelectAnotherCaption, setSelectNewCaption, setSizeInterruption, setSuccessNoteCaption, setTypeInterruption, setUserInterruption, setWarningNoteCaption
 
Methods inherited from class info.magnolia.ui.form.field.upload.AbstractUploadField
createDropZone, detach, drop, getAcceptCriterion, getDropZone, getFileWrapper, getRootLayout, getType, getUpload, interruptUpload, isValidFile, setAllowedMimeTypePattern, setMaxUploadSize, setRootLayout, updateDisplay, updateProgress, uploadFailed, uploadFinished, uploadStarted
 
Methods inherited from class com.vaadin.ui.CustomField
getContent, iterator, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, commit, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getState, getTabIndex, getValidators, getValue, isBuffered, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, toString, validate, validate, valueChange
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth
 
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListener
 

Constructor Detail

DamUploadField

public DamUploadField(D fileWrapper,
                      File tmpUploadDirectory,
                      info.magnolia.ui.imageprovider.ImageProvider imageProvider,
                      info.magnolia.ui.api.context.UiContext uiContext,
                      info.magnolia.ui.mediaeditor.MediaEditorPresenterFactory mediaEditorFactory,
                      info.magnolia.objectfactory.ComponentProvider componentProvider,
                      DamUploadFieldDefinition definition,
                      info.magnolia.i18nsystem.SimpleTranslator i18n)
Method Detail

getFileDetailSize

protected com.vaadin.ui.Component getFileDetailSize()
Add File Info.

Overrides:
getFileDetailSize in class info.magnolia.ui.form.field.upload.basic.BasicUploadField<D extends DamFileItemWrapper>

createCompletedActionLayout

protected com.vaadin.ui.Layout createCompletedActionLayout()
Override of CompletedLayout section.
Used the configuration in order to define the action to perform and Thumbnail component to display.

Overrides:
createCompletedActionLayout in class info.magnolia.ui.form.field.upload.basic.BasicUploadField<D extends DamFileItemWrapper>

createThumbnailComponent

protected com.vaadin.ui.Component createThumbnailComponent()
Create a preview image with a button if configured:

Overrides:
createThumbnailComponent in class info.magnolia.ui.form.field.upload.basic.BasicUploadField<D extends DamFileItemWrapper>

populateFromDefinition

protected void populateFromDefinition(DamUploadFieldDefinition definition)

setCaptionExtension

protected void setCaptionExtension(String mimeType)
Caption section.

Overrides:
setCaptionExtension in class info.magnolia.ui.form.field.upload.basic.BasicUploadField<D extends DamFileItemWrapper>

setLightboxCaption

public void setLightboxCaption(String lightboxCaption)

setEditFileCaption

public void setEditFileCaption(String editFileCaption)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.