@@ -17,7 +17,7 @@ This example shows how to serve an EMF instance in a REST API. There's two neat
### Generic EMF REST servlet
You can think of a REST API as a way of navigating from a set of root objects to some objects of interest and either reading or operating on them. Navigation is done along associations (references in Ecore terminologi) and you can typically filter and select while navigating. The result is typically serialized back as Json.
You can think of a REST API as a way of navigating from a set of root objects to some objects of interest and either reading or operating on them. Navigation is done along associations (references in Ecore terminologi) and you can typically filter and select while navigating. The result is typically serialized back as JSON.
If you're doing this in pure Java, you can use a combination of reflection and annotations to do this generically. The **tdt4250.emf.*** bundles provide the same for EMF: generic REST API access to any EMF model instance driven by the model:
...
...
@@ -27,13 +27,17 @@ If you're doing this in pure Java, you can use a combination of reflection and a
### Making EMF model bundles available for OSGi
To test the generic REST support, a resource allocation model (for university staff and courses) is used. This corresponding EMF model project (in general PDE bundle/plugin projects) is outside and in the same folder as the OSGi workspace. The layout is as follows
To test the generic REST support, a resource allocation model (for university staff and courses) is used. The corresponding EMF model project (in general PDE bundle/plugin projects) is outside and in the same folder as the OSGi workspace. The layout is as follows
The key here is how we use the feature and repository projects to build a p2 repo that the Bnd Workspace can use. This makes bundles from plugin projects managed by Eclipse PDE available for use in OSGi projects managed by Bnd(tools). With the current setup the p2 repo must be manually built by opening the **site.xml** file in the repository project and using the **Build** button.
The **build.bnd** file in the **cnf** folder configures the available repositories, including the p2 repositories for EMF, AQL and our locally built resource allocation model bundle. The reference to the latter is relative, so the location of the repository project is important.