org.mmbase.module.builders
Class AbstractImages

java.lang.Object
  extended byorg.mmbase.module.core.MMTable
      extended byorg.mmbase.module.core.MMObjectBuilder
          extended byorg.mmbase.module.builders.AbstractServletBuilder
              extended byorg.mmbase.module.builders.AbstractImages
Direct Known Subclasses:
ImageCaches, Images

public abstract class AbstractImages
extends AbstractServletBuilder

AbstractImages holds the images and provides ways to insert, retrieve and search them.

Since:
MMBase-1.6
Version:
$Id: AbstractImages.java,v 1.24.2.1 2004/08/26 12:18:27 michiel Exp $
Author:
Michiel Meeuwissen

Nested Class Summary
protected static class AbstractImages.CKeyCache
          Cache with 'ckey' keys.
 
Field Summary
 
Fields inherited from class org.mmbase.module.builders.AbstractServletBuilder
FORMAT_PARAMETERS, GUI_PARAMETERS, MIMETYPE_PARAMETERS, SERVLETPATH_PARAMETERS, usesBridgeServlet
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
AGE_PARAMETERS, broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, listCache, nodeCache, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
AbstractImages()
           
 
Method Summary
protected  java.lang.Object executeFunction(MMObjectNode node, java.lang.String function, java.util.List args)
          Every image of course has a format and a mimetype.
protected  java.lang.String getAssociation()
          This functions should return a string identifying where it is for.
protected  java.lang.String getDefaultPath()
          If no servlet path can be found via the association (if the servlet did not 'associate' itself with something, like servdb), then the getServletPath function will fall back to this.
protected abstract  java.lang.String getGUIIndicatorWithAlt(MMObjectNode node, java.lang.String title, Parameters a)
          An image's gui-indicator is of course some <img src>, but it depends on what kind of image (cached, original) what excactly it must be.
abstract  byte[] getImageBytes(java.util.List params)
          Returns an image which belongs to the given parameter set.
protected abstract  java.lang.String getImageFormat(MMObjectNode node)
          Returns the format of the image.
 java.lang.String getImageMimeType(MMObjectNode node)
          Determine the MIME type of this image node, baseImagd on the image format.
protected  java.lang.String getSGUIIndicator(MMObjectNode node, Parameters a)
          'Servlet' builders need a way to transform security to the servlet, in the gui functions, so they have to implement the 'SGUIIndicators'
protected  java.lang.String getSGUIIndicatorForNode(MMObjectNode node, Parameters a)
          Returns GUI Indicator for node
 
Methods inherited from class org.mmbase.module.builders.AbstractServletBuilder
getGUIIndicator, getGUIIndicator, getParameterDefinition, getServletPath, getServletPath, getSuperGUIIndicator
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, count, create, createAlias, delete, deleteNodeCache, drop, equals, equals, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getAncestors, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getConfigFile, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEditFields, getField, getFieldNames, getFields, getFields, getFunctionParameters, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getMMBase, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNode, getNodes, getNodes, getNodeType, getNumberFromName, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getQuery, getQuery, getQuery, getRawNodes, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hashCode, hostname_function, init, insert, insert, insertDone, isExtensionOf, isNodeCached, isVirtual, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, processSearchResults, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeSyncNodes, removeTmpNode, replace, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchList, searchList, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setDBLayout_xml, setDefaults, setDescription, setDescriptions, setInitParameter, setMaintainer, setMMBase, setParentBuilder, setPluralNames, setSearchAge, setSingularNames, setTableName, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, setXMLValues, signalNewObject, testValidData, toString, toString, toXML, updateFields, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
created, getFullTableName, getTableName, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractImages

public AbstractImages()
Method Detail

getAssociation

protected java.lang.String getAssociation()
Description copied from class: AbstractServletBuilder
This functions should return a string identifying where it is for. This is used when communicating with MMBaseServlet, to find the right servlet. For example 'images' or 'attachments'.

Specified by:
getAssociation in class AbstractServletBuilder

getDefaultPath

protected java.lang.String getDefaultPath()
Description copied from class: AbstractServletBuilder
If no servlet path can be found via the association (if the servlet did not 'associate' itself with something, like servdb), then the getServletPath function will fall back to this. For example 'img.db' or 'attachment.db'.

Specified by:
getDefaultPath in class AbstractServletBuilder

getGUIIndicatorWithAlt

protected abstract java.lang.String getGUIIndicatorWithAlt(MMObjectNode node,
                                                           java.lang.String title,
                                                           Parameters a)
An image's gui-indicator is of course some <img src>, but it depends on what kind of image (cached, original) what excactly it must be.


getSGUIIndicatorForNode

protected java.lang.String getSGUIIndicatorForNode(MMObjectNode node,
                                                   Parameters a)
Returns GUI Indicator for node


getSGUIIndicator

protected java.lang.String getSGUIIndicator(MMObjectNode node,
                                            Parameters a)
Description copied from class: AbstractServletBuilder
'Servlet' builders need a way to transform security to the servlet, in the gui functions, so they have to implement the 'SGUIIndicators'

Specified by:
getSGUIIndicator in class AbstractServletBuilder

getImageFormat

protected abstract java.lang.String getImageFormat(MMObjectNode node)
Returns the format of the image. Like 'jpg' or 'gif'.


getImageMimeType

public java.lang.String getImageMimeType(MMObjectNode node)
Determine the MIME type of this image node, baseImagd on the image format.


getImageBytes

public abstract byte[] getImageBytes(java.util.List params)
Returns an image which belongs to the given parameter set. The parameters exist of a list of string values, starting with the orginal image object alias or number, followed by operations (format and transformation instructions) This function is not used by ImageServlet. Perhaps it should be deprecated.

Parameters:
params - A list of parameters, containign at least the id of the image, possibly followed by operations
Returns:
the image as a byte[], or null if something went wrong

executeFunction

protected java.lang.Object executeFunction(MMObjectNode node,
                                           java.lang.String function,
                                           java.util.List args)
Every image of course has a format and a mimetype. Two extra functions to get them.

Overrides:
executeFunction in class AbstractServletBuilder


MMBase build 1.7.1.20041002