|
|
||
|
|
The Java platform
|
|
||
|
|
|
|
||
|
|
In this chapter, we will cover the Oracle JDeveloper 10
g
Integrated Development Environment (IDE). We will cover the basics from acquisition and installation to basic structure and navigation through a simple Java development example. Next, some of the more advanced web development features of Oracle JDeveloper 10
g,
including the incredible Oracle ADF framework, will be discussed. Finally, we will wrap up with an advanced web development example
There are literally entire books devoted just to the topic of Oracle JDeveloper 10 g, so we will by no means be able to cover every detail of the topic in this chapter. What we will hopefully be able to do is to provide information for newcomers to the tool as well as for those who have been working with Oracle JDeveloper 10 g for a couple of versions. For those readers looking for a comprehensive manual on Oracle JDeveloper 10 g , the authors recommend the Oracle JDeveloper 10 g Handbook.
| Note |
The Oracle JDeveloper 10g Handbook is
|
With that said, let s get started!
|
|
||
|
|
|
|
||
|
|
The installation of Oracle JDeveloper 10 g is simpler than for most other Oracle products. There is no need to define an ORACLE_HOME environment variable prior to beginning the installation. Following a popular trend back toward simplicity in software management, Oracle JDeveloper 10 g is provided as a Zip file (or appropriate compression type depending on your installation platform) that you simply extract to a directory you wish to work in. To begin execution of Oracle JDeveloper 10 g on Windows, the developer simply executes the jdevw.exe file found in the <install location>\jdev\bin directory. To run on Linux/Unix, source the jdev script in the <install location>/jdev/bin directory:
. ./jdev
| Note |
Oracle JDeveloper 10g can be downloaded from OTN here: http://www.oracle.com/technology/products/jdev/index.html. |
|
|
||
|
|
|
|
||
|
|
One of the basic advantages that any IDE should provide to developers is increased levels of productivity. Oracle JDeveloper 10
g
excels in this area, particularly with the enhancement of its code generation tools as well as advanced integration of its visual modeling
After Oracle JDeveloper 10 g is installed, click the jdevw.exe executable to load the application. You will be greeted with the Oracle JDeveloper 10 g splash screen, and eventually the default Oracle JDeveloper 10 g work environment is displayed.
The main display areas can be seen in Figure 13-1. Oracle JDeveloper 10 g consists of the Applications Navigator, Structure pane, Editor pane, and message log. The function of each of these components will be discussed, as well as some additional panes and tabs included within.
Figure 13-1:
The initial Oracle JDeveloper 10g screen
The Applications Navigator is the main navigation point for visually identifying and managing the resources for your projects. It is the root position for all of the code that developers work with while developing applications in Oracle JDeveloper 10
g.
Applications are the highest level of organization for project code. In previous versions of Oracle JDeveloper 10
g
, these were called workspaces and had their configuration information
Adding code to the Applications Navigator is easy. Click File New to bring up the New Gallery. From here, select General in the drill-down on the left and Application Workspace on the right. This takes you into the New Application Workspace Wizard, as shown in Figure 13-2.
Figure 13-2:
The Create Application Workspace dialog box
Here, developers are prompted for information including the
| Note |
Of special importance is the application template. This is a new feature added with Oracle JDeveloper 10g that allows for an added measure of productivity. Templates
|
You can also take a shortcut into the Application Workspace Wizard by simply right-clicking the word applications at the highest level of the Applications Navigator drill-down and selecting New Application Workspace.
Should you already have an existing application, you can add it to the Applications Navigator by clicking File Add To Applications and then navigating to the location of the .jws file that contains the details of the application you wish to add. As a shortcut, you can also click the green + in the far upper left of the Applications Navigator pane.
After the application, the
| Tip |
While on the topic of the file system, within the project folder on the file system you will find two additional
|
There are several properties that can be managed from the project level that are of importance when doing development in Oracle JDeveloper 10 g. To access the project properties as shown in Figure 13-3, you can right-click the project in question and select Project Properties. Alternatively, you can select the project you wish to manage and click Tools Project Properties or just double-click the project. There is also a shortcut at the top of the Applications Navigator you can use by selecting the project in question and clicking the icon that is third from the left.
Figure 13-3:
The Project Properties dialog box
Most of the options are
| Note |
Libraries are simply a way of binding a representative name to a set of code that is not directly a part of this project. In addition to all of the default libraries that come bundled with Oracle JDeveloper 10g, you can also create your own libraries when you wish to integrate custom-developed or third-party source trees. To do this, you simply select the New button in the dialog and follow the steps to bind a name to the source you wish to have comprise this library. Note that if you are
|
There are two additional tabs in the Applications Navigator pane to be aware of. The first one is the Connections tab. This tab segregates out the external connection information that you have configured for Oracle JDeveloper 10 g. This can include connections to an Application Server (like Oracle Application Server 10 g ), a database, a CVS server, a designer work area (for Oracle Designer repository), a SOAP server, a UDDI Registry (for web services), or a WebDAV server.
| Note |
WebDAV is a standard used to save data to a web site (as opposed to just reading it from a site). The IETF WWW Distributed Authoring and Versioning working
|
Several
The second additional tab of interest is the Run Manager tab. This tab allows you to keep track of the active processes that Oracle JDeveloper 10 g has spawned. When you wish to do local testing or debugging, Oracle JDeveloper 10 g loads your code into a local stand-alone version of the OC4J container that it spawns.
| Note |
See 2 for more information on OC4J. |
When you reach a condition where you wish to bring down the local instance (for example, when you re done testing) you would navigate to the Run Manager tab and right-click the OC4J instance, selecting Shutdown.
The Editor pane is exactly what it sounds like. It is the area where developers will be doing their actual coding. Whenever you wish to modify a file that is contained within your Applications Navigator, it is loaded into the Editor pane and edited as you choose. Loading something into the Editor pane also has a noticeable effect on your environment. First of all, the Structure pane in the lower left-hand corner becomes
The editor contains several productivity enhancements that would be expected of a fully realized IDE, including
The absolute basics include compiling and running your code from the editor. To compile a source loaded into the editor, you right-click
If you
One of the nicer productivity enhancements made to the editor in 10 g was the ability to split large documents into multiple panes and have them both available within the editor at the same time. To do this, select the Window Split Document option. When you re finished, select Window Unsplit Document to return to normal viewing. Also, if you have more than one document open, you can open up a new, separate Editor pane by selecting Window New Tab Group.
Those developers familiar with Microsoft Visual Studio should feel a
Figure 13-4:
Oracle JDeveloper10g in design mode
The component palette is an essential part of the visual design process for client-
Figure 13-5:
The Create Palette Page dialog box
This can be done in design mode or source mode. When you re working in design mode, it is often a part of WYSIWYG (what you see is what you get) design and development. This, in conjunction with the property inspector and ADF framework (which we will cover later), makes Oracle JDeveloper 10 g an excellent option for a RAD (Rapid Application Development) or rapid prototyping IDE.
One of the other included tabs in the component palette is the Data Controls tab. This contains items either that you have developed through the ADF framework as ADF BCs (ADF business components) or that you have explicitly
Developers can also utilize the component palette to provide a way to disseminate reusable components to your project team. One of the major benefits of JSP development is that it provides for an architecture where presentation developers can be productive without
How does the component palette help accomplish this? One of the capabilities of the component palette is to allow a project architect to disseminate the project s custom tag library to all of the presentation developers, while affording them access to it through a point-and-click interface. With the appropriate technology selected in the Technology drop-down, simply right-click the field of the palette. Suppose we want to create a page that contains all of the custom tags for our project. In this case, we will
Now that we have our component palette page created, we can proceed to add custom tags to that page. The actual tags
Figure 13-6:
The Add JSP Tag Components dialog box
You are then presented with another dialog box that prompts you for information about your taglib. This information is the same information that you would provide when registering your taglib in the web.xml file of a web application. This stands to reason, as the idea behind the component palette is to allow you to click your way to an application. The component palette needs this information so that it
Once you have registered your taglib, the dialog containing the registered taglibs will now also contain your newly registered taglib. Locate your taglib and drill into it to list the available tags to be added to the project palette. Select the tag you would like to add (using SHIFT and CTRL as normal for multiselecting) and click OK. A confirmation dialog will come up asking you Install jsp tag(s)? Click Yes and your new tag should appear in the component palette.
Congratulations! You ve just configured your project to take advantage of one of the biggest and most underused productivity tools provided for JSP development.
The Structure pane is where you can see the structure of the selected item or active code in the Editor pane (if
Figure 13-7:
The Connections view of the Oracle JDeveloper 10g Navigator
As an example of how flexible the Structure pane is, if you shift your focus to an HTML source in the Editor pane, the Structure pane will reflect the structure of the HTML code displayed there. The Structure pane can be of assistance when doing web development in several ways. First of all, as HTML is an interpreted language, there is no compiler to do syntax checking. Most developers have had the experience of trying to put together HTML pages with the type and test method. This is where you are trying to get a page to look a certain way but for some reason it stubbornly refuses. Eventually, the development gets bogged down into changing a line or two, reloading the page and checking it, changing a few more lines, reloading again, ad nauseam.
The Structure pane can help developers avoid this fate by providing not only a visual cue of the structure of the page but also a substitute for a compiler over this interpreted language. This is provided in the drill-down called HTML Errors that appears at the top of the Structure pane when interrogating an HTML source. As you drill into this, it will list the warnings and errors that the pane has
The Structure pane really isn t doing anything
There really isn t a great deal to say about the message log. As is
| Tip |
If the Allow Program Input option is selected in the project options, you can also enter in the parameters requested from an application (stdin.readLine();). |
|
|
||
|
|