Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EMF Search---Quick Start Guide
This quick start guide will explain :
- Steps to generate textual search infrastructure for arbitrary Ecore model (Here MoviesDb)
- Generated Code and relations to EMF Search framework architecture
- Explain Extensibility in context of this example
- Hints for code customizations
Contents
Movies DB Example
Fisrt, you need to grab org.eclipse.emf.search.tests plugin from CVS :
module : org.eclipse.emf/org.eclipse.emf.search/tests/org.eclipse.emf.search.tests
How To : Checking Out Code as an Anonymous User
Here is the full directory structure to get in order to be able to replay this "tutorial" :
Generate Model, Edit & Editor
In order to avoid generated MoviesDb Search infrastructure staying useless you need first to get Movies Db Model, Edit, Editor plugins generated from GenModel Editor like any other usual EMF projects.
(Note that you could be able to generate search stuff without these plugins existing, but the demo need these 3 Movies Db plugins at runtime).
Generate Search Wizard
Once you generated Movies DB Model, Edit & Editor plugins, right click on moviesDb.genmodel in package explorer and select "EMF Search > Generate Textual Search Infrastructure"
A Wizard propose EString/String EAttributes coming from packages. You must select one or more of these textual features prior proceeding with Core and/or UI Search infrastructure code generation (Note the two checkbox).
Coming from this EString EStructuralFeature list, custom code will be generated in two new plugins :
org.eclipse.emf.search.tests.movies.search org.eclipse.emf.search.tests.movies.search.ui
Copying Movies DB Data
You need to create a new basic project in order storing demo sample data (SimpleMoviesDb for instance) :
Then just copy the content of org.eclipse.emf.search.tests/models/codegen/Movies/data/ in the newly created project :
Movies Db Launch Configuration
In order to see your newly generated Movies DB Search in action, you need to create a new launch configuration :
Be sure the following pluins are checked in the "plugins" tab :
org.eclipse.emf.search.tests.movies org.eclipse.emf.search.tests.movies.edit org.eclipse.emf.search.tests.movies.editor org.eclipse.emf.search.tests.movies.search org.eclipse.emf.search.tests.movies.search.ui
Open Movies DB Search Page
Now you can open the Movies Db Search Page in your newly started runtime workbench :
As a result your custom Movies Db Search Page is displayed in a multi tab dialog :
Note that participant tabs have been created for each of db, customer, order packages plus an additional one containing the union of all the classifiers coming from these 3 packages.
Run A Textual Query On Customer Element
Once you got the cutomer participant tab selected, you could selected Customer element partcipant to get a textual query only qpplied on EString Attribute selected for generation.
As a result you get the customers which textual query matched with previously selected EString attributes.
After clicking on given result, Peter for example, you get the corresponding element opened in customer legacy Ecore editor:
Super Bonus : Replace
you can use the "replace..." button and see that you can replace "Peter" by "Lucas" for example ;-)