Skip to content
juliusse edited this page Apr 6, 2013 · 43 revisions

** WORK IN PROGRESS **

Table Of Content

User Related Actions

Action Call
Login User jsRoutes.controllers.User.login()
Logout User jsRoutes.controllers.User.logout()
Get Maps of User on Server jsRoutes.controllers.User.mapListFromDB()

Mindmap Related Actions

Get Information

Action Call
Get (complete/chunked) Mindmap as Json jsRoutes.controllers.MindMap.map(String mapId)
jsRoutes.controllers.MindMap.map(String mapId, Integer nodeCount)
Get Node with all/some Children as Json jsRoutes.controllers.MindMap.getNode(String mapId, String nodeId)
jsRoutes.controllers.MindMap.getNode(String mapId, String nodeId, Integer nodeCount)

Gaining and Releasing locks

Action Call
Request Lock for a Node jsRoutes.controllers.MindMap.requestLock(String mapId)
Release Lock for a Node jsRoutes.controllers.MindMap.releaseLock(String mapId)

Modifying a Mindmap

Action Call
Create Node in Map jsRoutes.controllers.MindMap.createNode(String mapId)
Change Node in Map jsRoutes.controllers.MindMap.changeNode(String mapId)
Delete Node in Map jsRoutes.controllers.MindMap.deleteNode(String mapId)

Detailed Informations

Login

Method POST
Action jsRoutes.controllers.User.login()
Form Data
  • username: String
  • password: String
Requires Nothing
Returns 303 Redirect

Logout

Method GET
Action jsRoutes.controllers.User.logout()
Form Data ---
Requires
Returns 303 Redirect

Map Info From Database

Method GET
Action jsRoutes.controllers.User.mapListFromDB()
Form Data ---
Requires
Returns List with MindMapInfo Objects

Mindmap As Json

Method GET
Action jsRoutes.controllers.MindMap.map(String mapId)
jsRoutes.controllers.MindMap.map(String mapId, Integer nodeCount)
Params mapId = Id of the map (currently mmIdOnServer)
nodeCount = soft limit of maximum nodes
Form Data ---
Requires
Returns A MindMap Object

Node As Json

Method GET
Action jsRoutes.controllers.MindMap.getNode(String mapId,Strin nodeId)
jsRoutes.controllers.MindMap.getNode(String mapId,Strin nodeId, Integer nodeCount)
Params mapId = Id of the map (currently mmIdOnServer)
nodeId = Id of node
nodeCount = soft limit of maximum nodes
Form Data ---
Requires
Returns A DefaultNode Object

Request Lock

Method POST
Action jsRoutes.controllers.MindMap.requestLock(String mapId)
Params mapId = Id of the map (currently mmIdOnServer)
Form Data nodeId = Id of Node
Requires
Returns Status 200 OK = success
Status 403 Forbidden = failure

Release Lock

Method POST
Action jsRoutes.controllers.MindMap.releaseLock(String mapId)
Params mapId = Id of the map (currently mmIdOnServer)
Form Data nodeId = Id of Node
Requires
Returns Status 200 OK = success
Status 403 Forbidden = failure

Create Node

Method POST
Action jsRoutes.controllers.MindMap.createNode(String mapId)
Params mapId = Id of the map (currently mmIdOnServer)
Form Data parentNodeId = Id of parent where the new node gets attached to
Requires
Returns A DefaultNode Object, which represents the created node

Remove Node

Method DELETE
Action jsRoutes.controllers.MindMap.deleteNode(String mapId)
Params mapId = Id of the map (currently mmIdOnServer)
Form Data nodeId = Id of node to delete
Requires
Returns Status 200 OK = success
Status 403 Forbidden = failure

Change Node

Method POST
Action jsRoutes.controllers.MindMap.changeNode(String mapId)
Params mapId = Id of the map (currently mmIdOnServer)
Form Data WILL BE ADDED
Requires
Returns WILL BE ADDED

Defined Objects

MindMapInfo

{
  "mmIdOnServer" : String,
  "mmIdInternal" : String,
  "revision" : Time,
  "filePath" : String,
  "fileName" : String
}

Mind Map

A mind map contains a root node, which is slightly different to a normal node.

{
  "id" : String
  "isReadonly" : boolean,
  "revision" : integer
  "name" : string
  "root" : RootNode
}

Node

  • hGap: horizontal distance to parent
  • shiftY: used to calculate the vertical position
  • icons: List with names of predefined icons
    • We need the icons on the server
    • Exit in freeplane project: \freeplane\bin\classes\images\icons
  • prefferedChild: appears to be important
  • nodeText: plain text or HTML, defined by isHtml
  • isHtml: defines if nodeText is plain text or HTML
  • link: external link or link to another node
    • http:// for hyperlinks
    • node:// for nodes
    • workspace:// for workspace files
  • attributes: Table with attributes of node
    • self definde table
    • information from JabRef
  • locked: name of user, which has lock on node
  • children: list with children, when they have been loaded
  • childrenIds: list with ids of children, when due to chunking they haven't been loaded

Note: children and childrenIds do not appear together!

{
  "id" : string,
  "hGap" : integer,
  "shiftY" : integer,
  "folded" : boolean,
  "icons" : [string,string,...], //names of icons
  "prefferedChild" : DefaultNode,
  "nodeText" : string,
  "isHtml" : boolean,
  "isFree" : boolean,
  "isSummary" : boolean,
  "defaultStyle" : string,
  "edgeStyle" : Edge, // edge to parent node, not specified parameters are inherited from parent
  "image" : Image,
  "link" : string,
  "children" : [DefaultNode,DefaultNode...],
  "childrenIds" : [string, string,...],
  "attributes" : map<string,string> | null
  "locked" : string
}

Root Node (Special case)

Very similar to a normal node with some small changes.
At the root node it is possible to have children on the right and on the left side.

  • leftChildren: sorted list with children on the left side
  • rightChildren: sorted list with children on the right side *For further descriptions see Normal Node
{
    "id" : string,
    "folded" : boolean,
    "icons" : [string,string,...], //names of icons
    "prefferedChild" : DefaultNode,
    "nodeText" : string,
    "isHtml" : boolean,
    "image" : Image,
    "link" : string,
    "leftChildren" : [DefaultNode,DefaultNode,...],
    "rightChildren" :  [DefaultNode,DefaultNode,...]
}

Clone this wiki locally