Hi Juergen,

yes, you can do this.

To create a standard (not geomap) Topicmap:

        curl -H "Authorization: Basic YWRtaW46" -H "Cookie: 
dm4_workspace_id=2610" -X POST 
localhost:8080/topicmap?name=My+ToDo+Map\&renderer_uri=dm4.webclient.default_topicmap_renderer\&private=false

In this example "My+ToDo+Map" is the (URL encoded) name of the topicmap 
(mandatory).

2610 is the ID of the workspace the map will be assigned to.

A workspace assignment is recommended. Otherwise the Topicmap would not appear 
in the Webclient menus, nor would be deletable.

You can also set the topicmap's Private flag (optional). Default is false.

The renderer_uri is mandatory.

The response is the created Topicmap topic.
This gives you the topicmap ID:

        {
          "id": 4250,
          "uri": "",
          "type_uri": "dm4.topicmaps.topicmap",
          "value": "My ToDo Map",
          "childs": {
            ...
          }
        }

To add a topic to a topicmap:

        curl -H "Authorization: Basic YWRtaW46" -H "Content-Type: 
application/json" -X POST localhost:8080/topicmap/4250/topic/8092 -d '{
            "dm4.topicmaps.x": 200,
            "dm4.topicmaps.y": 150,
            "dm4.topicmaps.visibility": true
        }'

Here 4250 is the topicmap, 8092 is the topic to add. The topic must exist 
already.
If the topicmap or the topic do not exist, you'll get an error response.

You can't add the same topic twice to a topicmap. If you do so you'll get an 
error response.

The message body is a JSON object with the view properties (mandatory).
IMPORTANT: the view properties (x, y, visibility) MUST be supplied, otherwise 
the topicmap will become corrupt.

The response is 204 No Content.

You can do many more things, like add associations to a topicmap, move things, 
hide things, set topic background color, or set a topicmap background image. 
Tell me if you need more information.

Please excuse the late reply.

Cheers,
Jörg


> On 19 Jan 2017, at 15:18, Juergen Neumann <[email protected]> wrote:
> 
> Dear Jörg,
> 
> is there a way to create an new topic map via the REST API and also
> "fill" it with existing content. My goal is to create a Todo-List-
> Topicmap for topics that need reviewing showing the revealed todo-
> topics.
> 
> If possible, could you provide a curl script example for it, please.
> 
> Thank you very much in advance!
> 
> Juergen

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

-- 
devel mailing list
[email protected]
http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de

Reply via email to