3 Setting Up a Development Environment

This chapter describes how to set up an environment for developing WebLogic Server Administration Console extensions using JSP tag libraries, schemas, and base Java classes. An Administration Console extension is a collection of XML files, Java classes, JSPs, and other standard Web-related resources. You can use any text editor or Integrated Development Environment (IDE) to develop your extension.

This chapter includes the following sections:

Set Up the Classpath (Optional)

If you are creating Apache Struts classes or Beehive Page Flow classes for your extension, you need a set of Apache classes in your classpath. If you are adding nodes to the NavTreePortlet, you need a set of Oracle classes.

To add these classes to your classpath, run the following script:

WL_HOME\server\bin\setWLSEnv.cmd 

or

WL_HOME\server\bin\setWLSEnv.sh 

where WL_HOME is the directory in which you installed WebLogic Server.

Note:

On UNIX operating systems, the setWLSEnv.sh command does not set the environment variables in all command shells. Oracle recommends that you execute this command using the Korn shell or bash shell.

Instead of using Oracle's script, you can add to your environment's classpath all of the JAR files in the WL_HOME/server/lib/consoleapp/webapp/WEB-INF/lib directory.

Import Tag Libraries Into IDEs (Optional)

If you are using Oracle's JSP templates to create JSPs in your extension, you must use JSP tags from the JSP Standard Tag Library (JSTL), the Oracle Administration Console Extension Tag Library, and the Apache Beehive Page Flows Tag Library.

WebLogic Server installs a version of these tag libraries, which you can make available to your IDE. Alternatively, you can download your own copy of these standard tag libraries. For more information, see JSP Templates and Tag Libraries.

Create a Directory Tree for the Extension

An Administration Console extension is a portion of a Web application and its resources must be organized into a directory structure that satisfies the requirements for standard Java EE Web applications. In addition, the WebLogic Portal framework, Apache Struts, and Apache Beehive require configuration files to be in specific locations.

To start working on your Administration Console extension, create a directory tree that matches the skeletal structure in Table 3-1.

Table 3-1 Directory Tree for an Administration Console Extension

Directory Description
root-dir 

The root directory of your extension. Oracle recommends that you do not create files in this directory.

The name of the directory has no programmatic significance. Choose a name that is meaningful to you.

When specifying URIs in your extension, the "/" (forward slash) character by itself represents this root directory.

root-dir/WEB-INF 

This directory must contain a file named netuix-extension.xml. This XML file functions as your extension's deployment descriptor.

If you use Apache Struts, you must locate your Struts configuration file in this directory.

root-dir/WEB-INF/classes 

If your extension uses a message bundle, your properties files must be in this directory.

If your extension uses custom classes, your package structure must start in this directory. For example, if you packaged your class files in a package named com.mycompany.extension, then create the following directory structure in the classes directory: com/mycompany/extension. Then save your compiled class files in this extension directory.

(optional) root-dir/WEB-INF/src 

If your extension uses custom classes, Oracle recommends that you save your pre-compiled Java source files in a package structure that starts in this directory.

When you archive your extension, you do not include this src directory.

(recommended) root-dir/ext_jsp

Oracle recommends that you save all of your extension's JSP files below a directory named ext_jsp.

Creating a separate directory for your JSPs shields content developers from needing to learn about other support files such as the Portal framework XML files.

If your extension contains many JSPs, consider creating subdirectories below ext_jsp.

If you follow this recommendation, URIs for your JSPs will start with /ext_jsp. For example, /ext_jsp/myContent.jsp

The directory named root-dir/jsp is reserved. The root directory of your extension must not contain a directory named jsp.

(recommended) root-dir/controls

Oracle recommends that you save all of your extension's portal book files (.book) below a directory named controls.

If your extension contains many books or pages, consider creating subdirectories below controls.

If you follow this recommendation, URIs for your books or pages will start with /controls. For example, /controls/myBook.book.

(recommended) root-dir/portlets

Oracle recommends that you save all of your extension's portlet files (.portlet) below a directory named portlets.

If your extension contains many portlets, consider creating subdirectories below portlets.

If you follow this recommendation, URIs for your portlets will start with /portlets. For example, /portlets/myContent.portlet.


If you are extending the Administration Console's Look and Feel, your root directory will contain additional subdirectories. See Chapter 5, "Rebranding the Administration Console."

Configure Preferences to See UI Control Labels

WebLogic Server provides a configuration option for displaying the labels of the Administration Console's extension points. You use these labels to specify where you want your extension to display. To display these labels:

  1. In the Administration Console toolbar, click Preferences.

  2. Select the Extensions tab.

  3. Select Show Definition Labels.

  4. Click Save.

A field is displayed over each labeled control on the page. The field displays the value of the control's definitionLabel, prefixed by Book: or Label: to indicate whether it is a book or a label. See Figure 3-1.

Figure 3-1 Control Labels in the Administration Console User Interface

Description of Figure 3-1 follows
Description of "Figure 3-1 Control Labels in the Administration Console User Interface"