[deepamehta-devel] Creating and filling a Topic-Map via API

Juergen Neumann j.neumann at junes.eu
Fri Jan 27 17:36:47 CET 2017


Fantastic, thank you! Works like a charme. :)

Am Donnerstag, den 26.01.2017, 13:29 +0100 schrieb Jörg Richter:
> 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 <j.neumann at junes.eu>
> > 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
> -- 
> devel mailing list
> devel at lists.deepamehta.de
> http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de
-- 
GnuPG KeyID: CD914C6C
Fingerprint: C1CC EF1D 1443 7279 72E7 ABDC A2DA 0328 CD91 4C6C



More information about the devel mailing list