|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmagoffin.matt.ma2.support.AbstractMediaHandler
magoffin.matt.ma2.image.BaseImageMediaHandler
magoffin.matt.ma2.image.jmagick.BaseJMagickMediaHandler
public abstract class BaseJMagickMediaHandler
Base implementation of MediaHandler that uses the JMagick
for image processing.
The configurable properties of this class are:
JMagickMediaEffect implementations.
| Field Summary | |
|---|---|
static int |
DEFAULT_OUTPUT_DEPTH
The default value for the outputDepth property. |
| Fields inherited from class magoffin.matt.ma2.image.BaseImageMediaHandler |
|---|
DEFAULT_ORIENTATION_180_VALUE, DEFAULT_ORIENTATION_90_CLOCKWISE_VALUE, DEFAULT_ORIENTATION_90_COUNTER_CLOCKWISE_VALUE, DEFAULT_ORIENTATION_METADATA_KEY, ROTATE_180, ROTATE_90_CCW, ROTATE_90_CW |
| Fields inherited from class magoffin.matt.ma2.support.AbstractMediaHandler |
|---|
log, METADATA_PARAMETER_KEY |
| Constructor Summary | |
|---|---|
BaseJMagickMediaHandler(java.lang.String mime)
Construct with a MIME type. |
|
| Method Summary | |
|---|---|
MediaItem |
createNewMediaItem(java.io.File inputFile)
Basic JMagick implementation of createNewMediaItem. |
protected void |
defaultHandleRequest(MediaItem item,
MediaRequest request,
MediaResponse response)
Default handler for JMagick requests. |
protected void |
defaultHandleResource(MediaItem item,
MediaRequest request,
MediaResponse response,
org.springframework.core.io.Resource itemResource)
Default handler for JMagick resource request. |
MediaEffect |
getEffect(java.lang.String key,
java.util.Map<java.lang.String,?> effectParameters)
Get a MediaEffect instance for a specific key. |
java.util.Map<java.lang.String,JMagickMediaEffect> |
getJmagickMediaEffectMap()
|
int |
getOutputDepth()
|
protected java.lang.String |
getResponseMime(MediaItem item,
MediaRequest request,
org.springframework.core.io.Resource itemResource)
Get the MIME type to set in the response. |
void |
handleMediaRequest(MediaItem item,
MediaRequest request,
MediaResponse response)
Basic JMagick implementation of handleMediaRequest. |
void |
setJmagickMediaEffectMap(java.util.Map<java.lang.String,JMagickMediaEffect> jmagickMediaEffectMap)
|
void |
setOutputDepth(int outputDepth)
|
protected void |
setupBaseItemProperties(MediaItem item,
magick.ImageInfo info)
Setup some basic properties from an ImageReader. |
| Methods inherited from class magoffin.matt.ma2.image.BaseImageMediaHandler |
|---|
getOrientation180Value, getOrientation90ClockwiseValue, getOrientation90CounterClockwiseValue, getOrientationMetadataKey, handleMetadata, needToRotate, setOrientation180Value, setOrientation90ClockwiseValue, setOrientation90CounterClockwiseValue, setOrientationMetadataKey |
| Methods inherited from class magoffin.matt.ma2.support.AbstractMediaHandler |
|---|
applyEffects, createMetadataList, defaultHandleRequestOriginal, getDomainObjectFactory, getFileExtension, getMediaBiz, getMediaMetadataInstance, getMime, getNoWatermarkSizes, getPreferredFileExtension, getRequestEffects, getSmetaPropertyMap, getUserBiz, needToAlter, setDomainObjectFactory, setMediaBiz, setMime, setNoWatermarkSizes, setPreferredFileExtension, setSmetaPropertyMap, setUserBiz |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_OUTPUT_DEPTH
outputDepth property.
| Constructor Detail |
|---|
public BaseJMagickMediaHandler(java.lang.String mime)
mime - the MIME type| Method Detail |
|---|
public MediaEffect getEffect(java.lang.String key,
java.util.Map<java.lang.String,?> effectParameters)
MediaHandlerImplementaions must define the keys they support, and define the parameters that go with it.
getEffect in interface MediaHandlergetEffect in class AbstractMediaHandlerkey - the key of the desired effecteffectParameters - a Map of parameters (optional)
public java.util.Map<java.lang.String,JMagickMediaEffect> getJmagickMediaEffectMap()
public void setJmagickMediaEffectMap(java.util.Map<java.lang.String,JMagickMediaEffect> jmagickMediaEffectMap)
jmagickMediaEffectMap - the jmagickMediaEffectMap to setpublic MediaItem createNewMediaItem(java.io.File inputFile)
This implementation creates a new MediaItem instance and then
calls setupBaseItemProperties(MediaItem, ImageInfo)
followed by BaseImageMediaHandler.handleMetadata(MediaRequest, Resource, MediaItem).
inputFile - the file to create the media item from
public void handleMediaRequest(MediaItem item,
MediaRequest request,
MediaResponse response)
This implementation simply calls
defaultHandleRequest(MediaItem, MediaRequest, MediaResponse).
item - the media item to processrequest - the requestresponse - the response
protected void setupBaseItemProperties(MediaItem item,
magick.ImageInfo info)
throws magick.MagickException
This will set up the item's width, height, and MIME type.
item - the MediaItem to setupinfo - the JMagick image
magick.MagickException - if a JMagick error occurs
protected void defaultHandleRequest(MediaItem item,
MediaRequest request,
MediaResponse response)
This implementation gets a Resource via
MediaBiz.getMediaItemResource(MediaItem) and passes that
to defaultHandleResource(MediaItem, MediaRequest, MediaResponse, Resource).
item - the itemrequest - the requestresponse - the response
protected java.lang.String getResponseMime(MediaItem item,
MediaRequest request,
org.springframework.core.io.Resource itemResource)
This implementation merely calls AbstractMediaHandler.getMime() but extending classes
may need to override this.
item - the MediaItem being processedrequest - the requestitemResource - the item resource being processed
protected void defaultHandleResource(MediaItem item,
MediaRequest request,
MediaResponse response,
org.springframework.core.io.Resource itemResource)
This can be used to service MediaHandlerDelegate
requests, if extending classes wish to support that API.
item - the itemrequest - the requestresponse - the responseitemResource - the media resource being operated onpublic int getOutputDepth()
public void setOutputDepth(int outputDepth)
outputDepth - the outputDepth to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||