SlideShare a Scribd company logo
Rules
#EclipseCon
Same amount of time per project
EMF Related
Same structure for each project
·
1min30-
·
Tools for Ecore or working with EMF Core
Framework on top of EMF Core
-
-
·
Scope and where to find it
An example (mostly code)
My feedback
-
-
-
http://thenounproject.com/einfachein/#
3/34
EcoreTools
Graphical Modeler for Ecore
http://download.eclipse.org/releases/juno
#EclipseCon 4/34
EcoreTools
ChocoApp domain model
Feedback·
Xcore
Textual Ecore with Java binding
+
http://wiki.eclipse.org/Xcore
http://download.eclipse.org/releases/juno
#EclipseCon 6/34
#EclipseCon
Feedback·
7/34
Extended Editing Framework (EEF)
Rich properties and dialogs
http://www.eclipse.org/modeling/emft/?project=eef
http://download.eclipse.org/releases/juno
#EclipseCon 8/34
#EclipseCon
Feedback·
9/34
CDO
Share and Distribute
http://www.eclipse.org/cdo/
http://download.eclipse.org/releases/juno
#EclipseCon 10/34
Transaction, History ...
#EclipseCon
      //changing stuff
      CDOTransaction tx = session.openTransaction();
    CDOResource res = tx.getResource("allChocos.choco", true);
    Board board = (Board) res.getContents().get(0);
    BuildFail newFailure = ChocoFactory.eINSTANCE.createBuildFail();
    newFailure.setDate(new Date());
    newFailure
        .setFailedLogURI("http://build.eclipse.org/hudson/somejob/23/build.log");
    board.getReasons().add(newFailure);
    tx.commit();
    
    // using history
    
    CDOView view = session.openView(aLongRepresentingSomeDate);
    Board board = (Board) view.getResource("allChocos.choco").getContents()
        .get(0);
    // I'll get the result from the past
    board.getChocos();
    board.getReasons();
    session.getCommitInfoManager().getCommitInfo(aLongRepresentingSomeDate)
        .getComment();
      
JAVA
"Now that I've Got a Model - Where's My Application?" in Theater/ Thursday 10:30am·
11/34
Compare 2.x
Team, Match, Diff and Merge
http://www.eclipse.org/emf/compare/
http://download.eclipse.org/modeling/emf/compare/updates/interim/2.1
#EclipseCon 12/34
Detecting conflict during REST operations
#EclipseCon
public Resource put(URI resourcePath, Resource putFromRemoteClient,long ancestorTimestamp) {
    Resource ancestorFromDB = data.getResourcePerRevision(resourcePath,
            ancestorTimestamp);     
    IComparisonScope scope = EMFCompare.createDefaultScope(putFromRemoteClient,
                                              latestFromDB.getResource(), ancestorFromDB);
    Comparison comp = EMFCompare.builder().build().compare(scope);
    for (Conflict conflict : comp.getConflicts()) {
        // How do you want to handle a conflict ?            
    }
        
    for (Diff diff : comp.getDifferences()) {
      diff.copyLeftToRight();
    }
    return latestFromDB.getResource();
}
      
JAVA
EMF Compare 2.0 : Scaling to Millions / 2pm today·
13/34
EMFPath
Mixing Guava and EMF
http://code.google.com/a/eclipselabs.org/p/emfpath/
http://svn.codespot.com/a/eclipselabs.org/emfpath/trunk/repository/
#EclipseCon 14/34
Querying with Java
#EclipseCon
public class UserQuery {
  private User user;
  public UserQuery(User user) {
     this.user = user;
  }
  public Iterable allPendingChocos() {  
    Predicate isPending = Having.feature(ChocoPackage.Literals.CHOCO__STATE,Equals.to(ChocoState.PENDING));
    return adapt(user).descendant().filter(Choco.class)
                                            .filter(isPending);
  }
}
      
JAVA
Feedback·
15/34
emfjson
EObjects to Json, Json to EObjects
https://github.com/ghillairet/emfjson
http://ghillairet.github.com/p2/emfjson/releases/0.5.0p>
#EclipseCon 16/34
A generic JSON API
#EclipseCon
public void get(URI resourcePath, OutputStream writer) throws IOException {
    Resource resource = this.dataAccess.get(resourcePath);
    JsResourceImpl jsRes = new JsResourceImpl(resourcePath); // put content from original resource to the json one.
    jsRes.getContents().addAll(resource.getContents());
    Map options = new HashMap();
    options.put(EMFJs.OPTION_INDENT_OUTPUT, true);
    options.put(EMFJs.OPTION_SERIALIZE_TYPE, false);
    jsRes.save(writer, options);
}
public void put(URI resourcePath, InputStream in) throws IOException {
    Map options = new HashMap();
    options.put(EMFJs.OPTION_ROOT_ELEMENT,ChocoPackage.eINSTANCE.getBoard());
    JsResourceImpl jsRes = new JsResourceImpl(resourcePath);
    jsRes.load(options);
    this.dataAccess.put(resourcePath, jsRes, 0);
    
    /*
     * You could retrieve the instance with :
     */
    Board root = (Board) jsRes.getContents().get(0);
}
      
JAVA
Feedback·
17/34
Gendoc2
Generate (*)Office docs from models
#EclipseCon
http://www.topcased.org/index.php?id_projet_pere=102
http://topcased-gendoc.gforge.enseeiht.fr/releases/1.6.0/
18/34
Monthly Report
#EclipseCon
Feedback·
19/34
mongoEMF
MongoDB and EMF
https://github.com/BryanHunt/mongo-emf
http://bryanhunt.github.com/mongo-emf/
#EclipseCon 20/34
Database backend
#EclipseCon
    User user = ChocoFactory.eINSTANCE.createUser();
    user.setName("Etienne Juliot");
    user.setEmail("etienne.juliot@obeo.fr");
    Resource resource = resourceSet.createResource(URI.createURI("mongodb://localhost/db/users/"));
    resource.getContents().add(user);
    try
    {
      user.eResource().save(null);
    }
    catch(IOException e)
    {
      e.printStackTrace();
    }
      
JAVA
Resource resource = resourceSet.getResource(URI.createURI("mongodb://localhost/app/users/4d6dc268b03b0db29961472c"), true);
User etienne = (User) resource.getContents().get(0);
JAVA
Feedback·
21/34
blueprints-emf
https://github.com/ghillairet/blueprints-emf
mvn clean package
#EclipseCon 22/34
Database backend
#EclipseCon
  EPackage.Registry.INSTANCE.put(ChocoPackage.eNS_URI, ChocoPackage.eINSTANCE);
  ResourceSet resourceSet = new ResourceSetImpl();
  Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put("graph", 
                                                              new XMIResourceFactoryImpl());
  Neo4jGraph graph = new Neo4jGraph("data/neo4j/chocos");
  GraphURIHandler.Registry.INSTANCE.put("graph://data/neo4j/chocos/", graph);
  EList uriHandlers = resourceSet.getURIConverter().getURIHandlers();
  uriHandlers.add(0, new GraphURIHandlerImpl());
  Board board = ChocoFactory.eInstance.createBoard();
  User user = ChocoFactory.eINSTANCE.createUser();
  user.setName("Etienne Juliot");
  board.getUsers().add(user);
  Resource resource = resourceSet.createResource(URI.createURI("graph://data/neo4j/chocos/"));
  resource.getContents().add(board);
  resource.save(null);
      
JAVA
Feedback·
23/34
EMF Specimen
Grow your models
https://github.com/Obeo/emf.specimen
mvn clean install
#EclipseCon 24/34
#EclipseCon
     
    // ChocoClass
   public class ChocoSpecimenConfiguration implements ISpecimenConfiguration {
  public IntegerDistribution getDepthDistributionFor(EClass eClass) {
    if (eClass == ChocoPackage.eINSTANCE.getChoco()) {
      return new BinomialDistribution(10, 0.5);
    } else if (eClass == ChocoPackage.eINSTANCE.getBuildFail()) {
      return new BinomialDistribution(100, 0.8);
    } else if (eClass == ChocoPackage.eINSTANCE.getUp()) {
      return new BinomialDistribution(5, 0.8);
    } else if (eClass == ChocoPackage.eINSTANCE.getDown()) {
      return new BinomialDistribution(2, 0.8);
    } else if (eClass == ChocoPackage.eINSTANCE.getChoco()) {
      return new BinomialDistribution(30, 0.3);
    }
    return new BinomialDistribution(100, 0.5);
  }
 
  // [...]  
  SpecimenGenerator generator = new SpecimenGenerator(
      new ChocoSpecimenConfiguration());
  List result = generator.generate(new ResourceSetImpl());
      
JAVA
Feedback·
25/34
Client Platform
RCP application framework
http://www.eclipse.org/emfclient/
http://download.eclipse.org/emf-store/releases/latest
#EclipseCon 26/34
Rich Editor
#EclipseCon
Building a Tool based on EMF in 20 minutes / Thursday 2pm·
27/34
Texo
Enterprise Application Stack for EMF
http://wiki.eclipse.org/Texo
http://download.eclipse.org/modeling/emft/texo/updates/interim
#EclipseCon 28/34
JPA + DAO
#EclipseCon
/**
 * A representation of the model object 'Choco'.
 * @generated
 */
@Entity(name = "choco_Choco")
public class Choco {
  @Basic()
  private String name = null;
  
  @Basic()
  @Temporal(TemporalType.DATE)
  private Date expiration = null;
  
  @ManyToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST,
      CascadeType.REFRESH }, optional = false)
  @JoinColumns({ @JoinColumn() })
  private User culprit = null;
      
JAVA
Taking EMF to the Mobile Web / Theater at 4.30pm·
29/34
Sonar Regex File Filter
Exclude generated code from your analysis
https://github.com/Obeo/fr.obeo.sonar.plugin.regexfilefilter
mvn clean package
#EclipseCon 30/34
Sonar
#EclipseCon
Feedback·
31/34
Wikitext Bridge (Mylyn Intent)
Get a model from a wiki page
http://www.eclipse.org/intent/
http://download.eclipse.org/releases/juno
#EclipseCon 32/34
Aggregate Wiki pages in a Single HTML document
#EclipseCon
private static void loadWikiPageAsModel() throws IOException {
    
    Document userGuide = getDocumentFromWiki(URI
        .createURI("http://wiki.eclipse.org/EMF_Compare/User_Guide"));
    Document developperGuide = getDocumentFromWiki(URI
        .createURI("http://wiki.eclipse.org/EMF_Compare/Developer_Guide"));
    Document faq = getDocumentFromWiki(URI
        .createURI("http://wiki.eclipse.org/EMF_Compare/FAQ"));
    Section userGuideSec = transformToSection(userGuide, "User Guide");
    Section developperGuideSec = transformToSection(developperGuide,
        "Developper Guide");
    Section faqSec = transformToSection(faq, "Frequently Asked Questions");
   
    
    Document aggregated = newDocument("EMF Compare");
    aggregated.getContent().add(userGuideSec);
    aggregated.getContent().add(developperGuideSec);
    aggregated.getContent().add(faqSec);
    
    Html generator = new Html(aggregated, new File("/tmp/wikiout"),
        Collections.EMPTY_LIST);
    generator.doGenerate(new BasicMonitor());
  }
      
JAVA
Feedback·
33/34
<Thank You!>
g+ www.google.com/profiles/cedric.brun
twitter @bruncedric
www model-driven-blogging.blogspot.fr/
github github.com/cbrun

More Related Content

PDF
What the heck is Eclipse Modeling and why should you care !
PDF
Hithhiker guide to eclipse presentation frameworks galaxy
PPTX
Eclipse 4.0 - Dynamic Models
PDF
Developing Rich Clients with the Eclipse 4 Application Platform
KEY
What's New in Plug-in Development (Galileo)
KEY
OSGi For Eclipse Developers
PDF
GMF : Create your graphical DSL - EclipseCon 11
PPTX
Building Eclipse Plugins and RCP Applications with Tycho - ECE 2012
What the heck is Eclipse Modeling and why should you care !
Hithhiker guide to eclipse presentation frameworks galaxy
Eclipse 4.0 - Dynamic Models
Developing Rich Clients with the Eclipse 4 Application Platform
What's New in Plug-in Development (Galileo)
OSGi For Eclipse Developers
GMF : Create your graphical DSL - EclipseCon 11
Building Eclipse Plugins and RCP Applications with Tycho - ECE 2012

What's hot (11)

PPTX
Uml to code with acceleo
PPT
ITU - MDD - Eclipse Plug-ins
PDF
Eclipse IDE and Platform news on Fosdem 2020
PPTX
An introduction to papyrus
PPTX
CDO Ignite
PPT
MDT Papyrus - Eclipse Con 2010
ODP
OpenOffice.org Extension Development with Java and NetBeans in practice
ODP
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
PPTX
Eclipse e4 Tutorial - EclipseCon 2010
PPT
Applets 101-fa06
PPTX
Jangaroo @ FlashCodersNY
Uml to code with acceleo
ITU - MDD - Eclipse Plug-ins
Eclipse IDE and Platform news on Fosdem 2020
An introduction to papyrus
CDO Ignite
MDT Papyrus - Eclipse Con 2010
OpenOffice.org Extension Development with Java and NetBeans in practice
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
Eclipse e4 Tutorial - EclipseCon 2010
Applets 101-fa06
Jangaroo @ FlashCodersNY
Ad

More from Cédric Brun (19)

PDF
Integrating Xtext and Sirius: Strategies and Pitfalls
PDF
Eclipse Modeling Guided Tour - EMF Compare
PDF
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
PDF
Eclipse Modeling Guided Tour - EcoreTools
ODP
EcoreTools-Next: Executable DSL made (more) accessible
PDF
Integrating Xtext and Sirius: Strategies and Pitfalls
PDF
Roadmap - SiriusCon2016
PDF
Modeling avengers – open source technology mix for saving the world econ fr
PDF
Modeling avengers – open source technology mix for saving the world
PDF
Breathe life into your designer!
PDF
Sirius : origins, present, future
PDF
Xtext + Sirius = ♥ / EclipseCon Europe 2014
PDF
Xtext + Sirius = &lt;3
PDF
Ecore Tools 2.0 : The Luna Revival
PDF
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
PDF
What every developer should know about EMF Compare
PDF
From Acceleo.org To Eclipse Modeling
ODP
Acceleo Day - Acceleo Mtl Code Generation
PDF
Team Work With Models Web
Integrating Xtext and Sirius: Strategies and Pitfalls
Eclipse Modeling Guided Tour - EMF Compare
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Eclipse Modeling Guided Tour - EcoreTools
EcoreTools-Next: Executable DSL made (more) accessible
Integrating Xtext and Sirius: Strategies and Pitfalls
Roadmap - SiriusCon2016
Modeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world
Breathe life into your designer!
Sirius : origins, present, future
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Xtext + Sirius = &lt;3
Ecore Tools 2.0 : The Luna Revival
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
What every developer should know about EMF Compare
From Acceleo.org To Eclipse Modeling
Acceleo Day - Acceleo Mtl Code Generation
Team Work With Models Web
Ad

Recently uploaded (20)

PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Sustainable Sites - Green Building Construction
PPT
Project quality management in manufacturing
PDF
composite construction of structures.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Digital Logic Computer Design lecture notes
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Well-logging-methods_new................
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
web development for engineering and engineering
CH1 Production IntroductoryConcepts.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
UNIT 4 Total Quality Management .pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Sustainable Sites - Green Building Construction
Project quality management in manufacturing
composite construction of structures.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Digital Logic Computer Design lecture notes
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Foundation to blockchain - A guide to Blockchain Tech
Well-logging-methods_new................
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Arduino robotics embedded978-1-4302-3184-4.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
web development for engineering and engineering

15 EMF projects in 25 minutes