Skip Headers

Oracle® Application Development Framework Developer's Guide 10g Release 3 (10.1.3) B25386-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# 20.9 Package and Deploy Your Adapter to JDeveloper

Perform these steps to deploy your adapter to JDeveloper:

1. Create an `extension.xml` file in the `meta-inf` directory (the same directory that contains the `adapter-definition.xml` file).

   You need to do this because you are deploying the adapter as a JDeveloper extension. You use the `extension.xml` to add your JAR files to JDeveloper's classpath.

   The `extension.xml` file contains the following lines:

   Example 20-34 extension.xml

       <?xml version = '1.0' encoding = 'UTF-8'?>
       <extension xmlns="http://jcp.org/jsr/198/extension-manifest"
                   id="oracle.adfm.sample-adapters"
                   version="10.1.3.36.45"
                   esdk-version="1.0">
          <name>ADFm Sample Adapter</name>
          <owner>Oracle Corporation</owner>
          <dependencies>
             <import>oracle.BC4J</import>
             <import>oracle.j2ee</import>
          </dependencies>
          <classpaths>
             <classpath>../../BC4J/jlib/dc-adapters.jar</classpath>
             <classpath>../../jlib/sampledc.jar</classpath>
          </classpaths>

          <hooks>
             <!-- Adapter-specific data control library definitions -->
             <libraries xmlns="http://xmlns.oracle.com/jdeveloper/1013/jdev-libraries">
                <library name="Sample Data Control" deployed="true">
                   <classpath>../../jlib/sampledc.jar</classpath>
                </library>
             </libraries>
          </hooks>
       </extension>

   For details on the tags in the `extension.xml` file, see the file `JDEV_HOME/jdev/doc/extension/ide-extension-packaging.html`.

2. Create a JAR file that contains the class files for your adapter, the `adapter-definition.xml` file, and the `extension.xml` file. The XML files must be in a `meta-inf` directory.

   For the simple CSV adapter, the JAR file is called sampledc.jar, and it contains the following files:

   Example 20-35 sampledc.jar

       connections.xml
       extension/meta-inf/extension.xml
       meta-inf/adapter-definition.xml
       meta-inf/Manifest.mf
       oracle/adfinternal/model/adapter/sample/CSVHandler$1.class
       oracle/adfinternal/model/adapter/sample/CSVHandler.class
       oracle/adfinternal/model/adapter/sample/CSVParser.class
       oracle/adfinternal/model/adapter/sample/SampleDataControl.class
       oracle/adfinternal/model/adapter/sample/SampleDCAdapter.class
       oracle/adfinternal/model/adapter/sample/SampleDCDef.class

3. Copy the JAR file to the `JDEV_HOME/jlib` directory.

4. Create another JAR file to contain only the extension.xml file and the manifest file in the meta-inf directory. For the simple CSV adapter, the JAR file is called oracle.adfm.sampledc.10.1.3.jar, and it contains the following files:

   Example 20-36 oracle.adfm.sampledc.10.1.3.jar

       meta-inf/extension.xml
       meta-inf/Manifest.mf

5. Copy the second JAR file (for example, `oracle.adfm.sampledc.10.1.3.jar`) to the `JDEV_HOME/jdev/extensions` directory.

6. Stop JDeveloper, if it is running.

7. Start JDeveloper. When you right-click on a node type that your adapter supports, you should see the "Create Data Control" menu item.

If you want more information on JDeveloper extensions, you can download the Extension SDK:

1. In JDeveloper, choose Help | Check for Updates. This starts the Check for Updates wizard.

2. On the Welcome page of the wizard, click Next.

3. On the Source page, select Search Update Centers, and select all the locations listed in that section. Click Next.

4. On the Updates page, select Extension SDK. Click Next to download and install the extension SDK.

5. On the Summary page, click Finish. You will need to restart JDeveloper so that it can access the Extension SDK files.

   For help on the Extension SDK, open the JDeveloper's online help, and navigate to Extending JDeveloper > Extending JDeveloper with the Extension SDK.