|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mmbase.applications.editwizard.WizardDatabaseConnector
This class handles all communition with mmbase. It uses the MMBase-Dove code to do the transactions and get the information needed for rendering the wizard screens. The WizardDatabaseConnector can connect to MMBase and get data, relations, constraints, lists. It can also store changes, create new objects and relations. The connector can be instantiated without the wizard class, but will usually be called from the Wizard class itself. EditWizard
| Constructor Summary | |
WizardDatabaseConnector()
Constructor: Creates the connector. |
|
| Method Summary | |
void |
cloneOneDeep(org.w3c.dom.Node sourcenode,
org.w3c.dom.Node targetParentNode,
java.lang.String allowedChildrenXpath)
This method can clone an object node one deep. |
org.w3c.dom.Node |
createObject(org.w3c.dom.Document data,
org.w3c.dom.Node targetParentNode,
org.w3c.dom.Node objectDef,
java.util.Map params)
This method can create a object (or a tree of objects and relations) |
org.w3c.dom.Node |
createObject(org.w3c.dom.Document data,
org.w3c.dom.Node targetParentNode,
org.w3c.dom.Node objectDef,
java.util.Map params,
int createorder)
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. |
org.w3c.dom.Node |
getConstraints(java.lang.String objecttype)
This method gets constraint information from mmbase about a specific objecttype. |
org.w3c.dom.Node |
getData(org.w3c.dom.Node targetNode,
java.lang.String objectnumber)
This method retrieves data (objectdata) from mmbase. |
org.w3c.dom.Node |
getData(org.w3c.dom.Node targetNode,
java.lang.String objectnumber,
org.w3c.dom.NodeList restrictions)
This method retrieves data (objectdata) from mmbase. |
org.w3c.dom.Node |
getDataNode(org.w3c.dom.Document document,
java.lang.String objectnumber,
org.w3c.dom.NodeList restrictions)
This method retrieves data (objectdata) from mmbase. |
org.w3c.dom.Node |
getList(org.w3c.dom.Node query)
This method retrieves a list from mmbase. |
org.w3c.dom.Node |
getNew(org.w3c.dom.Node targetNode,
java.lang.String objecttype)
This method gets a new temporarily object of the given type. |
org.w3c.dom.Node |
getNewRelation(org.w3c.dom.Node targetNode,
java.lang.String role,
java.lang.String sourceObjectNumber,
java.lang.String sourceType,
java.lang.String destinationObjectNumber,
java.lang.String destinationType,
java.lang.String createDir)
This method creates a new temporarily relation. |
org.w3c.dom.Node |
getPutData(org.w3c.dom.Document originalData,
org.w3c.dom.Document newData)
This method constructs a update transaction ready for mmbase. |
void |
getRelations(org.w3c.dom.Node targetNode,
java.lang.String objectnumber)
This method gets relation information from mmbase. |
void |
getRelations(org.w3c.dom.Node targetNode,
java.lang.String objectnumber,
org.w3c.dom.NodeList queryrelations)
This method gets relation information from mmbase. |
boolean |
isDifferent(org.w3c.dom.Node node1,
org.w3c.dom.Node node2)
This method compares two xml nodes and checks them for identity. |
org.w3c.dom.Document |
load(org.w3c.dom.Node schema,
java.lang.String objectnumber)
This method loads an object and the necessary relations and fields, according to the given schema. |
void |
makeFlat(org.w3c.dom.Node sourcenode,
org.w3c.dom.Node targetParentNode,
java.lang.String xpath,
java.lang.String allowedChildrenXpath)
This method makes the object data tree flat, so that Dove can construct a transaction from it. |
org.w3c.dom.Element |
put(org.w3c.dom.Document originalData,
org.w3c.dom.Document newData,
java.util.Map binaries)
This method can fire a Put command to Dove. |
void |
setUserInfo(Cloud cloud)
Sets the right cloud for the user info. |
void |
tagDataNode(org.w3c.dom.Node node)
This method tags datanodes starting from the current node. |
void |
tagDataNodes(org.w3c.dom.Document data)
This method tags the datanodes in the given document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WizardDatabaseConnector()
| Method Detail |
public void setUserInfo(Cloud cloud)
cloud - The cloud from which the userinfo should be set.public void tagDataNodes(org.w3c.dom.Document data)
data - The data document which should be tagged.public void tagDataNode(org.w3c.dom.Node node)
public org.w3c.dom.Document load(org.w3c.dom.Node schema,
java.lang.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 fails
public org.w3c.dom.Node getConstraints(java.lang.String objecttype)
throws WizardException
objecttype - the objecttype where you want constraint information from.WizardException - if the constraints could not be obtained
public org.w3c.dom.Node getList(org.w3c.dom.Node query)
throws WizardException
query - the node containign the query to runWizardException - if the constraints could not be obtained
public org.w3c.dom.Node getData(org.w3c.dom.Node targetNode,
java.lang.String objectnumber)
throws WizardException
targetNode - Results are appended to this targetNode.objectnumber - The number of the object to load.WizardException - if loading the object fails
public org.w3c.dom.Node getData(org.w3c.dom.Node targetNode,
java.lang.String objectnumber,
org.w3c.dom.NodeList restrictions)
throws WizardException
targetNode - Results are appended to this targetNode.objectnumber - 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 retrieved
public org.w3c.dom.Node getDataNode(org.w3c.dom.Document document,
java.lang.String objectnumber,
org.w3c.dom.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 retrieved
public void getRelations(org.w3c.dom.Node targetNode,
java.lang.String objectnumber)
throws WizardException
targetNode - The targetnode where the results should be appended.objectnumber - The objectnumber of the parent object from where the relations originate.WizardException - if the relations could not be obtained
public void getRelations(org.w3c.dom.Node targetNode,
java.lang.String objectnumber,
org.w3c.dom.NodeList queryrelations)
throws WizardException
targetNode - The targetnode where the results should be appended.objectnumber - The objectnumber of the parent object from where the relations originate.loadaction - The loadaction data as defined in the schema. These are used as 'restrictions'.WizardException - if the relations could not be obtained
public org.w3c.dom.Node getNew(org.w3c.dom.Node targetNode,
java.lang.String objecttype)
throws WizardException
targetNode - The place where the results should be appended.objecttype - The objecttype which should be created.WizardException - if the node could not be created
public org.w3c.dom.Node getNewRelation(org.w3c.dom.Node targetNode,
java.lang.String role,
java.lang.String sourceObjectNumber,
java.lang.String sourceType,
java.lang.String destinationObjectNumber,
java.lang.String destinationType,
java.lang.String createDir)
throws WizardException
targetNode - The place where the results should be appended.role - The name of the role the new relation should have.sourceObjectNumber - the number of the sourceobjectsourceType - the type of the sourceobjectdestinationObjectNumber - the number of the destination objectdestinationType - the type of the destination objectWizardException - if the relation could not be created
public org.w3c.dom.Node createObject(org.w3c.dom.Document data,
org.w3c.dom.Node targetParentNode,
org.w3c.dom.Node objectDef,
java.util.Map params)
throws WizardException
targetParentNode - The place where the results should be appended.objectDef - The objectdefinition.params - The params to use when creating the objects and relations.WizardException - if the object cannot be created
public org.w3c.dom.Node createObject(org.w3c.dom.Document data,
org.w3c.dom.Node targetParentNode,
org.w3c.dom.Node objectDef,
java.util.Map params,
int createorder)
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".targetParentNode - 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 1WizardException - if the object cannot be created
public org.w3c.dom.Element put(org.w3c.dom.Document originalData,
org.w3c.dom.Document newData,
java.util.Map 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.binaries - A hashmap with the uploaded binaries.
public org.w3c.dom.Node getPutData(org.w3c.dom.Document originalData,
org.w3c.dom.Document newData)
throws WizardException
originalData - The original data.newData - The new data.
public void makeFlat(org.w3c.dom.Node sourcenode,
org.w3c.dom.Node targetParentNode,
java.lang.String xpath,
java.lang.String allowedChildrenXpath)
sourcenode - The sourcenode from which should be flattened.targetParentNode - The targetParentNode where the results should be appended.allowChildrenXpath - This xpath defines what children may be copied in te proces and should NOT be flattened.
public void cloneOneDeep(org.w3c.dom.Node sourcenode,
org.w3c.dom.Node targetParentNode,
java.lang.String allowedChildrenXpath)
sourcenode - The sourcenode from where the flattening should start.targetParentNode - The parent on which the results should be appended.allowedChildrenXpath - The xpath describing what children may be copied.
public boolean isDifferent(org.w3c.dom.Node node1,
org.w3c.dom.Node node2)
node1 - The first node to checknode2 - Compare with thisone.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||