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

Spaces/Spi/PublisherSpi

< Spaces‎ | Spi

How can Eclipse Spaces Publishing be extended?

It is possible to extend Eclipse Spaces Publishing in the following ways:

  • Adding a Publishing Operation - this is done when a new way of writing artifacts into a space is needed
  • Adding UI specific for a Publishing Operation

These are described in more detail below

Publishing Operation

Adding publishing operations is done by extending the "org.eclipse.spaces.core" plugin by:

  • Implement "IPublishingOperationSelector" interface in the "org.eclipse.spaces.core.publisher.spi" and declare it in the extension point "publishingSelectors"

The IPublishingSelector returns instances of IPublishingOperation so an implementation of this interface is required. The extension should define a specific interface for the publishing operation e.g. "IMyPublishingOperation" and place that in a package that is exported to downstream plugins (most specifically it needs to be available by the ui plugin that should accompany the operations plugin - but more about that later).

i.e. private class MyPublishingOperation implements IPublishingOperation, IMyPublishingOperation { }

The IPublishingOperationSelector is given an ISpace and an IResource to operate on, and it can keep these for later. When the IPublishingOperation is told to execute, it will be asked to provide a standard Eclipse "Job" instance via a call to "getJob()". When returning the Job, it should be fully configured and prepared to execute the publishing task.

An IPublishingOperation should never write directly to the addresses specified by an ISpace - these are roots that are used by "org.eclipse.spaces.core.PublishingArea" to manage "top level folders" in the space.

A PublishingArea corresponds to a "typed folder". And an IPublishingOperation may want to create its own typed folder. (One type is "untyped"). The implementor of IPublishingOperation does not have to implement any areas, just ask for (or create) the wanted area. A Publishing area can also provide the addresses to its root (example, an "OSGi area" can provide the URL to use when using this area as an Eclipse Update Site).

Publishing Operation UI

The "org.eclipse.spaces.ui" plugin defines an extension point "publishingWizardFactories" where an IPublisingOperation specific wizard can be specified. To extend this point:

  • Declare an implementation of "IPublishingWizardFactory", and specify the publishing operation id this wizard will handle.
  • The extending plugin should declare the "org.myorg.mypublishingoperation" plug-in as a dependency so it gets access to the IMyPublishingOperation defined there.

Back to the top