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.
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 :
connection : pserver host : dev.eclipse.org repository : /cvsroot/modeling module : org.eclipse.emf/org.eclipse.emf.search/tests/org.eclipse.emf.search.tests login/pwd : anonymous/anonymous
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 the Movies Db Model, Edit & Editor plugins, you can right click on the moviesDb.genmodel in the package explorer and invoke "EMF Search > Generate Textual Search Infrastructure"
As a result you get a Wizard proposing all EString/String Eattributes coming from the 3 existing packages : db, order, customer. You need to select at least one of these textual features prior proceeding with code generation for Core and/or UI Search infrastructure.
Note that elements to select are only EAttributes of type EString. 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
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: