WebLogic Platform Tour Guide
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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:
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:
The employee view of the intranet portal is displayed.
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:
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
The Portal Designer is a graphic tool that enables you to design portals such as the Employee portal shown in the following figure.
The following table describes the portal design tools shown in the previous figure.
Create, view, and edit portal files in your portal application projects. The names of portal files end in 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. |
||
Add books and pages to the portal by dragging components from the Palette window and dropping them onto the Design View canvas. |
||
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. |
||
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). |
||
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
As shown in the previous figure, the following components make up the hierarchical structure of a portal:
A portal look and feel consists of a single XML file (with a .laf
extension) that points to the skeleton and skin definitions. To define the look-and-feel definition for the Desktop component, select one in the Look and Feel field in its Property Editor window.
The Document Structure window shows the relationship between specific components in the current portal file.
Figure 2-3 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:
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
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.
The following table describes the portlet design tools shown in the previous figure.
Create, view, and edit portlet files in your portal application projects. The names of portlet files end in 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. |
||
Add one of the following controls to the portlet:
|
||
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). |
||
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
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:
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
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
The following table describes the page flow design tools shown in the previous figure.
Create, view, and edit page flow files in your portal application projects. The names of page flow files end in 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. |
||
Design your page flow in this area. Switch between the following views, as required:
Changes made in one view are automatically reflected in the other. |
||
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: |
||
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 |
||
Edit a form bean defined for the selected action. If no form beans are defined for the selected action, the window is empty. |
||
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). |
||
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
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
To learn more about designing page flows:
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
The following table describes the JSP editing tools shown in the previous figure.
Create, view, and edit JSP files in your portal application projects. The names of JSP files end in |
||
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. |
||
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:
WebLogic Workshop includes the required tag libraries in the |
||
Navigate through the rows and columns of the selected table, and add, merge, or delete select cells and rows. |
||
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). |
||
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
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
To learn more about creating JSP content:
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:
Figure 2-12 WebLogic Administration Portal
To learn more about managing portals, see the WebLogic Administration Portal Help, available on e-docs.
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.
The e2ePortal
Web application defines the Avitek intranet portal. To view the e2ePortal
Web application in WebLogic Workshop:
The following table describes each of the folders in the e2ePortal
application.
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. |
|
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:
The contents of this folder are described in the sections that follow. |
|
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. |
|
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. |
|
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. |
|
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 role information (this folder is empty for the |
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.
The e2ePortalProject
Web application consists of three portals: Log In, Employee, and Manager.
Login.portal
.Employee.portal
.Manager.portal
.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.
The following table defines the portlets that are defined for each of the three portals.
For example, the following figure shows the Employee portlet in Design View.
Figure 2-16 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
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.
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
The following table describes each component of the controller file for the Direct Reports page flow.
Defines the The |
|
Displays a list of the current manager's direct employees. First, it uses a
To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help. |
|
Dummy action for form defined in |
|
Passes control to the |
|
Displays a |
|
Passes control to the |
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.
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
The following table describes each component of the controller file for the Employee page flow.
Retrieves the user name for the current user and passes control to The
The |
|
Displays the employee profile for the current user. Defines an input form to collect the information about the employee using the
To learn more about the |
|
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 The |
|
Passes control to the |
|
Displays a |
|
Passes control to the |
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.
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
The following table describes each component of the controller file for the Log Out page flow.
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
The following table describes each component of the controller file for the Manager Tasks Pending page flow.
Defines a Worklist The 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
|
|
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 The
To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help. |
|
Gets details about a selected task using
It then passes control to the |
|
Displays the Task Response text box, prompting the manager to respond to the pending task. |
|
Retrieves the manager's response using a form bean that defines the The
|
|
Passes control to the |
|
Displays a |
|
Passes control to the |
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.
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
The following table describes each component in the controller file for the Order page flow.
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
|
|
Prompts the user for the ID of the item being ordered. It defines an input form to collect the item ID using the
To learn more about the |
|
Retrieves the office equipment order and passes control to The It also uses |
|
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 If the user clicks Check Status, the
|
|
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:
It then passes control to the The |
|
Displays a list of the current manager's direct employees. First, it uses a
To learn more about the JSP page flow tags listed here, see Designing User Interfaces in JSPs in the WebLogic Workshop Help. |
|
Passes control to the |
|
Displays a |
|
Reprompts for information when user specifies an invalid entry. |
|
Passes control to the |
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 FileImpl
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
The following table describes the custom control design tools shown in the previous figure.
Create, view, and edit custom control files in your portal application projects. The names of custom control files end in |
||
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. |
||
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. |
||
Define instances of Java controls for use in the custom control. |
||
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). |
||
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
To learn more about building custom controls:
The e2ePortal
application defines two custom controls:
JoinDB
—Coordinates database queries to multiple databasesWorkflowInvoker
—Enables the portal to invoke a business processThe custom controls are described in detail in the following sections.
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
The following table describes the contents of the JoinDB
folder.
Defines the public interface for the custom control. This file is automatically generated by WebLogic Workshop. |
|
Defines the |
|
Database control file that defines the database calls used to retrieve employee information. This control is defined in detail in Viewing Employee Information. |
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
The following table describes the contents of the WorkflowInvoker
folder.
Web Service Definition Language (WSDL) file describing the methods and callbacks that the The |
|
Process control that starts the Order Requisition business process through the The |
|
Defines the implementation code for the custom control. The |
|
Defines the public interface for the custom control. This file is automatically generated by WebLogic Workshop. |
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:
<!-- 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.
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:
![]() ![]() |
![]() |
![]() |