info.magnolia.dam.asset.field
Class DamFileItemWrapper

java.lang.Object
  extended by info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper
      extended by info.magnolia.dam.asset.field.DamFileItemWrapper
All Implemented Interfaces:
info.magnolia.ui.form.field.upload.FileItemWrapper

public class DamFileItemWrapper
extends info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper

MultiMedia extended Implementation of the BasicFileItemWrapper.


Field Summary
 
Fields inherited from class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper
fileSize, item
 
Constructor Summary
DamFileItemWrapper(info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter jcrItem, File tmpDirectory, DamModule damModule)
           
 
Method Summary
 void clearProperties()
           
 long getDuration()
           
 long getHeight()
           
 MediaType getMediaType()
           
protected  String getMediaTypeIdForMimeType(String mimeType)
           
protected  UploadConfig getUploadConfig()
           
 long getWidth()
           
 boolean isImage()
           
protected  void populateItem()
          Based on the FileItemWrapper values, populate the Item.
Add height, width and duration information.
protected  void populateWrapperFromFileInputStream(InputStream is)
          Only update the File and File Sizes (size, height, width, duration).
Used once MediaEditor returns in order to update the File based on the modifications.
protected  void populateWrapperFromItem()
          Populate the current ItemWrapper with the Item properties.
Based on the MediaType set the appropriate properties.
protected  void populateWrapperFromReceiver(info.magnolia.ui.form.field.upload.UploadReceiver receiver)
          Populate the current ItemWrapper with the receiver properties.
Based on the MediaType set the appropriate properties.
 
Methods inherited from class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper
getExtension, getFile, getFileFormatProperty, getFileName, getFileNameProperty, getFileSize, getMimeType, initJcrItemProperty, isEmpty, populateFromItem, populateFromReceiver, reloadPrevious
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DamFileItemWrapper

public DamFileItemWrapper(info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter jcrItem,
                          File tmpDirectory,
                          DamModule damModule)
Method Detail

populateWrapperFromItem

protected void populateWrapperFromItem()
Populate the current ItemWrapper with the Item properties.
Based on the MediaType set the appropriate properties.

Overrides:
populateWrapperFromItem in class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper

populateWrapperFromReceiver

protected void populateWrapperFromReceiver(info.magnolia.ui.form.field.upload.UploadReceiver receiver)
Populate the current ItemWrapper with the receiver properties.
Based on the MediaType set the appropriate properties.

Overrides:
populateWrapperFromReceiver in class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper

populateWrapperFromFileInputStream

protected void populateWrapperFromFileInputStream(InputStream is)
Only update the File and File Sizes (size, height, width, duration).
Used once MediaEditor returns in order to update the File based on the modifications.


clearProperties

public void clearProperties()
Specified by:
clearProperties in interface info.magnolia.ui.form.field.upload.FileItemWrapper
Overrides:
clearProperties in class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper

populateItem

protected void populateItem()
Based on the FileItemWrapper values, populate the Item.
Add height, width and duration information.

Overrides:
populateItem in class info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper

getMediaTypeIdForMimeType

protected String getMediaTypeIdForMimeType(String mimeType)

getUploadConfig

protected UploadConfig getUploadConfig()

isImage

public boolean isImage()

getHeight

public long getHeight()
Returns:
the current image height. 0 If not yet set.

getWidth

public long getWidth()
Returns:
the current image width. 0 If not yet set.

getDuration

public long getDuration()
Returns:
the current media duration;

getMediaType

public MediaType getMediaType()
Returns:
the current MediaType.


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