Working with WebLogic Workshop Applications

 <  Day Day Up  >  

To help you get acclimated to the Workshop user interface, the following sections explain how to create or open an existing application and select files for editing activities.

Creating an Application

All development in WebLogic Workshop is performed in the context of an application. To create a new application, select File, New, Application from the main menu.

The New Application dialog box that opens, as shown in Figure 2.2, presents a number of application types for starting development. The default application is a good starting point when building a Web application, and the Portal and Process applications are good for beginning WebLogic Portal and WebLogic Integration work, respectively. Whatever your initial application type selection, you can always add new components at any point during development.

Figure 2.2. The New Application dialog box provides the means for selecting the type of application to develop.

graphics/02fig02.gif

The New Application dialog box also enables you to set the directory in which the application is stored. There is no need to specify the application name separately, as it always matches the last folder in your directory path .

Finally, you can use this dialog box to specify the WebLogic Server environment in which to run the application during development. For examples in this book, the directory corresponding to the WebLogic domain is provided.

For the sake of touring the Workshop Integrated Development Environment (IDE) in this chapter, make the selections specified in Table 2.2. If necessary, adjust the directory in which BEA WebLogic Platform 8.1 is installed, and click the Create button.

Table 2.2. New Application Dialog Box Settings

PARAMETER

SETTING

Application type

Default Application

Directory

C:\bea\weblogic81\samples\workshop\Chap2

Server

C:\bea\weblogic81\samples\domains\workshop

Viewing an Application

Workshop provides several tools to examine application components. This section describes how to use the Application, Files, and Document Structure panes for this purpose.

The Application Pane

After creating a new application, you can view its contents in the Application pane that, by default, is visible in the upper-left corner of the WebLogic Workshop environment. This pane, shown in Figure 2.3, displays a hierarchical tree view of the files in the application.

Figure 2.3. The Application pane provides a hierarchical view of the files in the application.

graphics/02fig03.gif

For this application, the first two folders, Chap2Web and Schemas , represent projects. Each project is made up of a collection of files needed to build a component of the application. Chap2Web is a Web project, used to build Web applications by creating JavaServer Pages (JSP) and defining how to navigate between them. Schemas is a Schema project, used to provide simple yet sophisticated access to XML documents in Java through the BEA Systems XML Beans technology. Table 2.3 summarizes all predefined WebLogic Workshop project types.

The list of available project types is determined by the version of Workshop that's installed. The Application Developer Edition, provided with WebLogic Server 8.1, includes all the fundamental project types needed to build Web applications and Web services as well as the back-end business logic through controls and Enterprise JavaBeans (EJBs). The Platform Edition, bundled with WebLogic Platform 8.1 and provided on the CD-ROM accompanying this book, adds project types to support development with WebLogic Portal and Integration.

Table 2.3. Built-in WebLogic Workshop Project Types

PROJECT TYPE

DESCRIPTION

Web

Used to build Web application user interfaces

Web Service

Used to expose business logic through the network to other applications; relies on standard protocols and formats to allow communication across different operating systems and programming languages

Control

Used to encapsulate business logic or access to enterprise resources in a Java class with a simple Application Programming Interface (API)

EJB

Used to create EJBs

Java

Used to develop common Java classes used by other projects in the application and that are not part of any other project type

Schema

Used to provide simple yet sophisticated access to XML documents in Java using the BEA Systems XML Beans technology

Portal

Used to create Web applications that can be easily personalized, customized, and reorganized without additional programming

Datasync

Used to create and maintain the data behind a personalized portal application

Process

Used to define the flow of business logic and data exchange between back-end systems and end users

You can browse the contents of any folder by double-clicking the folder name or clicking the + or - symbol to the left of the folder icon. Take a moment to examine the contents of Chap2Web , the Web project in this application. You will find that the project comprises

  • A Page Flow ( Controller.jpf )

  • Several standalone JSPs ( error.jsp , index.jsp )

  • Web application configuration files (the WEB-INF directory)

  • Web page resources, including style sheets and images (the resources directory)

The Modules and Libraries folders are repositories for compiled Java code that application components need. The difference is that the contents of the Modules folder are automatically deployed to WebLogic Server.

The Security Roles folder is used to create application-specific groups of users, usually based on their function in the organization. Then the roles are used to determine who can and cannot access the application's components. By keeping the roles abstract, the application does not need to concern itself with actual user identities. The WebLogic Server system administrator makes mappings between the roles and actual users after the application is deployed.

A number of context-specific application management options are available by right-clicking any entry in the Application pane. Right-clicking on most folders displays options for adding and importing objects as well as compiling resources. For example, as shown in Figure 2.4, when you right-click on the application folder at the root of the tree, a pop-up menu is displayed, with options for adding and importing existing projects, compiling the application, and deploying it to WebLogic Server. Right-clicking files in the Application pane displays options for saving, copying, deleting, and renaming resources.

Figure 2.4. The root folder pop-up menu displays common actions to take at the application level.

graphics/02fig04.gif

The online product documentation provides more information on all available pop-up menu options.

The Files and Document Structure Panes

Click the Files tab to see another view of the application. As shown in Figure 2.5, the Files pane lists all files associated with the application arranged in alphabetical order. The input text field can be used to filter the list and locate a specific file or set of files.

Figure 2.5. The Files pane provides an alternative to the Application pane to view the files included in a Workshop application.

graphics/02fig05.jpg

The Document Structure pane shown in Figure 2.6 provides another view of the application. Visible by default in the upper-right corner of the Workshop window when a file is being edited, this pane displays a hierarchical view of the parts in a file. For example, for JSP files, the pane displays the list of HTML and JSP tags. For a Java class, the pane displays the list of method and class variable declarations.

Figure 2.6. The Document Structure pane displays the context-specific key elements in a selected file.

graphics/02fig06.gif

 <  Day Day Up  >  


BEA WebLogic Workshop 8.1 Kick Start
BEA WebLogic Workshop 8.1 Kick Start: Simplifying Java Web Applications and J2EE
ISBN: 0672326221
EAN: 2147483647
Year: 2004
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net