Ticket #763 (closed Defect: fixed)
Update demo server after release
Reported by: | JuergeN | Owned by: | jpn |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.6 |
Component: | DeepaMehta Standard Distribution | Version: | 4.5 |
Keywords: | Cc: | ||
Complexity: | 3 | Area: | Communications |
Module: |
Description
done.
Change History
comment:2 Changed 10 years ago by jri
Thank you very much for updating the demo server to DM 4.5!
One hint relating the 8080 instance: we could consider making the "testuser" a member of the DeepaMehta workspace. She could create things just after logging in then. At the moment the Create menu appears only when she switches to hers private workspace. Let me know if you need any help.
comment:3 Changed 10 years ago by JuergeN
Good idea! And yes I need your help on the curl command to assign the testuser to the workspace.
comment:4 Changed 10 years ago by jri
To create a membership:
curl -X POST -H 'Authorization: Basic YWRtaW46' http://localhost:8080/accesscontrol/user/testuser/workspace/2339
Here (obviously) testuser is the username and 2339 the ID of the workspace.
The ID of the DeepaMehta workspace is different with each DM installation. So you must find it out before.
To find out the ID of a workspace:
curl http://localhost:8080/workspace/dm4.workspaces.deepamehta
Here dm4.workspaces.deepamehta is the URI of the workspace.
The result is JSON and looks like:
{"id":2339,"uri":"dm4.workspaces.deepamehta","type_uri":"dm4.workspaces.workspace","value":"DeepaMehta","childs":{"dm4.time.created":{"id":-1,"uri":"","type_uri":"dm4.time.created","value":1423027866676,"childs":{}},"dm4.time.modified":{"id":-1,"uri":"","type_uri":"dm4.time.modified","value":1423027866676,"childs":{}}}}
The result always starts with {"id": and then the workspace ID follows.
In your shellscript you have to extract it from the curl response, probably via regex or somehow.
---
A general JSON hint: for readability (when it comes to debugging) you can prettify the JSON:
curl http://localhost:8080/workspace/dm4.workspaces.deepamehta | jsonpretty
It looks something like this then:
{ "value": "DeepaMehta", "id": 2339, "childs": { "dm4.time.modified": { "value": 1423027866676, "id": -1, "childs": { }, "uri": "", "type_uri": "dm4.time.modified" }, "dm4.time.created": { "value": 1423027866676, "id": -1, "childs": { }, "uri": "", "type_uri": "dm4.time.created" } }, "uri": "dm4.workspaces.deepamehta", "type_uri": "dm4.workspaces.workspace" }
But note that jsonpretty does not keep the order of the JSON properties (value, id, childs, uri, type_uri) intact. The order changes each time you call it. (So the prettyfied version is possibly not so suitable for automatic processing.)
jsonpretty is available here (installable as a ruby gem):
https://github.com/nicksieger/jsonpretty
comment:5 Changed 10 years ago by JuergeN
Done. And thanks for the lesson. :)
On the demo server jsonpretty is available as json_pp.
comment:6 Changed 10 years ago by JuergeN
Also really nice: http://trentm.com/json/
comment:7 Changed 10 years ago by JuergeN
One more thing: The testuser does not seem to be assigned to his own workspace correctly. As least he cannot create anything when private workspace is selected. Also the link in the upper right corner with the logged in username testuser to edit the password does not work now.
comment:8 Changed 10 years ago by jri
I can't reproduce that.
As testuser I can create things in her private workspace. Also the account link in the upper right corner works properly.
I'm refering to the instance at http://demo.deepamehta.de:8080/de.deepamehta.webclient