C H A P T E R  1

Sun ONE Studio 5 update 1 Overview

This chapter provides an overview of the various parts of the Suntrademark ONE Studio 5 update 1 (Studio) IDE, and emphasizes the use of the visual tools for developing Suntrademark ONE Application Framework Web applications.

The terms Sun ONE Web App, and Sun ONE Application Framework application, are synonymous, and are used interchangeably throughout this document.

This document focuses on the Explorer window of the Sun ONE Studio 5 update 1. Most of the Explorer tabs provide different views of your application's file system structure, while other tabs might present other portions of the Sun ONE Studio 5 update 1 environment. Some of these tabs might be outside the scope of this document.

A completed version of the JatoTutorial application is used as a reference for demonstrating the various features of the Sun ONE Application Framework tools. If you have completed the JatoTutorial, you are familiar with the objects of this Sun ONE Application Framework application. If you have not completed the JatoTutorial, you might find it helpful to do so before proceeding with this document.

For complete documentation on the basic features of the NetBeans-based Sun ONE Studio 5 update 1, visit the NetBeans online documentation at: http://usersguide.netbeans.org/gwd/index.html

The following figure shows a complete view of the Sun ONE Studio 5 update 1 showing the Sun ONE Application Framework Workspace.

This figure shows a complete view of the Sun ONE Studio 5 update 1 showing the Sun ONE Application Framework Workspace. 

Any of the windows in one workspace can be included in any workspace. Default workspaces and layouts have been provided by the Sun ONE Studio 5 update 1 to get you started. Therefore, you are not required to do Sun ONE Application Framework application development in the Sun ONE Application Framework workspace.


Sun ONE Studio 5 update 1 Projects

Sun ONE Studio 5 update 1 projects provide you with an IDE sandbox, which is a way to isolate different development environments that you can customize for several different development efforts. When you run the Sun ONE Studio 5 update 1 for the first time, you are working in the default Sun ONE Studio 5 update 1 project.

For example, suppose you have an assignment that requires working with J2ME for wireless applications. You could mount all the necessary libraries and file systems, set compiler, editor, and build options, and more, that are unique for that particular project.

In another assignment, you might be working with CORBA, RMI, and rich GUI clients. This might require the mounting of several other kinds of libraries and file systems, and it might require very different build configurations.

Another scenario might be that you are tasked with maintaining a Web application framework at the company for which you are employed. In your spare time, you might work on an open source application server effort. These two projects could be placed into separate Sun ONE Studio 5 update 1 projects: Real Job Project and Open Source Project.



Note - Before you create or open a project, make sure that all Sun ONE Studio 5 update 1 invoked processes are shutdown first to ensure a quick and clean project switchover. Go to the Runtime tab in the Explorer window, expand the Processes node, and terminate all running processes (right-click the process and select Terminate Process).



For additional information about Sun ONE Studio 5 update 1 projects, visit the NetBeans online documentation at: http://usersguide.netbeans.org/gwd/gwd_project_setup.html#projects

Creating a New Sun ONE Studio 5 update 1 Project

To create a new Sun ONE Studio 5 update 1 project, select the Project | Project Manager menu option, click New, and provide a project name when prompted. A new Sun ONE Studio 5 update 1 project is created and opens. You can configure the project as required.

Opening a Sun ONE Studio 5 update 1 Project

To open another Sun ONE Studio 5 update 1 project, select the Project | Project Manager menu option. From the list of projects, select the project that you want to open and click the Open button. If the Open button is not enabled when you select the project name, that project is the currently open project.



Caution - If you want to mount multiple Sun ONE Application Framework applications in the same Sun ONE Studio 5 update 1 project, be sure that all of those applications are using the same version of the Sun ONE Application Framework JAR (jato.jar). You might not encounter any issues at all, but there could be compilation ambiguities.




Sun ONE Studio 5 update 1 Workspaces

Toward the top of the Sun ONE Studio 5 update 1, there is a set of tabs just under the Sun ONE Studio 5 update 1 toolbars. Each of these tabs is a separate workspace. These workspaces are contained within the Sun ONE Studio 5 update 1 project (see Sun ONE Studio 5 update 1 Projects). Unlike Sun ONE Studio 5 update 1 projects, workspaces are not sandboxes, but instead all share the resources available in the current Sun ONE Studio 5 update 1 project.

The following figure shows Sun ONE Studio 5 update 1 Workspaces.

This figure shows Sun ONE Studio 5 update 1 Workspaces. 

Sun ONE Studio 5 update 1 workspaces allow you to create customized layouts to perform specific tasks. For example, the Editing workspace contains many windows that facilitate creating and building your applications. The Debugging workspace has windows that focus on working with the built-in debugger. There is nothing unique about the different workspaces that have been provided in the Sun ONE Studio 5 update 1 by default. You can configure the Editing workspace to include all of the windows that appear in the Debugging workspace, and vice versa. The Sun ONE Studio 5 update 1 presents these default workspaces as a means of organizing certain application development tasks. You can create a new workspace of your own and name it whatever you want, and add whatever windows you want (for example, Output, Explorer, Properties, and so on).

The Sun ONE Application Framework workspace displays much like the Editing workspace. Conversely, at any time, you can customize the Sun ONE Application Framework workspace to include any of the other IDE features that are not part of its default layout. Also, you should not assume any special relationship between the Sun ONE Web Apps tab and the Sun ONE Application Framework workspace. The Sun ONE Web apps tab can be included in any of the other workspaces.

For additional information about Sun ONE Studio 5 update 1 workspaces, visit the NetBeans online documentation at: http://usersguide.netbeans.org/gwd/gwd_project_setup.html#workspaces


Sun ONE Studio 5 update 1 Explorer Tabs

The Sun ONE Studio 5 update 1 has a window with one or more tabs. Often, there are as many as four different tabs, as follows:

However, this can vary, as the Sun ONE Studio 5 update 1 allows for extreme layout customization. Each of these tabs exposes the Sun ONE Studio 5 update 1 environment in a different way.

For additional information about the Sun ONE Studio 5 update 1 Explorer window, visit the NetBeans online documentation at: http://usersguide.netbeans.org/gwd/gwd_project_setup.html#explorer

Filesystems Tab

The Filesystems tab of the Explorer window displays all currently mounted directories, as shown in the following figure.

This figure shows the Filesystems tab of the Explorer window that displays all currently mounted directories. 

When you create a new Sun ONE Application Framework application, the Web Context directory (also known as servlet context or base Web application directory) is mounted automatically. Any JAR files located in the WEB-INF/lib directory of your Sun ONE Application Framework application are also mounted. Although these JAR files only physically exist in the WEB-INF/lib directory, they are displayed at the top level node.

As you add Sun ONE Application Framework components that require additional libraries (for example, jaxrpc-api.jar, and others for Web Service models) or when you manually copy JAR files to your application's WEB-INF/lib directory, the Sun ONE Studio 5 update 1 automatically mounts these new JAR files. The Sun ONE Studio 5 update 1 might not recognize a new JAR file immediately. This is dependent upon the refresh rate setting for your Sun ONE Studio 5 update 1 configuration.

Besides the virtual view of the JAR files, the Filesystems view provides the raw directory and file layout as found in your operating system's file system. As a Sun ONE Application Framework application developer, you do not need to spend much, if any, time in this view.

Project Tab

For Web applications, such as a Sun ONE Application Framework application, the Project tab displays a logical (flattened) view of your Web application's directory structure, as shown in the following figure.

This figure shows the Project tab with a logical (flattened) view of your Web application's directory structure. 

Like the JAR files in the Filesystems tab, some buried nodes are mounted at the top level node for convenient access. As a Sun ONE Application Framework application developer, you probably never need to view this tab.

Runtime Tab

The Runtime tab shows various resources available in the Sun ONE Studio 5 update 1 in the form a tree node structure.

Nodes that you might interact with while developing applications (not limited to Web applications or Sun ONE Application Framework Web applications) are as follows:

The following figure shows the Runtime tab.

This figure shows the Runtime tab. 

Server Registry Node

Server Registry contains a list of all the servlet containers that can be managed and utilized from within the Sun ONE Studio 5 update 1. Tomcat and Sun ONE Application Server are two such servlet containers that come with the Sun ONE Studio 5 update 1. You might have to visit the Sun ONE Studio 5 update 1 Update Center to download and install the module if it has not already been installed by default.

Processes Node

Processes lists any processes that were launched (and are still running) by the Sun ONE Studio 5 update 1. When you compile your application, the compilation process displays in Processes until it has finished its task. When you test run your application, the servlet container process is listed here.

The servlet container remains running until you shut it down. To shut down any process launched by the Sun ONE Studio 5 update 1, go to the Processes list, right-click the desired process, and select Terminate Process.

Shut down all processes launch by the Sun ONE Studio 5 update 1 before closing the Sun ONE Studio 5 update 1 or switching Sun ONE Studio 5 update 1 projects. Sun ONE Studio 5 update 1 projects are managed (created, deleted, opened) from the Sun ONE Studio 5 update 1 Project menu option. Sun ONE Studio 5 update 1 projects are outside the scope of this document.

Databases Node

Databases is a list of all the RDBMS drivers and connections that have been configured in the Sun ONE Studio 5 update 1. There is a Drivers folder subnode, and potentially a list of database connections.

The Drivers folder node has a list of many vendor database driver versions. If the drivers for a particular database are available to the Sun ONE Studio 5 update 1, the Drivers folder node is enabled. Otherwise, it is disabled (a diagonal, red line through its icon). You can add new drivers by right-clicking the Drivers folder node, selecting the Add Driver action, and supplying the required driver information in the dialog box that is presented. You must also make the driver available to the Sun ONE Studio 5 update 1 by placing it in the Sun ONE Studio 5 update 1 lib/ext directory.

The connections, if any, can be connected (represented by a complete icon), or disconnected (represented by a broken icon). To connect a connection, right-click the connection node and select the Connect or Connect As action. You are prompted for the required connection information (username, password, and so on). To complete the connection, the target database server must be running, so be sure the preferred database server is started and accessible. To disconnect, right-click the connection and select the Disconnect action.

You can add new connections by right-clicking the Databases node and selecting the Add Connection action. You are prompted with the database type, location, and connection information. Before attempting to create a connection to the database, be sure, as described earlier in this section (Databases Node), that the proper driver is available to the Sun ONE Studio 5 update 1.

Sun ONE Web Apps Tab

The Sun ONE Web Apps tab provides a user friendly view of your Web application. You can mount one or more Sun ONE Application Framework applications in this tab. Mounting a Sun ONE Application Framework application also mounts it as a Filesystem in the Filesystems tab, and as a Web module in the Project tab. Within each mounted Sun ONE Application Framework application there are three top level nodes, as follows:

Each of these nodes is introduced in Chapter 2, Sun ONE Web Apps Tab Overview, with details on creating and mounting Sun ONE Application Framework applications.