Utility Tools

CHAPTER 16

Deployment Descriptor Editor

The Deployment Descriptor Editor provides a quick and easy way to construct and populate J2EE-compatible deployment descriptors. This chapter describes the Deployment Descriptor Editor and includes these topics:

 
Top of page

About deployment descriptors

A deployment descriptor is an XML document that provides information about the components of a J2EE module (such as a WAR or an EJB JAR) or application (EAR). The deployment descriptor provides data that is required for both of the following:

Sun has defined the contents and structure of a deployment descriptor for each J2EE archive. For more information, see J2EE Deployment Descriptor DTDs.

How deployment descriptors are created   exteNd Director automatically constructs and adds a J2EE-compatible deployment descriptor file to your project in the appropriate location, as follows:

J2EE archive

Deployment descriptor file

Directory location

Application client

application-client.xml

/META-INF

EAR

application.xml

EJB JAR

ejb-jar.xml

RAR

ra.xml

WAR

web.xml

/WEB-INF

As you add J2EE components to a project, exteNd Director adds the corresponding elements to the deployment descriptor when it has enough information to do so.

 
Top of page

About the Deployment Descriptor Editor

The Deployment Descriptor Editor allows you to fine-tune the deployment descriptor by modifying or completing entries that exteNd Director is unable to complete automatically.

The Deployment Descriptor Editor displays the deployment descriptor elements as expandable nodes. The nodes correspond to elements of the deployment descriptor DTD. All possible deployment descriptor entries are represented graphically, so you can use the interface to help you add the appropriate entries without having to memorize the DTD.

Here's a sample of the Deployment Descriptor Editor for an EAR project:

DeplDesc

TIP:   You can view or edit the deployment descriptor in raw XML by choosing the XML tab. The Deployment Descriptor Editor opens in the mode (raw XML or tree view) that was in use when you last saved.

Nodes displayed in bold (such as Modules and Roles) allow child nodes to be added or removed. You can add or remove these nodes by right-clicking and selecting from the popup menu.

Many of the nodes require additional information, which you can provide by completing a property sheet. To display the Property Inspector for a node, highlight the node, right-click, and select Properties.

To save your changes to the deployment descriptor file in the archive, select File>Save (or click the Save icon).

 
Top of page

Using the Deployment Descriptor Editor

You can use the Deployment Descriptor Editor either to fine-tune the default deployment descriptor created by exteNd Director or to create a new deployment descriptor.

Procedure To create a deployment descriptor:

  1. Open the project for which you want to create the new deployment descriptor.

  2. Select File>New>File.

  3. Select the General tab.

  4. Select Deployment Descriptor and click OK.

    This constructs the deployment descriptor shell based on the contents of the project and displays the shell in the Edit Pane.

Procedure To associate a deployment descriptor with a project:

NOTE:   If you created a deployment descriptor outside of the exteNd Director development environment, you can still use it with a project by following these steps.

  1. Open the project that you want to associate the deployment descriptor with.

  2. Go to the Directory Pane.

  3. Double-click the deployment descriptor you want.

    You are prompted to associate the descriptor with the current project or a different project (which you can choose)—or to edit the deployment descriptor in XML mode.

  4. Choose the option to associate the descriptor with the current project, then click OK.

    This opens the deployment descriptor in the Deployment Descriptor Editor.

  5. Save the deployment descriptor to complete the association.

Procedure To modify a deployment descriptor:

  1. Open the project whose deployment descriptor you want to modify.

  2. Highlight the project (SPF) file, right-click, and select Open Deployment Descriptor from the popup menu.

    You are prompted for build preferences. Once you specify your build preferences, the Deployment Descriptor Editor opens the file ready for editing.

Procedure To add a deployment descriptor element:

  1. Open the deployment descriptor for editing.

  2. Highlight the descriptor element, right-click, and choose Add from the popup menu.

    The editor adds a new element with the title UntitledXXX.

  3. Highlight the new element, right-click, and choose Properties from the popup menu to launch the Property Inspector (so you can define any necessary values).

Procedure To remove a deployment descriptor element:

  1. Open the deployment descriptor for editing.

  2. Make sure the Descriptor tab (not the XML tab) is selected.

  3. Highlight the descriptor element you want to remove, right-click, and select Delete from the popup menu.

    NOTE:   If Delete is not available as a menu option, that means the element is not removable.

Validating a deployment descriptor   The Deployment Descriptor Editor automatically checks your work as follows:

When you

The Deployment Descriptor Editor

Switch mode (from graphical to XML and vice versa)

Checks the syntax of the deployment descriptor

Save a deployment descriptor

Validates the deployment descriptor against the corresponding DTD

But you can force validation anytime.

Procedure To force validation of a deployment descriptor:



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...