The nodePath parameters appearing in this interface always contain an
array of path segments identifying a node in the subtree of this plugin. This
parameter contains an absolute path, so the first segment is always
".". Special characters appear escaped in the segments.
Error handling
When a tree manipulation command is called on the DmtAdmin service, it must
perform an extensive set of checks on the parameters and the authority of the
caller before delegating the call to a plugin. Therefore plugins can take
certain circumstances for granted: that the path is valid and is within the
subtree of the plugin and the session, the command can be applied to the
given node (e.g. the target of setNodeValue is a leaf node), etc. All
errors described by the error codes DmtException#INVALID_URI,
DmtException#URI_TOO_LONG, DmtException#PERMISSION_DENIED,
DmtException#COMMAND_NOT_ALLOWED and
DmtException#TRANSACTION_ERROR are fully filtered out before control
reaches the plugin.
If the plugin provides meta-data for a node, the DmtAdmin service must also
check the constraints specified by it, as described in MetaNode. If
the plugin does not provide meta-data, it must perform the necessary checks
for itself and use the DmtException#METADATA_MISMATCH error code to
indicate such discrepancies.
The DmtAdmin does not check that the targeted node exists (or that it does
not exist, in case of a node creation) before calling the plugin. It is the
responsibility of the plugin to perform this check and to throw a
DmtException#NODE_NOT_FOUND or
DmtException#NODE_ALREADY_EXISTS if needed. In this case the DmtAdmin
must pass through this exception to the caller of the corresponding
DmtSession method.
The plugin can use the remaining error codes as needed. If an error does not
fit into any other category, the DmtException#COMMAND_FAILED code
should be used.
| Modifier and Type | Method and Description |
|---|---|
| public void | copy(String[]
an absolute path specifying the node or the root of a
subtree to be copied nodePath, String[] the absolute path of the new node or root of a subtree newNodePath, boolean false if only a single node is copied,
true if the whole subtree is copiedCreate a copy of a node or a whole subtree. |
| public void | createInteriorNode(String[]
the absolute path of the node to create nodePath, String the type URI of the interior node, can be type)null if no
node type is definedCreate an interior node with a given type. |
| public void | createLeafNode(String[]
the absolute path of the node to create nodePath, DmtData the value to be given to the new node, can be value, String nullthe MIME type to be given to the new node, can be
mimeType)nullCreate a leaf node with a given value and MIME type. |
| public void | |
| public void | renameNode(String[]
the absolute path of the node to rename nodePath, String the new name property of the node newName)Rename a node. |
| public void | setNodeTitle(String[]
the absolute path of the node nodePath, String the title text of the node, can be title)nullSet the title property of a node. |
| public void | setNodeType(String[]
the absolute path of the node nodePath, String the type of the node, can be type)nullSet the type of a node. |
| public void | setNodeValue(String[]
the absolute path of the node nodePath, DmtData the data to be set, can be data)nullSet the value of a leaf or interior node. |
| copy | back to summary |
|---|---|
| public void copy(String[] nodePath, String[] newNodePath, boolean recursive) throws DmtException Create a copy of a node or a whole subtree. Beside the structure and values of the nodes, most properties managed by the plugin must also be copied, with the exception of the Timestamp and Version properties.
| |
| createInteriorNode | back to summary |
|---|---|
| public void createInteriorNode(String[] nodePath, String type) throws DmtException Create an interior node with a given type. The type of interior node, if specified, is a URI identifying a DDF document.
| |
| createLeafNode | back to summary |
|---|---|
| public void createLeafNode(String[] nodePath, DmtData value, String mimeType) throws DmtException Create a leaf node with a given value and MIME type. If the specified
value or MIME type is
| |
| deleteNode | back to summary |
|---|---|
| public void deleteNode(String[] nodePath) throws DmtException Delete the given node. Deleting interior nodes is recursive, the whole subtree under the given node is deleted.
| |
| renameNode | back to summary |
|---|---|
| public void renameNode(String[] nodePath, String newName) throws DmtException Rename a node. This operation only changes the name of the node (updating the timestamp and version properties if they are supported), the value and the other properties are not changed. The new name of the node must be provided, the new path is constructed from the base of the old path and the given name.
| |
| setNodeTitle | back to summary |
|---|---|
| public void setNodeTitle(String[] nodePath, String title) throws DmtException Set the title property of a node. The length of the title is guaranteed not to exceed the limit of 255 bytes in UTF-8 encoding.
| |
| setNodeType | back to summary |
|---|---|
| public void setNodeType(String[] nodePath, String type) throws DmtException Set the type of a node. The type of leaf node is the MIME type of the data it contains. The type of an interior node is a URI identifying a DDF document.
For interior nodes, the
| |
| setNodeValue | back to summary |
|---|---|
| public void setNodeValue(String[] nodePath, DmtData data) throws DmtException Set the value of a leaf or interior node. The format of the node is
contained in the
If the specified value is
| |