|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.util.functions.FunctionProvider
org.mmbase.module.core.MMTable
org.mmbase.module.core.MMObjectBuilder
org.mmbase.module.builders.AbstractServletBuilder
public abstract class AbstractServletBuilder
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.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
|---|
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctionsFunction, GUI_INDICATOR, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction |
| Fields inherited from class org.mmbase.module.core.MMTable |
|---|
maxNodesFromQuery, mmb, storageConnector, tableName |
| Fields inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
functions, getFunctions |
| Constructor Summary | |
|---|---|
AbstractServletBuilder()
|
|
| Method Summary | |
|---|---|
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). |
| Methods inherited from class org.mmbase.module.core.MMTable |
|---|
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size |
| Methods inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
addFunction, createParameters, getFunction, getFunctions, getFunctionValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public AbstractServletBuilder()
| Method Detail |
|---|
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(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(MMObjectNode).
Use only to commit changes - for adding node, use MMObjectBuilder.insert(String, MMObjectNode).
commit in class MMObjectBuildernode - The node to be committed
protected abstract String getSGUIIndicator(MMObjectNode node,
Parameters a)
protected final String getSuperGUIIndicator(String field,
MMObjectNode node)
public final String getGUIIndicator(MMObjectNode node,
Parameters pars)
MMObjectBuilder
getGUIIndicator in class MMObjectBuilder
public final String getGUIIndicator(String field,
MMObjectNode node)
getGUIIndicator in class MMObjectBuilderfield - the name field of the field to displaynode - The node to display
String, 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)
executeFunction in class MMObjectBuilderMMObjectBuilder.executeFunction(MMObjectNode, String, java.util.List)public InputStream getBinary(MMObjectNode node)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||