public class WizardDatabaseConnector extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
didcounter |
| Constructor and Description |
|---|
WizardDatabaseConnector()
Constructor: Creates the connector.
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
convertBooleanToInt(Node rootNode)
Booleans in MMBase are represented by a boolean value.
|
protected void |
convertDateTimeToInt(Node rootNode)
The editwizard uses integer values to represent dates.
|
protected void |
convertIntToBoolean(Node rootNode)
Booleans in MMBase are represented by a boolean value.
|
protected void |
convertIntToDateTime(Node rootNode)
The editwizard uses integer values to represent dates.
|
Node |
createObject(Document data,
Node targetParentNode,
Node objectDef,
Map<String,Object> params,
Document loadedData)
This method can create a object (or a tree of objects and relations)
|
Node |
createObject(Document data,
Node targetParentNode,
Node objectDef,
Map<String,Object> params,
int createorder,
Document loadedData)
This method can create a object (or a tree of objects and relations)
this method should be called from the wizard if it needs to create a new
combination of fields, objects and relations.
|
Node |
getConstraints(String objecttype)
This method gets constraint information from mmbase about a specific objecttype.
|
Node |
getDataNode(Document document,
String objectnumber,
NodeList restrictions)
This method retrieves data (objectdata) from mmbase.
|
Node |
getList(Node query)
This method retrieves a list from mmbase.
|
Document |
load(Node schema,
String objectNumber)
This method loads an object and the necessary relations and fields, according to the given schema.
|
(package private) Collection<Node> |
loadRelations(Node object,
String objectNumber,
Node loadAction)
This method loads relations from MMBase and stores the result in the given object node.
|
Element |
put(Document originalData,
Document loadedData,
Document newData,
Map<String,byte[]> binaries)
This method can fire a Put command to Dove.
|
void |
setUserInfo(Cloud cloud)
Sets the right cloud for the user info.
|
void |
tagDataNodesWithoutDataID(Document data)
This method tags the datanodes in the given document.
|
public WizardDatabaseConnector()
public void setUserInfo(Cloud cloud)
cloud - The cloud from which the userinfo should be set.public void tagDataNodesWithoutDataID(Document data)
data - The data document which should be tagged.Collection<Node> loadRelations(Node object, String objectNumber, Node loadAction) throws WizardException
object - The objectNode where the results should be appended to.objectNumber - The objectnumber of the parentobject from where the relations should originate.loadAction - The node with loadaction data. Has inforation about what relations should be loaded and what fields should be retrieved.null if none.WizardException - if loading the relations failspublic Document load(Node schema, String objectNumber) throws WizardException
schema - The schema carrying all the information needed for loading the proper object and related fields and objects.objectNumber - The objectnumber of the object to start with.WizardException - if loading the schema failspublic Node getConstraints(String objecttype) throws WizardException
objecttype - the objecttype where you want constraint information from.WizardException - if the constraints could not be obtainedpublic Node getList(Node query) throws WizardException
query - the node containign the query to runWizardException - if the constraints could not be obtainedpublic Node getDataNode(Document document, String objectnumber, NodeList restrictions) throws WizardException
document - Results are imported in this documentobjectnumber - The number of the object to load.restrictions - These restrictions will restrict the load action. So that not too large or too many fields are retrieved.WizardException - if the object could not be retrievedpublic Node createObject(Document data, Node targetParentNode, Node objectDef, Map<String,Object> params, Document loadedData) throws WizardException
data - data of current wizardtargetParentNode - The place where the results should be appended.objectDef - The objectdefinition.params - The params to use when creating the objects and relations.loadedData - WizardException - if the object cannot be createdpublic Node createObject(Document data, Node targetParentNode, Node objectDef, Map<String,Object> params, int createorder, Document loadedData) throws WizardException
$lt;action type="create"$gt;
$lt;object type="authors"$gt;
$lt;field name="name"$gt;Enter name here$lt;/field$gt;
$lt;relation role="related" [destination="234" *]$gt;
$lt;object type="locations"$gt;
$lt;field name="street"$gt;Enter street$lt;/field$gt;
$lt;/object$gt;
$lt;/relation$gt;
$lt;/object$gt;
$lt;/action$gt;
*) if dnumber is supplied, no new object is created (shouldn't be included in the relation node either),
but the relation will be created and directly linked to an object with number "dnumber".data - data of current wizardtargetParentNode - The place where the results should be appended.objectDef - The objectdefinition.params - The params to use when creating the objects and relations.createorder - ordernr under which this object is added (i.e. when added to a list)
The first ordernr in a list is 1loadedData - WizardException - if the object cannot be createdpublic Element put(Document originalData, Document loadedData, Document newData, Map<String,byte[]> binaries) throws WizardException
originalData - The original data object tree.newData - The new and manipulated data. According to differences between the original and the new data, the transaction is constructed.loadedData - The data loaded by actions on the wizardbinaries - A hashmap with the uploaded binaries.WizardException - if the data could not be storedprotected void convertIntToDateTime(Node rootNode)
rootNode - the node whose field sub nodes should be convertedprotected void convertIntToBoolean(Node rootNode)
rootNode - the node whose field sub nodes should be convertedprotected void convertDateTimeToInt(Node rootNode)
rootNode - the node whose field sub nodes should be convertedprotected static void convertBooleanToInt(Node rootNode)
rootNode - the node whose field sub nodes should be convertedMMBase 1.9-SNAPSHOT - ${javadoctimestamp}