org.mmbase.module.builders
Class AbstractServletBuilder

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

public abstract class AbstractServletBuilder
extends MMObjectBuilder

Some builders are associated with a servlet. Think of images and attachments. There is some common functionality for those kind of builders, which is collected here.

Since:
MMBase-1.6
Version:
$Id: AbstractServletBuilder.java,v 1.20.2.1 2004/05/26 09:04:43 michiel Exp $
Author:
Michiel Meeuwissen

Field Summary
static Parameter[] FORMAT_PARAMETERS
           
static Parameter[] GUI_PARAMETERS
          Can be used to construct a List for executeFunction argument (new Parameters(GUI_ARGUMENTS))
static Parameter[] MIMETYPE_PARAMETERS
           
static Parameter[] SERVLETPATH_PARAMETERS
           
protected  boolean usesBridgeServlet
          If this builder is association with a bridge servlet.
 
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
AbstractServletBuilder()
           
 
Method Summary
protected  java.lang.Object executeFunction(MMObjectNode node, java.lang.String function, java.util.List args)
          Overrides the executeFunction of MMObjectBuilder with a function to get the servletpath associated with this builder.
protected abstract  java.lang.String getAssociation()
          This functions should return a string identifying where it is for.
protected abstract  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.
 java.lang.String getGUIIndicator(MMObjectNode node)
          This is final, because getSGUIIndicator has to be overridden in stead
 java.lang.String getGUIIndicator(java.lang.String field, MMObjectNode node)
          This is final, because getSGUIIndicator has to be overridden in stead
 Parameter[] getParameterDefinition(java.lang.String function)
          perhaps we need something like this
protected  java.lang.String getServletPath()
           
protected  java.lang.String getServletPath(java.lang.String root)
          Get a servlet path.
protected abstract  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 getSuperGUIIndicator(java.lang.String field, MMObjectNode node)
          Gets the GUI indicator of the super class of this class, to avoid circular references in descendants, which will occur if they want to call super.getGUIIndicator().
 
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
 

Field Detail

GUI_PARAMETERS

public static final Parameter[] GUI_PARAMETERS
Can be used to construct a List for executeFunction argument (new Parameters(GUI_ARGUMENTS))


SERVLETPATH_PARAMETERS

public static final Parameter[] SERVLETPATH_PARAMETERS

FORMAT_PARAMETERS

public static final Parameter[] FORMAT_PARAMETERS

MIMETYPE_PARAMETERS

public static final Parameter[] MIMETYPE_PARAMETERS

usesBridgeServlet

protected boolean usesBridgeServlet
If this builder is association with a bridge servlet. If not, it should not put the 'session=' in the url to the servlet (because the serlvet probably is servdb, which does not understand that).

Constructor Detail

AbstractServletBuilder

public AbstractServletBuilder()
Method Detail

getAssociation

protected abstract java.lang.String getAssociation()
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'.


getDefaultPath

protected abstract 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. For example 'img.db' or 'attachment.db'.


getServletPath

protected java.lang.String getServletPath(java.lang.String root)
Get a servlet path. Takes away the ? and the * which possibly are present in the servlet-mappings. You can put the argument(s) directly after this string.

Parameters:
root - The path to the application's root.

getServletPath

protected java.lang.String getServletPath()

getSGUIIndicator

protected abstract 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'


getSuperGUIIndicator

protected final java.lang.String getSuperGUIIndicator(java.lang.String field,
                                                      MMObjectNode node)
Gets the GUI indicator of the super class of this class, to avoid circular references in descendants, which will occur if they want to call super.getGUIIndicator().


getGUIIndicator

public final java.lang.String getGUIIndicator(MMObjectNode node)
This is final, because getSGUIIndicator has to be overridden in stead

Overrides:
getGUIIndicator in class MMObjectBuilder
Parameters:
node - The node to display
Returns:
the display of the node as a String

getGUIIndicator

public final java.lang.String getGUIIndicator(java.lang.String field,
                                              MMObjectNode node)
This is final, because getSGUIIndicator has to be overridden in stead

Overrides:
getGUIIndicator in class 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

getParameterDefinition

public Parameter[] getParameterDefinition(java.lang.String function)
perhaps we need something like this

Overrides:
getParameterDefinition in class MMObjectBuilder

executeFunction

protected java.lang.Object executeFunction(MMObjectNode node,
                                           java.lang.String function,
                                           java.util.List args)
Overrides the executeFunction of MMObjectBuilder with a function to get the servletpath associated with this builder. The field can optionally be the number field to obtain a full path to the served object.

Overrides:
executeFunction in class MMObjectBuilder
See Also:
MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List)


MMBase build 1.7.1.20041002