Offline Lens - ftsrg/mondo-collab-framework GitHub Wiki

Offline Collaboration Architecture

Figure below illustrates the application of the collaboration server in the offline scenario. The gold VCS repository initially consists of three subsequent revisions of the front model. Users A and B are depicted; since different access control rules apply to them, different parts of the model has to be hidden from them. Neither user is allowed to directly access the gold repository, but using the GET operation, a front repository is automatically derived for both of them. The front repositories mirror the three revisions in the gold repository, but with the appropriate model elements hidden or obfuscated in each revision. Both users can access their own front repository as a bonafide VCS repository; they can keep using their familiar VCS clients and modeling tools. In particular, users may check out either the newest revision, or any older one in the revision history; furthermore, they can commit new revisions. If User A creates a new revision and attempts to commit it to their front repository, the collaboration server executes PUTBACK . The commit will be rejected (with a helpful error message) if any of the modifications performed by User A were unauthorized, or conflicted with locks. Otherwise, PUTBACK will append a new revision to the gold repository that reflects the changes performed by User A on their front model, while preserving model details hidden from User A unchanged from the parent revision. Finally, new revisions in the gold model are automatically propagated via GET to front models that do not yet have them (in this case, the front model of User B).

Lens

How to create your lens application

  1. Open your eclipse

  2. Install MONDO Collaboration Framework

    1. Help -> Install New Software... -> Paste the following update-site http://mondo.inf.mit.bme.hu/web/mondo-collaboration/update/
    2. Select all the features
    3. Click on [Next] etc.
    4. You should restart your Eclipse to apply the changes after the install.
  3. Create a new Plug-in Project

    1. Right click in the package explorer -> New -> Project... -> Plug-in Project
    2. Name it as you wish.
  4. Add dependencies - open your MANIFEST.MF file in the default editor and switch to the "Dependencies" tab at the bottom of the editor.

    • org.mondo.collaboration.security.lens
    • [your metamodel]
  5. Add extensions - open your MANIFEST.MF file in the default editor and switch to the "Extensions" tab at the bottom of the editor

    • org.mondo.collaboration.security.lens.uniqueIDSchemeFactory
      • create a new "scheme-factory-class"
  6. Implement "scheme-factory-class"

    import org.eclipse.emf.common.util.URI;
    import org.eclipse.emf.ecore.EObject;
    import org.mondo.collaboration.security.lens.correspondence.ComposableIDFunction;
    import org.mondo.collaboration.security.lens.correspondence.DefaultEMFUniqueIDFunctions;
    import org.mondo.collaboration.security.lens.correspondence.EObjectCorrespondence.UniqueIDScheme;
    import org.mondo.collaboration.security.lens.correspondence.EObjectCorrespondence.UniqueIDSchemeFactory;
    
    public class UniqueIdSchemeFactory implements UniqueIDSchemeFactory {
    
        @Override
        public UniqueIDScheme apply(URI input) {
            return ComposableIDFunction.dispatchTo(WTUniqueID.INSTANCE, DefaultEMFUniqueIDFunctions.forBaseURI(input));
        }
    
        public static class WTUniqueID extends ComposableIDFunction {
            public final static WTUniqueID INSTANCE = new WTUniqueID();
    
            @Override
            public Object tryApply(EObject input) {
                // You have to implement this method!!!
                return null;
            }
        }	    
    }		
    

    You have to implement the "tryApply(EObject input)" method which responsible for calculating a unique ID for each input objects. (For instance, returns the value of an "id" attribute if it exists)

  7. Add a "Product Configuration" to the project

    • Right click on the project -> New -> Other -> Product Configuration
    • Set at least the following configurations:
       	<plugins>
             <plugin id="com.google.guava" version="15.0.0.v201403281430"/>
             <plugin id="com.google.inject"/>
             <plugin id="com.google.inject.multibindings" fragment="true"/>
             <plugin id="com.ibm.icu"/>
             <plugin id="javax.inject"/>
             <plugin id="javax.xml"/>
             <plugin id="org.antlr.runtime" version="3.2.0.v201101311130"/>
             <plugin id="org.apache.commons.cli"/>
             <plugin id="org.apache.commons.lang"/>
             <plugin id="org.apache.commons.logging"/>
             <plugin id="org.apache.felix.gogo.command"/>
             <plugin id="org.apache.felix.gogo.runtime"/>
             <plugin id="org.apache.felix.gogo.shell"/>
             <plugin id="org.apache.log4j"/>
             <plugin id="org.eclipse.core.commands"/>
             <plugin id="org.eclipse.core.contenttype"/>
             <plugin id="org.eclipse.core.expressions"/>
             <plugin id="org.eclipse.core.filesystem"/>
             <plugin id="org.eclipse.core.filesystem.java7" fragment="true"/>
             <plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
             <plugin id="org.eclipse.core.jobs"/>
             <plugin id="org.eclipse.core.resources"/>
             <plugin id="org.eclipse.core.runtime"/>
             <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
             <plugin id="org.eclipse.core.variables"/>
             <plugin id="org.eclipse.debug.core"/>
             <plugin id="org.eclipse.emf.cdo.ecore.retrofit" fragment="true"/>
             <plugin id="org.eclipse.emf.codegen"/>
             <plugin id="org.eclipse.emf.codegen.ecore"/>
             <plugin id="org.eclipse.emf.common"/>
             <plugin id="org.eclipse.emf.ecore"/>
             <plugin id="org.eclipse.emf.ecore.xmi"/>
             <plugin id="org.eclipse.emf.mwe.core"/>
             <plugin id="org.eclipse.emf.mwe.utils"/>
             <plugin id="org.eclipse.emf.mwe2.language"/>
             <plugin id="org.eclipse.emf.mwe2.launch"/>
             <plugin id="org.eclipse.emf.mwe2.runtime"/>
             <plugin id="org.eclipse.equinox.app"/>
             <plugin id="org.eclipse.equinox.common"/>
             <plugin id="org.eclipse.equinox.console"/>
             <plugin id="org.eclipse.equinox.ds"/>
             <plugin id="org.eclipse.equinox.event"/>
             <plugin id="org.eclipse.equinox.frameworkadmin"/>
             <plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
             <plugin id="org.eclipse.equinox.p2.artifact.repository"/>
             <plugin id="org.eclipse.equinox.p2.core"/>
             <plugin id="org.eclipse.equinox.p2.director"/>
             <plugin id="org.eclipse.equinox.p2.directorywatcher"/>
             <plugin id="org.eclipse.equinox.p2.engine"/>
             <plugin id="org.eclipse.equinox.p2.extensionlocation"/>
             <plugin id="org.eclipse.equinox.p2.garbagecollector"/>
             <plugin id="org.eclipse.equinox.p2.jarprocessor"/>
             <plugin id="org.eclipse.equinox.p2.metadata"/>
             <plugin id="org.eclipse.equinox.p2.metadata.repository"/>
             <plugin id="org.eclipse.equinox.p2.publisher"/>
             <plugin id="org.eclipse.equinox.p2.publisher.eclipse"/>
             <plugin id="org.eclipse.equinox.p2.reconciler.dropins"/>
             <plugin id="org.eclipse.equinox.p2.repository"/>
             <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse"/>
             <plugin id="org.eclipse.equinox.preferences"/>
             <plugin id="org.eclipse.equinox.registry"/>
             <plugin id="org.eclipse.equinox.security"/>
             <plugin id="org.eclipse.equinox.simpleconfigurator"/>
             <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
             <plugin id="org.eclipse.equinox.util"/>
             <plugin id="org.eclipse.incquery.patternlanguage"/>
             <plugin id="org.eclipse.incquery.patternlanguage.emf"/>
             <plugin id="org.eclipse.incquery.runtime"/>
             <plugin id="org.eclipse.incquery.runtime.base"/>
             <plugin id="org.eclipse.incquery.runtime.base.itc"/>
             <plugin id="org.eclipse.incquery.runtime.evm"/>
             <plugin id="org.eclipse.incquery.runtime.matchers"/>
             <plugin id="org.eclipse.incquery.runtime.rete"/>
             <plugin id="org.eclipse.incquery.runtime.rete.recipes"/>
             <plugin id="org.eclipse.jdt.compiler.apt" fragment="true"/>
             <plugin id="org.eclipse.jdt.compiler.tool" fragment="true"/>
             <plugin id="org.eclipse.jdt.core"/>
             <plugin id="org.eclipse.jdt.debug"/>
             <plugin id="org.eclipse.jdt.launching"/>
             <plugin id="org.eclipse.osgi"/>
             <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
             <plugin id="org.eclipse.osgi.services"/>
             <plugin id="org.eclipse.text"/>
             <plugin id="org.eclipse.viatra.modelobfuscator.runtime"/>
             <plugin id="org.eclipse.xpand"/>
             <plugin id="org.eclipse.xtend"/>
             <plugin id="org.eclipse.xtend.lib"/>
             <plugin id="org.eclipse.xtend.lib.macro"/>
             <plugin id="org.eclipse.xtend.typesystem.emf"/>
             <plugin id="org.eclipse.xtext"/>
             <plugin id="org.eclipse.xtext.common.types"/>
             <plugin id="org.eclipse.xtext.ecore"/>
             <plugin id="org.eclipse.xtext.generator"/>
             <plugin id="org.eclipse.xtext.logging" fragment="true"/>
             <plugin id="org.eclipse.xtext.smap"/>
             <plugin id="org.eclipse.xtext.util"/>
             <plugin id="org.eclipse.xtext.xbase"/>
             <plugin id="org.eclipse.xtext.xbase.lib"/>
             <plugin id="org.eclipse.xtext.xtext.generator"/>
             <plugin id="org.mondo.collaboration.security.lens"/>
             <plugin id="org.mondo.collaboration.security.lens.offline.cli"/>
             <plugin id="org.mondo.collaboration.security.macl.xtext"/>
             <plugin id="org.mondo.collaboration.security.macl.xtext.rule"/>
             <plugin id="org.mondo.wt.cstudy.lens"/>
             <plugin id="org.mondo.wt.cstudy.metamodel"/>
             <plugin id="org.objectweb.asm"/>
             <plugin id="org.sat4j.core"/>
             <plugin id="org.sat4j.pb"/>
             <plugin id="org.tukaani.xz"/>
          </plugins>
       
          <configurations>
             <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
             <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
             <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
             <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
             <plugin id="org.eclipse.equinox.p2.reconciler.dropins" autoStart="true" startLevel="0" />
             <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
          </configurations>
       	
      
    1. Export the product
      • open you product configuration file
      • click on export button
      • follow the instructions there
⚠️ **GitHub.com Fallback** ⚠️