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.
Difference between revisions of "EMF Search---Quick Start Guide"
(→Movies DB Example) |
m (→Eclipse Live Demo) |
||
(20 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
− | === | + | === Quick Start === |
+ | This document intent to explain how to generate EMF Search infrastructure from arbitrary Ecore models mainly relying on user defined *.genmodel resources. | ||
− | |||
− | Following steps will described : | + | Following steps will be described : |
− | + | #Resources retrieval from CVS | |
− | + | #Model Plugins Generation | |
− | + | ##Model | |
− | + | ##Edit | |
− | + | ##Editor | |
− | + | #Search Infrastructure Generation Configuration | |
+ | ##Select textual features to consider | ||
+ | ##Select infrastructure to generate : Core and/or UI | ||
+ | #Runtime Launch Configuration Setting | ||
+ | #Setup Environment Setting | ||
+ | ##Create new project | ||
+ | ##Copy sample data | ||
+ | #Generated Feature Integrity Verification | ||
+ | ##Run a simple test query | ||
+ | ##Verify results consistency | ||
+ | ##Go back to editor by clicking | ||
+ | ==== Eclipse Live Demo ==== | ||
− | |||
+ | Here are links to screencast & demos in case you don't like to read : | ||
− | + | [http://live.eclipse.org/node/515 Eclipse Live Demo : Textual Search/Replace Infrastructure Generation] | |
+ | [http://74.53.13.78/eclipse/EMFSearch/EMFSearchCodegen.htm Direct Access to screencast] | ||
− | + | ==== Movies DB Example Plugin CVS Retrieval ==== | |
− | |||
+ | You first need org.eclipse.emf.search.tests plugin from CVS : | ||
+ | |||
+ | |||
+ | |||
+ | module : org.eclipse.emf/org.eclipse.emf.search/tests/org.eclipse.emf.search.tests | ||
+ | |||
+ | |||
+ | [http://wiki.eclipse.org/EMF/Getting_Source#Checking_Out_Code_as_an_Anonymous_User EMF CVS How To : Checking Out Code as an Anonymous User] | ||
− | |||
+ | Directory structure needed for the example : | ||
Line 47: | Line 66: | ||
− | + | 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) | |
− | + | ||
Line 57: | Line 75: | ||
− | (Note that you could be able to generate search stuff without these plugins existing, but the demo need these | + | (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 ==== | ==== Generate Search Wizard ==== | ||
Line 70: | Line 88: | ||
− | A Wizard propose EString/String EAttributes coming from packages | + | |
+ | A Wizard propose EString/String EAttributes coming from analyzed packages. | ||
Line 76: | Line 95: | ||
[[Image:GenerateSearchCoreAndUIWizard.png|450px|EMF Search Textual Core and UI Code Generation Wizard]] | [[Image:GenerateSearchCoreAndUIWizard.png|450px|EMF Search Textual Core and UI Code Generation Wizard]] | ||
+ | |||
+ | 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 | + | Coming from this EString EStructuralFeature selection, Search infrastructure custom code will be generated in two new plugins (one if only one checkbox selected) : |
Line 84: | Line 105: | ||
org.eclipse.emf.search.tests.movies.search.ui | 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 : | |
− | + | [[Image:CreateSimpleMoviesDbProject.png|450px]] | |
+ | |||
+ | Copy all *.movies, *.customers, *.orders from org.eclipse.emf.search.tests/models/codegen/Movies/data/ to new project : | ||
− | |||
+ | [[Image:SimpleMoviesDbPlusDataDir.png|320px]] | ||
==== Movies Db Launch Configuration ==== | ==== Movies Db Launch Configuration ==== | ||
− | + | ||
+ | Testing your newly generated Movies DB Search in action require to create a new launch configuration : | ||
Line 122: | Line 145: | ||
org.eclipse.emf.search.tests.movies.search | org.eclipse.emf.search.tests.movies.search | ||
org.eclipse.emf.search.tests.movies.search.ui | org.eclipse.emf.search.tests.movies.search.ui | ||
+ | |||
Line 127: | Line 151: | ||
− | + | ||
+ | Open the Movies Db Search Page in your newly started runtime workbench (Ctrl + H) : | ||
Line 135: | Line 160: | ||
− | + | Custom Movies Db Search Page is displayed in a multi tab dialog : | |
Line 143: | Line 168: | ||
− | + | Participant tabs have been created for each of the 3 packages plus an additional one containing the union of all the classifiers. | |
+ | |||
Line 149: | Line 175: | ||
− | Once you got the cutomer participant tab selected, you | + | 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. | |
− | + | ||
[[Image:MoviesDbCustomerTextualQueryResults.png|450px|MoviesDb Customer Textual Query Results]] | [[Image:MoviesDbCustomerTextualQueryResults.png|450px|MoviesDb Customer Textual Query Results]] | ||
+ | |||
+ | |||
+ | 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 | + | After clicking on given result, Peter for example, you get the corresponding element selected in customer legacy Ecore editor: |
Line 169: | Line 197: | ||
[[Image:MoviesDbCustomerFinalSelectionToViewer.png|450px]] | [[Image:MoviesDbCustomerFinalSelectionToViewer.png|450px]] | ||
+ | |||
+ | |||
==== Super Bonus : Replace ==== | ==== Super Bonus : Replace ==== | ||
− | + | ||
+ | Using "replace..." button allows you to replace "Peter" by "Lucas" for example ;-) | ||
+ | |||
+ | |||
[[Image:MoviesDbCustomerTextualReplace.png|450px]] | [[Image:MoviesDbCustomerTextualReplace.png|450px]] | ||
Line 183: | Line 216: | ||
[[Image:MoviesDbCustomerTextualReplace3.png|450px]] | [[Image:MoviesDbCustomerTextualReplace3.png|450px]] | ||
− | |||
=== Generated Code Explained === | === Generated Code Explained === | ||
+ | |||
+ | To be continued ... |
Latest revision as of 06:16, 24 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
Contents
Quick Start
This document intent to explain how to generate EMF Search infrastructure from arbitrary Ecore models mainly relying on user defined *.genmodel resources.
Following steps will be described :
- Resources retrieval from CVS
- Model Plugins Generation
- Model
- Edit
- Editor
- Search Infrastructure Generation Configuration
- Select textual features to consider
- Select infrastructure to generate : Core and/or UI
- Runtime Launch Configuration Setting
- Setup Environment Setting
- Create new project
- Copy sample data
- Generated Feature Integrity Verification
- Run a simple test query
- Verify results consistency
- Go back to editor by clicking
Eclipse Live Demo
Here are links to screencast & demos in case you don't like to read :
Eclipse Live Demo : Textual Search/Replace Infrastructure Generation Direct Access to screencast
Movies DB Example Plugin CVS Retrieval
You first need 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
Directory structure needed for the 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 :
Copy all *.movies, *.customers, *.orders from org.eclipse.emf.search.tests/models/codegen/Movies/data/ to new project :
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
Using "replace..." button allows you to replace "Peter" by "Lucas" for example ;-)
Generated Code Explained
To be continued ...