An extension for an IDE like JDeveloper is made out of
two major types of components:
The required classes
An XML manifest file
These components are bundled into a JAR file, which is then placed into a specific directory.
The "update center" manages this JAR file and its location.
There are a couple of update center sites managed by Oracle which JDeveloper is aware of.
In JDeveloper 10.1.3 the update center mechanism has been enhanced so that,
by providing the location of an "Update Center XML file" containing all the required
information on the web, anyone who wishes to write an extension can benefit from this facility.
JDeveloper will then automatically upgrade the installed extensions when and where necessary.
Before explaining this further it should be noted that each extension is uniquely identified
by an attribute called id
that belongs to the root element of the extension manifest,
called extension.
We will have to refer to this unique id when it will be about
having your extension managed by the JDeveloper update center facility.
First you will need to create an update center.
An update center is a specific XML document that can be reached through http.
This XML document will associate an extension - using the unique id we talked about above - and a
ZIP file containing:
the JAR file for the extension
another xml file named bundle.xml, in a META-INF directory
<?xml version = '1.0' encoding = 'UTF-8'?>
<update-bundle version="1.0"
xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle"
xmlns:u="http://xmlns.oracle.com/jdeveloper/update">
<u:update id="oracle.jdeveloper.extensions.sdk.installer">
<u:name>JDeveloper Extensions SDK Installer</u:name>
<u:version>0.1</u:version>
<u:author>Olivier Le Diouris</u:author>
<u:author-url>http://jroller.com/page/oliv</u:author-url>
<u:description>
Install the Extension SDK in your instance of JDeveloper
</u:description>
<u:requirements>
<u:requires-extension id="oracle.jdeveloper"
minVersion="10.1.3"
maxVersion="10.1.4" />
</u:requirements>
</u:update>
</update-bundle>
The text in bold refers to the id of the extension, that is stored in the extension manifest file, the
one called extension.xml, stored in the META-INF directory of the extension JAR file,
as in the following XML snippet:
As you can guess, it is critical to have a unique identifier for the extensions you
might write.
It is also a good practice to give the JAR file containing the extension a name made
of the extension id followed by the version.
The name of such a file would then be oracle.jdeveloper.extensions.sdk.installer.0.1.jar.
The bundle described above and the JAR file containing the extension have to be archived in a
zip structured this way:
In the example above, installer.zip is the file that will be placed in the update center, and
oracle.jdeveloper.extensions.sdk.installer.0.1.jar is the JAR file containing the extension.
If other archives are required for the extension to work, they can be stored in the zip as well.
They would be unarchived where they figure in the zip, so it is probably a good idea to have them in a sub-directory
so that the extension directory is not going to be polluted by too many files.
Giving that sub-directory a name based on the extension id is a good practice.
The last step is to refer to the zip described above from the update center.
As we said, the update center is an XML Document accessible on the web.
Again, let us take an example, we will call our XML document center.xml:
<?xml version="1.0" encoding="windows-1252" ?>
<updates version="1.0"
xmlns="http://xmlns.oracle.com/jdeveloper/updatecenter"
xmlns:u="http://xmlns.oracle.com/jdeveloper/update">
<u:update id="oracle.jdeveloper.extensions.sdk.installer">
<u:name>JDeveloper Extensions SDK Installer</u:name>
<u:version>0.1</u:version>
<u:author>JDeveloper Team</u:author>
<u:author-url>http://otn.oracle.com/products/jdev</u:author-url>
<u:description>Install the Extension SDK in your instance of JDeveloper</u:description>
<u:bundle-url>http://olediour-pc.us.oracle.com/ESDKInstaller/installer.zip</u:bundle-url>
</u:update>
<u:update id="...">
...
</u:update>
</updates>
Notice again the reference to the extension unique id.
Also, notice the element called bundle-url, that refers to the ZIP file described in the
previous section. See that it does not need to be on the same machine as this
XML document.
From JDeveloper, you can access any update center from the menu Help | Check for Updates.
In the wizard that pops up, you can then refer to the document we've described in the previous section:
Then let the wizard drive the process, and you will have the possibility to update
any extension, when necessary.
On the image above, the three first update centers come out-of-the-box with JDeveloper,
the fourth line being an update center added for the purpose of this document.
You can also notice that this operation can happen from a local file,
which would be in this case the ZIP file mentioned above, the one containing
the bundle.xml, and the extension JAR file.
With JDeveloper and the Ant support that is now provided, it is very easy
for an extension project to generate not only the JAR file required by the extension,
but also the zip containing the bundle and the jar, plus the XML document for the update center.
Here is an example of such an Ant build file, into which you might want to
take a look at the "bundle" target: