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

JCR Management

Revision as of 06:18, 17 August 2008 by Sandro.boehme.gmx.de (Talk | contribs) (JCR Mangement (JCRM))

JCR Mangement (JCRM)

JCR Management will provide tooling and a JCR (http://en.wikipedia.org/wiki/Content_repository_API_for_Java) persistence framework for EMF with pluggable JCR implementations.


The Contributions

  • My employer inovex GmbH (http://www.inovex.de) contributes 7 person days where I can work on this project within working hours.
  • Ed Merks:
    • helps as a mentor for questions regarding the Eclipse foundation.
    • implemented a new feature request for EMF that I had (dynamic feature delegation)
    • answers a lot of my questions in the newsgroup
  • The ATL team contributed an initial meta model and transformation that will speed up ATL integration.
  • Nick Boldt created the initial JCR Management (CVS, website, ...) setup at eclipse.org

The Status

JCRM is not production ready at the moment. The current code base consists of prototypes that serve as a basis for concrete discussions about requirements and solutions.

The Tooling

EMF Class Editor

The class editor is based on the EMF Ecore model. This model is generated from the node types in the repository.

ClassEditor.png

Jackrabbit XML Nodetype Editor

This editor can be generated from a usual EMF model. It can be used to register an EMF model as node types. JackrabbitXMLNodetypeEditor.png

Jackrabbit CND Editor

This model is generated from the node types in the repository. It contains validation checks and a minimal code completion. It is based on oAW's XText which provides way more features for such editors than I currently use.

JackrabbitCNDEditor.png

Domain Model Editor

This is the editor that EMF generates but it is backed by a repository. Every change in the model immediately changes the underlaying repository. E.g. if you add a "Book" object in that editor node.addNode("NewNode","Book") is called. As soon as you save the editor session.save() is called. JCRMDomainModelEditor.png

The Framework

 public static void main(String[] args) {
 	// Create a resource set to hold the resources.
 	ResourceSet resourceSet = new ResourceSetImpl();
 	
 	// Register the appropriate resource factory to handle all file extensions.
 	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
 	("mydomainmodel", new demo.MyResourceFactory());
 
 	// Register the package to ensure it is available during loading.
 	resourceSet.getPackageRegistry().put
 		(MyDomainModelPackage.eNS_URI, 
 		 MyDomainModelPackage.eINSTANCE);
      
 	try {
               // Create a resource using the registered "mydomainmodel" extension
 		Resource resource = resourceSet.createResource(URI.createURI("http:///My.mydomainmodel"));
               // Craete a domain object. The constructor is generated to be protected but you 
               // can make it public if you want.
 		Library library = MyDomainModelFactory.eINSTANCE.createLibrary();
               // In contrast to the JCR specification EMF generally allows to have many root nodes.
               // JCRM puts the root node of the repository in the content of the resource where
               // it can get retrieved.
               // In Jackrabbit the root node of the repository is of type "root"
 		root rootNode = (root) resource.getContents().get(0);
 		rootNode.getResidualDefinition_base().add(library);
 		
 		library.setName_1_false("MyLibraryNameByAPI");
 		library.setNodeName("MyLibraryNodeNameByAPI");
 		Book aBook = MyDomainModelFactory.eINSTANCE.createBook();
 		library.getResidualDefinition_Book().add(aBook);
 		Writer aWriter = MyDomainModelFactory.eINSTANCE.createGuideBookWriter();
 		aBook.setAuthor_Writer(aWriter);
 		aWriter.setName_1_false("aGuidBookWritersNameByAPI");
 		aBook.setTitle_1_false("Book-TitleByAPI");
 		aBook.setPages_1_false("200ByAPI");
 		resource.save(System.out, null);
 	}
 	catch (IOException exception) {
 		exception.printStackTrace();
 	}
 }

Tasks

  1. See Bugzilla for an overview of the ToDo's https://bugs.eclipse.org/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&product=EMFT&component=JCR+Management&long_desc_type=allwordssubstr&long_desc=&order=Importance


Next Milestone

Create a first downloadable presentation of the project to show the potential of Eclipse modeling to the Jackrabbit community.

Ideas

  • Using Cedrics Compare editor inside the JCR Manager
http://www.eclipse.org/modeling/emft/?project=compare#compare

Values

  • simplicity
  • transparency
  • no dependency on JCR implementations

FAQ

  1. What's the relationship between JCR Management and Jackrabbit JCR-OCM?

One part of JCR Management has the same goal as JCR-OCM - exposing node data and operations to domain models - but JCRM uses an MDSD approach based on Eclipse Modeling Framework (EMF). This makes it depending less on reflection and using more generated classes instead. It will delegate as many calls on JCR node data as possible to minimize copying node data to domain model objects. Additionally JCR Management also has many other goals. But find out the details of JCR-OCM and check out the source code and the documentation.

CVS Access

Some important things are now checked in. Third party jars are not yet checked in as the IP for Jackrabbit needs to be reviewed by Eclipse. Please use the plugin id's as project names ("org.eclipse.emf.jcrm.metamodel" and "org.eclipse.emf.jcrm.model")

CVS Repository Connection

  • Server: dev.eclipse.org
  • Repository Path: /cvsroot/modeling
  • User: anonymous
  • Password: (leave blank)
  • Connection Type: pserver
  • Checkout As: Empty EMF Project

Modules

  • You can check out the plugins in the org.eclipse.emf/org.eclipse.emf.jcrm/plugins folder as CVS modules

Back to the top