Skip navigation.

WebLogic Platform Tour Guide

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Logging In to the Avitek Corporate Intranet

The Tour begins here! In this section you (new employee John Smith) log in to the Avitek corporate intranet. This section describes the login process and the features of the intranet portal, demonstrating the integration of an application built using WebLogic Portal. (WebLogic Portal is delivered as part of the WebLogic Workshop Platform Edition.)

Follow the steps described in Step Through the Tour and review the concepts described in this section to learn about:

 


Step Through the Tour

When the WebLogic Platform Tour Web application is launched, you are prompted to log in to the Avitek intranet portal.

Begin by logging in to the Avitek corporate intranet as new employee John Smith:

  1. Enter the following user name and password in the Avitek Log In window:
  2. User Name: john
    Password: employee

  3. Click Log In.

The employee view of the intranet portal is displayed.

 


Developing an Intranet Portal Using WebLogic Portal

WebLogic Portal simplifies the development, management, and delivery of portals. Using WebLogic Workshop with the WebLogic Workshop Portal Extensions, you can graphically design portals, integrating web services, Web applications, and business processes. Once you build portals using WebLogic Workshop, you can deploy and manage them using WebLogic Portal.

The following sections describe the main features of WebLogic Portal:

Designing a Portal

A portal provides a user interface for Web-based applications. It is a single point of access to enterprise data and applications, presenting a unified and personalized view of that information to employees, customers, and business partners.

WebLogic Workshop makes it easy to create a portal: click the target folder and choose File—>New—> Portal. The Portal Designer opens and displays a portal with a default header, body, and footer.

The Portal Designer is a graphic tool that enables you to design portals such as the Employee portal shown in the following figure.

Figure 2-1 Portal Designer

Portal Designer


 

The following table describes the portal design tools shown in the previous figure.

Table 2-1 Tools for Designing Portals 

Callout #

Use this tool...

For these tasks...

1

Application Window

Create, view, and edit portal files in your portal application projects. The names of portal files end in .portal.

The Portlet Designer stores the portal as an XML file. You can view the portal file in XML format within WebLogic Workshop by right-clicking the portal file and selecting Open as XML from the drop-down menu when the Open as XML portal application property is enabled.

To enable the Open as XML portal application property:

    1. Choose Tools—> Application Properties to open the Application Properties window.

    2. Select the Portal folder in the left-hand pane.

    3. Select the Is the Open as XML Option available? Portal option by clicking its checkbox.

    4. Select OK to apply the changes and close the Application Properties window.

2

Design View

Design your portal in this area.

3

Palette Window

Add books and pages to the portal by dragging components from the Palette window and dropping them onto the Design View canvas.

4

Data Palette Window

Add portlets to the portal by dragging them from the Data Palette window and dropping them onto the Design View canvas. You can use the sample portlets provided by WebLogic Portal, or you can create your own, as described later in Designing a Portlet.

5

Property Editor Window

Set properties for the portal component that is currently selected, such as the portal look and feel. You can select a portal component by clicking on it in the Design View canvas or by selecting its name in the Document Structure window (described below).

6

Document Structure Window

View the components of the portal interface in a hierarchical structure (see Figure 2-3).

You can select a portal component in the Document Structure window by clicking on it. The portal component is selected in Design View and you can edit its properties in the Property Editor window.


 

The following figure shows the hierarchical structure of a portal.

Figure 2-2 Hierarchical Structure of a Portal

Hierarchical Structure of a Portal


 

As shown in the previous figure, the following components make up the hierarchical structure of a portal:

The Document Structure window shows the relationship between specific components in the current portal file.

Figure 2-3 Document Structure Window for a Portal

Document Structure Window for a Portal


 

Note that the Header and Footer components in the Document Structure window represent areas above and below the main body that typically include personalized content, banner graphics, legal notices, and related links.

To learn more about creating and designing portals:

Designing a Portlet

Each page within a portal can contains a set of nested pages, or portlets—user-specific resources on a portal page. Portlets provide access to specific applications or services, giving users access to multiple sources of information, business processes, and applications in a single place.

WebLogic Workshop makes it easy to create a portlet: click the target folder and choose File—>New—> Portlet. The Portlet Wizard steps you through the process of creating an initial portlet and opens it in the Portlet Designer.

The Portlet Designer is a graphic tool that enables you to design portlets such as the Employee portlet shown in the following figure. The Portlet Designer stores the portlet as an XML file.

Figure 2-4 Portlet Designer

Portlet Designer


 

The following table describes the portlet design tools shown in the previous figure.

Table 2-2 Tools for Designing Portlets 

Callout #

Use this tool...

For these tasks...

1

Application Window

Create, view, and edit portlet files in your portal application projects. The names of portlet files end in .portlet.

The Portlet Designer stores the portlet as an XML file. You can view the portlet file in XML format within WebLogic Workshop by right-clicking the portlet file and selecting Open as XML from the drop-down menu when the Open as XML portal application property is enabled.

To enable the Open as XML portal application property:

    1. Choose Tools—> Application Properties to open the Application Properties window.

    2. Select the Portal folder in the left-hand pane.

    3. Select the Is the Open as XML Option available? Portal option by clicking its checkbox.

    4. Select OK to apply the changes and close the Application Properties window.

2

Design View

Design your portlet in this area.

3

Palette Window

Add one of the following controls to the portlet:

  • Help Mode—Adds an icon to the titlebar. Users click the icon to access help information. You set the associated Help URI value in the Property Editor window.

  • Edit Mode—Adds an icon to the titlebar. Users click the icon to load a page that enables them to edit the contents of the current portlet. You set the associated Edit URI value in the Property Editor window to define the page that is loaded when the user clicks the Edit icon.

  • New Preference—Adds customizable application properties at the developer level that can be exposed to the administrator and end user.

4

Property Editor Window

Set properties for the portlet component that is currently selected. For example, you can set the Content URI property to identify the page flow or JSP that defines the initial content of the portlet. You can select a portlet component by clicking on it in the Design View canvas or by selecting its name in the Document Structure window (described below).

5

Document Structure Window

View the components of the portlet interface in a hierarchical structure (see Figure 2-5).

You can select a portlet component in the Document Structure window by clicking on it. The portal component is selected in Design View and you can edit its properties in the Property Editor window.


 

The following figure shows the Document Structure window for a portlet.

Figure 2-5 Document Structure Window for a Portlet

Document Structure Window for a Portlet


 

As shown in the Document Structure window, the following components make up the hierarchical structure of the sample Employee portlet interface:

To learn more about designing portlets:

Controlling the User Path Using Page Flows

Within a Web application, a page flow links together multiple Web pages in a particular sequence, thus determining the user's path through those pages and the associated data. A page flow consists of a Java class with specially designed annotations, methods, and forms that control the behavior of Web application components; it is based on the Apache Struts framework.

You can include one or more JSP files in the page flow by adding them to the page flow folder. The JSP files can use special tags, which are understood by the page flow runtime, to raise actions. The actions in the JSP correspond to action methods that are defined in the page flow. Actions can be used to perform site navigation, pass data, or invoke back-end business logic via controls. The business logic in the page flow class is separate from the presentation code defined in the JSP files.

WebLogic Workshop makes it easy to create a page flow: click the target folder and choose File—>New—> Page Flow. The Page Flow Wizard steps you through the process of creating an initial page flow and opens it in the Page Flow Designer.

The Page Flow Designer is a graphic tool that enables you to design page flows such as the Employee page flow shown in the following figure.

Figure 2-6 Page Flow Designer—Flow View

Page Flow Designer—Flow View


 

The following table describes the page flow design tools shown in the previous figure.

Table 2-3 Tools for Designing Page Flows 

Callout #

Use this tool...

For these tasks...

1

Application Window

Create, view, and edit page flow files in your portal application projects. The names of page flow files end in .jpf.

Each page flow consists of a folder that contains a single controller file, any JSP files that are referenced, and any other application files required by the page flow. JSP files to be included in a page flow must reside within the page flow folder.

2

Flow, Action, and Source Views

Design your page flow in this area. Switch between the following views, as required:

  • Flow View—Build a graphical relationship between the pages in the Web application and the actions that link the pages.

  • Action View—Define the actions raised by the action icons in your page flow (see Figure 2-7).

  • Source View—Edit the source code directly to add business logic.

Changes made in one view are automatically reflected in the other.

3

Palette Window

Create a graph of icons in your page flow by dragging components from the Palette window and dropping them onto the Flow View canvas. Icon types include:

  • Begin Action—begin() method that defines the page that is loaded and the actions that are executed when the page flow is started. This icon is required and added automatically for you when you create a page flow.

  • Action—Method for an action that you define in the page flow controller class.

  • Page—JSP page that is loaded when an action method runs.

  • Page Flow—Page flow that is loaded when an action method runs.

  • Exit—done() method that defines what happens when the user exits the current page flow.

  • Return to Action—Redirect method that returns control to a specific action.

  • Return to Page—Redirect method that returns control to a specific page.

4

Data Palette Window

Define instances of Java controls and form beans to use in the page flow.

Java controls make it easy to access enterprise resources, such as Enterprise Java Beans (EJBs) and databases, from within your application. A control handles the work of connecting to the enterprise resource for you, so that you can focus on the business logic of your application.

Form beans define variables that are used to store form data. If an action defines a form bean, a small box appears in the lower right-hand corner of the action icon. For example, the previous figure shows that form beans are defined for the UsrInfo and logout methods.

5

Form Bean Window

Edit a form bean defined for the selected action. If no form beans are defined for the selected action, the window is empty.

6

Property Editor Window

Set properties for the component that is currently selected in the page flow. You can select a page flow icon by clicking on it in the Design View canvas or by selecting its name in the Document Structure window (described below).

7

Document Structure Window

View a summary of the Java entities and page flow icons that comprise the page flow (see Figure 2-8). The summary includes the Java classes, methods and signatures, variables, and inner classes defined for the page flow.

You can select a Java entity or page flow icon in the Document Structure window by clicking on it. When you select a page flow icon, it is selected in the Flow or Action View canvas and you can edit its properties in the Property Editor window. You can double-click on a Java entity or page flow icon to jump to its code location in Source View.


 

The following figure shows the Action View for the Employee page flow.

Figure 2-7 Page Flow Designer—Action View

Page Flow Designer—Action View


 

The Action View displays all actions and Java controls defined for the page flow, and the pages and page flows referenced.

The following figure shows the Document Structure window for a page flow.

Figure 2-8 Document Structure Window for a Page Flow

Document Structure Window for a Page Flow


 

To learn more about designing page flows:

Creating JSP Content

JSPs provide a convenient way to present dynamically generated content over the Internet. JSPs are used to implement portlets and can contain static HTML code, JSP tag libraries, JSP scriptlets that access EJB components, or any other application functionality available with the application server.

WebLogic Workshop makes it easy to create a JSP: click the target folder and choose File—>New—> JSP File. The JSP Editor opens and displays a JSP file with basic HTML content.

Figure 2-9 JSP Editor

JSP Editor


 

The following table describes the JSP editing tools shown in the previous figure.

Table 2-4 Tools for Designing JSPs 

Callout #

Use this tool...

For these tasks...

1

Application Window

Create, view, and edit JSP files in your portal application projects. The names of JSP files end in .jsp.

2

Design and Source Views

Design your JSP in this area. Switch between the Design and Source code views, as required; changes made in one view are automatically reflected in the other.

In Design View, the HTML elements on the JSP page are rendered as they would be shown in a browser. The Java code and other elements are rendered in a schematic fashion.

3

Palette Window

Add JSP tags to your JSP content by dragging components from the Palette window and dropping them onto the Design View canvas.

JSP tags can be categorized as follows:

  • HTML—Standard HTML element tags.

  • NetUI—Page flow tags, including standard, data binding, and template tags.

  • Portal—WebLogic Portal tags for content rendering, personalization, skeleton rendering, and so on.

  • Custom controls—Tags for custom controls that you define for the project. The steps required to build a custom control are described in Building a Custom Control.

  • Client-specific content—Tags for client-specific content.

WebLogic Workshop includes the required tag libraries in the WEB-INF folder. The *.tld files are J2EE-standard tag library descriptor files. The *.tldx files are WebLogic Workshop specific files that contain information about how the tags behave within the IDE.

4

Data Palette Window

View or add components in the following categories:

  • Page—Add and view controls and view defined form beans.

  • Page Flow—View the properties, controls, and actions defined for the page flow.

5

Table Navigator Window

Navigate through the rows and columns of the selected table, and add, merge, or delete select cells and rows.

6

Property Editor Window

Set properties for the JSP file component that is currently selected. You can select a JSP tag component by clicking on it in the Design View canvas, in the hierarchical tag structure shown in the Design View status bar (see Figure 2-11), or in the Document Structure window (described below).

7

Document Structure Window

View the JSP tags in the JSP file in a hierarchical structure (see Figure 2-10). You can click any JSP component in the Document Structure window to select it in the Design View and edit its properties.


 

The following figure shows the Document Structure window for a JSP file.

Figure 2-10 Document Structure Window for a JSP File

Document Structure Window for a JSP File


 

The current JSP tag hierarchy is also reflected in the Design View status bar, as shown in the following figure.

Figure 2-11 JSP Tag Hierarchy in Design View Status Bar

JSP Tag Hierarchy in Design View Status Bar


 

To learn more about creating JSP content:

Administering Portals with WebLogic Portal

WebLogic Portal provides a control structure that supports the full portal lifecycle, including design, development, deployment, and management. Once the portal designer has developed the resources required for a portal Web site, the portal administrator can use those resources to assemble, maintain, and modify multiple portals.

Portal administration involves many traditional system administration activities, as well as business user tasks that control the behavior, content, and appearance of portals.

The WebLogic Administration Portal, shown in the following figure, enables portal administrators to manage the following portal features:

To learn more about managing portals, see the WebLogic Administration Portal Help, available on e-docs.

 


Reviewing the Avitek Intranet Portal

The Avitek intranet portal enables employees and managers to log in to the corporate intranet. When you log in, you access a customized version of the intranet portal for either an employee or a manager.

The following table defines the user names defined for the WebLogic Platform Tour.

Table 2-5 User Names Defined for the WebLogic Platform Tour 

This user name...

And password...

Enables...

john

employee

John Smith, an employee of Avitek, to:

  • View his employee profile

  • Submit orders for office equipment and check the status of those orders

rachel

emanager

Rachel Burns, a manager at Avitek, to:

  • View a list of her direct employees

  • Approve or reject orders for office equipment issued by her direct employees and check the status of those orders


 

The e2ePortal Web application defines the Avitek intranet portal. To view the e2ePortal Web application in WebLogic Workshop:

  1. Open the e2ePortal application, as follows:
    1. Choose File—>Open—>Application.
    2. Navigate to the samples\platform\end2end\e2ePortal folder of the WebLogic Platform installation.
    3. Select e2ePortal.work.
    4. The names of application files end in .work.

    5. Click Open to open the application.
  2. If the application files are not currently displayed in WebLogic Workshop, choose View—> Application.
  3. The e2ePortal application information is displayed, as follows:

    Application Information


     

The following table describes each of the folders in the e2ePortal application.

Table 2-6 e2ePortal Application Folders 

Folder

Contents

data

Data files required to support WebLogic Portal features, such as personalization, campaigns, and so on. This folder is standard in all application projects. You can modify the default contents based on your application requirements.

e2ePortalProject

Application project files, including portal, portlet, page flow, and JSP content files for the sample portals. This folder also contains the following standard application subdirectories:

  • resources—Standard Web application folder containing Portal application resources such as sample CSS, images, and template JSPs.

  • WEB-INF—Standard Web application folder containing deployment descriptors and validation files.

The contents of this folder are described in the sections that follow.

Schema

Schema definitions.

JoinDB

Custom Java control that coordinates access to multiple databases. The contents of this folder are described in detail in Reviewing the Custom Controls for the Avitek Intranet Portal.

WorkflowInvoker

Custom Java control that invokes a business process from the portal. The contents of this folder are described in detail in Reviewing the Custom Controls for the Avitek Intranet Portal.

Modules

Application and portal system JAR files. This folder is standard in all application projects. You can modify the default contents based on your application requirements.

Libraries

Run-time related library files. This folder is standard in all application projects. You can modify the default contents based on your application requirements.

Security Roles

Security role information (this folder is empty for the e2ePortal Web application). This folder is standard in all application projects. You can modify the default contents based on your application requirements.


 

The following sections describe the contents of the e2ePortalProject folder, including the portals, portlets, page flows, and JSP content files that make up the Avitek intranet portal.

Before proceeding, open WebLogic Workshop and expand the e2ePortalProject folder in the Application window. To view the contents of any portal or portlet, double-click its name in the Application window.

Reviewing the Portals

The e2ePortalProject Web application consists of three portals: Log In, Employee, and Manager.

As shown, each portal in the e2ePortalProject application project defines a hierarchical structure with the following elements:

The framework folder defines the look and feel elements available to the application project. The Look and Feel property in the Property Editor window is set to default for each of the portal files.

The portlets are described in detail in the next section.

Reviewing the Portlets

The following table defines the portlets that are defined for each of the three portals.

Table 2-7 Portlets for the Employee Management System 

Portlet

Parent Portal

Description

Direct Reports

Manager

Accesses the Employee Information database to display a list of employees who report to a particular manager.

Doc Tour

All Portals

Provides a context-sensitive link to the WebLogic Platform Tour Guide (this guide) for more detailed information about stepping through the tour.

Employee

Employee

Accesses the Employee Information database to display an employee profile.

Log In

Log In

Enables users to log in to the Avitek intranet portal, working with the WebLogic Server security system to provide secure access to the portal.

Log Out

All portals (except Log In)

Enables users to log out of the portal.

Manager Tasks Pending

Manager

Communicates with the Office Equipment Order Management system to allow managers to view office equipment orders issued by their direct employees, and to approve or reject pending orders.

Navigation

All Portals

Displays context-sensitive information about the currently displayed portal and portlets and provides a context-sensitive link to the WebLogic Platform Tour Guide (this guide) for more detailed information.

Order

Employee

Communicates with the Office Equipment Order Management system to allow employees to submit orders for office equipment or to view pending orders.


 

For example, the following figure shows the Employee portlet in Design View.

Figure 2-16 Employee Portlet in Design View

Employee Portlet in Design View


 

The following figure shows an example of the Property Editor window settings for the Employee portlet.

Figure 2-17 Portlet Property Settings for the Employee Portlet

Portlet Property Settings for the Employee Portlet


 

The majority of the property settings shown in the previous figure are the same across all portlets in the Avitek intranet portal. The Content and Portlet Title property settings are unique to each portlet.

The following sections describe the following portlets:

To display any portlet in Design View, double-click the name of the portlet in the Application Window.

Direct Reports Portlet

The Direct Reports portlet (Manager.portlet) accesses the Employee Information database to display a list of the employees who report directly to a particular manager. The Content URI property in the Property Editor window specifies the following file as the initial page flow file referenced by the Direct Reports portlet: /manager/Controller.jpf.

The following figure shows the controller file, Controller.jpf, for the Direct Reports page flow in the Flow View canvas of the Page Flow Designer.

Figure 2-18 Controller File for the Direct Reports Page Flow

Controller File for the Direct Reports Page Flow


 

The following table describes each component of the controller file for the Direct Reports page flow.

Table 2-8 Components of the Controller File for the Direct Reports Page Flow 

Component

Function

begin Icon

Defines the employeeList() method that retrieves a list of the current manager's direct employees and passes control to EmployeeList.jsp.

The employeeList() method uses an instance of the UsersDBControl database control, m_DBCtrl, to retrieve employee information from the Employee Information database. The UsersDBControl database control is described in detail in Viewing Employee Information.

EmployeeList.jsp

Displays a list of the current manager's direct employees. First, it uses a netui-data:callPageFlow JSP page flow tag to call the employeeList() method defined in the controller file. Then, it uses the netui-data:repeater, netui-data:repeaterHeader, netui-data:repeaterItem, and netui:label JSP page flow tags to render the contents. For example:

<netui:form action="info">
<netui-data:callPageFlow method="employeeList" resultId="array"/>
<table border="0">
<netui-data:repeater dataSource="{pageContext.array}">
<netui-data:repeaterHeader>
<table border="0.5">
<tr>
<td><b>Employee Name</b></td>
<td></td>
<td><b>Employee Email</b></td>
</tr>
</netui-data:repeaterHeader>
<netui-data:repeaterItem>
<tr>
<td>
<netui:label value="{container.item.employeename}"/>
</td>
<td>
<netui:label value="{container.item.email}"/>
</td>
</tr>
</netui-data:repeaterItem>
</netui-data:repeater>
</table>
</netui:form>

To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help.

info Action

Dummy action for form defined in EmployeeList.jsp. Passes control to EmployeeList.jsp.

logout Action

Passes control to the expired.jsp file. This action is triggered, when the user logs off the system, by the Log Out page flow controller file, described in Log Out Portlet.

expired.jsp

Displays a Data Expired message when the user logs off the system to indicate data within the current session has expired.

logIn Action

Passes control to the begin action of the Controller.jpf page flow. This action is triggered, when the user selects Log In Again from the Log Out portlet.


 

Doc Tour Portlet

The Doc Tour portlet (Doc.portlet) provides a context-sensitive link to the WebLogic Platform Tour Guide (this guide) for detailed information about stepping through the tour. The Content URI property in the Property Editor window specifies the following file as the page flow file referenced by the Doc Tour portlet as follows: /doc/Controller.jpf.

To provide context-sensitive information, the Controller.jpf file calls the appropriate JSP files based on the user actions performed within the other portlets.

Employee Portlet

The Employee portlet (Employee.portlet) accesses the Employee Information database to display an employee profile. The Content URI property in the Property Editor window specifies the following file as the page flow file referenced by the Employee portlet as follows: /employee/Controller.jpf.

The following figure shows the Employee page flow controller file, Controller.jpf, in the Flow View canvas of the Page Flow Designer.

Figure 2-19 Controller File for Employee Page Flow

Controller File for Employee Page Flow


 

The following table describes each component of the controller file for the Employee page flow.

Table 2-9 Components of the Controller File for the Employee Page Flow 

Component

Function

begin Icon

Retrieves the user name for the current user and passes control to Info.jsp (or to Error.jsp in the event of an error).

The begin() method uses an instance of the UsersDBControl database control, m_DBCtrl, to retrieve the user name using the employee ID. For example:

joindb.UsersDBControl.User user= null;
.
.
.
String empId=SubjectUtils.getUsername(sub);
user = m_DBCtrl.lookupUser(empId);

The UsersDBControl database control is described in detail in Viewing Employee Information.

Info.jsp

Displays the employee profile for the current user. Defines an input form to collect the information about the employee using the netui:form JSP page flow tag. It associates the contents of the form with the form bean defined by the UsrInfo action. For example:

<netui:form action="/UsrInfo" focus="employeename">

To learn more about the netui:form page flow tag, see Designing User Interfaces in JSPs in the WebLogic Workshop Help.

Error.jsp

Displays an error message in the event of an error.

UsrInfo Action

Retrieves the employee information for the current user using a form bean with properties that correspond to the data fields in the input form. It then passes control to Info.jsp (or to Error.jsp in the event of an error).

The UsrInfo action uses an instance of the UsersDBControl database control, m_DBCtrl, to retrieve employee information from the Employee Information database. The UsersDBControl database control is described in detail in Viewing Employee Information.

logout Action

Passes control to the expired.jsp file. This action is triggered, when the user logs off the system, by the Log Out page flow controller file, described in Log Out Portlet.

expired.jsp

Displays a Data Expired message when the user logs off the system to indicate data within the current session has expired.

logIn Action

Passes control to the begin action of the Controller.jpf page flow. This action is triggered when the user selects Log In Again from the Log Out portlet.


 

Log In Portlet

The Log In portlet (Login.portlet) enables users to log in to the Avitek intranet portal, working with the WebLogic Server security system to provide secure access to the Avitek intranet portal. The Content URI property in the Property Editor window specifies the following file as the initial JSP file displayed in the Log In portlet as follows: /login/login.jsp

The secure log in process is described in detail in Configuring Security in Web Applications.

Log Out Portlet

The Log Out portlet (Logout.portlet) enables a user to log out of the Avitek intranet portal. The Content URI property in the Property Editor window specifies the following file as the page flow file referenced by the Log Out portlet: /logout/Controller.jpf.

The following figure shows the controller file, Controller.jpf, for the Log Out page flow in the Flow View canvas of the Page Flow Designer.

Figure 2-20 Controller File for the Log Out Page Flow

Controller File for the Log Out Page Flow


 

The following table describes each component of the controller file for the Log Out page flow.

Table 2-10 Components of the Controller File for the Log Out Page Flow 

Component

Function

begin Icon

Passes control to the logout.jsp file.

logout.jsp

Displays the name of the current user and enables a user to log out.

logout Action

Initiates the logout process when a user clicks the Log Out button. Triggers the logout actions defined in the Employee and Order portlets to expire any current data.

loggedout.jsp

Displays a message indicating that the user has been logged out.

logIn Action

Returns the user to the login/logout.jsp file.


 

Manager Tasks Pending Portlet

The Manager Tasks Pending portlet (Worklist.portlet) communicates with the Office Equipment Order Management system to display office equipment orders issued by a manager's direct employees, and to enable the manager to approve or reject pending orders. The Content URI property in the Property Editor window specifies the following file as the page flow file referenced by the Manager Tasks Pending portlet: /worklist/Controller.jpf.

The following figure shows the controller file, Controller.jpf, for the Manager Tasks Pending page flow in the Flow View canvas of the Page Flow Designer.

Figure 2-21 Controller File for the Manager Tasks Pending Page Flow

Controller File for the Manager Tasks Pending Page Flow


 

The following table describes each component of the controller file for the Manager Tasks Pending page flow.

Table 2-11 Components of the Controller File for the Manager Tasks Pending Page Flow 

Component

Function

begin Icon

Defines a Worklist TaskSelector to retrieve a list of tasks assigned to the current user. It then passes control to the worklist.jsp file.

The begin() method uses an instance of the ManagerWorker task worker control, worker, to communicate with the manager's Worklist user interface.

A Worklist user interface allows individuals to interact with a running business process to handle tasks assigned to them. A task worker control provides an interface to a Worklist user interface, allowing your business process to operate on a current task.

The worker task control is used to retrieve the current tasks assigned. For example:

private worklist.ManagerWorker worker;
/**
* @jpf:action
* @jpf:forward name="success" path="worklist.jsp"
*/
protected Forward begin()
{
Subject sub= Security.getCurrentSubject();
// by default display the owned tasks
TaskSelector selector = new TaskSelector();
.
.
.
TaskInfo[] infos = worker.getTaskInfos(selector);
.
.
.
}

worklist.jsp

Provides a user interface to the Worklist, displaying information about all pending tasks assigned to the current user, including task name, task state, and associated employee name. It uses the netui-data:repeater, netui-data:repeaterHeader, netui-data:repeaterItem, and netui:label JSP page flow tags to render the contents.

The worklist.jsp files provide links to raise an action using the netui-anchor JSP page flow tag. For example:

<netui:anchor action="taskDetail">Respond to the Task
<netui:parameter name="taskId"
value="{container.item.taskId}"/>
</netui:anchor>

To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help.

taskDetail Action

Gets details about a selected task using worker, an instance of the ManagerWorker task worker control. For example:

TaskInfo[] infos = worker.getTaskInfo(taskId);

It then passes control to the response.jsp file. This action is triggered, when the user clicks Respond to Task.

response.jsp

Displays the Task Response text box, prompting the manager to respond to the pending task.

setReplyXML Action

Retrieves the manager's response using a form bean that defines the responseXML property that corresponds to the data field in the input form. It then passes control to the worklist.jsp file (or to Error.jsp in the event of an error).

The setReply action uses an instance of worker, an instance of the ManagerWorker task worker control to set the task response. For example:

worker.setTaskResponseString(response, taskInfo.getTaskId());
worker.startTask(taskInfo.getTaskId());
worker.completeTask(taskInfo.getTaskId());

error.jsp

Displays an error message in the event of an error.

logout Action

Passes control to the expired.jsp file. This action is triggered, when the user logs off the system, by the Log Out page flow controller file, described in Log Out Portlet.

expired.jsp

Displays a Data Expired message when the user logs off the system to indicate data within the current session has expired.

logIn Action

Passes control to the worklist.jsp file. This action is triggered, when the user selects Log In Again from the Log Out portlet.


 

Navigation Portlet

The Navigation portlet (Navigation.portlet) displays context-sensitive information about the currently displayed portal and portlets. The Content URI property in the Property Editor window specifies the following file as the page flow file referenced by the Navigation portlet as follows: /navigation/Controller.jpf.

To provide context-sensitive information, the Controller.jpf file calls the appropriate JSP files based on the user actions performed within the other portlets.

Order Portlet

The Order portlet (Order.portlet) communicates with the Office Equipment Order Management system to enable employees to submit new office equipment orders or to view pending orders. The Content URI property in the Property Editor window specifies the following file as the initial page flow file referenced by the Order portlet: /order/Controller.jpf.

The following figure shows the Order page flow controller file, Controller.jpf, in the Flow View canvas of the Page Flow Designer.

Figure 2-22 Controller File for the Order Page Flow

Controller File for the Order Page Flow


 

The following table describes each component in the controller file for the Order page flow.

Table 2-12 Components of the Controller File for the Order Page Flow 

Component

Function

begin Icon

Passes control to the Equipment.jsp file.

Equipment.jsp

Provides a user interface to the Office Equipment Order Management system, enabling users to place an order or view the status of pending orders. It provides links to raise actions using the netui-anchor JSP page flow tag, including placeOrderStatus and checkStatus. For example:

<netui:anchor action="placeOrderPage">
Place a New Order</netui:anchor></p>
<netui:anchor action="checkStatus">
Check Order Staus</netui:anchor></p>

placeOrderPage Action

Passes control to the placeOrder.jsp file.

placeOrder.jsp

Prompts the user for the ID of the item being ordered. It defines an input form to collect the item ID using the netui:form JSP page flow tag. It associates the contents of the form with the form bean defined by the placeOrder action. For example:

<netui:form action="/placeOrder" focus="ordid">

To learn more about the netui:form page flow tag, see Designing User Interfaces in JSPs in the WebLogic Workshop Help.

placeOrder Action

Retrieves the office equipment order and passes control to Success.jsp (or to Error.jsp in the event of an error). The placeOrder action defines a form bean with properties that correspond to the data fields in the order input form.

The placeOrder action uses m_WorkflowInvoker, an instance of the custom WorkflowInvoker control, to invoke the Order Requisition business process. The WorkflowInvoker custom control is described in detail in Building a Custom Control.

It also uses m_DBCtrl, an instance of the UsersDBControl database control, m_DBCtrl, to insert the order into the Employee Information database. The UsersDBControl database control is described in detail in Viewing Employee Information.

Success.jsp

Displays a message, indicating that the order was placed successfully, and prompts the user to check the status of all pending orders or click Done. It defines an input form using the netui:form JSP page flow tag and associates its contents with the form bean defined by the done action. For example:

<netui:form action="done">

If the user clicks Check Status, the checkStatus action is raised; if the user clicks Done, the done action is raised. For example:

<netui:button type="submit" 
value="Check Order Status" action="checkStatus"></netui:button>
<netui:imageButton value="Done"
src="/e2ePortalProject/framework/skins/default/images/done.gif">
</netui:imageButton>

Error.jsp

Displays an error message in the event of an error.

checkStatus Action

Retrieves the employee ID and uses the JoinDB custom control to coordinate database queries to the Employee Information and Office Equipment Order Management databases. For example:

m_Array= m_JoinDB.joinDB(m_employeeid);

It then passes control to the Status.jsp file.

The JoinDB custom control is described in detail in Building a Custom Control.

Status.jsp

Displays a list of the current manager's direct employees. First, it uses a netui-data:callPageFlow JSP page flow tag to call the checkStatusBusiness() method defined in the controller file. Then, it uses the netui-data:repeater, netui-data:repeaterHeader, netui-data:repeaterItem, and netui:label JSP page flow tags to render the contents. For example:

<netui-data:callPageFlow method="checkStatusBusiness" resultId="m_Array"/>
<netui-data:repeater dataSource="{pageContext.m_Array}">
<netui-data:repeaterHeader>
<table border="1">
<tr>
<td><b>Order ID</b></td>
<td><b>Status Description</b></td>
</tr>
</netui-data:repeaterHeader>
<netui-data:repeaterItem>
<tr>
<td>
<netui:label value="{container.item.m_ordId}" />
</td>
<td>
<netui:label value="{container.item.m_statusDesc}" />
</td>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter>
</table>
</netui-data:repeaterFooter>
</netui-data:repeater>

To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help.

DoneStatus Action

Returns control to the Equipment.jsp file.

Done Action

Returns control to the Equipment.jsp file.

logout Action

Passes control to the expired.jsp file. This action is triggered, when the user logs off the system, by the Log Out page flow controller file, described in Log Out Portlet.

expired.jsp

Displays a Data Expired message when the user logs off the system.

ErrorInvalid.jsp

Reprompts for information when user specifies an invalid entry.

logIn Action

Passes control to the begin action of the Controller.jpf page flow. This action is triggered when the user selects Log In Again from the Log Out portlet.


 

 


Building a Custom Control

Java controls are reusable components you can use anywhere within a platform application. They provide a convenient way to incorporate access to resources and encapsulate business logic.

WebLogic Workshop includes a set of built-in Java controls, mostly designed to access resources, such as Enterprise Java Beans (EJBs) and databases, from within your application. For an example of how to use one, see Using a Built-In Control.

You can also create custom Java controls tailored to your project or application. Custom controls are based on the same framework that built-in controls are based. Unlike built-in controls, which give you access to an interface that extends the source, source files for custom controls are stored within the project and accessed directly from the locations in which they are stored. This arrangement enables you to separate and reuse the control code.

WebLogic Workshop makes it easy to create a custom control: click the target folder and choose File—>New—> Custom Java Control. The Custom Control Editor opens and displays a Java control source file. This file defines the implementation for your custom control. It can be identified by the string Impl that appears in its name, for example, JoinDBImpl.jcs. In addition, WebLogic Workshop automatically generates and maintains a Java class file that defines the public interface for the Java control—you never need to edit this file.

The Custom Control Editor is a graphical tool that enables you to design a custom control and create methods to expose its functionality, such as the JoinDB custom control shown in the following figure.

Figure 2-23 Custom Control Editor

Custom Control Editor


 

The following table describes the custom control design tools shown in the previous figure.

Table 2-13 Tools for Designing Custom Control Files 

Callout #

Use this tool...

For these tasks...

1

Application Window

Create, view, and edit custom control files in your portal application projects. The names of custom control files end in .jcs.

2

Design and Source Views

Design your custom control file in this area. Switch between the Design and Source code views, as required; changes made in one view are automatically reflected in the other.

3

Palette Window

Add methods, callbacks, variables, and so on, by dragging components from the Palette window and dropping them onto the Design View canvas. The options available in the Palette window depend on the type of control you are building.

4

Data Palette Window

Define instances of Java controls for use in the custom control.

6

Property Editor Window

Set properties for the custom control component that is currently selected. You can select a custom control component by clicking on it in the Design View canvas or by selecting its name in the Document Structure window (described below).

7

Document Structure Window

View a summary of the Java entities that make up the control file (see Figure 2-24). The summary includes the Java classes, methods and signatures, variables, and inner classes defined for the custom control.

You can select a Java entity in the Document Structure window by clicking on it. When you select a method, it is selected in the Design View canvas and you can edit its properties in the Property Editor window. You can double-click on a Java entity to jump to its code location in Source View.


 

The following figure shows the Document Structure window for a custom control.

Figure 2-24 Document Structure Window for a Custom Control

Document Structure Window for a Custom Control


 

To learn more about building custom controls:

 


Reviewing the Custom Controls for the Avitek Intranet Portal

The e2ePortal application defines two custom controls:

The custom controls are described in detail in the following sections.

JoinDB Custom Control

The JoinDB custom control coordinates database queries to multiple databases, including:

The JoinDB custom control is employed by the CheckStatus action defined in the Order portlet page flow, as described in Order Portlet.

The JoinDB custom control and related files are stored within the JoinDB folder in the e2ePortal application, as shown in the following figure.

Figure 2-25 Files for the JoinDB Custom Control

Files for the JoinDB Custom Control


 

The following table describes the contents of the JoinDB folder.

Table 2-14 JoinDB Custom Control File Descriptions 

File

Function

JoinDBImpl.jcs

Defines the implementation code for the custom control.

JoinDB.java

Defines the public interface for the custom control. This file is automatically generated by WebLogic Workshop.

OrderStatus.java

Defines the OrderStatus() method used to merge order tracking information (retrieved from the Office Equipment Order Management database) with employee information (retrieved from the Employee Information database). This method is used by the custom control.

UsersDBControl.jcx

Database control file that defines the database calls used to retrieve employee information. This control is defined in detail in Viewing Employee Information.


 

WorkflowInvoker Custom Control

The WorkflowInvoker custom control enables the portal to invoke a business process.

The WorkflowInvoker custom control is employed by the PlaceOrder action defined in the Order portlet page flow, as described in Order Portlet.

The WorkflowInvoker custom control and related files are stored in the WorkflowInvoker folder in the e2ePortal application, as shown in the following figure.

Figure 2-26 Files for the WorkflowInvoker Custom Control

Files for the WorkflowInvoker Custom Control


 

The following table describes the contents of the WorkflowInvoker folder.

Table 2-15 WorkflowInvoker Custom Control File Descriptions 

File

Description

OrderRequisitionControlWSContract.wsdl

Web Service Definition Language (WSDL) file describing the methods and callbacks that the OrderRequisitionControlWS.jws web service implements, including method names, parameters, and return types.

The OrderRequisitionControlWS.jws web service is defined in the e2eWorkflow application, as described in Reviewing the Office Equipment Order Management System.

OrderRequisitionWebServices.jcx

Process control that starts the Order Requisition business process through the OrderRequisitionControlWS.jws file.

The OrderRequisitionControlWS.jws web service is defined in the e2eWorkflow application, as described in Reviewing the Office Equipment Order Management System.

WorkflowInvokerImpl.jcs

Defines the implementation code for the custom control. The invokeWorkflow() method calls the clientRequest() method defined by the OrderRequisitionControlWS.jws web service to invoke the Order Requisition workflow, defined in Order Requisition Business Process.

WorkflowInvoker.java

Defines the public interface for the custom control. This file is automatically generated by WebLogic Workshop.


 

 


Configuring Security in Web Applications

Secure access to the WebLogic Platform Tour is provided by WebLogic Server security realm user authentication.

To provide secure access to a Web application using user authentication, update the web.xml and weblogic.xml deployment descriptors to define the following parameters:

Deployment descriptors are XML documents that describe the contents of an application directory or JAR file. The J2EE specification defines standard, portable deployment descriptors for J2EE components and applications, such as web.xml. BEA defines additional WebLogic-specific deployment descriptors, such as weblogic.xml, for deploying a component or application in a WebLogic Server environment.

In a WebLogic Server environment, the deployment descriptors are located in the WEB-INF directory of the Web application root directory, as required by the J2EE specification. The WEB-INF directory also contains two subdirectories for storing compiled Java classes and library JAR files. Note that the root directory of the Web application hierarchy defines the document root. All files under this root directory (except files in the WEB-INF directory) can be served to the client.

Security constraints, such as user authentication, are defined in the web.xml file.

For example, supposed you wanted to define security constraints for the e2ePortal application. Open the web.xml file for the e2ePortal application in WebLogic Workshop, as follows:

  1. In the e2ePortal/e2ePortalProject folder, expand the WEB-INF directory in the Applications window.
  2. Double-click the web.xml file, located in the WEB-INF directory.
  3. This file defines the security constraint information as follows:

<!-- Security -->
<security-constraint>
<web-resource-collection>
<web-resource-name>login</web-resource-name>
<url-pattern>/Controller.jpf</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>employee</role-name>
<role-name>manager</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>employee</web-resource-name>
<url-pattern>/Employee.portal</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>employee</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>manager</web-resource-name>
<url-pattern>/Manager.portal</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login/loginRedirect.jsp</form-login-page>
<form-error-page>/login/login_error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>employee</role-name>
</security-role>
<security-role>
<role-name>manager</role-name>
</security-role>
<security-role>
<description>Administrator</description>
<role-name>Admin</role-name>
</security-role>
<security-role>
<description>all users</description>
<role-name>AnonymousRole</role-name>
</security-role>

The following table describes the XML elements in the previous code excerpt.

This element...

Performs this function...

<login-config>

Enables form-based authentication and specifies:

  • /login/loginRedirect.jsp as the JSP page containing the authentication form

  • /login/login_error.jsp as the JSP file page to return in the event of an error

The login.jsp file that is initially displayed in the Log In portlet generates an input form for obtaining user login information. It defines the action as follows:

<% String formActionURL = 
response.encodeURL("j_security_check");%>
<form method="post" action="<%formActionURL %>">

As a result, the login information is passed to j_security_check for authentication.

<security-constraint>

Specifies the following security details:

  • Web application component to which the security constraint is applied—this is the first page that is called when you invoke the Web application in a browser.

  • User roles that have security access, such as employee and manager.

  • No transport guarantees are required for communications between client and server.

<security-role>

Specifies valid security roles. At deployment time, security role mappings are obtained from the weblogic.xml file. (This file is configured using the WebLogic Server Administration Console.)


 

To learn more about configuring security, see Securing Web Applications in Programming WebLogic Security, available on e-docs.

Before proceeding to the next step in the WebLogic Platform Tour:

  1. Close all open files by choosing File—>Close Files
  2. To conserve screen real estate, temporarily minimize the WebLogic Workshop window.

 

Skip navigation bar  Back to Top Previous Next