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.
Difference between revisions of "EMF Search---Quick Start Guide"
(→Generate Model, Edit & Editor) |
(→Copying Movies DB Sample Data) |
||
Line 94: | Line 94: | ||
− | You need to create a project and to copy demo sample data. | + | You need to create a project and to copy demo sample data. Name the project "SimpleMoviesDb" or whatever you like : |
Line 107: | Line 107: | ||
[[Image:SimpleMoviesDbPlusDataDir.png|450px]] | [[Image:SimpleMoviesDbPlusDataDir.png|450px]] | ||
− | |||
− | |||
==== Movies Db Launch Configuration ==== | ==== Movies Db Launch Configuration ==== |
Revision as of 17:35, 22 April 2008
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
Introduction
This document aim to explain to users how to generate EMF Search infrastucture from arbitrary models mainly relying on existing .genmodel resources.
Following steps will be described :
- Resources retrieval from CVS
- User Model, Edit & Editor Plugins Generation
- Search Infrastructure Generation Configuration
- Verification Launch Configuration Setting
- Setup Verification Environement Setting
- Generated Feature Integrity Verification
Movies DB Example Plugin CVS Retrieval
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
EMF CVS How To : Checking Out Code as an Anonymous User
Here is the full directory structure needed for this example :
Generate Model, Edit & Editor
First step consist in generating MoviesDb Model, Edit, Editor plugins from GenModel Editor like any other usual EMF projects. (Eg. right click on MoviesDb GenModel element)
(Note that you could be able to generate search stuff without these plugins existing, but the demo need these 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 analyzed packages.
You must select one or more of proposed textual features prior proceeding with Core and/or UI Search infrastructure code generation (Note the two checkbox : Core & UI).
Coming from this EString EStructuralFeature selection, Search infrastructure custom code will be generated in two new plugins (one if only one checkbox selected) :
org.eclipse.emf.search.tests.movies.search org.eclipse.emf.search.tests.movies.search.ui
Copying Movies DB Sample Data
You need to create a project and to copy demo sample data. Name the project "SimpleMoviesDb" or whatever you like :
All content from org.eclipse.emf.search.tests/models/codegen/Movies/data/ is needed :
Movies Db Launch Configuration
Testing your newly generated Movies DB Search in action require 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
Open the Movies Db Search Page in your newly started runtime workbench (Ctrl + H) :
Custom Movies Db Search Page is displayed in a multi tab dialog :
Participant tabs have been created for each of the 3 packages plus an additional one containing the union of all the classifiers.
Run A Textual Query On Customer Element
Once you got the cutomer participant tab selected, you can selected Customer as unique element partcipant to laucnh a textual query.
This query will only be applied on EString EAttributes previously selected for Search plugins code generation.
The query result gives you the customers instances which textual query expression matched previously selected EString attributes current values.
After clicking on given result, Peter for example, you get the corresponding element selected in customer legacy Ecore editor:
Super Bonus : Replace
Usinguse "replace..." button allows you to replace "Peter" by "Lucas" for example ;-)