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

EMF Search---Quick Start Guide

Revision as of 18:23, 21 April 2008 by Lucas.bigeardel.gmail.com (Talk | contribs) (Run A Textual Query On Customer Element)

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


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

EMF Search Tests CVS Module

Here is the full directory structure to get in order to be able to replay this "tutorial" :

MoviesDb Containing Plugin


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.

Generate Model, Edit, Editor Plugins from GenModel Editor

(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"

EMF Search Textual Core and UI Code Generation Action

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.

EMF Search Textual Core and UI Code Generation Wizard

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 :

MoviesDb Runtime 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 :

MoviesDb Search Drop Down Menu

As a result your custom Movies Db Search Page is displayed in a multi tab dialog :

MoviesDb Customer Textual Query

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.

MoviesDb Customer Textual Query Results

After clicking on given result, Peter for example, you get the corresponding element opened in customer legacy Ecore editor:

MoviesDbCustomerTextualQueryResultsOpenAction.png


File:MoviesDbCustomerFinalSelectionToViewer.png

Back to the top