public abstract class AbstractServletBuilder extends MMObjectBuilder
| Modifier and Type | Field and Description |
|---|---|
protected String |
externalUrlField
If set, this points out a field in the builder that optionally contains
a url to an external (binary) source, which is then used as the stored
attachment (instead of accessing the database).
|
static String |
FIELD_FILENAME |
static String |
FIELD_HANDLE |
static String |
FIELD_MIMETYPE |
static Parameter[] |
FORMAT_PARAMETERS |
static Parameter[] |
GUI_PARAMETERS
Can be used to construct a List for executeFunction argument
(new Parameters(GUI_ARGUMENTS))
|
protected static Pattern |
legalizeFileName |
static Parameter[] |
MIMETYPE_PARAMETERS |
static String |
PROPERTY_EXTERNAL_URL_FIELD |
protected boolean |
usesBridgeServlet
If this builder is association with a bridge servlet.
|
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctions, GUI_INDICATOR, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, temporaryNodes, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunctionmaxNodesFromQuery, mmb, storageConnector, tableNamefunctions| Constructor and Description |
|---|
AbstractServletBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addFileName(MMObjectNode node,
String servlet)
Adds a filename to the path to a servlet, unless this does not make sense (not filename can
be determined) or it was explicitely set not to, using the servlet context init parameter
'mmbase.servlet.<association>addfilename.
|
protected void |
checkHandle(MMObjectNode node)
Tries to fill all fields which are dependend on the 'handle' field.
|
boolean |
commit(MMObjectNode node)
Commit changes to this node to the storage layer.
|
protected Object |
executeFunction(MMObjectNode node,
String function,
List<?> args)
Overrides the executeFunction of MMObjectBuilder with a function to get the servletpath
associated with this builder.
|
protected abstract String |
getAssociation()
This functions should return a string identifying where it is
for.
|
InputStream |
getBinary(MMObjectNode node) |
protected String |
getDefaultFileName() |
protected abstract 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.
|
StringBuilder |
getFileName(MMObjectNode node,
StringBuilder buf) |
StringBuilder |
getFileName(Node node,
StringBuilder buf) |
String |
getGUIIndicator(MMObjectNode node,
Parameters pars)
A complicated default implementation for GUI.
|
String |
getGUIIndicator(String field,
MMObjectNode node)
This is final, because getSGUIIndicator has to be overridden in stead
|
protected abstract Set<String> |
getHandleFields()
Returns the fields which tell something about the 'handle' field, and can be calculated from it.
|
protected String |
getMimeType(MMObjectNode node)
Returns the Mime-type associated with this node
|
protected String |
getServletPath() |
protected String |
getServletPath(String root)
Get a servlet path.
|
protected String |
getSession(Parameters a,
int nodeNumber) |
protected abstract 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 String |
getSuperGUIIndicator(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().
|
boolean |
init()
Read 'externalUrlField' property
|
int |
insert(String owner,
MMObjectNode node)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided).
|
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, create, createAlias, createAlias, createIfNotExists, delete, equals, equals, executeFunction, fieldLocalChanged, getAncestors, getBlobCache, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getHTML, getInitParameter, getInitParameters, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedInputStream, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hashCode, hostname_function, insert, isExtensionOf, isNodeCached, isNull, isVirtual, loadInitParameters, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, notify, preCommit, process, removeEventListener, removeField, removeLocalObserver, removeNode, removeRelations, removeRemoteObserver, removeSyncNodes, replace, safeCache, sendFieldChangeSignal, setDefaults, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, shutdown, testValidData, toString, toString, update, updateFields, wrapcount, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, sizeaddFunction, createParameters, getFunction, getFunctions, getFunctionValuepublic static final String PROPERTY_EXTERNAL_URL_FIELD
public static final String FIELD_MIMETYPE
public static final String FIELD_FILENAME
public static final String FIELD_HANDLE
public static final Parameter[] GUI_PARAMETERS
public static final Parameter[] FORMAT_PARAMETERS
public static final Parameter[] MIMETYPE_PARAMETERS
protected boolean usesBridgeServlet
protected String externalUrlField
protected static final Pattern legalizeFileName
protected abstract String getAssociation()
protected abstract String getDefaultPath()
public boolean init()
init in class MMObjectBuilderMMObjectBuilder.create()protected String getServletPath(String root)
root - The path to the application's root.protected String getServletPath()
protected String getMimeType(MMObjectNode node)
protected void checkHandle(MMObjectNode node)
protected abstract Set<String> getHandleFields()
public int insert(String owner, MMObjectNode node)
MMObjectBuilderMMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).insert in class MMObjectBuilderowner - The administrator creating the nodenode - The object to insert. The object need be of the same type as the current builder.int value which is the new object's unique number, -1 if the insert failed.public boolean commit(MMObjectNode node)
MMObjectBuilderMMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).
Use only to commit changes - for adding node, use MMObjectBuilder.insert(int, java.lang.String).commit in class MMObjectBuildernode - The node to be committedprotected abstract String getSGUIIndicator(MMObjectNode node, Parameters a)
protected final String getSuperGUIIndicator(String field, MMObjectNode node)
public final String getGUIIndicator(MMObjectNode node, Parameters pars)
MMObjectBuildergetGUIIndicator in class MMObjectBuilderpublic final String getGUIIndicator(String field, MMObjectNode node)
getGUIIndicator in class MMObjectBuilderfield - the name field of the field to displaynode - The node to displayString, null if not specifiedprotected String getDefaultFileName()
public StringBuilder getFileName(MMObjectNode node, StringBuilder buf)
public StringBuilder getFileName(Node node, StringBuilder buf)
protected boolean addFileName(MMObjectNode node, String servlet)
protected String getSession(Parameters a, int nodeNumber)
protected Object executeFunction(MMObjectNode node, String function, List<?> args)
public InputStream getBinary(MMObjectNode node)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}