Get custom response data from custom model server comand #195
-
Hello, I am working on an application which uses EMFCloud as server and theia on frontend. I need to implement custom command which should return json data as part of response. Now the problem is that modelserverapi edit() method returns boolean response but here we need to return custom data which comes from command operation. Can anyone have an idea on how to achieve this or any other alternate way using model server api. Thanks you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @mishaltripathi, to directly return a Json object via the edit API, you would have to extend the API you are using (e.g. the There is one example available via the discussion_custom_command.mp4Some useful starting points are:
HTH and best regards, |
Beta Was this translation helpful? Give feedback.
Hi @mishaltripathi,
to directly return a Json object via the edit API, you would have to extend the API you are using (e.g. the
ModelServerClientApiV2
) and also extend the ModelServer itself by adding a separate endpoint to return the Json object response.There is one example available via the
emfcloud-modelserver
example server and theemfcloud-modelserver-theia
example application. It triggers a custom 'counter' command that returns the current counter object in Json format.You can test that by starting up the example application and use the menu
Custom
to trigger this custom command.See also this short clip:
discussion_custom_command.mp4
Some useful starting points are: