Previous Next vertical dots separating previous/next from contents/index/pdf

Applications and Projects

In Workshop for WebLogic you create and build applications (or more formally, enterprise applications). This topic introduces applications and their organization in Workshop for WebLogic.

Workshop for WebLogic organizes the resources (projects, files and folders) of your application in the following way:

For an introduction to creating a workspace and setting up a simple enterprise application and its projects, review the Getting Started tutorial. To look at sample applications, look at the sample applications.

Workspaces

In Workshop for WebLogic, you can have only one workspace open at a time. A workspace is a single top level folder that contains one or more applications and component projects/modules. Workspaces are described in detail in the Eclipse help system available by clicking Help > Help Contents and then choosing Workbench User Guide.

Opening a Different Workspace

To open a new workspace, click File > Switch Workspace and click Browse to choose a new workspace folder.

Creating a New Workspace

To create a new workspace, click File Switch Workspace and click Browse to navigate to the location of the new workspace folder. Then click Make New Folder to create a new workspace folder.

Deleting a Workspace

A workspace is a directory. To delete a workspace and its contents, simply delete the directory on your computer.

Enterprise Applications

An enterprise application (often called simply an application) in Workshop for WebLogic is the collection of all resources that are built together and then deployed as a unit to an instance of WebLogic Server. Enterprise application components can also be archived as a unit into an Enterprise ARchive (EAR) file.

Enterprise applications consist of a collection of projects which appear as siblings in the workspace. For every enterprise application you must create the following an enterprise application (EAR) project that serves as the assembly point for all of the projects in the application.

The Java code and other files of the application are then contained in additional projects: dynamic web project(s), web service project(s), EJB project(s), and/or utility project(s).

An enterprise application is different from a web application. Web application refers to a collection of resources, typically HTML or JSP pages, that allow users to access functionality via the Web. An enterprise application may contain zero or more web applications.

An application should represent a related collection of business solutions. For example, if you were building an e-commerce site you might design an application that includes web applications for catalog shopping and customer account management and the components that support them (Java controls, EJBs, etc.). You might also need to deploy a human resources application for use by your employees. The human resources application is not related to the e-commerce application. Therefore, in Workshop for WebLogic you would probably create two applications to separate these disparate business functions.

When creating an enterprise application, the normal process is to

  1. Create a new workspace for the application (optional)
  2. Create an EAR project to link all of the application's projects
  3. Create projects for the modules within the application
  4. Create the project contents.

Creating a New Enterprise Application Project

To create a new enterprise application project, click File > New > Project and expand J2EE. Choose Enterprise Application Project. After specifying the project name and choosing the facets, the third screen of the installation wizard allows you to click New Module to create initial J2EE module projects. This is not recommended because it creates Eclipse projects, not Workshop for WebLogic projects. For a more detailed description of how to create an EAR project, see Tutorial: Getting Started with Workshop for WebLogic Platform.

Component Projects

A project groups the files of a component of an application.

In Workshop for WebLogic, the available project types are:

Note that the Eclipse platform provides other project types. However Workshop for WebLogic features work only with the project types supported by Workshop for WebLogic.

When to Create a New Project

As you develop an application, you may need to create new projects within the application for the following reasons:

Organizing Workspaces and Enterprise Application Projects

There are two common methods for organizing your projects in workspaces:

  1. All projects within the workspace. In this structure, the project folders are created a sub-folders of the workspace folder. This organization has the advantage of keeping all application files together in one folder.
  2. Component (source) projects stored outside the workspace. In this structure, the project folders are created outside the workspace folder. This organization has more flexibility for linking projects together, especially where you are working with multiple enterprise applications. This organization also allows for easier reassembly if the enterprise application is restructured, since the workspace folder can be recreated without affecting the project folders.

Archiving and Source Control for Project Source Code

You can archive projects and workspaces either as self-contained ZIP files or through source control. The workspace and project folders contain metadata that should not be checked in to source control. See Working with Source Control for more information.

Summary of Project Types

Project Type Project Contents
Enterprise Application (EAR) Project

- links component projects of the application for deployment and archiving
- one EAR project per enterprise application
JAR files and deployment descriptors
build files and auto-generated files
Enterprise JavaBeans (EJB) Project

entity beans
session beans
message-driven beans
Java source files

Dynamic Web Project

- web applications

page flows (Java, JSP)
web files (HTML, CSS, JPEG, etc.)

Web Service Project

- web services

web services files (WSDL, Java)
Java source files

Utility Project

- contains shared controls and code
Java source files

EAR Project

Enterprise Application (EAR) projects:

EAR projects appear as siblings to the other projects in a workspace but functionally, they link together projects and do not contain any of the content of your application. A single dynamic web project (web application) can be deployed without an EAR project, but more complex applications require an EAR project for correct deployment.

When an EAR project is created, by default it contains the following facets:

Organization of EAR Projects

The EarContent directory contains the following:

EarContent
/ APP-INF Libraries that are available to any project in the application should be stored in EarContent/APP-INF/lib.
/ META-INF

Deployment descriptor files that may be edited by the user:

  • application.xml - lists the modules referenced by the EAR project
  • weblogic-application.xml - lists the modules referenced by the EAR project; these resources can be used by any module/project referenced by the EAR project

EJB Project

Enterprise Java Beans (EJBs) are Java software components of enterprise applications. The J2EE Specification defines the types and capabilities of EJBs as well as the environment (or container) in which EJBs are deployed and executed. From a software developer’s point of view, there are two aspects to EJBs: first, the development and deployment of EJBs; and second, the use of existing EJBs from client software. An EJB Project provides support for creating and deploying new EJBs.

When an EJB project is created, by default it contains the following facets:

and can optionally have

Note that if an EJB project has dependencies on other EJB projects or on utility projects, you must create the dependency explicitly, they are not set when the project is created.

Organization of EJB Projects

The src directory contains the user's Java source files. Creating a package causes a new folder to be created in the src folder. Beans are then created within the packages.

Dynamic Web Project

Dynamic web projects are used to create web applications.

User interface components are constructed from Java Server Pages (JSPs), which are web pages that can interact with server resources to produce dynamic content. Workshop for WebLogic allows you to create page flows that define and contain the logic required to connect multiple JSPs.

A dynamic web project can contain multiple page flows.

Each dynamic web project ultimately produces a J2EE module, each of which is included in the complete Workshop for WebLogic application's EAR file when the application is built for deployment.

The contents of web projects are accessed via URLs.

 

When a dynamic web project is created, by default it contains the following facets:

and may contain the following optional facets, as required:

 

Organization of Dynamic Web Projects

The src and WebContent directories contain:

src Java source code
WebContent Web files (e.g., JSP, graphics, HTML, CSS, etc.)
/WEB-INF Libraries used by this web project should be stored in web/WEB-INF/lib.

Note that when you create a new page flow, a folder is created inside the src folder to contain the Java controller file and any other Java source files associated with the page. A folder of the same name is created inside the web folder to contain the JSP files associated with the page flow.

Creating a package causes a new folder to be created in the src folder. You can also create folders and files explicitly in the src directory.

 

Web Service Project

Web service projects are used to develop web services that conform to standards such as SOAP for message exchange, XML for messages to/from the service, and a WSDL that specifies the web service's public interface.

Web services are typically used to expose enterprise application logic to other applications (as opposed to users).

Web Services Description Language (WSDL) files are generated automatically when a web service is created within a web project.

Each web service project ultimately produces a J2EE module, each of which is included in the complete Workshop for WebLogic application's EAR file when the application is built for deployment.

The contents of web service projects are accessed via the test client which allows you to access each operation of the web service by clicking on a button.

 

When a web project is created, by default it contains the following facets:

and the following facets are optional, as needed:

 

Organization of Web Service Projects

The src and WebContent directories contain:

src Java source code
WebContent Web files (e.g., JSP, graphics, HTML, CSS, etc.)
/WEB-INF Libraries used by this web project should be stored in web/WEB-INF/lib.

Note that when you create a new page flow, a folder is created inside the src folder to contain the Java controller file and any other Java source files associated with the page. A folder of the same name is created inside the web folder to contain the JSP files associated with the page flow.

Creating a package causes a new folder to be created in the src folder. You can also create folders and files explicitly in the src directory.

Utility Project

A utility project is a place to develop or collect general-purpose Java code that is not directly part of special entities such as web services, controls or EJBs. For example, a utility Project might hold shared controls or Java code for a library of string formatting functions that are used in web services and JSPs in other projects in the application.

When a utility project is created, by default it contains the following facets:

Organization of Utility Projects

The src directory contains the user's Java source files. Creating a package causes a new folder to be created in the src folder. You can also create folders and files directly in the src directory.

Note that if a utility project has dependencies on other utility projects or on EJB projects, you must create the dependency explicitly, they are not set when the project is created.

 

Related Topics

Tutorial: Getting Started with Workshop for WebLogic Platform

Setting Project Facets

 

Skip navigation bar   Back to Top