[Integration] BEA Portal 10

Introduction

This is a step by step guide showing how a valid login user to BEA Portal 10 Application, can seamlessly access a resource ( typically a dashboard, report ) from the Repertoire Server.
From Repertoire Server 7.x.x onwards, integration has been make easier with the ability to access resources using the server’s REST API.


BEA Portal 10 Tutorial

This article is based on the tutorial from BEA Portal 10 Documentation.

http://e-docs.bea.com/wlp/docs100/tutorials/index.html

It is highly recommended that the details of this BEA Portal 10 documentation be read and understood, before attempting the step by step guide below.


Repertoire SSO

A redirect servlet component is required to be deployed within Weblogic Application Server. This is to allow any valid login user to the Portal 10 framework to be able to access the Repertoire Server resources seamlessly.

The details of the redirect servlet can be found at Single Sign On in Repertoire Server

Rather than reading the username/password from the web.xml config file as mentioned in the article, we need to pass the current login username to the Repertoire Server for authentication purposes.

The following code snipplets highlight the key areas of the redirect servlet.

// ParamBasedRedirect.java

package com.elixirtech.ers2.servlet.demo;
...
import java.security.Principal;
...
public class ParamBasedRedirect extends HttpServlet
{
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,java.io.IOException
{

Principal user = request.getUserPrincipal();

if( user != null )
{

ServletConfig config = getServletConfig();
String url = config.getInitParameter("url");

//String username = config.getInitParameter("username");
String username = user.getName();
String password = config.getInitParameter("password");

String returnurl = config.getInitParameter("url") + request.getParameter("rtu");

HttpClient client = new HttpClient();
PostMethod post = new PostMethod(url+"login.html");
// Use the authericated username to do a POST to ERS
post.addParameter("username",username);
post.addParameter("password",password);
int ret = client.executeMethod(post);
if (ret==200 || ret==302)
{
for (Cookie c : client.getState().getCookies())
{
if ("ELXSESSIONID".equalsIgnoreCase(c.getName()))
{
response.sendRedirect(url+"authenticate-session.html?session="+ c.getValue()+ "&return=" + returnurl);
return;
}
}
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Can't get session cookie");
}
else
{
response.sendError(ret);
}

}
}
}

// ParamBasedRedirect.java

In this code snipplet, we need to import java.security.Principal package. The package holds the current login username in the Portal 10 application. The authentication process will only execute with a valid login user. The login username will be used to authenticate at the Repertoire Server. Upon a successful authentication, a session cookie (ELXSESSIONID) will then be maintain during subsequent requests for different resources in the Repertoire Server.

A different SessionCookie is required as BEA Portal 10 Application uses the same default session cookiename (JSESSIONID) as Repertoire Server. To change the default sessionid name, see config/jetty.xml from the Repertoire Server Installation folder.

Once the following redirect servlet is successfully configured and deployed, you should be able to independently test if the redirect servlet is working correctly by typing the following URL in the web browser. ( A valid login sesssion at Portal 10 Framework is required )
http://localhost:7001/RepertoireDemoServlet/ui/ParamBasedRedirect?rtu=tool/dashboard?perspective=%2FElixirSamples%2FDashboard%2FCorporate+Performance+Management%2FPerformance+Management+Dashboard.pml


Elixir Portlets

The following WAR Application contain samples Elixir Portlets that is deployable within a BEA Portal Application.

These portlets are location at the myPortalWebProject.war\portlets\elixir folder

Download : myPortalWebProject.zip (881.9 KB)

The following Dashbard.portlet is an example of how the redirect servlet is used to reference a Repertoire resource with a iframe in HTML.

<?xml version="1.0" encoding="UTF-8"?>
<portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
<netuix:portlet asyncContent="iframe" defaultMinimized="false" definitionLabel="Dashboard_1" title="My Elixir Dashboard">
<netuix:titlebar>
<netuix:edit contentUri="/portlets/elixir/setPreferences.jsp" visible="false"/>
</netuix:titlebar>
<netuix:content>
<netuix:jspContent contentUri="/portlets/elixir/loadableIframe.jsp"/>
</netuix:content>
<netuix:preference
description="My Elixir Dashboard"
modifiable="true" multiValued="false" name="iframe.defaultUrl"
value="[http://localhost:7001/RepertoireDemoServlet/ui/ParamBasedRedirect?rtu=tool/dashboard?perspective=%2FElixirSamples%2FDashboard%2FCorporate+Performance+Management%2FPerformance+Management+Dashboard.pml"/](http://localhost:7001/RepertoireDemoServlet/ui/ParamBasedRedirect?rtu=tool/dashboard?perspective=%2FElixirSamples%2FDashboard%2FCorporate+Performance+Management%2FPerformance+Management+Dashboard.pml%22/)>
<netuix:preference description="Preference description goes here" modifiable="true"
multiValued="false" name="iframe.height" value="600pixels"/>
<netuix:preference description="Width" modifiable="true" multiValued="false"
name="iframe.width" value="1400pixels"/>
<netuix:preference description="Start tag" modifiable="true" multiValued="false"
name="iframe.startTag" value="&lt;html>"/>
<netuix:preference description="End tag" modifiable="true" multiValued="false"
name="iframe.endTag" value="&lt;/html>"/>
</netuix:portlet>
</portal:root>

Screen Shots and Presentation Slides

The following read-only ppt contains brief description and screenshots of the integrated application.

Download : BEA_Portal_-Elixir_Integration.zip (2.6 MB)