Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "RAP/EMF Integration"

< RAP
(Runtime)
(35 intermediate revisions by 4 users not shown)
Line 1: Line 1:
| [[RAP|RAP wiki home]] | [http://eclipse.org/rap RAP project home] |
 
 
[[Image:Emf rap.png|right]]
 
[[Image:Emf rap.png|right]]
  
== THIS IS EXPERIMENTAL! IT IS NOT OFFICIALLY SUPPORTED NEITHER BY RAP NOR BY EMF ==
+
== EMF Runtime ==
  
== Runtime ==
+
The non-UI part of EMF works with RAP out of the box. With the aid of the following bundles, EMF models can be created and accessed.
 +
* <code>org.eclipse.emf.common</code>
 +
* <code>org.eclipse.emf.ecore</code>
 +
Even though these bundles express an optional dependency on <code>org.eclipse.core.resources</code>, this dependency isn't required at runtime. As of the Indigo release, these base features (along with a couple of others) are built independently of the rest of the core and are included in a "EMF Base Framework" feature.
  
EMFs runtime part should work out of the box with RAP as there are no dependencies to UI-related stuff.
+
== EMF UI and Edit Framework ==
The example mentioned in the end of this page only uses the following two core plugins of EMF. These have an optional dependency to the resource bundles but don't need them to work properly.
+
Since 2.6 M6, EMF provides branches of it's UI/Edit framework for use with RAP (details are documented in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=213988 bug 213988]). The necessary bundles are available from the EMF software repository and can be used together with the RAP runtime (> 1.3 M6).
The bundles used for the model in this example are
+
* org.eclipse.emf.common
+
* org.eclipse.emf.ecore
+
  
== Resources ==
+
The following sections ouline the basic steps to run EMF on RAP. The Ecore and Genmodel of the Library Example used throughout this page can be [http://wiki.eclipse.org/images/0/0b/Emfrapexample.zip downloaded here]
EMF relies in the UI parts on the Resource infrastructure to support seamless integration with the Eclipse workspace. This is a big problem as the resource framework is multi-user enabled and thus can lead to problem in the RAP environment. Even if there may be workarounds available (eg. session-scoped EFS implementation), there is still only one workspace available. This can lead to big problems like a user who locks the workspace automatically locks all other users in the webapp.
+
  
== UI and Edit Framework ==
+
=== Prepare the IDE ===
Generated edtitors of EMF (and in particular their dependencies) have to be modified to run on RAP. The two interesting bundles from EMF are:
+
* org.eclipse.emf.common.ui
+
* org.eclipse.emf.editor.ui
+
  
With the support for cell editors in the properties view and D&D, many problems from the past have vanished. But there are still many references to IDE- and Resource-specific features that will not be available in RAP. This should be a topic to discuss further how to resolve this. That resources will be session-scoped is out of the context of the 3.x stream of the platform. This *may* come with e4 but at the moment, there are committers working on this. Another option would be to split the EMF-bundles in EMF-Core and Resource-Integration bundles. As the dependencies to resource is rather broad, this could lead to many API breaks which is not very good either.
+
In order to develop applications for EMF and RAP, you will need to install two features into your IDE:
Single-sourcing the EMF-Bundles as they are with the dependency to the Resources framework would lead to a situtation where users could use them but have to be aware of the fact they should never use any API that may, even accidentally, call into the resources infrastructure.
+
* The tools to work with EMF models, which are available from [http://www.eclipse.org/modeling/emf/updates here] (chose versions >= 2.6 M6)
 +
* The tooling for RAP, that can be obtained from [http://eclipse.org/rap/downloads/index.php here] (chose versions >= 1.3 M6)
  
== IDE Bundle ==
+
=== Assemble the Runtime Target ===
As the EMF UI bundles have a dependency on the IDE bundle of Eclipse (<code>org.eclipse.ui.ide</code>), we need to support this somehow. This is rather problematic as IDE itself relies heavily on the Resource infrastructure.
+
As simple mock is attached to the bug report stated in the references section. This is not intended to be used outside of the research/evaluation process.
+
  
== Demo ==
+
The minimal runtime consists of EMF for RAP and the RAP runtime itself. To set up the target platform, the most conventient way is assemble it directly from the Helios software repository:
The demo consists of a patch for the EMF-UI plugins, a mock of the IDE bundle and the EMF library example. As host we use a simple RAP application (<code>org.eclipse.rap.demo</code>). The whole source can be found in the zip attached to the corresponding bug report.
+
* Helios Repository: <code><nowiki>http://download.eclipse.org/releases/helios</nowiki></code>
 +
The following features are interesting for you:
 +
* Rich Ajax Platform (RAP) Target Components
 +
* EMF RAP Target Components
 +
Both of them are contained in the EclipseRT category. Note also that, as of the Indigo release, the "EMF Base Framework" feature must also be installed from the Modeling category.
 +
{{warning|EMF for RAP and the RAP runtime must not be installed into the IDE, it will break the IDE.}}
  
== References ==
+
[[Image:Rapemftarget.png]]
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=213988 Bug 213988: Investigate support for RAP]
+
 
* [http://ed-merks.blogspot.com/2008/01/emf-and-rap-go-great-together-too.html Blog post: EMF and RAP go great together too]
+
Please make sure to '''uncheck''' the "Include required software" option when adding the features from the repositories.
* [http://wiki.eclipse.org/EMF_Editor_goes_RAP Wiki page: EMF Editor goes RAP]
+
 
 +
=== Configuring EMF and RAP as Runtime ===
 +
 
 +
Open up the Properties view on your .genmodel file and set the "Rich Ajax Application" from the "Editor" category to true.
 +
 
 +
[[Image:Rapemfproperties.png]]
 +
 
 +
After that you can generate your edit and editor code.
 +
 
 +
=== Launch the application ===
 +
 
 +
You can now launch the application via it's generated <code>org.eclipse.core.runtime.applications</code> extension. Just use the ''LibraryEditorAdvisorApplication'' entry point.
 +
 
 +
[[Image:Rapemflaunch.png]]
 +
 
 +
[[Category:RAP]]
 +
[[Category:Modeling]]
 +
[[Category:EMF]]

Revision as of 11:55, 13 June 2012

Emf rap.png

EMF Runtime

The non-UI part of EMF works with RAP out of the box. With the aid of the following bundles, EMF models can be created and accessed.

  • org.eclipse.emf.common
  • org.eclipse.emf.ecore

Even though these bundles express an optional dependency on org.eclipse.core.resources, this dependency isn't required at runtime. As of the Indigo release, these base features (along with a couple of others) are built independently of the rest of the core and are included in a "EMF Base Framework" feature.

EMF UI and Edit Framework

Since 2.6 M6, EMF provides branches of it's UI/Edit framework for use with RAP (details are documented in bug 213988). The necessary bundles are available from the EMF software repository and can be used together with the RAP runtime (> 1.3 M6).

The following sections ouline the basic steps to run EMF on RAP. The Ecore and Genmodel of the Library Example used throughout this page can be downloaded here

Prepare the IDE

In order to develop applications for EMF and RAP, you will need to install two features into your IDE:

  • The tools to work with EMF models, which are available from here (chose versions >= 2.6 M6)
  • The tooling for RAP, that can be obtained from here (chose versions >= 1.3 M6)

Assemble the Runtime Target

The minimal runtime consists of EMF for RAP and the RAP runtime itself. To set up the target platform, the most conventient way is assemble it directly from the Helios software repository:

  • Helios Repository: http://download.eclipse.org/releases/helios

The following features are interesting for you:

  • Rich Ajax Platform (RAP) Target Components
  • EMF RAP Target Components

Both of them are contained in the EclipseRT category. Note also that, as of the Indigo release, the "EMF Base Framework" feature must also be installed from the Modeling category.

Warning2.png
EMF for RAP and the RAP runtime must not be installed into the IDE, it will break the IDE.


Rapemftarget.png

Please make sure to uncheck the "Include required software" option when adding the features from the repositories.

Configuring EMF and RAP as Runtime

Open up the Properties view on your .genmodel file and set the "Rich Ajax Application" from the "Editor" category to true.

Rapemfproperties.png

After that you can generate your edit and editor code.

Launch the application

You can now launch the application via it's generated org.eclipse.core.runtime.applications extension. Just use the LibraryEditorAdvisorApplication entry point.

Rapemflaunch.png

Back to the top