Skip Headers
Oracle® Fusion Middleware Quick Start Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14246-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Creating New Portal Projects

To get started developing a portal, at a minimum, you need to create a portal EAR and a portal WAR. These are just regular EAR and WAR projects that have been configured to include portal libraries and other artifacts.

This chapter includes the following topics:

3.1 Choosing a Web Application Framework Technology

Before beginning a portal web project, your team needs to choose an appropriate web application framework. WLP supports several web application frameworks, including:

For more information on these web application frameworks, see Oracle Fusion Middleware Portal Development Guide for Oracle WebLogic Portal and Oracle Fusion Middleware Portlet Development Guide for Oracle WebLogic Portal.

3.2 Creating Your EAR Project

To create your EAR project:

  1. Start Oracle Enterprise Pack for Eclipse.

    On the left side of the Oracle Enterprise Pack for Eclipse is the Project Explorer view. You use this view to navigate within your projects.

Figure 3-1 Project Explorer View

Description of Figure 3-1 follows
Description of "Figure 3-1 Project Explorer View"

  1. Right-click within the Project Explorer and select New > Portal Ear Project.

    Note:

    Although other ways exist for creating a new portal ear project, such as File > New > Project... > Portal Ear Project, the path from the Project Explorer is the easiest and most direct.
  2. Complete the pages in the wizard as required, using the information provided in Table 3-1.

    Note:

    Oracle Enterprise Pack for Eclipse includes cheat sheets for developing portal applications, how to use Oracle Enterprise Pack for Eclipse features, developing Java applications, and other topics. To access a cheat sheet from the menu bar, select Help > Cheat Sheets.

Table 3-1 New Portal EAR Project Wizard

In this Wizard ... Select or Enter...

Project name

This name will become the default base name for several things, such as the portal administration tools URL. For example, if the name is projectXapp, the administration tools URL will be /projectXappAdmin.

Use default

Deselect this check box.

The default location for projects is within your workspace. However, as recommended in Chapter 2, your project should not go within your workspace directory.

Browse

Browse to the location where you want to put your EAR project. This should be an empty directory with the same name as the project. Based on the example in Example 2-1, it would be something like HOME/projects/projectX/projectXapp.

Note: Naming your directories with the same root name is not required, but does eliminate ambiguity. You can create any new directories you need by using the Make New Folder button in the Browse For Folder dialog.

Project Facets page

By default you get the facets needed for a portal. You can also add other facets such as Collaboration or Analytics. If you do not know if you if need these facets, you can add them later.


  1. After clicking Finish, click Yes when the dialog asks if you want to open the associated perspective.

    Your EAR project is created, but shows an error, as indicated by the red X on the project in the Project Explorer. The Problems view (Figure 3-2) shows EAR projects are required to contain one or more modules.

The error occurs because you have not yet created a WAR project (or other kind of project) in the EAR.

3.3 Creating Your Portal Web Application (WAR) Project

To create your portal web application (WAR) project:

  1. Within the Project Explorer, right-click your project and select New > Portal Web Project.

  2. Complete the pages in the wizard as required.

Table 3-2 New Portal Web Project Wizard

In this Wizard ... Select or Enter...

Project name

By default this name is used as the context root of your web application. For example, if you choose a project name of projectX, your URLs for the web application will start with /projectX.

Use default

Deselect this check box.

The default location for projects is within your workspace. However, as recommended in Chapter 2, your project should not go within your workspace directory.

Browse

Browse to the location where you want to put your WAR project. This should be an empty directory with the same name as the project. Based on the example in Example 2-1, it would be something like HOME/projects/projectX/projectX.

Add project to an EAR

Make sure that EAR you created is selected.

This adds the WAR as a module within the EAR and clears the EAR's build error.

Project Facets Page

Carefully look at the facets list and see what you might need. The default set covers most situations. You can always go back and add and remove facets as needed.


3.4 Datasync Project

A datasync project is an optional project that stores general purpose portal services data used in the development of personalized applications and portals. These portal services include User profiles, session properties, and campaigns.

To create the Datasync project:

  1. From the menu bar, click File > New > Datasync Project.

  2. Complete the pages in the wizard as required.

Table 3-3 Datasync Project Wizard

In this Wizard ... Select or Enter...

Project name

Name of the Datasync project.

Use Default

Deselect this check box.

The default location for projects is within your workspace. However, as recommended in Chapter 2, your project should not go within your workspace directory.

Browse

Browse to the location where you want to put your Datasync project. This should be an empty directory with the same name as the project. Based on the example in Example 2-1, it would be something like HOME/projects/projectX/projectXdatasync.

EAR Membership

Make sure that the EAR you created is selected.


3.5 Utility Projects

Use a Utility project for application-scoped source code. In particular, for plain Java classes that are shared by other projects that are included in your EAR. The Utility project code is in the EAR's APP-INF/classes directory. This means it is not a deployed submodule and does not get a <java> entry in META-INF/application.xml.

Note:

A submodule can be deployed separately from an EAR, which can significantly improve redeployment time. For more information, see Section 10.5, "Prefer Quicker Redeploys."

To create the Utility project:

  1. Within the Project Explorer, right-click and select New > Other.

  2. In the Select a wizard dialog box, select J2EE > Utility Project, and then click Next.

  3. Complete the pages in the wizard as required.

Table 3-4 Utility Project Wizard

In this Wizard ... Select or Enter...

Project name

The name of the utility.

Use Default

Deselect this check box.

The default location for projects is within your workspace. However, as recommended in Chapter 2, your project should not go within your workspace directory.

Browse

Browse to the location where you want to put your Datasync project. This should be an empty directory with the same name as the project. Based on the example in Example 2-1, it would be something like HOME/projects/projectX/projectXutility.

Add project to an EAR

Select the appropriate EAR project from the drop-down list.

Project Facets page

If you will be writing EJB or Java code that uses the WebLogic Portal APIs, be sure to select the facets that give access to those APIs.


3.6 EJB Projects

If you are planning to write any EJBs, you need to create an EJB project. An EJB project requires an ejb-jar.xml with at least one EJB. If you do not want to create an EJB project now, you can always do it later.

Tip:

EJB projects are also useful for plain Java code because an EJB is deployed as a submodule. Submodules are advantageous because they can significantly improve the time it takes to redeploy. So you might want to create an EJB project even if you are not using EJBs. For more information, see Section 10.5.3, "EJB Projects in a Sub-classloader Deploy Faster."

To create an EJB project:

  1. From the menu bar, click File > New > Other.

  2. In the Select a wizard dialog box, select EJB > WebLogic EJB Project.

  3. Complete the pages in the wizard as required.

Table 3-5 EJB Project Wizard

In this Wizard ... Select or Enter...

Project name

The name of your EJB Project.

Use Default

Deselect this check box.

The default location for projects is within your workspace. However, as recommended in Chapter 2, your project should not go within your workspace directory.

Browse

Browse to the location where you want to put your EJB project. This should be an empty directory with the same name as the project. Based on the example in Example 2-1, it would be something like HOME/projects/projectX/projectXejb.

Add project to an EAR

Select the appropriate EAR project from the drop-down list.

Project Facets page

If you will be writing EJB or Java code in this project that uses the WebLogic Portal APIs, make sure you select the correct facets to give access to those APIs.

Note: The WebLogic EJB Project uses WebLogic EJBGen to generate the Home and Remote interfaces and the ejb-jar.xml file. An EJBGen project does not build or deploy without EJBGen-style EJBs.


The new EJB project shows an error until you create at least one EJB. You can create a placeholder EJB for now. For information on how to do this, see Tutorial: Building Enterprise JavaBeans.

If your EJB project depends on code in your Utility project:

  1. In Project Explorer, right-click your EJB project and select Properties.

  2. On the left side of the Properties dialog box, select J2EE Module Dependencies.

  3. Under Available dependent JARS, select your utility JAR.

  4. Click OK.

3.7 Related Information

The following topics provide more detail for creating new portal projects: