Top Banner
® AD204 Lotus Domino, WebSphere Portal, and Lotus Workplace Integration Part 4: Developing Portlets for Domino in Java Joel Demay, Lotus Worldwide Technical Sales Oliver Trabert, Senior Consultant, WP Experts
67

ad204

May 01, 2017

Download

Documents

Manuel Vega
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ad204

®

AD204 Lotus Domino, WebSphere Portal, and Lotus Workplace Integration Part 4:

Developing Portlets for Domino in Java

Joel Demay, Lotus Worldwide Technical Sales Oliver Trabert, Senior Consultant, WP Experts

Page 2: ad204
Page 3: ad204

Presenters bio’s

Joel Demay, Lotus Worldwide Technical Sales

Page 4: ad204

Presenters bio’s cont.

Oliver Trabert, Senior Consultant, WP Experts GmbHWorked exclusively with WebSphere Portal (WP) for more than 2 years doing numerous on-site customer implementations

Experienced WP architect, solution designer and performance expert

Specialized in ‘portalization’ of Domino applications

Co-author of multiple IBM Redbooks on WP• Portalizing Domino Applications for WebSphere Portal• Portal Application Design and Development Guidelines• A Portal Composite Pattern Using WebSphere Portal V5

Contact: [email protected]

Page 5: ad204

Preface

Intermediate level lecture with code examples and best practices.

Entry skillsDomino savvy developers with medium Java skills

You should have basic Portal knowledge

Exit skills:Good overview of Domino Portlet development

Learned concepts to architect scalable Domino Portal applications

Page 6: ad204

Ask the audience

Please tell us your experienceWho has implemented a Portal today?

Who is planning implementation this year, next year?

Portal Administration (e.g Portlet deployment)

WebSphere Studio Application Developer (WSAD) / Eclipse

Servlet’s, EJB’s, custom JSP taglib’s

Domino Java API

Portlet development

This will help us to keep the session at the right level.

Thank You!

Page 7: ad204

Agenda

Brief Portal/Workplace definitionOverview of Domino access methodsPortlet development introductionMy first Domino PortletPortlet design principlesAuthenticationResource managementPortal applications

Portlet frameworks

Architecture

If we still have time: Domino Rich-Text in Portlets

Q&A

Page 8: ad204

Brief Portal/Workplace definition

WebSphere PortalStandard infrastructure platform for building enterprise class applications

Delivers integrated content and applications

Enables the integration of existing applications and processes

Unified collaborative workplace.

Page 9: ad204

Brief Portal/Workplace definition

Lotus WorkplaceConsists of flexible, portal-ready collaboration products

Products provide features similar to those found in the core IBM/Lotus Software portfolio

Earlier informally referred to as the next generation of Lotus products, or ‘NextGen’

built on industry standards and core IBM/Lotus technologies

Page 10: ad204

Portal and Lotus Workplace together

Lotus Workplace leverages WebSphere Portal as its presentation layerPortlet development works in the same way

Page 11: ad204

Overview of Domino access methods

‘Native’ Java methods only, not Domino JSP tag libraryJSP tags were covered in AD203 already

Collaborative Components APIXMLDomino Java API (Backend classes)

Local (JNI)

Remote (DIIOP)Custom

Page 12: ad204

Collaborative Components API

DefinitionJava API and JSP tags to implement Lotus advanced collaboration in Portlets

Allows to incorporate some features of Domino, QuickPlace, Sametime, and Discovery Server

Methods provided complement - not replace - the APIs of the individual companion products

Sometimes referred to as "collaborative services" or "cs"

Page 13: ad204

Collaborative Components API cont.

AccessInfrastructure objects

• Information on the environment (e.g. installed products)• Manage authentication

Service objects• Provide some functionality to access to the Lotus products• DominoService, QPService, PeopleService,

DiscoveryServerService, SametimeService JSP tags

• Provide people awareness and menus• People tags, Menu tags

Page 14: ad204

Collaborative Components API cont.

Example: DominoServiceDirectory-related methods Document-related methods View-related methods (getViewInfo() and getDatabaseViews())

BenefitsProvide standardized access to Lotus productsEasy-to-use high level APIs Consistent security model across all Lotus productsPeople and menu tags are especially useful

ConsLimited functionality compared to native product API’s

Page 15: ad204

Collaborative Components API cont.

NoticeAlways call the cleanup() method when finished with the Service object.

The Lotus Notes productivity portlets that ship with Portal are NOT based on the Collaborative Components API.

ReferencePortal InfoCenterhttp://publib.boulder.ibm.com/pvc/wp/500/ent/en/InfoCenter/collab/ksd_cs_api_intro.htmlComprehensive overview and code examples

API Java dochttp://www-106.ibm.com/developerworks/websphere/zones/portal/portlet/5.0api/CollabServices/

Redbook: Collaborative serviceshttp://www.redbooks.ibm.com/redpapers/pdfs/redp0319.pdf

Page 16: ad204

XML

DefinitionDomino provides support for Extensible Markup Language, or XML

XML enables you to tag data in order to delimit it

Compared with HTML, HTML describes the appearance of data

XML describes the structure of data

XML representation of Domino data is known as DXL

DXL describes Domino-specific data and design elements

DXL provides a basis for importing or exporting XML representations of Domino data

Page 17: ad204

XML cont.

AccessUses Domino HTTP?ReadViewEntries URL command

• http://localhost/names.nsf/people?ReadViewEntries

XML Processor

Portlet

Domino HTTPDomino View

Optional parameters• CollapseView, Count, Expand, ExpandView, KeyType, PreFormat,

ResortAscending, ResortDescending, RestrictToCategory, Start, StartKey, UntilKey

NoticeParameters have evolved with succeeding Domino versions

HTTP

Page 18: ad204

XML cont.

BenefitsFastest method to read view dataUsed e.g. by the Lotus Notes productivity portlets

ConsNeed HTTP enabledLimited functionality, e.g. no search, write access

ReferenceDomino 6.5 Designer helphttp://www-12.lotus.com/ldd/doc/domino_notes/6.5/help65_designer.nsf/2e73cbb2141acefa85256b8700688cea/3147390f7d5857fb85256d9b0042fe98?OpenDocument

Related sessions

Page 19: ad204

Domino Java API

Provides Java access to the Domino backend classes

AccessSupports local and remote accessWith virtually identical object modelsJava interfaces are contained in the lotus.domino packageMain difference is in the thread management

Page 20: ad204

Domino Java API

LocalThin layer of Java code into the Domino "back-end" code, which is implemented in C++. Java Native Interface (JNI)Need Notes/Domino DLL’s locally installedcode is loaded "in process" in the Java Virtual Machine (JVM)

Domino Java API

Portlet

Domino C APIJNI

BenefitsFast and versatile

ConsCPU load, can degrade overall Portal performance JNI = introduced potential risks / can crash JVM = Portal serverMemory management, resource exhaustionThread init/term issueThe tread that creates a Domino session also needs to destroy it!

Page 21: ad204

Domino Java API

RemoteUse IIOP (CORBA's protocol)Local Java object instances are just instances of proxy objectsAll Domino objects reside on the remote Domino machine

NoticeThe JVM garbage collection can’t notify Domino backend that objects went away

Always call recycle() on the Session objectthis implicitly recycles all the Session’s child objects

Domino 5 DIIOP does not scale well

Domino 5: ncso.jar vs. ncsow.jar.

DIIOP task

Portlet

Domino C API

CORBA via IIOP

Proxy objectsRemote Domino Java API

real Objects

Page 22: ad204

Domino Java API

BenefitsAs versatile as local accessDistributed architecture

ConsSlower than local accessHigher network load

References:Advisor article from Bob Balabanhttp://advisor.com/Articles.nsf/aid/BALAB03Redbook: Domino and WebSphere TogetherRedbook: Portalizing Domino Applications for WebSphere Portal

Page 23: ad204

Custom

Hybrid solution combining remote access with JNI local access

AccessUsing local Java application (JNI)

Implements a socket server to communicate with the Portlet

Socket Server

Portlet

Domino Java API

Domino C APIJNI

RMI via IIOP

BenefitsAllows for service oriented architecturesGet the native access performanceWithout the drawbacks

ConsSpecific functional implementationNot easy to extend

Page 24: ad204

Blended methods

Using more than one access method

Uses a combination of XML over HTTP and DIIOP

Good example is Lotus Notes productivity portletsFor specific requirements the best solution

But makes configuration and debugging more difficult

Page 25: ad204

Summary of Access Methods

There is all the access you need availableNo one method fits all needsOverview matrix

Page 26: ad204

Assumption

In the following examples we will focus on remote Java API access (DIIOP)Use people awareness from the collaborative services

Why?Easy to understand for Lotus Script developers

Very flexible

Has less requirements for the runtime environment than any blended approach

Page 27: ad204

Portlet development introduction

Development environmentWebSphere Studio (WSAD)Portal toolkitWebSphere Portal 5

Page 28: ad204

Portlet development introduction cont.

ConfigurationDomino/WAS Single-Sign-On (SSO)WSAD

References:WSAD setupRedbook: A Guide for Portlet Application DevelopmentAppendix A: Portlet development platform sample installationhttp://www.redbooks.ibm.com/redpieces/pdfs/sg246076.pdfSingle Sign On

NoticeFollow exactly the step by step installation instructionsUnless you fully understand the products

Page 29: ad204

Using the Portal toolkit

Portlet creation demo

Page 30: ad204

Base structure of a Portlet

Java SourceJSP’sPortlet XML

Page 31: ad204

My first Domino Portlet

A naïve approachPut scriptlet on the view.jsp

// Creating diiop session for Dominodiiopsession =

NotesFactory.createSession("<servername>","<username>","<password>");

Iterate through view;

Diiopsession.recycle();

Page 32: ad204

Add People Awareness

<%@taglib uri="/WEB-INF/tld/people.tld" prefix="p"%>

<p:person><%=doc.getItemValueString("LastName")%></p:person>

Page 33: ad204

Problems with this approach

Portlet designCluttered code (see e.g. WP 4.2 Notesview Portlet JSP’s)

Difficult to read and maintain

64K limit for JSP pages

Authenticationno dynamic user / Single-Sign-On

Resource managementCreate and destroy the Domino resources with each call

Resource are ‘expensive’, especially the Domino session

Portlet caching

Page 34: ad204

Portlet design

Model View Controller design

Page 35: ad204

Portlet design

What does this mean for our Portlet?Identify the Modell, View and Controller parts of the Portlet

Separate out the different code elements

Page 36: ad204

Code flow

How does the code run?

Page 37: ad204

Important objects

How do the different pieces communicate together?

Data beans

portletsession, portletrequest, portletresponse

Page 38: ad204

Portlet actions

How does user interaction work?Example 1: Portlet edit mode

Example 2: Execute search

Page 39: ad204

Portlet actions: Edit mode

Page 40: ad204

Portlet actions

1. Initially, the doView method is executed.2. A JSP is called to render an initial screen. A message is

obtained from the request object.3. The Portlet View mode screen is shown in the browser window.4. The user clicks Edit to go into Edit mode.5. The Edit mode screen is displayed (the doEdit method is

executed).6. The user selects the desired action button (red or blue).7. The actionPerformed method is executed to process the action.

A resulting8. message is stored in the request object.9. The doView method is executed to complete the cycle and a

message is10.obtained from the request object.

Page 41: ad204

Portlet actions: Execute Search

Page 42: ad204

Authentication

Single-Sign-On (SSO)

Page 43: ad204

LTPA token

Light-Weight Third Party Authentication (LTPA). LTPA uses shared secret keysOnce a user is authenticated all server in the same DNS domain trust this authenticationLTPA utilizes a token, which is stored as a cookie

WAS and Domino can be configured to use LTPA

Page 44: ad204

LTPA pitfalls

NoticeYour browser will always show that WAS did issue an LTPA cookie.This maps the client’s user ID to a valid LTPA credential, but is used by WAS internally only. This can be verified by looking at the domain of the cookie. It shows the fully qualified DNS name of the WAS server. This limits its validity to this machine only.

Tivoli Access Manager and Siteminder

Page 45: ad204

Session creation options

Using LTPAcreateSession(hostString, PortletRequest)

createSession(hostString, tokenString)

From EJB’screateSession(hostString, null)

Using user credentialscreateSession(hostString, Credentials)

AlternativelyUse Collaborative Components API

Page 46: ad204

Acquire session via Collaborative Components API

CSEnvironment environ = CSEnvironment.getEnvironment(request);

CSCredentials cred = environ.getCredentials(request);

DominoService dominoService = (DominoService)CSFactory.getService(cred, CSFactory.DOMINO_SERVICE, Server, "http");

Session s=dominoService.getSessionObject();

Page 47: ad204

Credential Vault

Vault segmentVault slotCredential Object

Page 48: ad204

Types of Credential Objects

PassiveUserPasswordPassive, SimplePassive, JaasSubjectPassive

ActiveHttpBasicAuth

HttpFormBasedAuth

JavaMail

LtpaToken

SiteMinderToken

WebSealToken

Page 49: ad204

None LTPA authentication cases

Different name/password for Portal/DominoCreate a Vault slot

Use UserPasswordPassive

Example

Page 50: ad204

Resource management

Step1: Manage Domino session in the Portlet controllerStep2: Implement an object poolIn addition use Portlet cachingBest practices

Page 51: ad204

Manage Domino session in the Portlet controller

Store Domino session in the Portletsession

Let’s see how this is done.

Problem:Session time-out

• Problematic in R5• Associated objects, e.g. views and sessions

Implicit Portal sessions for unauthenticated users / Performance

References:

Page 52: ad204

Implement an object pool

More scalable, resourcefulEnables load balancingThread safeHelps with session time-outEase of use

Page 53: ad204

Pools

1. Portlet calls an interface method on the virtual object.

2. The virtual object's implementation reserves a matching physical object from a named pool.

3. The method call is delegated to the physical object.

4. When the method call is completed, the physical object is returned to the appropriate pool for use by other virtual objects.

Page 54: ad204

Domino session pool

TasksManage sessions

Periodically garbage collect sessions

ImplementationUse Jakarta common pools implementations

Page 55: ad204

Pools

Outlook:Extend the pool to manage databases and view objects

NoticeThe Domino JSP tag library has an build in session manager (new in Domino 6.5)

There are commercially available pool managers, e.g. fromLooseleaf Software (not Portal specific)

Page 56: ad204

Some Domino performance considerations

Use your Lotus Script experience

Use the least # of method calls possible

Always use views to query data = indexedUse viewentries, do not access the document

Page 57: ad204

Use caching

Portlet cachedoView gets called every time the Portal page is rendered

Portlet.xml

lastmodified

Page 58: ad204

Portal applications

Page 59: ad204

Portlet applications

RequirementsMultiple Portlet applications

Applications with page flows

Portlet cooperation (not covered here)

Raises the need forPortlet Framework

Architecture

Page 60: ad204

Portlet Framework

Problems with the standard approachImplementing complex process control is outside the scope of thePortlet API.

End up creating lots of code, just for user interaction

Repetitive and makes the code much harder to read

SolutionConsider your application to be a collection of Portlet actions and states

Envision a well-defined approach to state transitions

Page 61: ad204

Introduction to the state pattern

Page 62: ad204

Architecture

Moving from single Portlet to Portal applicationsFurther abstraction of Model View and Controller

Implement session EJB’s

You really need to know what you are doing here!

Page 63: ad204

Summary

Domino Portlet developmentIs very powerful

Is 100% Java development

Domino access is not a problem

Needs Java experience

Needs proper architecture

Can be complex (EJB)

Can be time consuming

Page 64: ad204

So when would we choose it?

You need to decide if your application is tactical or strategic

Tactical

Strategic

Need to decide carefully what functionalities you really need in the Portlet. (integration depth)

Need to know implementation alternatives (e.g. Portlet Builders from Bowstreet or CONET, Domino JSP tag library)

Page 65: ad204

Domino Rich-Text in Portlets

Page 66: ad204

®

REMINDER

Please fill out the session evaluation form.

Thank you!

Page 67: ad204

®

Your Turn

Questions ?