creation of external bundles
Download
Skip this Video
Download Presentation
Creation of external bundles

Loading in 2 Seconds...

play fullscreen
1 / 15

Creation of external bundles - PowerPoint PPT Presentation


  • 184 Views
  • Uploaded on

Creation of external bundles . Gendoc2 v1.0.1 2010/03/29. External bundles usage. External bundles are used to : Provide a set of Java services that will be used inside Gendoc2 scripts Group services by functionality or model type ex : Requirements, UML, …

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Creation of external bundles' - lynsey


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
creation of external bundles

Creation of external bundles

Gendoc2 v1.0.12010/03/29

external bundles usage
External bundles usage
  • External bundles are used to :
    • Provide a set of Java services that will be used inside Gendoc2 scripts
    • Group services by functionality or model type ex : Requirements, UML, …
  • External bundles can be used inside gendoc2 scripts :
    • Imported by default or imported explicitly using the attribute ‘importedBundles’ of the tag
    • Bundle names are separated by a semicolon (‘;’) when importing several bundles in a script with attribute ‘importedBundles’ Example : => Bundles “topcased” and “requirements” are imported.
    • When a bundle has been imported, all services provided by the bundle can be used directly into Gendoc2 scripts that follow this context definition
creation of an external bundle
Creation of an external bundle

NOTE :

  • All the examples presented in the following steps refer to Acceleo technology for scripts.
  • For now, Acceleo language is the only script language handled by Gendoc2.
  • Acceleo language description is available at: http://wiki.eclipse.org/Acceleo
  • Steps to create an external bundle
    • Creation of an Acceleo project
    • Creation of an Acceleo generation file
    • References to the metamodel(s)
    • Creation of one (or several) Java file(s) containing a list of services
    • Creation of Acceleo queries mapped with Java methods
    • Registration to Gendoc2 extension point for external bundles
    • Export of the bundle as a plugin to integrate into Eclipse platform
creation of an acceleo project 1 3
Creation of an Acceleo project (1/3)
  • Create a new Acceleo project using menu File -> New … -> Acceleo project
  • Fill project name :(for example : org.topcased.gendoc2.bundle.acceleo.<>)
creation of an acceleo project 2 3
Creation of an Acceleo project (2/3)
  • Initialize the Acceleo generation file

Name of the generation module

Metamodelto use for generation

No impact for external bundles

creation of an acceleo project 3 3
Creation of an Acceleo project (3/3)
  • Overview of the generated plugin and generation file

Generatedbundle plugin

Metamodel URL

Generation file

Module name

Useless for bundles(Can be deleted manually)

Acceleo script

creation of java services
Creation of Java services
  • Create Java classes containing the Java services into the bundle plugin
mapping java services to acceleo queries
Mapping Java services to Acceleo queries
  • Inside Acceleo file (.mtl) :
    • Remove generated part containing [template …]
    • Add necessary metamodels (separated by ‘,’)
    • For each Java service needed, add a query with :
      • A name
      • A list of typed parameters
      • A return type
      • An invoke of the Java method

Metamodel(s)

Java class

Java method

Input parameters

registration to gendoc2 extension point 1 4
Registration to Gendoc2 extension point (1/4)
  • Add a dependency to org.topcased.gendoc2.script.acceleo plugin
    • Inside MANIFEST.MF file, in “Dependancies” tab, clic on button “Add”
registration to gendoc2 extension point 2 4
Registration to Gendoc2 extension point (2/4)
  • Inside tab “Extensions” of MANIFEST.MF, clic on ‘Add’
    • Select the extension point to register to : “org.topcased.gendoc2.script.acceleo.services”
registration to gendoc2 extension point 3 4
Registration to Gendoc2 extension point (3/4)
  • The extension definition needs :
    • A unique name
    • A .emtl file (corresponds to a compiled.mtl file) => can be found in /bin directory of the plugin instead of /src
    • A boolean :
      • If false : this bundle must be explicitely referenced inside “importedBundles” attribute of the tag
      • If true : bundle imported by default
registration to gendoc2 extension point 4 4
Registration to Gendoc2 extension point (4/4)
  • The list of metamodels that are necessary for the services provided must be associated to the extension. They can be added by a right-clic on the service
  • For each one, fill :
    • the metamodel name
    • the metamodel URL
export the external bundle plugin 1 2
Export the external bundle plugin (1/2)
  • Before exporting, indicate specifically the export of all .emtl file(s) present in /bin directory In “Build” tab of plugin.xml file :

Add .emtl file to binary build

export the external bundle plugin 2 2
Export the external bundle plugin (2/2)
  • Use export wizard, present in “Overview” tab of the plugin.xml file, indicating the output directory
  • Put the generated JAR file inside directory “dropins” of your Eclipse install.
  • Restart your Eclipse : the bundle is available for use
usage in a gendoc2 template document
Usage in a Gendoc2 template document
  • Add bundle name in the “importedBundles” attribute of tag(not necessary if the bundle has been created as “importedByDefault”)
  • Call the queries declared in the bundle inside tags
  • Generated :
ad