blob: fe7d3970b7fc51085325213dd488a4e0715e583f [file] [log] [blame]
<div id="midcolumn">
<h2>How to register a model to the EMF Client Platform</h2>
<p>
This tutorial will explain how to register a model to the ECP. In previous tutorials, we have already started the ECP without explicitly naming the model to be used. This resulted in the application having to guess the right model. Since in our case there was only one model in the workspace (the example model), the application always chose the correct model. But in general, it is better to register the model to be used to the application.
</p>
<p>In the following, we will again use the <a href="http://unicase.googlecode.com/svn/trunk/documentation/tutorials/emfcp/exampleModel.zip"> example model </a> to demonstrate the steps.</p>
<b>Step 1: Open the Extensions view</b>
<p>Open the <em>plugin.xml</em> file of the project that you want to register the model for. In this case, we will use the project <em>example.Model.editorCustomizations</em>. Make sure that the <em>Extensions</em> tab at the bottom is activated.
</p>
<p><img width=700 src="images/extensionsView.png" alt="Extension view of plugin.xml"/></p>
<b>Step 2: Add new extension</b>
<p>
Click on the <em>Add...</em> button, select the <em> org.eclipse.emf.ecp.model.ecppackage</em> and press <em>Finish</em>.
</p>
<b>Step 3: Enter model URI</b>
<p>
The only information needed by the <em>ecpModelPackage</em> extension is the URI of the modelPackage to be used.
</p>
You can get the model URI by navigating to the root node of your ecore model. In this example, you can find the ecore model with the name <em>library.ecore</em> in the <em>model</em> folder of the project <em>exampleModel</em>. Open it and collapse the view until the root node is visible. Open its <em>Properties</em> view by double clicking and find the model URI.
<p><img width=700 src="images/modelURI.png" alt="Extension view of plugin.xml"/></p>
Copy it into the textbox of the <em>ecpModelPackage</em> extension and you are done. The <em>library.ecore</em> model has now been registered to the project <em>exampleModel.editorCustomizations</em>.
</div>