Model server API to return models of a specific type #45
Replies: 4 comments
-
[Martin Fleck] Hello @HBank(hbank) , Thank you for your interest in the model server, your use case certainly sounds interesting! I am not sure I understand what exactly the Please note that you can also query all model URIs through the |
Beta Was this translation helpful? Give feedback.
-
[hansbank] Hi @martin-fleck, Thank you for your reply. With
Maybe also a namespace might be required ('http://www.eclipsesource.com/modelserver/example/coffeemodel'). Your suggestion to use |
Beta Was this translation helpful? Give feedback.
-
[Martin Fleck] Hi @HBank(hbank) , I understand, so the method would be similar to the query element methods (by name, by id) for a specific URI, right? We'll definitely have a look at that and we'll let you know whether we think that we should add that to the generic API. In the meantime you should be able to fulfill your needs with custom routing. I created a branch/commit to quickly showcase this: eclipse-emfcloud/emfcloud-modelserver@954ffed. The API could be improved in the routing area but for now you need to add a custom module to your launcher and add a binding for Routing. The injector that is used within your routing class (available through
Please note that this commit also has some adaptations to the MANIFEST file of the lib bundle which is independent from that change but something that we will merge very soon anyway as it caused some problems when starting the server from Eclipse. I tested this with Postman and the REST requests return the correct data. Please let me know whether this also works for you or whether you run into any problems. Thank you! |
Beta Was this translation helpful? Give feedback.
-
[hansbank] Hi @martin-fleck(martin-fleck) , this is exactly what I was looking for, with this I can implement the requirement apart from model server code. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Model server provides an to load models, either all models or just one:
In the model server, instances of different type can exist together. The types have been defined in EMF, via ecore model. The
models
API returns all instances of all types. In our scenario, we have a requirement to load instances of a specific type only. To load instances of type 'Xyz', the url could be:I checked the code of model server ModelServerRouting.java and it seems to be a small extension to add this.
is this a useful extension?
and is worth to add this to model server
do other people have same/similar requirement
Thanks for your feedback
original thread by hansbank
Beta Was this translation helpful? Give feedback.
All reactions