...
Generic endpoint for tree views. A client fetches the tree configuration to build the view, subsequent calls to fetch nodes return data for each column. Each tree is served by a TreeHandler. The TreeHandler can provide functionality that is specific for its tree.
NodeData is not treated as a node in the tree. Instead a returned node in the tree contains NodeDatas that should be rendered as subnodes in the displayed tree. The returned node has column values for each NodeData.
- get child nodes
- method: GET
- path: .magnolia/rest/tree/<treeName>/<path>
- arguments: treeName and path in uri
- returns: TreeNodeList
- get tree configuration
- method: POST
- path: .magnolia/rest/tree/<treeName>/config
- arguments: treeName in uri
- returns: JsonTreeConfiguration
- execute command
- method: POST
- path: .magnolia/rest/tree/<treeName>/<path>/command
- arguments: treeName and path in uri, parameter command is the name of the command, rest of parameter are used by the actual command
- returns: depends on the command, must be able to also output a message (AlertUtil-style)
Commands include:
- create content
- arguments: optional name (defaults to 'untitled'), itemType
- returns: a TreeNodeList with only the newly created TreeNode
- note: for the website tree the command must also set the default template
- delete content
- arguments: none other than the path
- returns: a TreeNodeList of the deleted nodes parent
- note: must also deactivate the deleted node
- rename content
- arguments: the new name
- returns: a TreeNodeList of the node that changed name
- note: what if the new name is already used? create unique or fail?
- move content
- arguments: new path, name of node to place before/after
- returns: a TreeNodeList of the parent that the node was moved to
- note: must also deactivate the moved node and all its children
- copy content
- arguments: new path, name of node to place before/after
- returns: a TreeNodeList of the parent that the node was copied to
- note: what if there's already a node by that name? create unique or fail?
- activate
- activate incl subnodes
- set nodedata (add or update)
- arguments: name, value and type
- returns: a TreeNodeList of the node where nodedata was added/changed
- remove nodedata
- arguments: name of nodedata to remove
- returns: a TreeNodeList of the node where nodedata was removed
- rename nodedata
- arguments: name of nodedata to rename, new name
- returns: a TreeNodeList of the node where nodedata was renamed
- note: what if the new name already exists? create unique or fail?
- list versions
- revert to version
- import and export
- note: does this even make sense to do with REST? (there's certainly nothing to return as JSON)
Website (.magnolia/rest/website)
...