org.mmbase.module.builders
Class Images
java.lang.Object
org.mmbase.util.functions.FunctionProvider
org.mmbase.module.core.MMTable
org.mmbase.module.core.MMObjectBuilder
org.mmbase.module.builders.AbstractServletBuilder
org.mmbase.module.builders.AbstractImages
org.mmbase.module.builders.Images
- All Implemented Interfaces:
- EventListener, NodeEventListener, RelationEventListener, ImagesInterface
public class Images
- extends AbstractImages
If this class is used as the class for your builder, then an 'handle' byte field is assumed to
contain an image. You builder will work together with 'icaches', and with imagemagick (or jai).
This means that is has the following properties: ImageConvertClass,
ImageConvert.ConverterCommand, ImageConvert.ConverterRoot and MaxConcurrentRequests
- Version:
- $Id: Images.java 46174 2011-12-21 21:00:47Z michiel $
- Author:
- Daniel Ockeloen, Rico Jansen, Michiel Meeuwissen
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctionsFunction, GUI_INDICATOR, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction |
|
Method Summary |
boolean |
commit(MMObjectNode node)
|
static File |
createTemporaryFile(SerializableInputStream in,
String template)
|
protected Object |
executeFunction(MMObjectNode node,
String function,
List<?> args)
The executeFunction of this builder adds the 'cache' function. |
protected void |
fillImageCacheNode(MMObjectNode image,
MMObjectNode icacheNode,
String template)
|
MMObjectNode |
getCachedNode(MMObjectNode node,
String template)
Returns a icache node for given image node and conversion template. |
String |
getDefaultImageType()
The default image type is used when magic could not determin the type |
protected Dimension |
getDimension(MMObjectNode node,
String template)
|
protected String |
getGuiForNewImage(MMObjectNode node,
String alt,
Parameters args)
|
protected String |
getGUIIndicatorWithAlt(MMObjectNode node,
String alt,
Parameters args)
The GUI-indicator of an image-node also needs a res/req object. |
protected String |
getSGUIIndicatorForNode(MMObjectNode node,
Parameters args)
Returns GUI Indicator for node |
boolean |
init()
Read configurations (imageConvertClass, maxConcurrentRequest),
checks for 'icaches', inits the request-processor-pool. |
(package private) void |
invalidateTemplateCacheNumberCache(int number)
|
(package private) void |
invalidateTemplateCacheNumberCache(String ckey)
|
void |
notify(NodeEvent event)
|
void |
removeNode(MMObjectNode node)
Override the MMObjectBuilder removeNode, to invalidate the Image Cache AFTER a deletion of the
image node. |
void |
shutdown()
|
| Methods inherited from class org.mmbase.module.builders.AbstractImages |
checkHandle, getAssociation, getBlobCache, getDefaultPath, getDimension, getDimensionForEmptyHandle, getFileSize, getHandleFields, getImageFormat, getMimeType, getSGUIIndicator, handleEmpty, storesDimension, storesFileSize, storesImageType |
| Methods inherited from class org.mmbase.module.builders.AbstractServletBuilder |
, addFileName, getBinary, getDefaultFileName, getFileName, getFileName, getGUIIndicator, getGUIIndicator, getServletPath, getServletPath, getSession, getSuperGUIIndicator, insert |
| Methods inherited from class org.mmbase.module.core.MMObjectBuilder |
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, create, createAlias, createAlias, createIfNotExists, delete, equals, equals, executeFunction, fieldLocalChanged, getAncestors, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getHTML, getInitParameter, getInitParameters, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedInputStream, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hashCode, hostname_function, insert, isExtensionOf, isNodeCached, isNull, isVirtual, loadInitParameters, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, preCommit, process, removeEventListener, removeField, removeLocalObserver, removeRelations, removeRemoteObserver, removeSyncNodes, replace, safeCache, sendFieldChangeSignal, setDefaults, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, testValidData, toString, toString, update, updateFields, wrap |
| Methods inherited from class org.mmbase.module.core.MMTable |
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size |
CACHE_PARAMETERS
public static final Parameter[] CACHE_PARAMETERS
CACHEDNODE_PARAMETERS
public static final Parameter[] CACHEDNODE_PARAMETERS
HEIGHT_PARAMETERS
public static final Parameter[] HEIGHT_PARAMETERS
WIDTH_PARAMETERS
public static final Parameter[] WIDTH_PARAMETERS
DIMENSION_PARAMETERS
public static final Parameter[] DIMENSION_PARAMETERS
GUI_PARAMETERS
public static final Parameter[] GUI_PARAMETERS
defaultImageType
protected String defaultImageType
- Supposed image type if not could be determined (configurable)
dimensions
static Map<File,Dimension> dimensions
deleter
static Timer deleter
Images
public Images()
init
public boolean init()
- Read configurations (imageConvertClass, maxConcurrentRequest),
checks for 'icaches', inits the request-processor-pool.
- Overrides:
init in class AbstractServletBuilder
shutdown
public void shutdown()
- Overrides:
shutdown in class MMObjectBuilder
executeFunction
protected Object executeFunction(MMObjectNode node,
String function,
List<?> args)
- The executeFunction of this builder adds the 'cache' function.
The cache function accepts a conversion template as argument and returns the cached image
node number. Using this you order to pre-cache an image.
- Overrides:
executeFunction in class AbstractImages
- Since:
- MMBase-1.6
getDimension
protected Dimension getDimension(MMObjectNode node,
String template)
- Since:
- MMBase-1.7.4
fillImageCacheNode
protected void fillImageCacheNode(MMObjectNode image,
MMObjectNode icacheNode,
String template)
- Since:
- MMBase-1.9.2
getCachedNode
public MMObjectNode getCachedNode(MMObjectNode node,
String template)
- Returns a icache node for given image node and conversion template. If such a node does not exist, it is created.
- Since:
- MMBase-1.8
createTemporaryFile
public static File createTemporaryFile(SerializableInputStream in,
String template)
throws IOException
- Throws:
IOException
getGuiForNewImage
protected String getGuiForNewImage(MMObjectNode node,
String alt,
Parameters args)
throws IOException
- Throws:
IOException- Since:
- MMBase-1.9.2
getGUIIndicatorWithAlt
protected String getGUIIndicatorWithAlt(MMObjectNode node,
String alt,
Parameters args)
- The GUI-indicator of an image-node also needs a res/req object.
- Specified by:
getGUIIndicatorWithAlt in class AbstractImages
- Since:
- MMBase-1.6
getSGUIIndicatorForNode
protected String getSGUIIndicatorForNode(MMObjectNode node,
Parameters args)
- Description copied from class:
AbstractImages
- Returns GUI Indicator for node
- Overrides:
getSGUIIndicatorForNode in class AbstractImages
getDefaultImageType
public String getDefaultImageType()
- Description copied from class:
AbstractImages
- The default image type is used when magic could not determin the type
- Overrides:
getDefaultImageType in class AbstractImages
commit
public boolean commit(MMObjectNode node)
- Overrides:
commit in class AbstractServletBuilder
removeNode
public void removeNode(MMObjectNode node)
- Override the MMObjectBuilder removeNode, to invalidate the Image Cache AFTER a deletion of the
image node.
Remove a node from the cloud.
- Overrides:
removeNode in class MMObjectBuilder
- Parameters:
node - The node to remove.
notify
public void notify(NodeEvent event)
- Specified by:
notify in interface NodeEventListener- Overrides:
notify in class MMObjectBuilder
invalidateTemplateCacheNumberCache
void invalidateTemplateCacheNumberCache(int number)
- Javadoc:
invalidateTemplateCacheNumberCache
void invalidateTemplateCacheNumberCache(String ckey)
- Since:
- MMBase-1.7
MMBase2 Resources 2.0-SNAPSHOT - 2013-05-29T22:09