Rules

  • Same amount of time per project
    • 1min30
  • EMF Related
    • Tools for Ecore or working with EMF Core
    • Framework on top of EMF Core
  • Same structure for each project
    • Scope and where to find it
    • An example (mostly code)
    • My feedback
http://thenounproject.com/einfachein/#

EcoreTools

Graphical Modeler for Ecore

http://download.eclipse.org/releases/juno

EcoreTools

ChocoApp domain model

  • Feedback

Xcore

Textual Ecore with Java binding

+

http://wiki.eclipse.org/Xcore

http://download.eclipse.org/releases/juno

  • Feedback

Extended Editing Framework (EEF)

Rich properties and dialogs

http://www.eclipse.org/modeling/emft/?project=eef

http://download.eclipse.org/releases/juno

  • Feedback

CDO

Share and Distribute

http://www.eclipse.org/cdo/

http://download.eclipse.org/releases/juno

Transaction, History ...

      //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();
      
  • "Now that I've Got a Model - Where's My Application?" in Theater/ Thursday 10:30am

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

Detecting conflict during REST operations

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();
}
      
  • EMF Compare 2.0 : Scaling to Millions / 2pm today

EMFPath

Mixing Guava and EMF

http://code.google.com/a/eclipselabs.org/p/emfpath/

http://svn.codespot.com/a/eclipselabs.org/emfpath/trunk/repository/

Querying with Java

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);
  }
}
      
  • Feedback

emfjson

EObjects to Json, Json to EObjects

https://github.com/ghillairet/emfjson

http://ghillairet.github.com/p2/emfjson/releases/0.5.0p>

A generic JSON API

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);
}
      
  • Feedback

Gendoc2

Generate (*)Office docs from models

http://www.topcased.org/index.php?id_projet_pere=102

http://topcased-gendoc.gforge.enseeiht.fr/releases/1.6.0/

Monthly Report

  • Feedback

mongoEMF

MongoDB and EMF

https://github.com/BryanHunt/mongo-emf

http://bryanhunt.github.com/mongo-emf/

Database backend

    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();
    }
      
Resource resource = resourceSet.getResource(URI.createURI("mongodb://localhost/app/users/4d6dc268b03b0db29961472c"), true);

User etienne = (User) resource.getContents().get(0);
  • Feedback

blueprints-emf

https://github.com/ghillairet/blueprints-emf

mvn clean package

Database backend

  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);
      
  • Feedback

EMF Specimen

Grow your models

https://github.com/Obeo/emf.specimen

mvn clean install

     
    // 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());
      
  • Feedback

Client Platform

RCP application framework

http://www.eclipse.org/emfclient/

http://download.eclipse.org/emf-store/releases/latest

Rich Editor

  • Building a Tool based on EMF in 20 minutes / Thursday 2pm

Texo

Enterprise Application Stack for EMF

http://wiki.eclipse.org/Texo

http://download.eclipse.org/modeling/emft/texo/updates/interim

JPA + DAO

/**
 * 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;
      
  • Taking EMF to the Mobile Web / Theater at 4.30pm

Sonar Regex File Filter

Exclude generated code from your analysis

https://github.com/Obeo/fr.obeo.sonar.plugin.regexfilefilter

mvn clean package

Sonar

  • Feedback

Wikitext Bridge (Mylyn Intent)

Get a model from a wiki page

http://www.eclipse.org/intent/

http://download.eclipse.org/releases/juno

Aggregate Wiki pages in a Single HTML document

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());
  }
      
  • Feedback

<Thank You!>