Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up examples repository on github and add examples to OSATE #1016

Closed
lwrage opened this issue Jan 17, 2018 · 1 comment · Fixed by #2233
Closed

Clean up examples repository on github and add examples to OSATE #1016

lwrage opened this issue Jan 17, 2018 · 1 comment · Fixed by #2233
Assignees
Milestone

Comments

@lwrage
Copy link
Contributor

lwrage commented Jan 17, 2018

There are various models that should probably be removed.

@lwrage lwrage added the backlog label Jan 18, 2018
@lwrage lwrage removed the backlog label Jul 9, 2019
@lwrage lwrage changed the title Clean up examples repository on github Clean up examples repository on github and add examples to OSATE Mar 5, 2020
@jjhugues
Copy link
Contributor

jjhugues commented Mar 10, 2020

Here is a proposed design for addressing this issue

  • create a examples directory in OSATE repository
  • create a plugin org.osate.examples that stores all examples as static resources in directory org.osate.examples
  • put all examples in examples subdirectory of org.osate.examples by copying the whole OSATE project.

This plugin will leverage existing Eclipse extension points to advertise examples, here is a snippet of plugin.xml to illustrate this

<plugin>
   <extension point="org.eclipse.ui.newWizards">     
    <category
        id="org.osate.examples.category"
        name="OSATE Examples"
        parentCategory="org.eclipse.ui.Examples">
    </category>
    
    <wizard category="org.eclipse.ui.Examples/org.osate.examples.category"
            class="org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard"
            icon="icons/aadl.gif"
            id="org.osate.examples.EMV2Examples"
            name="EMV2 Examples"
            project="true">
      <description>A collection of EMV2 examples</description>
    </wizard>        
   </extension>
   
  <extension point="org.eclipse.emf.common.ui.examples">
  	<example wizardID="org.osate.examples.EMV2Examples">
      <projectDescriptor name="ARP4761"
                         contentURI="examples/ARP4761/"
                         description="ARP4761 example"/>
      <projectDescriptor name="Stepper motor"
                         contentURI="examples/StepperMotor/"
                         description="Stepper Motor example"/>
  	</example>
  </extension>
</plugin>

From the UI, the user may simply go to File->New->Examples then select EMV2 examples. This will import directly the projects ARP4761 and StepperMotor in the user workspace.

As opposed to the previous approach, we directly import projects instead of selecting files or directories. The benefit is that it is a no code approach. We can define as many "project wizard" as required to bundle them as chapters, e.g "EMV2 examples", "FACE examples", etc.

Note that this is the approach used by Sirius, see https://github.com/pcdavid/org.eclipse.sirius/tree/master/plugins/org.eclipse.sirius.samples.family

It has been tested and works well.

A more sophisticated variant used by EMF is the following

I am not convinced we need this level of sophistication, as it duplicates effort and scatters examples outside of an eclipse plugin. This would makes the testing more complex (see #418)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants