Skip navigation.
Downloads | Product Documentation | Support

WebLogic Portlets for SAP Development Guide

# WebLogic Portlets for SAP Development Guide

This document explains how to develop Portlets for the BEA WebLogic Portlets for SAP application from an existing framework.

The BEA WebLogic Portlets for SAP application integrates the BEA WebLogic Portal application with the SAP R/3 4.6C System.

This guide contains the following sections:

- About Portlet Architecture
- Creating a New Portal Application with the Portlets
- Adding the Portlets to an Existing Portal Application
- Creating a New Portlet
- Analyzing SAP Business Objects
- Extending the .jsp Template
- Extending the .jpf Template
- Updating the .properties File for Configuring the Business Object
- Deploying the Portal Application
- Configuring BEA WebLogic Portlets Administration
- Understanding Application Constants
- Password Encryption
- Database Tables
- Linking Portlets

# About Portlet Architecture

The basic architecture of the BEA Portal application, shown in Figure 1, helps in integrating with the business objects from SAP R/3 system.

Figure 1 Architecture diagram

## About Login Portlet Transaction Flow

1. Login portlet helps to login to the portal.
2. The User enters the user credentials and clicks Submit. The request is posted to a Backing file.
3. The Backing file uses BEA's API for authentication to validate the user entered credentials. On successful validation the logged in user information is stored in the session.
4. On successful login, portlets are displayed with information based on the user information that is stored in the session by the backing file. Other wise the login screen is shown with the appropriate message.

## Business Portlet Transaction Flow

1. A Business Process Request is invoked from the portlet.
2. Any action in the portlet is routed to the Business Object Controller (BOC) specific to that portlet through the Java Page Flow (JPF).
3. First, the Control comes to the JPF depending on the action performed in the portlet.
4. Before sending the business request to the BOC, validations are performed, if any, using the Validator. If any validation error occurs, the request is redirected to the pages specified in the error handling mechanism for that action.
5. On successful validation, the JPF routes the request to the BOC.
6. The Business Object routes the request to the Data Engine Layer (DEL).
7. SAP DEL processes the request by accessing the Database Layer (DBL).
8. The responsibility of the DEL is to process the business request, get the required information using the DBL, connect to the ERP, and call the respective BAPI to process the Business Request and return the response back to the JPF, which in turn displays the portlet.

# Creating a New Portal Application with the Portlets

To Create a New Portal Application with the Portlets (SAP):

1. Open BEA WebLogic Workshop application.
2. Navigate to File > New > Application, and create an application category portal.
3. To setup the data, right-click on the data folder and navigate to Install, and click on PortletsforSAPPropertySet.
4. Create a new Portal Web Project:
5. Right-click on the newly created portal web project and select PortletsForSAP option.
6. Open the portal file (.portal) and right-click on the placeholder and insert the required portlets.

# Adding the Portlets to an Existing Portal Application

To Add Portlets to an existing Portal Application:

1. Open BEA WebLogic Workshop application.
2. To set up the data, right-click on the data folder, navigate to Install, and click on Update PortletsforSAPPropertySet.
3. Right-click on the existing portal web project and select Update PortletsForSAP option.
4. Open the portal file (.portal) and right-click on the placeholder and insert the required portlets.

# Creating a New Portlet

A sample portlet is available under the following location:

`<%BEA_HOME%>\weblogic81\portal\thirdparty\sapportlets\newportlet`

To Create a New Portlet:

1. Copy the sample .jsp and .jpf files in the folder having BEA portlets.
2. Rename the sample file with the name of your choice.
3. Modify the code in the .jpf and .jsp files that is inside "< >" brackets.
4. Deploy the newly created portlet from BEA WebLogic Workshop.

## Creating a New Portlet from a Pre-configured Business Object

To Create a New Portlet from a pre-configured business object:

1. Copy the sample .jsp and .jpf files in the folder having BEA portlets.
2. Rename the sample file with the name of your choice.
3. Modify the code in the .jpf and .jsp files that is inside "< >" brackets.
4. Deploy the newly created portlet from BEA WebLogic Workshop.
5. Login to BEA WebLogic Portlets V1.0 as an administrator, if you want to change the look and feel of the portlet by changing the label names of the columns shown to the users.

## Adding Create, Update, or Delete Functionality to an Existing Portlet

To Add Create, Update, or Delete Functionality to an existing Portlet:

1. Copy the sample .jsp and .jpf files in the folder having BEA portlets.
2. Rename the sample files with the name of your choice.
3. Under the sample folder there is a folder called portlets. Under this folder, there is a file called SamplePortlet.portlet. Rename this file with the name of your portlet.
4. Under the sample folder there is one more folder called SamplePortletFlow. Rename the folder with the name of your portlet and append the word "Flow". Modify the .jsp and .jpf files as per your requirements.
5. Under the SamplePortletFlow folder there is a folder called SamplePortletPref. Rename the folder with the name of your portlet and append the word "Flow". Modify the .jsp and .jpf files as per your requirements.
6. Deploy the newly created portlet from BEA WebLogic Workshop.

## Creating a New Portlet from a New SAP Business Object

1. Login to BEA WebLogic Portlets V1.0 as an administrator, and configure the business object as per your requirements. Refer to administration guide (BEA WebLogic Portlets Administration Guide) for details.
2. Deploy the newly created portlet from BEA WebLogic Workshop.

# Analyzing SAP Business Objects

Log in to your SAP 4.6C system in order to get information regarding the available business objects. Once you have analyzed the BAPI's that you will be requiring for your application you can configure these BAPI's (Business Object Preferences) using the BEA WebLogic Portlets Administration Screen. Refer to administration guide (BEA WebLogic Portlets Administration Guide) for details.

# Extending the .jsp Template

The .jsp file is for viewing. This can be updated and extended as per the developer's requirements.

# Extending the .jpf Template

The .jpf files can be updated and extended by adding new actions as per the requirements for the portlet.

# Updating the .properties File for Configuring the Business Object

To update the .properties file:

1. Open BEA WebLogic Workshop application.
2. Open the file PORTALnet.properties file.
3. Update the properties file as per the requirements.

1. If a new portlet is developed, Portlet ID and the required input fields for that portlet should be specified.
2. For Sales Order portlet the following information needs to be updated depending on the EIS.

>     #########################################

>     # SAP Sales Area

>     #########################################

>     SAP_SALES_AREA_PLANT               = value

>     SAP_CONTROLAREA                    = value

>     SAP_COMPANYCODE                    = value

>     SAP_SALES_ORG                      = value

>     SAP_DISTR_CHANNEL                  = value

>     SAP_DIVISION                       = value

>     SAP_SALES_ORDER_DOC_TYPE           = value

>     SAP_RETURN_ORDER_DOC_TYPE          = value

>     SAP_PARTNER_ROLE                   = value

>     SAP_RETURN_ORDER_STORAGE_LOCATION  = value

# Deploying the Portal Application

1. Open BEA WebLogic Workshop application.
2. Build the Application.
3. Start the Server.

# Configuring BEA WebLogic Portlets Administration

The portlets can be configured using BEA WebLogic Portal Administration functionality.

For more information refer to Administration Guide for BEA WebLogic Portlets.

# Understanding Application Constants

This section explains the purpose of the main constants that are used across the product. This is helpful in centralizing the constants and their values.

DateFormat Constants Used in DateUtil.java:

Constants defined under this section hold all the possible date formats used across the product.

Symbolic Constants:

Constants defined under this section hold all the symbols used across the product.

For example: "&amp;", "&lt;", "&gt;"

Property set Name:

Constant used to define the property file name representing Property set Name.

DataType Name Constants:

Constants defined under this section hold all the datatypes used in the product to be shown as list of values.

Constants Used for Window:

Constants defined under this section hold all values that are used to set the properties of the browser window, that has been created using javascript.

Constants Used for Code Lookup:

Constants defined under this section hold all values that are used as one of the parameters while looking up for the code description.

Note: Any change to the constant applications without analysis will hinder the product functionality

# Password Encryption

Password encryption is done using digital certificates. Digital certificates are generated using the Java keytool. Encryption and decryption is done using the DES algorithm on the private key and public key of the digital certificate.

# Database Tables

This section details the database design (tables, fields, data types and description etc.,)

Table 1 PNET_APPL_INSTANCE

Table Alias | PNET_APPL_INSTANCE
Description | This table holds the EIS application instance details.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique id
APP_ID | NUMBER | N | Unique Application id for EIS
NAME | VARCHAR 2(32) | Y | Name of the EIS Application
NATIVE_BASE_URL | VARCHAR 2(300) | Y | Url to connect to the EIS Application
DEF_USER_NAME | VARCHAR 2(30) | Y | User id for connecting to the EIS Application
DEF_PASSWORD | VARCHAR 2(200) | Y | Password for connecting to the EIS Application
DEF_FLAG | VARCHAR 2(1) | Y | This flag represents the instance to be used by the application by default.
CON_STR_1 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_2 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_3 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_4 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_5 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_6 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_7 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_8 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_9 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.
CON_STR_10 | VARCHAR 2(30) | Y | Represents connection string parameters that are required to connect to EIS.

Primary Key | ID
Foreign Key | APP_ID
Sequence | ID

Table 2 PNET_APP_ROLE

Table Alias | PNET_APP_ROLE
Description | This table holds the possible user types example CUSTOMER/EMPLOYEE
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
APP_ID | NUMBER | N | Unique Application id for EIS
ROLE_ID | NUMBER | N | Represents role Id (Example representing CUSTOMER/ EMPLOYEE)

Primary Key | ID
Foreign Key | APP_ID,ROLE_ID
Sequence |

Table 3 PNET_COMP_DET

Table Alias | PNET_COMP_DET
Description | This table holds information pertaining to the Business Object Input/Output parameters.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
COMP_MAST_ID | NUMBER | Y | Represents for which business Object this info pertaining to
PAGELET_PARAM_ID | NUMBER | Y | Represents portlet id
PARAMETER_TYPE | VARCHAR2 (30) | Y | Represents either input or output
SUB_TYPE | VARCHAR2 (30) | Y | Represents type of parameter scalar/table/struct
NAME | VARCHAR2 (30) | Y | Name of the parameter
MANDATORY | CHAR (1) | Y | This filed is required or not.

Primary Key | ID
Foreign Key | COMP_MAST_ID
Sequence | ID

Table 4 PNET_COMP_DET_SAP

Table Alias | PNET_COMP_DET_SAP
Description | This table holding default values for parameters for the business objects.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | Y | Represents the pagelet parameter id
COMP_DET_ID | NUMBER | N | Unique
FIELD_NAME | VARCHAR2 (30) | Y | Represents the fields name
DEFAULT_VALUE | VARCHAR2 (30) | Y | Holds default value
MANDATORY | CHAR (1) | Y | Represents either mandatory or not
COMP_DET_SAP_ID | NUMBER | Y | Unique id

Primary Key | ID
Foreign Key | COMP_DET_ID
Sequence | COMP_DET_SAP_ID

Table 5 PNET_COMP_MAST

Table Alias | PNET_COMP_MAST
Description | This table holds information pertaining to the Business Object s
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
PAGELET_ID | NUMBER | N | Holds pagelet id
NAME | VARCHAR 2(100) | Y | Holds Name of the business object
APP_ID | NUMBER | Y | Represents application id
ACTION | VARCHAR 2(10) | Y | Represents the business object action used (create/update.)
AUTHOR | VARCHAR 2(1) | Y | Represents owner
VERSION | NUMBER | Y | Version
PORTLET_ID | NUMBER | Y | Represents portlet id

Primary Key | ID
Foreign Key | PAGELET_ID, PORTLET_ID
Sequence | ID

Table 6 PNET_CONN_STR_CFG

Table Alias | PNET_CONN_STR_CFG
Description | Holds the description for the instance details
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
APP_ID | NUMBER | N | Represents EIS application
LABEL | VARCHAR 2(70) | Y | Represents label name for the parameter
COL_NAME | VARCHAR 2(30) | Y | Represents name of the column for the parameter
DISPLAY_ORDER | NUMBER | Y | --

Primary Key | ID
Foreign Key | APP_ID
Sequence |

Table 7 PNET_PAGELET

Table Alias | PNET_PAGELET
Description | Holds the information pertaining to the portlets
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique id
APP_ID | NUMBER | N | Represents EIS application
NAME | VARCHAR 2(32) | N | Represents Portlet name
TITLE | VARCHAR 2(100) | N | Represents portlet title
VERSION | NUMBER | N | Portlet version
ACTION | VARCHAR 2(10) | Y | For which action like view, update, delete, create
CREATEDBY | VARCHAR 2(1) | Y | Represents creator name.

Primary Key | ID
Foreign Key | APP_ID
Sequence | ID

Table 8 PNET_PAGELET_DET

Table Alias | PNET_PAGELET_DET
Description | Holds the display parameters for the business object.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
PAGELET_ID | NUMBER | N | Id representing the portlet
NAME | VARCHAR 2(32) | N | Name of the display parameter
URL | VARCHAR 2(300) | Y | Url
TARGET_FLAG | VARCHAR 2(1) | N | Has values yes or no.
DATATYPE | VARCHAR 2(70) | N | Represents type of data Char, Number, Date
HIDDEN_FLAG | VARCHAR 2(1) | N | Whether this field is to be displayed or not.
DISPLAY_ORDER | NUMBER | Y | --
SORT_ORD | VARCHAR 2(4) | Y | --
LABEL | VARCHAR 2(70) | N | Represents Display label
COMP_MAST_ID | NUMBER | Y | Represents business object id.
COMP_DET_ID | NUMBER | Y | Represents display parameter table/struct/scalar id.
SEED_FLAG | VARCHAR 2(1) | Y | --
AUTHOR, | VARCHAR 2(1) | Y | Created by
MANDATORY, | VARCHAR 2(1) | Y | This field is mandatory for business object to function or not

Primary Key | ID
Foreign Key | PAGELET_ID,COMP_MAST_ID,COMP_DET_ID
Sequence | ID

Table 9 PNET_PAGELET_DET_ROLE

Table Alias | PNET_PAGELET_DET_ROLE
Description | This table holds the information pertaining for the display parameters based on the user types.
Owner |

Data Element Name | Data Type | Mandatory | Description
PAGELET_DET_ID | NUMBER | Y | Represents pagelet det id
PAGELET_ID | NUMBER | Y | Represents the pagelet id
PARAM_ROLE | VARCHAR 2(30) | Y | Represents user type either (ex customer/employee)
COMP_DET_ID, | NUMBER | Y | Represents comp det id.
HIDDEN_FLAG, | VARCHAR 2(1) | Y | This field is mandatory for business object to function or not
LABEL | VARCHAR 2(70) | N | Represents Display label

Primary Key | PAGELET_DET_ID
Foreign Key | COMP_DET_ID,
Sequence |

Table 10 PNET_PAGELET_PARAM

Table Alias | PNET_PAGELET_PARAM
Description | This tables holds the list of edit parameters
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
PAGELET_ID | NUMBER | N | Represents the pagelet id
NAME | VARCHAR 2(32) | Y | Name of the edit parameter
DATATYPE | VARCHAR 2(70) | Y | Represents type of data Char, Number, Date
PARAM_ROLE | VARCHAR 2(30) | Y | Represents user type either (ex customer/employee)
CONDITION | VARCHAR 2(30) | Y | --
COMP_MAST_ID | NUMBER | Y | Represents business object id
COMP_DET_ID | NUMBER | Y | Represents comp det id
LOCAL_FLAG | VARCHAR 2(1) | N | --
LOCAL_VAL | VARCHAR 2(70) | Y | --
REQUEST_FLAG | VARCHAR 2(1) | N | --
LABELNAME | VARCHAR 2(32) | Y | Represents Display label

Primary Key | ID
Foreign Key | PAGELET_ID,COMP_MAST_ID,COMP_DET_ID
Sequence |

Table 11 PNET_PAGELET_PARAM_ROLE

Table Alias | PNET_PAGELET_PARAM_ROLE
Description | This table holds the information pertaining to the edit display parameters based on user type.
Owner |

Data Element Name | Data Type | Mandatory | Description
PAGELET_PARAM_ID | NUMBER | N | Represents pagelet param id
PAGELET_ID | NUMBER | Y | Represents pagelet id
PARAM_ROLE | VARCHAR 2(30) | N | Represents param role
LOCAL_FLAG | VARCHAR 2(1) | Y | --
LOCAL_VAL | VARCHAR 2(70) | Y | --
REQUEST_FLAG | VARCHAR 2(1) | Y | --
COMP_DET_ID | NUMBER | Y |

Primary Key | None
Foreign Key | COMP_DET_ID
Sequence | None

Table 12 PNET_ROLE

Table Alias | PNET_ROLE
Description | This table holds the information pertaining to the user types
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique id
NAME | VARCHAR 2(30) | Y | User type (example EMPLOYEE/CUSTOMER)

Primary Key | ID
Foreign Key | None
Sequence | None

Table 13 PNET_SINGLE_SIGN

Table Alias | PNET_SINGLE_SIGN
Description | Holds user credential mapping values.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
PORTAL_USERID | VARCHAR 2(32) | N | Represents portal user id
APP_INST_ID | NUMBER | N | Represents application instance id
TGT_USERNAME | VARCHAR 2(30) | Y | Represents EIS user id value
TGT_PASSWORD | VARCHAR 2(200) | Y | Represents EIS password
NATIVE_ENABLED_FLAG | VARCHAR 2(1) | N | Represents whether to give permission to native enable or not to EIS
TARGET_ENABLED_FLAG | VARCHAR 2(1) | N | Represents whether to give permission to target enable or not to EIS
USER_ROLE | VARCHAR 2(1) | Y | Represents user type Customer/Employee
ACTIVE_FLAG | VARCHAR 2() | Y | This flag represents whether this mapping is active or not.
DEFAULT_CREDENTIAL | CHAR (1) | Y | Represents to use the EIS Instance Credential or not.

Primary Key | ID
Foreign Key | APP_INST_ID
Sequence | ID

Table 14 PNET_SRC_APPLICATION

Table Alias | PNET_SRC_APPLICATION
Description | This holds the application instance details.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
NAME | VARCHAR 2(32) | Y | EIS Instance application name
VERSION | VARCHAR 2(32) | Y | Default value 1.0
DESCRIPTION | VARCHAR 2(200) | Y | About the EIS Instance Application
NATIVE_URL_TEXT | VARCHAR 2(200) | Y | --
APP_TYPE | VARCHAR 2(32) | Y | Represents application type SAP/Siebel

Primary Key | ID
Foreign Key | None
Sequence | None

Table 15 PNET_URL_PARAM

Table Alias | PNET_URL_PARAM
Description | This table holds the parameters pertaining to the native drill down.
Owner |

Data Element Name | Data Type | Mandatory | Description
ID | NUMBER | N | Unique Id
PAGELET_DET_ID | NUMBER | N | Represents Pagelet id
PARAM_NAME | VARCHAR 2(30) | Y | Represents Parameter Name
PARAM_TYPE | NUMBER | Y | Represents parameter type
PARAM_VALUE_SRC | VARCHAR 2(300) | Y | --
PARAM_VALUE | VARCHAR 2(300) | Y | Represents field name in the business object.

Primary Key | ID
Foreign Key | PAGELET_DET_ID
Sequence |

Table 16 PNET_USER_PARAM_MAP

Table Alias | PNET_USER_PARAM_MAP
Description | This table holds the customer id for the portal user
Owner |

Data Element Name | Data Type | Mandatory | Description
USER_ID | NUMBER | N | Represents the portal user id
APP_ID | NUMBER | N | Represents the EIS Application Id
USER_PARAM_ID | NUMBER | N | --
VALUE | VARCHAR 2(70) | Y | Represents the customer id in EIS.

Primary Key | None
Foreign Key | USER_ID,APP_ID,USER_PARAM_ID,
Sequence | None

# Linking Portlets

Inter-portlet communication can be achieved using backing files, but the page flow is the recommended mechanism. This topic explains how to use multiple page flows that react to browser events such as forms. To create page flow portlets that communicate with each other, take the following steps:

To Create Portlets that Share Messages:

1. Inside the portal Web application, create a portlets directory.
2. Within this portlets directory, create two new page flows. (A separate directory will be automatically created for each one).
3. Create a portlet for each page flow and place these portlets on a portal.
4. In the Portal, click on the second portlet and set the listen to attribute to the instanceLabel of the first portlet. (Open the Portal in Design View, click once on the second portlet and find the properties editor.)

Note: The listenTo attribute is associated with the instanceLabel of the other portlet. You can change the definitionLabel without affecting the listenTo behavior.

5. In the .jpf file for the second portlet you can do one of two things.

The first option is to use the same action method signature as in the first page flow. For example, this action definition is from the page flow controller for portlet 2:

>      /**

>       * @jpf:action

>       * @jpf:forward name="listening" path="listening.jsp"

>       */

>       public Forward passString1(portlets.j1.j1Controller.Form form)

>       {

>           thePassedText = form.getText();

>           return new Forward( "listening" );

>       }

Or you can add a handler for ActionNotFoundException handler. For example, in the page flow controller for portlet 2, make sure the @jpf:catch annotation is defined at the class level:

>     /**

>      * @jpf:controller

>      * @jpf:catch type="ActionNotFoundException" method="doNothing"

>      */

And in the same page flow controller, that an action method such as the following is defined:

>      /**

>       * @jpf:exception-handler

>       * @jpf:forward name="current" return-to="currentPage"

>       */

>       protected Forward doNothing( ActionNotFoundException e, String actionName, String message, FormData form )

>       {

>           return new Forward( "current" );

>       }

As you edit the page flow, you can verify the navigation by opening a viewer that will preview the pages without the portal.

1. Place the two portlets inside placeholders within your portal.