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

java.lang.Objectorg.mmbase.applications.dove.AbstractDove
public abstract class AbstractDove
This class handles Remote Procedure Calls described using a DOM model.
The original data is received in xml, likely through a specialized servlet such
as the DoveServlet (but this is not required. it may, for instance, be
possible to use this class in conjunction with SOAP or even outside a servlet
context).
The call should result in a new DOM tree (see the EditWizard API for details).
XXX: Currently, this class performs some type of validation on the xml received.
If errors occur, they are included in the response, at the place where they
occur. This means that the <error > tag can occur anywhere in the
response, which is not very neat.
Errors have three types:
parser : the xml given is invalid or does not follow the grammar.
This likely means there is a bug in the client code.
server : the code invoked is either not yet implemented or another,
server-related, error occurred (such as no memory, bad configuration,
etc.).
Server errors entirely fail a request.
client : The data requested could not be retrieved or values specified
were invalid. I.e. a requested node does not exist (any more), or a
put failed due to locking or invalid data.
This is ONLY for debugging purposes!
XML validation should occur at the parser and be captured early.
If we reach consensus that we must always validate, the xml-checking can be left
out, as we can then assumes a correct model. This will optimize processing.
| Constructor Summary | |
|---|---|
AbstractDove(Document doc)
Constructor |
|
| Method Summary | |
|---|---|
protected Element |
addContentElement(String tagname,
String content,
Element out)
Creates a DOM element which contains a Text Node, and adds it to the specified node as a child. |
void |
doRequest(Element in,
Element out)
Handles a request running one or more RPCs. |
abstract void |
doRequest(Element in,
Element out,
Cloud cloud,
Map<String,byte[]> repository)
Handles a request running one or more RPCs. |
Element |
executeRequest(Element in)
This method executes the request from the editors, it can be invoked directly |
Element |
executeRequest(Element in,
Cloud cloud,
Map<String,byte[]> repository)
This method executes the request from the editors, it can be invoked directly |
protected Element |
getFirstElement(Node item)
Retrieves the first child node of an element that is itself an element. |
protected Element |
getFirstElement(Node item,
String tagname)
Retrieves the first child node of an element that is itself an element, and has the specified tagname. |
protected Element |
getNextElement(Node item)
Retrieves the next sibling of an element that is itself an element. |
protected Element |
getNextElement(Node item,
String tagname)
Retrieves the the next sibling of an element that is itself an element, and has the specified tagname. |
protected String |
getTypeDescription(int type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DOCTYPE_REQUEST
public static final String DOCTYPE_RESPONSE
public static final String REQUEST
public static final String RESPONSE
public static final String SECURITY
public static final String GETDATA
public static final String GETNEW
public static final String GETNEWRELATION
public static final String GETRELATIONS
public static final String GETCONSTRAINTS
public static final String GETLIST
public static final String PUT
public static final String SECURITY_NAME
public static final String SECURITY_PASSWORD
public static final String SECURITY_CLOUD
public static final String SECURITY_METHOD
public static final String OBJECT
public static final String FIELD
public static final String ORIGINAL
public static final String NEW
public static final String RELATIONS
public static final String RELATION
public static final String ERROR
public static final String QUERY
public static final String PARENT
public static final String DESCENDANTS
public static final String DESCENDANT
public static final String SINGULARNAME
public static final String PLURALNAME
public static final String DESCRIPTION
public static final String FIELDS
public static final String GUINAME
public static final String GUITYPE
public static final String MAXLENGTH
public static final String REQUIRED
public static final String ELM_ID
public static final String ELM_NUMBER
public static final String ELM_OLDNUMBER
public static final String ELM_TYPE
public static final String ELM_SEARCHTYPE
public static final String ELM_STATUS
public static final String ELM_NAME
public static final String ELM_ROLE
public static final String ELM_DESTINATION
public static final String ELM_DESTINATIONTYPE
public static final String ELM_SOURCETYPE
public static final String ELM_SEARCHDIR
public static final String ELM_CREATEDIR
public static final String ELM_LANG
public static final String ELM_XPATH
public static final String ELM_WHERE
public static final String ELM_ORDERBY
public static final String ELM_DIRECTIONS
public static final String ELM_SOURCE
public static final String ELM_HREF
public static final String ELM_MAYWRITE
public static final String ELM_MAYDELETE
public static final String ELM_CONTEXT
public static final String ELM_SIZE
public static final String ELM_ENCODING
public static final String IS_PARSER
public static final String IS_SERVER
public static final String IS_CLIENT
public static final String IS_TRUE
public static final String IS_FALSE
protected static final String[] TYPE_DESCRIPTIONS
protected final Document doc
| Constructor Detail |
|---|
public AbstractDove(Document doc)
doc - the Document that is constructed. This should only be used to
construct new DOM elements. New (child) nodes should not be added
to this document, but to the out element.| Method Detail |
|---|
protected String getTypeDescription(int type)
protected Element addContentElement(String tagname,
String content,
Element out)
tagname - name of the new elementcontent - content of the new element as a stringout - the element to which to add the new Element.
protected Element getFirstElement(Node item)
null.
item - the element to find the first child element of
null.
protected Element getFirstElement(Node item,
String tagname)
null.
item - the element to find the first child element oftagname - the tagname of the element desired
null.protected Element getNextElement(Node item)
null.
item - the element to find the sibling element of
null.
protected Element getNextElement(Node item,
String tagname)
null.
item - the element to find the sibling element oftagname - the tagname of the element desired
null.
public abstract void doRequest(Element in,
Element out,
Cloud cloud,
Map<String,byte[]> repository)
in - the element that described the request (or input).
The childnodes should describe the calls to perform.out - the element that described the response (or return value).
Results of calls should be added as childs to this element.cloud - the MMCI cloud to use, if applicable.repository - Repository that contains the blobs
public void doRequest(Element in,
Element out)
in - the element that described the request (or input).
The childnodes should describe the calls to perform.out - the element that described the response (or return value).
Results of calls should be added as childs to this element.
public Element executeRequest(Element in,
Cloud cloud,
Map<String,byte[]> repository)
in - the element that described the request (or input).
The childnodes should describe the calls to perform.cloud - the MMCI cloud to use, if applicable.repository - Repository that contains the blobs
public Element executeRequest(Element in)
in - the element that described the request (or input).
The childnodes should describe the calls to perform.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||