<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to you under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">

<document> 
  <header> 
    <title>Using the 10 Core and 1.1 UI Derby plug-ins</title> 
  </header> 
  <body> 

<p>
This paper lists the components and functionality of the Derby plug-ins 
for Eclipse.  Also, installation and how to use the plug-ins is discussed. 
It's helpful to have some knowledge of Eclipse prior to reading this paper,
however, the accompanying help for the plugin is sufficient to allow new 
Eclipse users to succeed in creating a simple application in Eclipse 
using the Derby plug-ins.
</p>

<section>
<title>Architecture of the plug-ins</title>

<p>
The Derby Core, UI and Help plug-ins are all available in source and binary
form. 
</p>
<p>
Listed below are the contents of the most recent versions of the three plug-ins:
</p>

<table>
<tr>
<th>Binary Zip file name</th>
<th>Plugin name</th>
<th>Source location</th>
<th>Contents</th>
</tr>
<tr>
<td>derby_core_plugin_10.3.1.zip</td>
<td>Derby Core Plug-in, org.apache.derby.core_10.3.1</td>
<td>The Derby Core plug-in can be built when the Derby jar files are built
from source.<br/><br/>
Follow the instructions in BUILDING.TXT on the <a href="http://db.apache.org/derby/derby_downloads.html#How+to+build+Derby">Apache Derby: Downloads</a> page, in
the How to build Derby section.</td>
<td>derby.jar, derbytools.jar, derbynet.jar, derbyclient.jar, plugin.xml</td>
</tr>

<tr>
<td>derby_ui_plugin_1.1.1.zip</td>
<td>Derby UI Plug-in, org.apache.derby.ui_1.1.1</td>
<td>trunk/plugins/eclipse/org.apache.derby.ui</td>
<td>ui.jar, plugin.xml</td>
</tr>

<tr>
<td>derby_ui_plugin_1.1.1.zip</td>
<td>Derby Plug-in Documentation, org.apache.derby.plugin.doc_1.1.1</td>
<td>trunk/plugins/eclipse/org.apache.derby.plugin.doc</td>
<td>html and image files contained in the topics directory, plugin.xml, toc.xml</td>
</tr>
</table>
</section>

<p>
The instructions in this guide assume that you have downloaded these releases.
If a more current release is available, download it instead and adjust these
instructions accordingly.
</p>

<section>
<title>Functionality</title>
<p>
After installing the Derby core plug-in the following jar files are present
in the Eclipse plug-ins subdirectory of org.apache.derby.core_10.3.x:
</p>

<ul>
<li>
derby.jar, derbytools.jar, derbynet.jar, derbyclient.jar
</li>
</ul>

<p>
The functionality of the core plug-in makes available these jar files, 
and thus the Derby database to Eclipse users, however no menu items 
or UI additions to the Eclipse environment are available.
</p>

<p>
After installing the Derby UI plug-in, UI components such as 
menu items and pop-up windows are available from any Eclipse 
project which has the Apache Derby nature added to it. After installing
the Help plug-in, the Derby plug-in Users Guide is installed in the 
Eclipse help system.
The UI plug-in has the core plug-in as one of its dependencies.  In 
other words, this plug-in will not work, and no menu items will appear 
if the core plug-in is not already installed. 
The specific functionality added to the Eclipse environment after the 
UI plug-in is installed is: 
</p>

<ul>
<li>
Add or remove the Derby nature from any Eclipse project
</li>
<li>
Ability to configure the Derby network server for each project, 
including the port number and derby.system.home
</li>
<li>
All Derby jar files are added to the Java Build Path of an Eclipse project
</li>
<li>
Run ij and entire SQL scripts from within Eclipse
</li>
<li>
Start and stop the network server from within Eclipse and track them for
each project
</li>
<li>
Run sysinfo from within Eclipse
</li>
</ul>
</section>

<section>
<title>Installing the plug-ins</title>

<p>
Prior to installing the plug-ins Eclipse 3.1M6 or higher must be installed.  
The current version of the plug-ins have been tested with Eclipse 3.2 GA.
</p>
<p>
The <a href="http://www.eclipse.org/downloads/index.php">downloads page</a> at
eclipse.org has the Eclipse 3.x SDK downloads.
</p>

<p>
The binary version of the core plug-in, which does not include the source, is 
available for download on each Derby release page at 
<a href="../derby_downloads.html">downloads.html</a>.
Download the derby_core_plugin_10.3.1.zip from
the <a href="http://db.apache.org/derby/releases/release-10.3.1.4.cgi">Derby
10.3.1.4</a> release page. 
To obtain the source for the UI and
documentation plug-ins in the form of an Eclipse PDE (Plug-in Development Environment) project first check out the source at trunk/plugins/eclipse/org.apache.derby.ui for the UI plugin, and trunk/plugins/eclipse/org.apache.derby.plugin.doc for the documentation plugin.  See the document <a href="Readme.html">Readme.txt</a> for complete instructions on how to build these two plugins from the source. 
</p>

<p>
Note that both the Core and the UI plug-in need to be installed
if any UI functionality is required, such as adding the Apache Derby
nature, running the Derby network server, etc. is desired. 
</p>

<p>
Unzip the core plugin files into the Eclipse home directory.  

The location where you installed Eclipse is referred to as ECLIPSE_HOME. 
For instance, this might be /eclipse in a Linux or Unix environment 
or C:/eclipse on Windows. Unzip the files to the ECLIPSE_HOME directory.
Copy the entire directory from the ui and help file plugin projects into
the plugins directory.  For instance you should have a a folder called
org.apache.derby.ui_1.1.1 and org.apache.derby.plugin.doc_1.1.1 after
downloading and creating the plug-in project in Eclipse.
Three new subdirectories should now exist under the ECLIPSE_HOME/plugins 
directory:
</p>

<ul>
<li>org.apache.derby.core_10.3.1</li> 
<li>org.apache.derby.ui_1.1.1</li>
<li>org.apache.derby.plugin.doc_1.1.1</li>
</ul>

</section>

<section>
<title>Incompatibilities with earlier version of the plug-ins</title>

<p>
Earlier versions of the plug-ins, specifically versions of the core plug-in
prior to 10.1.1 and version 1.1.1 of the UI plug-in are not supported or
any combination of the two.
</p>
</section>

<section>
<title>Uninstalling Previous Versions of the Plug-ins</title>

<p>
If you are already using previous versions of the plug-ins, pre 10.1.1 for
the Core and pre 1.1.1 for the UI plug-in you may uninstall them or simply
install the new versions of the plug-ins on top of them. 
</p>
</section>

<section>

<title>Launching Eclipse and Bringing up the Help</title>
<p>
If you are new to Eclipse, this section will help you get started
in using Eclipse by following the information contained in the Derby Plug-ins
User's Guide which is part of the Eclipse Help system.  This guide is useful
for both novice Eclipse users and experienced users.  If you are already 
familiar with Eclipse, skip this section, but refer to the Help for 
the plug-ins under  
<strong>Help >> Help Contents >> Derby Plug-ins User Guide</strong>.
Each task described in this paper is described in detail in this help
document.
</p>
<p>
Launch either eclipse.exe on Windows under the ECLIPSE_HOME directory, or 
eclipse in Linux or Unix environments under the ECLIPSE_HOME 
directory.  Accept the suggested default workspace called <em>workspace</em>.  
If this is the first time you have started Eclipse a Welcome window will 
appear.  Close this window.
</p>
<p>
Now bring up the Help for the Derby plug-ins which contains a tutorial and
examples of how to create an Eclipse project, add the Apache Derby nature,
and use the other menu items associated with the plug-ins.
From the main Eclipse menu at the top select 
<strong>Help >> Help Contents >> Derby Plug-ins User Guide</strong>.
Expand the <strong>Getting Started</strong> section in the Derby Plug-ins 
User Guide and refer to each step to learn how to create an Eclipse
project, add the Apache Derby nature and ultimately build a stand-alone 
application which accesses a Derby database.
</p>

</section>

<section>

<title>Adding the Apache Derby Nature to an Eclipse Project</title>
<p>
If you skipped the section above, <strong>Launching Eclipse and Bringing up 
the Help</strong>, launch Eclipse now after installing the plugins if you
have not already done so.
Either create a new project, or open an existing project.  The Apache 
Derby menu item will appear when the project folder is right-clicked.
</p>
<p>
To add the Apache Derby Nature to a project, right-click it and select
<strong>Apache Derby >> Add Apache Derby nature</strong>.  
</p>

<p>
<img src="../images/add_nature.GIF" alt="Adding the Derby Nature"></img>
</p>

<p>
Adding the Derby nature to your Eclipse project does the following:
</p>

<ul>
<li>
Adds the <strong>derby.jar, derbynet.jar, derbytools.jar, 
derbyclient.jar</strong> jar files to the Java Build Path of the project.<br/><br/>
</li>
<li>
Enables the Derby features for the project.  Several other menu items now
appear under the <strong>Apache Derby</strong> menu item. 
The <strong>ij</strong> and <strong>sysinfo</strong>
tools are now accessible from this menu, and the Apache Derby Network 
Server can now be started and stopped using this menu. <br/><br/>
</li>
<li>
Allows Apache Derby properties such as the port number the Network Server 
listens on, and the value for derby.system.home to be set for the project. 
</li>
</ul>

<p>
Follow the <a href="plugin_help/start_toc.html">Getting Started</a> 
section in the Plug-in documentation or use the Derby Plug-in Users Guide in
the Help to learn how to start the Network Server, use ij and sysinfo 
and build a Java application which uses Derby. 
</p>

</section>

<p><em>Last updated: January 4, 2007</em></p>

</body>
</document>
