org.mmbase.module.builders
Class Images

java.lang.Object
  |
  +--org.mmbase.module.core.MMTable
        |
        +--org.mmbase.module.core.MMObjectBuilder
              |
              +--org.mmbase.module.builders.Images

public class Images
extends MMObjectBuilder

images holds the images and provides ways to insert, retract and search on them.

Version:
$Id: Images.java,v 1.41 2001/07/06 13:54:20 michiel Exp $
Author:
Daniel Ockeloen, Rico Jansen

Field Summary
protected static java.lang.String ImageConvertClass
           
protected  Queue imageRequestQueue
           
protected  java.util.Hashtable imageRequestTable
           
protected  ImageRequestProcessor[] ireqprocessors
           
protected  int MaxConcurrentRequests
           
protected  int MaxRequests
           
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
Images()
           
 
Method Summary
 int convertAlias(java.lang.String num)
           
 byte[] getCachedImage(java.util.Vector params)
          Will return null when not in cache, and otherwise a byte [] representing the picture..
 java.lang.String getGUIIndicator(MMObjectNode node)
          What should a GUI display for this node.
 java.lang.String getGUIIndicator(java.lang.String field, MMObjectNode node)
          What should a GUI display for this node/field combo.
 byte[] getImageBytes(scanpage sp, java.util.Vector params)
          Returns a picture wich belongs to the given param line, with caching
 byte[] getImageBytes5(scanpage sp, java.util.Vector params)
          Deprecated. glue method until org.mmbase.servlet.servdb is updated
 java.lang.String getImageMimeType(java.util.Vector params)
          Will return "jpg" as default type, or one of the strings in params, must contain the following "f(type)" where type will be returned
 java.util.Vector getList(scanpage sp, StringTagger tagger, java.util.StringTokenizer tok)
          Obtains a list of string values by performing the provided command and parameters.
 byte[] getOriginalImage(java.util.Vector params)
          Will return null when something goes wrong otherwise, a byte[] whcih represents the picture
 boolean init()
          Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called.
 void setDefaults(MMObjectNode node)
          Sets defaults for a node.
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, debug, deleteNodeCache, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescription, getDescriptions, getDutchSName, getEditFields, getField, getFieldNames, getFields, getFullTableName, getFunctionParameters, getHardNode, getHTML, getInitParameter, getInitParameters, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNode, getNode, getNodeType, getNumberFromName, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, getXMLSetup, hostname_function, init_obj2type, insert, insert, insertDone, isNodeCached, isVirtual, isXMLConfig, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, replace, search, search, search, searchIn, searchIn, searchIn, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setClassName, setDBLayout_xml, setDBLayout, setDebug, setDescription, setDescriptions, setDutchSName, setInitParameter, setMaintainer, setMMBase, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setVersion, setXmlConfig, setXMLPath, setXMLValues, signalNewObject, testValidData, toXML, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ImageConvertClass

protected static java.lang.String ImageConvertClass

MaxConcurrentRequests

protected int MaxConcurrentRequests

MaxRequests

protected int MaxRequests

imageRequestQueue

protected Queue imageRequestQueue

imageRequestTable

protected java.util.Hashtable imageRequestTable

ireqprocessors

protected ImageRequestProcessor[] ireqprocessors
Constructor Detail

Images

public Images()
Method Detail

init

public boolean init()
Description copied from class: MMObjectBuilder
Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called. The method retrieves data from the TypeDef builder, or adds data to thet builder if the current builder si not yet registrered.
Overrides:
init in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Returns:
Always true.
See Also:
MMObjectBuilder.create()

getGUIIndicator

public java.lang.String getGUIIndicator(MMObjectNode node)
Description copied from class: MMObjectBuilder
What should a GUI display for this node. Default is the first non system field (first field after owner). Override this to display your own choice (see Images.java).
Overrides:
getGUIIndicator in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to display
Returns:
the display of the node as a String

setDefaults

public void setDefaults(MMObjectNode node)
Description copied from class: MMObjectBuilder
Sets defaults for a node. Fields "number", "owner" and "otype" are not set by this method.
Overrides:
setDefaults in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to set the defaults of.

getGUIIndicator

public java.lang.String getGUIIndicator(java.lang.String field,
                                        MMObjectNode node)
Description copied from class: MMObjectBuilder
What should a GUI display for this node/field combo. Default is null (indicating to display the field as is) Override this to display your own choice.
Overrides:
getGUIIndicator in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to display
field - the name field of the field to display
Returns:
the display of the node's field as a String, null if not specified

getImageMimeType

public java.lang.String getImageMimeType(java.util.Vector params)
Will return "jpg" as default type, or one of the strings in params, must contain the following "f(type)" where type will be returned
Parameters:
params - a Vector of Strings, which could contain the "f(type)" string
Returns:
"jpg" by default, or the first occurence of "f(type)"

getImageBytes5

public byte[] getImageBytes5(scanpage sp,
                             java.util.Vector params)
Deprecated. glue method until org.mmbase.servlet.servdb is updated

Returns a picture wich belongs to the given param line, with caching
Parameters:
sp - Not needed at this moment,...
params - The name/id of the picture, followed by operations, which can be performed on the picture..
Returns:
null if something goes wrong, otherwise the picture in a byte[]

getImageBytes

public byte[] getImageBytes(scanpage sp,
                            java.util.Vector params)
Returns a picture wich belongs to the given param line, with caching
Parameters:
sp - Not needed at this moment,...
params - The name/id of the picture, followed by operations, which can be performed on the picture..
Returns:
null if something goes wrong, otherwise the picture in a byte[]

getCachedImage

public byte[] getCachedImage(java.util.Vector params)
Will return null when not in cache, and otherwise a byte [] representing the picture..
Parameters:
params - a Vector of Strings, containing the name/id of the picture, followed by operations, which can be performed on the picture..
Returns:
null if something goes wrong, otherwise the picture in a byte[]

getOriginalImage

public byte[] getOriginalImage(java.util.Vector params)
Will return null when something goes wrong otherwise, a byte[] whcih represents the picture
Parameters:
params - a Vector of Strings, containing the name/id of the picture, followed by operations, which can be performed on the picture..
Returns:
null if something goes wrong, otherwise the picture in a byte[]

convertAlias

public int convertAlias(java.lang.String num)

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger tagger,
                                java.util.StringTokenizer tok)
                         throws ParseException
Description copied from class: MMObjectBuilder
Obtains a list of string values by performing the provided command and parameters. This method is SCAN related and may fail if called outside the context of the SCAN servlet.
Overrides:
getList in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
sp - The scanpage (containing http and user info) that calls the function
tagger - a Hashtable of parameters (name-value pairs) for the command
tok - a list of strings that describe the (sub)command to execute
Returns:
a Vector containing the result values as a String


MMBase 2001