org.mmbase.module.builders
Class AbstractServletBuilder

java.lang.Object
  |
  +--org.mmbase.module.core.MMTable
        |
        +--org.mmbase.module.core.MMObjectBuilder
              |
              +--org.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.11.2.2 2003/07/03 09:02:07 vpro Exp $
Author:
Michiel Meeuwissen

Field Summary
protected  boolean usesBridgeServlet
          If this builder is association with a bridge servlet.
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, 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
protected  java.lang.String getServletPath()
           
protected  java.lang.String getServletPath(java.lang.String fileName)
          Returns the path to the servlet.
protected  java.lang.String getServletPath(java.lang.String context, java.lang.String fileName)
          Get a servlet path.
protected abstract  java.lang.String getSGUIIndicator(java.lang.String session, javax.servlet.http.HttpServletResponse res, MMObjectNode node)
          'Servlet' builders need a way to transform security to the servlet, in the gui functions, so they have to implement the 'SGUIIndicators'
protected abstract  java.lang.String getSGUIIndicator(java.lang.String session, javax.servlet.http.HttpServletResponse res, java.lang.String field, MMObjectNode node)
           
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, create, createAlias, created, 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, getFullTableName, getFunctionParameters, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNode, getNodes, getNodeType, getNumberFromName, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getQuery, getQuery, getQuery, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hashCode, hostname_function, init, insert, insert, insertDone, isExtensionOf, isNodeCached, isVirtual, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, 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, setValue, setValue, setVersion, setXMLPath, setXMLValues, signalNewObject, testValidData, toString, toString, toXML, updateFields, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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 context,
                                          java.lang.String fileName)
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:
context - The context (empty string, or starting with /). Will be ignored if determined already.
fileName - Optional fileName. Will be added to the url, but it will not influence the servlet.

getServletPath

protected java.lang.String getServletPath(java.lang.String fileName)
Returns the path to the servlet.
See Also:
getServletPath(String, String)

getServletPath

protected java.lang.String getServletPath()

getSGUIIndicator

protected abstract java.lang.String getSGUIIndicator(java.lang.String session,
                                                     javax.servlet.http.HttpServletResponse res,
                                                     MMObjectNode node)
'Servlet' builders need a way to transform security to the servlet, in the gui functions, so they have to implement the 'SGUIIndicators'

getSGUIIndicator

protected abstract java.lang.String getSGUIIndicator(java.lang.String session,
                                                     javax.servlet.http.HttpServletResponse res,
                                                     java.lang.String field,
                                                     MMObjectNode node)

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
Following copied from class: org.mmbase.module.core.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
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

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


MMBase build 1.6.5.20030923