org.mmbase.module.builders
Class Attachments

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

public class Attachments
extends AbstractServletBuilder

This builder can be used for 'attachments' builders. That is builders which have a 'handle' field and are associated with the 'attachments servlet.

Version:
$Id: Attachments.java,v 1.21.2.1 2003/01/06 17:03:20 michiel Exp $
Author:
cjr@dds.nl, Michiel Meeuwissen

Fields inherited from class org.mmbase.module.builders.AbstractServletBuilder
usesBridgeServlet
 
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
Attachments()
           
 
Method Summary
protected  void checkHandle(MMObjectNode node)
          If mimetype is not filled on storage in the database, then we can try to do smart things.
 boolean commit(MMObjectNode node)
          Commit changes to this node to the database.
protected  java.lang.Object executeFunction(MMObjectNode node, java.lang.String function, java.util.List args)
          Implements 'mimetype' function (Very simply for attachments, because they have the field).
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.
 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'
 java.lang.String getSGUIIndicator(java.lang.String session, javax.servlet.http.HttpServletResponse res, java.lang.String field, MMObjectNode node)
           
 int insert(java.lang.String owner, MMObjectNode node)
          Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided).
 boolean process(scanpage sp, java.util.StringTokenizer command, java.util.Hashtable cmds, java.util.Hashtable vars)
          this method will be invoked while uploading the file.
protected  boolean setEditFileField(EditState ed, java.lang.String fieldname, java.util.Hashtable cmds, scanpage sp)
           
 
Methods inherited from class org.mmbase.module.builders.AbstractServletBuilder
getGUIIndicator, getGUIIndicator, getServletPath, getServletPath, getServletPath, getSuperGUIIndicator
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, 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, insertDone, isExtensionOf, isNodeCached, isVirtual, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, 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
 

Constructor Detail

Attachments

public Attachments()
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'.
Overrides:
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'.
Overrides:
getDefaultPath in class AbstractServletBuilder

process

public boolean process(scanpage sp,
                       java.util.StringTokenizer command,
                       java.util.Hashtable cmds,
                       java.util.Hashtable vars)
this method will be invoked while uploading the file.
Overrides:
process 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
command - a list of strings that describe the (sub)command to execute (the portion after ' PRC-CMD-BUILDER')
cmds - the commands (PRC-CMD) that are iurrently being processed, including the current command.
vars - variables (PRC-VAR) thatw ere set to be used during processing. the variable 'EDITSTATE' accesses the EditState object (if applicable).
Returns:
the result value as a String

getSGUIIndicator

public java.lang.String getSGUIIndicator(java.lang.String session,
                                         javax.servlet.http.HttpServletResponse res,
                                         MMObjectNode node)
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'
Overrides:
getSGUIIndicator in class AbstractServletBuilder

getSGUIIndicator

public java.lang.String getSGUIIndicator(java.lang.String session,
                                         javax.servlet.http.HttpServletResponse res,
                                         java.lang.String field,
                                         MMObjectNode node)
Overrides:
getSGUIIndicator in class AbstractServletBuilder

setEditFileField

protected boolean setEditFileField(EditState ed,
                                   java.lang.String fieldname,
                                   java.util.Hashtable cmds,
                                   scanpage sp)

checkHandle

protected void checkHandle(MMObjectNode node)
If mimetype is not filled on storage in the database, then we can try to do smart things.

insert

public int insert(java.lang.String owner,
                  MMObjectNode node)
Description copied from class: MMObjectBuilder
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided). This method indirectly calls MMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).
Overrides:
insert in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
owner - The administrator creating the node
node - The object to insert. The object need be of the same type as the current builder.
Returns:
An int value which is the new object's unique number, -1 if the insert failed.

commit

public boolean commit(MMObjectNode node)
Description copied from class: MMObjectBuilder
Commit changes to this node to the database. This method indirectly calls MMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode). Use only to commit changes - for adding node, use MMObjectBuilder.insert(int, java.lang.String).
Overrides:
commit in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to be committed
Returns:
true if commit successful

executeFunction

protected java.lang.Object executeFunction(MMObjectNode node,
                                           java.lang.String function,
                                           java.util.List args)
Implements 'mimetype' function (Very simply for attachments, because they have the field).
Overrides:
executeFunction in class AbstractServletBuilder
Since:
MMBase-1.6.1


MMBase build 1.6.5.20030923