Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

The ConfiguredTreeHandler has a set of named commands. Items on context menu and function menu references one of these commands.

to be decided: how is should a content context menu item mapped describe that it wants to use a command? the client should have minimal knowledge of what commands existdialog?

to be decided: some context menu items will perform actions solely on the client side, such as refreshing the view, how should this be represented in the config?

to be decided: searching the repository is a very special kind of function bar item, how can it be represented?

  • 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<command>
    • arguments: treeName and path in uri, parameter command is , path and the name of the command in uri, rest of parameters are used by the actual command
    • returns: depends on the command, must be able to also output a message (AlertUtil-style)

Commands are configured in the repository, arguments to the command are set using node data and mapped in using C2B. Commands include:

  • create content
    • arguments: optional name (defaults to 'untitled'), itemType
    • returns: a TreeNodeList with only the newly created TreeNode
    • note:
      • if the new name is already taken a unique name will be generated
      • for the website tree the command must also set the default template (CreateWebsiteNodeCommand performs this)
      • for the users tree the command must also add the newly added user to UserManager
  • 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:
      • if the new name is already taken a unique name will be generated
      • for the users tree the command must update ACLs after rename
  • 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:
      • if the new name is already taken a unique name will be generated
  • 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:
      • the new content must be deactivated
      • if the new name is already taken a unique name will be generated
  • activate
  • activate incl subnodes
  • add nodedata
    • arguments: name, value and type (type and value optional defaults to empty string)
    • returns: a TreeNodeList of the node where nodedata was added
    • note: if the name is already taken a unique name will be generated
  • set nodedata
    • arguments: name and value
    • returns: a TreeNodeList of the node where nodedata was 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)
  • search
    • arguments: search query
    • returns: search result

To be decided: After invoking the command its up to the handler to return a good response. Depending on the command we need to return very different things:

  • Create, we need to return the new nodes parent so that the client sees how the new node is ordered among its siblings
  • Move, we need to return the parent that the node moves to, see above, and we need to let the client know that it is no longer where it used to be.
  • and so on...

Website (.magnolia/rest/website)

...