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

Difference between revisions of "Equinox Transforms"

m (How To Run The Examples)
(Updated to new bundle formats)
Line 3: Line 3:
 
==How To Run The Examples==
 
==How To Run The Examples==
  
# Download [http://fullmoon.torolab.ibm.com/downloads/drops/R-3.2.1-200609210945/index.php Eclipse 3.2.1] (or any subsequent maintenance release)While this hasn't been tested with Eclipse 3.3 yet there shouldn't be any issues with using 3.3 instead.
+
# Download [http://fullmoon.torolab.ibm.com/downloads/drops/R-3.2.1-200609210945/index.php Eclipse 3.2.1] or any subsequent release.  This code has been tested with 3.2.1, 3.3.2, and numerous 3.4 milestones up to and including M5.
 
# Check out the following projects from site :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse folder equinox-incubator:  
 
# Check out the following projects from site :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse folder equinox-incubator:  
#* ''org.eclipse.equinox.transforms''
+
#* ''org.eclipse.equinox.transforms.hook''
 +
#* ''org.eclipse.equinox.transforms.util''
 
#* ''org.eclipse.equinox.transforms.replace''
 
#* ''org.eclipse.equinox.transforms.replace''
 
#* ''org.eclipse.equinox.transforms.replace.images''
 
#* ''org.eclipse.equinox.transforms.replace.images''
Line 14: Line 15:
 
# Check out ''org.eclipse.osgi'' from :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse/ (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=143696 bug 143696] for why this is necessary)
 
# Check out ''org.eclipse.osgi'' from :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse/ (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=143696 bug 143696] for why this is necessary)
 
# From the Run menu, choose Run
 
# From the Run menu, choose Run
# locate the example launch you wish to run and run it.  They are named Replacement Transform Launch, Sed Transform Launch, and XSLT Transform Launch.  '''''Please note''''' that the Sed launch will not work if you do not have the sed program available on your path.
+
# locate the example launch you wish to run and run it.  They are named Replacement Transform Launch, Sed Transform Launch, and XSLT Transform Launch.  '''''Please note''''' that the Sed launch will not work if you do not have the sed program available on your path.  Please also note that the serialization of launches between different versions of Eclipse and between workspaces on varying OS platforms can sometimes be problematic.  You may need to go to the Plug-Ins tab in the launch configuration and choose "Add Required Plug-Ins" to ensure that you have all of the required bundles.
  
 
==How To Package Transformers for Distribution==
 
==How To Package Transformers for Distribution==
Line 21: Line 22:
 
The transformer bundles work via adaptor hooks.  As such, they are framework extensions and follow slightly different rules than other bundles.  For full documentation on how to use adaptor hooks in your application please see [[Adaptor Hooks]].
 
The transformer bundles work via adaptor hooks.  As such, they are framework extensions and follow slightly different rules than other bundles.  For full documentation on how to use adaptor hooks in your application please see [[Adaptor Hooks]].
  
#ensure that all bundles required for the desired transformations are available.  This typically means ''org.eclipse.equinox.transforms'' , the bundle implementing the desired transform type (ie: ''org.eclipse.equinox.transforms.xslt''), and the bundle that provides the transformation file(s) (ie: '''''org.eclipse.equinox.transforms.plugin'').
+
#ensure that all bundles required for the desired transformations are available.  This means typically means ''org.eclipse.equinox.transforms.hook'' , the bundle implementing the desired transform type (ie: ''org.eclipse.equinox.transforms.xslt''), and the bundle that provides the transformation file(s) (ie: ''org.eclipse.equinox.transforms.plugin'').
#create (either from scratch or by copying one from your existing product configuration) a config.ini file that has your transformation file bundle in the osgi.bundles property with an eager start level.  Ie: org.eclipse.equinox.transforms.xslt.plugin@1:\start.  See the config.ini in ''org.eclipse.equinox.transforms.xslt'' for an example.
+
#create (either from scratch or by copying one from your existing product configuration) a config.ini file that has your both the bundle inplmenting the transformer type (ie: ''org.eclipse.equinox.transforms.xslt'') as well as the bundle containing your particular transforms (ie: ''org.eclipse.equinox.transforms.plugin'') listed on the ''osgi.bundles'' line with an eager start level.  Ie: ''org.eclipse.equinox.transforms.xslt@1:\start, org.eclipse.equinox.transforms.xslt.plugin@1:\start''.  See the config.ini in ''org.eclipse.equinox.transforms.xslt.plugin'' for an example.
#ensure that the ''org.eclipse.equinox.transforms'' bundle and your transformation type bundles (ie: ''org.eclipse.equinox.transforms.xslt'') are expressed as framework extension bundles in the ''osgi.framework.extensions'' VM property.  Ie: ''-Dosgi.framework.extensions=org.eclipse.equinox.transforms,org.eclipse.equinox.transforms.xslt''  
+
#ensure that the ''org.eclipse.equinox.transforms.hook'' bundle is expressed as framework extension bundle via the ''osgi.framework.extensions'' property in the config.ini file.  Ie: ''osgi.framework.extensions=org.eclipse.equinox.transforms.hook''  
  
 
==How To Write Your Own Transformer==
 
==How To Write Your Own Transformer==

Revision as of 12:26, 22 February 2008

Projects exist in the equinox incubator that allow you to provide transformations of bundle resources at the OSGi level. Various example transformers exist (XSLT, sed, replacement) that can be used to transform any resource in a bundle including but not limited to plugin.xml, MANIFEST.MF, class files, etc.

How To Run The Examples

  1. Download Eclipse 3.2.1 or any subsequent release. This code has been tested with 3.2.1, 3.3.2, and numerous 3.4 milestones up to and including M5.
  2. Check out the following projects from site :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse folder equinox-incubator:
    • org.eclipse.equinox.transforms.hook
    • org.eclipse.equinox.transforms.util
    • org.eclipse.equinox.transforms.replace
    • org.eclipse.equinox.transforms.replace.images
    • org.eclipse.equinox.transforms.sed
    • org.eclipse.equinox.transforms.sed.manifest
    • org.eclipse.equinox.transforms.xslt
    • org.eclipse.equinox.transforms.xslt.plugin
  3. Check out org.eclipse.osgi from :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse/ (see bug 143696 for why this is necessary)
  4. From the Run menu, choose Run
  5. locate the example launch you wish to run and run it. They are named Replacement Transform Launch, Sed Transform Launch, and XSLT Transform Launch. Please note that the Sed launch will not work if you do not have the sed program available on your path. Please also note that the serialization of launches between different versions of Eclipse and between workspaces on varying OS platforms can sometimes be problematic. You may need to go to the Plug-Ins tab in the launch configuration and choose "Add Required Plug-Ins" to ensure that you have all of the required bundles.

How To Package Transformers for Distribution

Very rough ATM.

The transformer bundles work via adaptor hooks. As such, they are framework extensions and follow slightly different rules than other bundles. For full documentation on how to use adaptor hooks in your application please see Adaptor Hooks.

  1. ensure that all bundles required for the desired transformations are available. This means typically means org.eclipse.equinox.transforms.hook , the bundle implementing the desired transform type (ie: org.eclipse.equinox.transforms.xslt), and the bundle that provides the transformation file(s) (ie: org.eclipse.equinox.transforms.plugin).
  2. create (either from scratch or by copying one from your existing product configuration) a config.ini file that has your both the bundle inplmenting the transformer type (ie: org.eclipse.equinox.transforms.xslt) as well as the bundle containing your particular transforms (ie: org.eclipse.equinox.transforms.plugin) listed on the osgi.bundles line with an eager start level. Ie: org.eclipse.equinox.transforms.xslt@1:\start, org.eclipse.equinox.transforms.xslt.plugin@1:\start. See the config.ini in org.eclipse.equinox.transforms.xslt.plugin for an example.
  3. ensure that the org.eclipse.equinox.transforms.hook bundle is expressed as framework extension bundle via the osgi.framework.extensions property in the config.ini file. Ie: osgi.framework.extensions=org.eclipse.equinox.transforms.hook

How To Write Your Own Transformer

TBD

Back to the top