a deep dive on building notes/domino applications with xpages

92
A Deep Dive on building Notes/Domino Applications with XPages Martin Donnelly | Software Architect | IBM Ireland Tony McGuckin | Software Engineer | IBM Ireland

Upload: aleksander-jug

Post on 04-Apr-2015

611 views

Category:

Documents


1 download

DESCRIPTION

A Deep Dive on building Notes/Domino Applications with XPagesAll materials belong to IBM.

TRANSCRIPT

Page 1: A Deep Dive on building Notes/Domino Applications with XPages

A Deep Dive on building Notes/Domino Applications with XPages

Martin Donnelly | Software Architect | IBM Ireland

Tony McGuckin | Software Engineer | IBM Ireland

Page 2: A Deep Dive on building Notes/Domino Applications with XPages

Agenda

● Introductions

● Quick XPages App Dev Summary

● XPages Architecture Overview

● Deep Dive Demos

● Recaps

● A View To The Future

● Q&A

● Advanced Data Sources

● Data collections

● DOJO

● AJAX in action

● Server side language

● Client side processing

● Custom controls

● Managed Beans

● XPages on the Rich Client

● Themes

Page 3: A Deep Dive on building Notes/Domino Applications with XPages

Software Architect: IBM Ireland

▬ IBM Lotus® Domino® Designer 8.5.x / IBM Lotus® Domino® XPages

▬ IBM Lotus® Component Designer 6.0

▬ JavaServer™ Faces (JSF) Tooling IBM® Rational® Application Developer

▬ Java Visual Editor extensions for IBM® Rational® Application Developer

Software Developer: Iris Associates / Lotus Development

▬ IBM Lotus® Domino® Designer V4.6 to V6.01

▬ IBM Lotus® 1-2-3® for Unix®, LotusScript, etc.

Software Engineer: IBM Ireland

▬ IBM Lotus® Domino® Designer 8.5.x / IBM Lotus® Domino® XPages

▬ IBM Lotus® Component Designer 6.0

▬ Customer Enablement / Proof of Concept Development

▬ Lotus OneUI Adoption and iWidget Consistency Work

Speaker Introductions

Tony McGuckin

Martin Donnelly

Page 4: A Deep Dive on building Notes/Domino Applications with XPages

XPages App Dev Summary

Page 5: A Deep Dive on building Notes/Domino Applications with XPages

Notes/Domino Application DevelopmentOnwards & Upwards

2010

2009

• - First release of XPages• - Runs on the Domino server

Notes/Domino 8.5

Notes/Domino 8.5.1• - Runs within the Notes client• - Generates iWidget• - Active Content Filtering• - Performance/scalability improvements

Later...

• - Stability/performance improvements

• - Better client integration• - Fixing pending issues/requests• - Extensibility

Notes/Domino 8.5.x

Notes/Domino next

• - XPages next generation• - Consumes/generates REST services• - Generates Dojo based UI• - Advanced set of Web controls

• - Full client integration• - Mobile devices support• - Integration with other Lotus products

• - Quickr, Connections, Sametime• - More data sources (RDBMS...)• - iWidget consumption

The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion

- Rebased to Eclipse platform- New XPage & Custom Control

design elements- Fully integrated XPages

development environment

XPages Runtime

Domino Designer

- Performance/Stability Improvements- New editors- New Extensibility APIs- NO CHARGE Designer Download !!!

• - Designer Framework Enhancements• - Improved Version Awareness• - Customer Driven Tactical Improvements

• - Source Control Integration• - Improved JavaScript Editors• - CSS Preview• - Many more under investigation

Page 6: A Deep Dive on building Notes/Domino Applications with XPages

XPages Birthday

2010 celebrates the first XPages birthday

But the technology behind it is over 5 years old …JavaServer Faces

XFaces & Lotus Component Designer

Get the full story here: http://thexcast.net/?p=11

Page 7: A Deep Dive on building Notes/Domino Applications with XPages

XPages Proof Point:

RAD Web 2.0 framework

Build application assets with less effort

Maximize reuse of assets

Architect your user experience for consumability

52 custom controls maximize reuse

Dojo: Customized RTE, Tooltips

Implemented Blueprint for the CSS framework

Develop once for Web and client

XPages provide client access choice (Notes, browser, mobile)

Mobile

IPhone / AndroidTM

Page 8: A Deep Dive on building Notes/Domino Applications with XPages

XPages Proof Point: ITANA

“XPages have allowed me to deliver classic Notes database applications to the iPhone without having to change the template. I can simply create one database with an XPage, and it will connect to the database that is appropriate for the particular user – even if the other database is on different server.”

Mark Hughes – HughesConnect.com

Page 9: A Deep Dive on building Notes/Domino Applications with XPages

XPages Proof Point: IBM

developerWorks/Lotus wikis

www.ibm.com/developerworks/lotus/commu

nity/wikis.htmlSelect the Lotus Notes and Domino Application Designer wiki

IBM Lotus and WebSphere Portal Business

Solutions Catalog

https://greenhouse.lotus.com/catalog/

Page 10: A Deep Dive on building Notes/Domino Applications with XPages

XPages Architecture

Overview

Page 11: A Deep Dive on building Notes/Domino Applications with XPages

XPages in a Nutshell

● A Notes/Domino design element

● A runtime designed to generate modern Web applications

● Pure XML markup, defining:

▬ Controls, data sources, business logic, custom controls

● Solves age-old limitations expressed by the Notes/Domino community

▬ UI/Data separation, HTML generation control, server state, localization, extensibility …

● Capable of targeting multiple clients

● Highly extensible runtime and design time

● Standards-based technology: JavaServer™ Faces

● Full integrated into Domino Designer 8.5.x

● Visual Design Page, Source Page, Control Palette, Outline View etc

Page 12: A Deep Dive on building Notes/Domino Applications with XPages

XPages Development Model

Drag & drop application building using XPages

JavaScript libraries and custom controls

Integration of Java libraries/classes

Use managed beans and advanced extensions

Use the XPages native API

Power users

Advanced users with development skills

Java developers

XPages Extensibility API

8.5.x

XPages Architecture

Page 13: A Deep Dive on building Notes/Domino Applications with XPages

XPages Technology

● Java and JSF behind the scene

▬ Runs in the Domino JVM, within the http process

▬ JSF had been extended in many places to make it richer and easier

▬ XML File format, composite controls, script languages, data sources,

localization, simple actions, ajax requests...

▬ As of 8.5.x, uses and extended JSF 1.1 library

▬ Lot of performance and scalability enhancements

▬ Some JSF 1.2/2.0 API had been back-ported

● XPages runs within a servlet engine

▬ A custom servlet engine is used to run NSF based Web applications

▬ The NSF is seen as a deployed J2EE® Web Module

▬ The Servlet API is available to the running XPages

● The Dojo Toolkit is used as the runtime JavaScript™ library

▬ Used as a core JavaScript library as well as a UI widget framework

▬ Tightly integrated within the XPages Runtime

Page 14: A Deep Dive on building Notes/Domino Applications with XPages

J2EE Artifacts

Page 15: A Deep Dive on building Notes/Domino Applications with XPages

XPages in the Notes Client

How it works – pretty much the same as on the server

Web Container

XPages Runtime

Notes Client

XPages UI Container

Embedded XULRunner

NSF apps have a new XPages client launch optionWhen app is opened, this URL is passed to XPages client containerThe container further transforms the URL ...

•Creates a instance of the XULRunner browser•Sends a secure request to client web container

The web container routes all XSP requests to the XPages runtimeXPages runtime renders pages back to the XULRunner browser

In Short

NSF design elements

(XSP, Java™ class files…)

are made available as

module resources to the

servlet API.

Each NSF can be

projected as an auto-

deployed Web Module.

The XPages runtime

inserts as a generic web

module and provides a

virtual container for NSFs

XPages requests sent to

an embedded Java Web

container

Page 16: A Deep Dive on building Notes/Domino Applications with XPages

Global Architecture

EclipseWorkspace

Domino Server

NSF files

Eclipse directly reads/writes to the NSF thanks to a custom EFS

Domino Designer in Eclipse

The runtime directly reads from the NSF

Notes Client

NSF replication

Supports both the Domino server and the rich client

Supports the data and the design elementsreplication

Page 17: A Deep Dive on building Notes/Domino Applications with XPages

XPages Architecture - 8.5/8.5.1

17

Domino Server Notes Client

Domino HTTP Task

XPages

Runtime

XPages Extensions provided as jar files

NSF Applications

● You can extend XPages within an NSF Application, or as separate XPages Extensions.

● The Domino runtime is deployed as a set of jar files into well defined directories

Extensions are provided as jar files copied to <domino>/xsp/nsf/lib

(warn: this directory is cleaned-up by the installer when upgrading the server)

● The Client runtime is deployed as a set of OSGi bundles (plugins)

Extensions are also deployed as OSGi bundles

Notes Client Process

OSGi Runtime

XPages

Runtime

Profile

+Web Container

XPages ExtensionsOSGi bundles

NSF Applications

Page 18: A Deep Dive on building Notes/Domino Applications with XPages

XPages Architecture – 8.5.x

18

Domino HTTP Task

OSGi Runtime

XPages

Runtime

NSF Applications

XPages ExtensionsOSGi bundles

Notes Client Process

OSGi Runtime

XPages

Runtime

XPD Profile

+Web Container

XPD Profile

Domino Server Notes Client

NSF Applications

● Both the Domino server and the Notes client are deployed as OSGi bundles

The same extension mechanism is used in both platforms; extensions are provided as OSGi bundles.

XPages ExtensionsOSGi bundles

Page 19: A Deep Dive on building Notes/Domino Applications with XPages

XPages XML File format● Each tag in the XML file represents a control or a complex property (an

object attached to a control)

▬ All the standard XPages controls are in a single, reserved, namespace

▬ Each tag in the XML file represents a control or a complex property

▬ There is one root tag, called <xp:view>

● Control properties are passed as element attributes

▬ Special <this.prop> syntax to make the XML file more “readable”, when it contains illegal XML

characters, like CR/LF

▬ Collections as defined through <this.prop> tag, where each sub-tag is an entry in the collection

(this supports polymorphism, for example data sources)

● Pass-through tags

▬ Tags without a namespace are passed “as is” to the browser, without any further processing

Page 20: A Deep Dive on building Notes/Domino Applications with XPages

XPages Files● XPages and Custom controls are defined as:

▬ An pure XML file defining the page content

▬ A xsp-config file is defining the content of a custom control

▬ Ex: list of controls properties, icon, palette category...

● The XPages Compiler

▬ From .xsp to .java to .class

▬ Designer generates a high performance Java file out of the XPages XML source

▬ The Eclipse Java compiler compiles this Java file into a class file

▬ Both processors feeds the Eclipse problems view

● How an XPage is version-ed

▬ Each control in the page has a minimum runtime requirement

▬ Each property of each control has the same requirement

▬ -> the runtime requirement for the page is the requirement maximum above

▬ This is also extended in 8.5.x to get an application version

Page 21: A Deep Dive on building Notes/Domino Applications with XPages

JSF Processing Model

http://www.ibm.com/developerworks/java/library/j-jsf2/

Page 22: A Deep Dive on building Notes/Domino Applications with XPages

Page RenderingJSF Markup – XML + HTML JSF Hierarchy of Components

JSF Render-kit

HTML Basic

HTML Dojo Client

Notes Client

Rendering Phase

HTML MarkupCan use Dojo library/widgets

Browser

One single markup for all the platforms Actual rendering is done using JSF RenderKit Render-kit is selected using an extension point Can leverage platform specificities

- Control properties can be set per platform

- Pages can be per render-kit

- Use of the platform style sheets

Handheld

Mobile devices

Page 23: A Deep Dive on building Notes/Domino Applications with XPages

XPages Deep Dive Demos

Page 24: A Deep Dive on building Notes/Domino Applications with XPages

XPages Introductory Demo

Ideally view this demo first

https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=dw-c-wcsdp&S_PKG=051410A

Page 25: A Deep Dive on building Notes/Domino Applications with XPages

Data Sources

Page 26: A Deep Dive on building Notes/Domino Applications with XPages

What Are Data Sources?● Data sources are XPages artifact for connecting the UI controls to the data

▬ Data is well separated from the UI

▬ An XPage is not linked to a single document or a view – Can connect to multiple data sources at the

same time!

● Data Sources can be defined globally in the page or in panels

● Data Sources are making available objects (ex: a Domino document) that

are used by the UI controls for accessing the data

▬ These objects are seen by any control located in the children hierarchy

● Extensible architecture for new data sources in the future

Page 27: A Deep Dive on building Notes/Domino Applications with XPages

Domino Data Sources● XPages is equiped, in standard, with 2 Notes/Domino data sources:

▬ View data sources

▬ Access to Domino views or folders

▬ Document data sources

▬ Access to Domino documents

● Based on the Java back-end API

▬ Publishes View and Document back-end objects

Page 28: A Deep Dive on building Notes/Domino Applications with XPages

View Data Sources● Building a View Data Source ...

▬ Visual helpers to generate markup

▬ Data palette to work with members

▬ Property sheet for detailed settings

▬ All properties computable via JS

● Simple Tag

▬ <xp:dominoView var="dominoView” viewName="xpAllDocuments">

Page 29: A Deep Dive on building Notes/Domino Applications with XPages

Views Are Also About Folders● UI support in Lotus Domino Designer 8.5.x is for Notes view data sources

only

▬ But... The XPages runtime system supports both Views and Folders

▬ And... It's on the list of things to be added for 8.5.x

▬ View name is editable, type in folder name into “View” editbox.

▬ Type name of column into “View Column” field (or, compute it!) editable

Page 30: A Deep Dive on building Notes/Domino Applications with XPages

Summary On View Data Sources● How do I work with data in Domino Folders?

▬ You can use a folder name anywhere you use viewName

<xp:dominoView var="dominoFolder" viewName="My Folder">

● What if my view or folder is in another db on another server

▬ Just specify the database name at the data source level

▬ All these information can obviously be computed

<xp:dominoView var="dominoFolder" databaseName=”serverName!!myDb.nsf”

viewName="($All)">

● And if I want to use a replica id instead of a database name?

▬ You guessed it:

<xp:dominoView var="dominoFolder" databaseName=”802574A9:004134AF”

viewName="($All)">

▬ And you can finally cut/copy/paste replica ids in Designer 8.5

Page 31: A Deep Dive on building Notes/Domino Applications with XPages

How To Manage Multiple Data Sources In The Same Page?

● No restrictions on the number of data sources used on an XPage!

▬ Multiple data sources require special management in certain cases

▬ e.g. Open Document simple action generates a URL using the UNID

▬ http://localhost/d080905a.nsf/p02.xsp?documentId=662F287DE0738485802574BE0

02E8A8A &action=openDocument

● If multiple document data sources are defined on the page ...

▬ Which one does this map “documentId” and “action” to?

▬ We can handle this scenario easily using a special data source property!

Page 32: A Deep Dive on building Notes/Domino Applications with XPages

Data Sources Parameters and URL● Each data source has a set of parameters

● These parameters can be controlled by a URL

▬ View data sources

▬ Document data sources

● Tweaking the URL behavior

▬ Multiple data sources in the same page

▬ Ignoring the URL parameters

▬ Ex: multiple data sources in the same page (a view and a document)

▬ Ex: security reasons, do not let people access document others that the one you want them to

access

▬ But the parameters, as any other properties, can be computed and access the URL query string

Page 33: A Deep Dive on building Notes/Domino Applications with XPages

Examples● Ex: 2 Domino Document Data Sources using Customer and Order forms

▬ <xp:dominoDocument var="document1" formName="customer"

requestParamPrefix="cust"> </xp:dominoDocument>

▬ <xp:dominoDocument var="document2" formName="orders"></xp:dominoDocument>

● Construct a URL using the prefix to uniquely identify the data source

▬ http://localhost/d080905a.nsf/p02.xsp?custdocumentId=662F287DE0738485802574B

E002E8A8A &custaction=openDocument

● More detailed example online

▬ Updating data from multiple forms from a single XPage

▬ http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-

7FFLYJ

Page 34: A Deep Dive on building Notes/Domino Applications with XPages

Advanced Data Sources● Repeating data sources

▬ Data sources can be located within a repeat tag

▬ In that case, multiple objects will be opened, one per repeat occurence

● Example: repeating documents

▬ A main View data source is used to browse the view entries

▬ Opening a document for each entry in a view

▬ The document id is computed based on the current view entry

▬ The save action will save all the documents being opened

▬ -> be careful: each document opened consume memory resources, plus takes time to open

Page 35: A Deep Dive on building Notes/Domino Applications with XPages

Working With Data Collections

Page 36: A Deep Dive on building Notes/Domino Applications with XPages

What is a Data Collection● A data collection is a set of objects that can be iterated

▬ Ex: a view is a collection of view entries

● Data collections can be iterated using dedicated controls

▬ Data table

▬ View control

▬ Repeat control

Page 37: A Deep Dive on building Notes/Domino Applications with XPages

Data Table● A data table is made of columns

▬ Each column has 3 parts

▬ A header

▬ A body

▬ A footer

● The data table repeats through the collection and create one body row per

occurrence

● The body row contains controls that will be repeated

▬ Those controls can be editable, when the data source supports it

▬ Limitations: domino views are not editable

Page 38: A Deep Dive on building Notes/Domino Applications with XPages

Data Table vs View Panel● The view panel has extended, simplified data binding

▬ It displays data in read only mode

▬ The column data binding doesn't require controls to be added to the body

▬ A column name is generally used for easy data binding

▬ A 'value' property can also be used to compute the column value

▬ Controls added to the body are supported if needed

● The view panel has extended user behaviors

▬ Allows hierarchical data display with twisties

▬ Categorized columns

▬ Documents hierarchy (responses)

▬ Supports column resorting

Page 39: A Deep Dive on building Notes/Domino Applications with XPages

Repeat Control● A repeat control is used to repeat content made of an arbitrary set of

controls

▬ Gives the highest flexibility when displaying repeated data

▬ Can be stacked, contain data sources or any kind of controls (views...)

● 2 modes are available:

▬ Dynamic repeat behavior

▬ The JSF hierarchy contains the repeat control and one copy of its contents. At runtime, the content is

repeated per occurrence, by giving a different context to the repeated control

▬ Create controls

▬ The repetition happens when the JSF tree is constructed and the runtime create one set of child

controls per occurrence. The repeat control is only used once and removed from the hierarchy

Page 40: A Deep Dive on building Notes/Domino Applications with XPages

The Pager● A pager is a customizable control

● A custom pager can be created by simply accessing the collection iterator

properties

▬ first: defines the index of the first element to display

▬ rows: defines the number of items to display

● The repeat control, as well as the data table, have convenience methods

to set the current position (8.5.2)

▬ gotoFirstPage(), gotoNextPage()...

● A pager can now be configured to navigate to the last entry (8.5.2)

▬ alwaysCalculateLast="true“

▬ Has performance implications to consider

"The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes

only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release,

and timing of any features or functionality described for our products remains at our sole discretion"

Page 41: A Deep Dive on building Notes/Domino Applications with XPages

Creating a Custom Pager● How the pager works?

▬ It connects to FacesDataIterator components, like a dynamic repeat control, a data table or a view

panel

▬ The items being displayed by the FacesDataIterator are defined by 2 property

▬ first: the index of the first item being displayed (0 to count-1)

▬ rows: the number of rows being displayed

▬ When displaying itself, the pager grabs the value of those properties and displays the pages and the

action links

▬ When clicking on the pager links, the pager adjusts the first property of the FacesDataIterator

● A custom control can use the same behavior

Page 42: A Deep Dive on building Notes/Domino Applications with XPages

Server Side Languages

Page 43: A Deep Dive on building Notes/Domino Applications with XPages

XPages Expressions● Every control property can have a static value or can be computed

▬ In Designer, a diamond appears next to the property to make it computed

▬ In the source code, the value of the attribute is using a specific syntax

● Load time versus runtime execution

▬ A load time expression is only evaluated once, when the page is constructed

▬ Syntax: ${[language:]xxxxx}

▬ A runtime expression is evaluated each time it is needed

▬ Syntax: #{[language:]xxxxx}

▬ Can lead to many evaluations when the page is processed

▬ Some properties, like the control id, do not support this mode

Page 44: A Deep Dive on building Notes/Domino Applications with XPages

JavaScript on The Server● XPages choose JavaScript as the default processing language on the

server

▬ Parity with the browser: reuse your skills

▬ Tighly integrated with Java

● Uses the javascript: prefix in an expression

Page 45: A Deep Dive on building Notes/Domino Applications with XPages

Global Objects● JavaScript makes some objects available as global objects

▬ Exposed by the Designer script editor

▬ session, database...

▬ No need to declare the object like in Lotuscript (Dim s as new NotesSession)

● The available scopes

▬ application, session, view, request

▬ Store data at different levels

● The XPages context object

▬ Gives access to set of useful APIs

Page 46: A Deep Dive on building Notes/Domino Applications with XPages

Global Functions● Besides global object, JavaScript also has global functions

▬ getComponent()

▬ Returns the JSF component

based on its id.

▬ See control snippets

for available methods

▬ Save()

▬ Saves all the data sources in the page

Page 47: A Deep Dive on building Notes/Domino Applications with XPages

JavaScript Libraries● JavaScript code can be located in different places

▬ In the XPages themselves

▬ No need for agents!

▬ In libraries of reusable code (.jss)

● Libraries processing model

▬ Loaded the first time they are used

▬ Discarded when the system is claiming for memory

▬ Uses Java weak references mechanism

▬ Unpredictable: do not store global values in the library, use scopes instead!

Page 48: A Deep Dive on building Notes/Domino Applications with XPages

Integrating Java Code● Calling Java from JavaScript

▬ The JavaScript bridge

▬ Package names, importPackages, Package keyword

▬ How types are mapped

● Adding Java files into an NSF

▬ New source directory – do not use “Local”!

● Adding libraries into an NSF

▬ WEB-INF/lib

● Adding a shared library

▬ Better scalability

▬ Server directories:

▬ 8.5.1: <domino>/xsp/nsf/lib – Warn, as it is clear out when the server is reinstalled

▬ 8.5.x next: OSGi plug-ins

Page 49: A Deep Dive on building Notes/Domino Applications with XPages

Accessing the JSF Controls● Each control in the page is in fact an instance of a Java object that inherits

from the JSF UIComponent object

● The Java objects can be accessed through the getComponent() global

function

▬ The controls are accessed using their JSF id ('name')

▬ Each component property/method can be accessed through JavaScript

▬ Ex: getComponent('MyComputedField').getValue()

▬ Domino Designer is providing code completion on the available method

Page 50: A Deep Dive on building Notes/Domino Applications with XPages

What is EL?● EL means Expression Language

▬ Main JSF processing language

▬ Not a complete language, but a bridge between pages and Java

▬ Default when no language is specified in a expression #{myobject.myprop}

▬ Used to bind controls to Domino documents

▬ Internally uses JSF variable and property resolvers. Can be extended in Java.

● EL syntax

▬ Used to access object properties

▬ myobject, myobject.property, myobject[“property”]

▬ http://developers.sun.com/docs/jscreator/help/jsp-jsfel/jsf_expression_language_intro.html#syntax

Page 51: A Deep Dive on building Notes/Domino Applications with XPages

Advanced Uses of Expressions● Sometimes, when computing a string property, it can be useful to compute

different parts of the value separately

▬ The XPages expression engine supports an expression that is a mix of expressions and static strings

▬ Ex: computing the style property

style=”background: #{o.bg}; font-family: #{o.font}”

● When a load time expression generates a runtime expression

▬ Ex: a custom control that needs a dynamic data binding capability

Page 52: A Deep Dive on building Notes/Domino Applications with XPages

Client Side Processing

Page 53: A Deep Dive on building Notes/Domino Applications with XPages

Client Side JavaScript● Inserting client script into a page

▬ The Script resource at the page level

▬ The outputScript tag

● The Event handler

▬ What is different between the eventHandler and the all properties?

● Dynamic client script

▬ The script contained in an outputScript tag can be computed: server side script can compute client

side script.

Page 54: A Deep Dive on building Notes/Domino Applications with XPages

Using Dojo Controls● dojoType & dojoAttributes

▬ Each control can have a Dojo type and a set of Dojo attributes assigned

▬ Dojo attributes are only generated if there is a Dojo type defined

▬ In the future, some optimizations can be used to generate JavaScript instead of HTML tags, thus not

triggering the Dojo parser

● Dojo Modules

▬ Dojo modules can be defined in a page or in a custom control. Gerenates a dojo.require()

statement in the HTML

● Dojo & clientID

▬ When a Dojo type is assigned to a control, then a client id is automatically generated

▬ Use #{id:xxx} to find the runtime control ids

Page 55: A Deep Dive on building Notes/Domino Applications with XPages

Controls Ids in the Browser● Multiple XPages controls can have the same JSF id in the same page, or

in the same “NamingContainer”

▬ For example, when the same custom control is added twice to the same page

● But the browsers require the ids to be unique in the page

▬ The XPages runtime then generate unique client ids per controls

▬ These ids are composed by the ids of the parent (naming containers) concatenated using ':'. When

within a repeat/data table, the current iteration index in also appended

● Warnings

▬ The ':' character used to compose the final client id, is not CSS friendly – This is a JSF design flaw

▬ Client ids are not easily predictable To make them predictable, be sure that their ids are designed in

Designer, else the runtime will generate random _idxxx ids. As a good practice, do not rely on client

ids in your code. Use dedicated functions instead.

Page 56: A Deep Dive on building Notes/Domino Applications with XPages

Calculating a Control Client Id● Computing a client id for a control can be done by:

▬ Calling the getClientId() global function in server side JavaScript

▬ Using the #{id:xxxx} expression on the server side

Page 57: A Deep Dive on building Notes/Domino Applications with XPages

Custom Controls

Page 58: A Deep Dive on building Notes/Domino Applications with XPages

What is a Custom Control?● Composite controls

● Parameterizable sub-forms

● Controls made by assembling existing controls

● Behave exactly as native controls

● Appear in the Control palette

● Define their own set of properties

▬ Hierarchical with custom editors

● Pure Java controls● Use the full JSF APIs

● Base classes provided to ease development

Control is like a page

Page 59: A Deep Dive on building Notes/Domino Applications with XPages

Defining the Control Properties● Each control can have custom properties

▬ Defined in the Designer property panel

▬ The properties can be hierarchical

● At runtime, the custom control can access the value using

compositeData.

Page 60: A Deep Dive on building Notes/Domino Applications with XPages

Using Editable Areas● Editable areas are place holders in a custom control where users can drop

their own controls

● Can be used to define common page layouts

● Uses the JSF concept of facet

Page 61: A Deep Dive on building Notes/Domino Applications with XPages

Extending the Design Time Experience● Providing a design time rendering

▬ This is a piece of markup rendered by designer instead of the custom control definition

▬ Provides a better user experience

● Using property editors

▬ Property editors can be assigned

to help users setting values

● Leveraging the “pretty” panels (8.5.2)

▬ Some panels are automatically displayed if the control contains some properties

▬ Data panel

▬ Style panel

▬ Dojo panel

Page 62: A Deep Dive on building Notes/Domino Applications with XPages

XPagesand Managed Beans

Page 63: A Deep Dive on building Notes/Domino Applications with XPages

Managed Beans● Define the scope: request, page, session, application

● Standard Java Bean class (needs a parameterless constructor)

● Mapping to a global name in faces-config.xml

● Can be used in JavaScript like the global build in objects

● Good for external stuff

Page 64: A Deep Dive on building Notes/Domino Applications with XPages

XPages in the Notes Client

Page 65: A Deep Dive on building Notes/Domino Applications with XPages

Launching XPages in the Notes Client

Notes Client:

Lotus Domino Designer:

Launch Properties can be set in both Lotus Notes and Lotus Domino

Designer

Page 66: A Deep Dive on building Notes/Domino Applications with XPages

Customization of XPages in Notes

Rich Client Platform Specific Properties

Native Platform Dialogs

Client Themes

Ability to customize application user experience for the Notes Client

XPages Toolbar

Navigation, Clear Cache / Refresh Page, View Source, Print / Page Setup

enableModifiedFlag

Prompt to save any modified content

Bookmarking XPages

Failover Support

Page 67: A Deep Dive on building Notes/Domino Applications with XPages

Customization of XPages in Notes

SWT Dialogs instead of JavaScript™ Alert / Confirm Dialogs

● Client Side JavaScript Access to Java Platform Services

▬ XSP.Alert() XSP.Xxx();

▬ XSP._NotPublished();

Web Notes Client

Page 68: A Deep Dive on building Notes/Domino Applications with XPages

Customization of XPages in Notes

Rich Client Platform Specific Properties

Provide a different user experience in Web and in Notes

In Notes, analogous to traditional 'hide/when' functionality

e.g. Discussion Template 8.5.1 Toolbar

<xp:label value="Welcome " id="labelWelcome">

<xp:label.rcp rendered="false"></xp:label.rcp>

</xp:label>

<xp:text escape="true" id="cfUserName" value="..">

<xp:text.rcp rendered="false"></xp:text.rcp>

</xp:text>

Page 69: A Deep Dive on building Notes/Domino Applications with XPages

enableModifiedFlagIntegrated with Notes Client document save model

Main Save menu sensitive to modified document content

Hooks explicit File Save / {Ctl}{S} operations

Alerts user to unsaved content on certain events

<Esc> / Close Window

Navigation to other page (client + web)

Applying enableModifiedFlag

Can be applied to any input control

Default setting overrides the need to specify behavior in many places

disableModifiedFlag flag allows an input control to explicitly “opt out” of the process

Handles client side and server side validation scenarios

Client side JavaScript reports an error before save can be performed

Server side validator finds an error after the page is submitted

Page 70: A Deep Dive on building Notes/Domino Applications with XPages

XPages Client Theme

Support for Client Themes

Different look and feel when applications are used in the Notes Client

8.5.1 Application Properties panel extended

Allow property setting for Application, Web and Client Themes

No “Out of the Box” Client Theme for 8.5.1 / 8.5.2

Page 71: A Deep Dive on building Notes/Domino Applications with XPages

XPages & Composite ApplicationsFull integration with Composite Applications in 8.5.1

Comp App supports XPages applications and XPages Components

Component

A new 8.5.1 Component design element

Define Publish & Receive Events for interaction with other components

Define Parameters to conditionalize component behavior

Wire XPages components together or with other components

PIM (mail),

Managed Browser

Symphony Containers

Widgets...

New XPages Simple Actions to easily handle Publish Events

Receive Events handled with JavaScript

Page 72: A Deep Dive on building Notes/Domino Applications with XPages

XPages in Composite Applications Editor

Adding an XPages Application/Component to a Composite Application

Easy peasy – select Notes URL via the design element picker or just specify manually

Page 73: A Deep Dive on building Notes/Domino Applications with XPages

XPages in Composite Applications

XPages Discussion Component

Notes Mail View

Google Widget

Page 74: A Deep Dive on building Notes/Domino Applications with XPages

XPages & Composite Applications

Two Part Online Video Shows Full Details

www-10.lotus.com/ldd/ddwiki.nsf/dx/XPage_Components_in_Notes_851_Videos.htm

www-

10.lotus.com/ldd/ddwiki.nsf/dx/XPages_Components_in_the_Notes_8.5.1_Client_De

monstration_Video

Page 75: A Deep Dive on building Notes/Domino Applications with XPages

A Glimpse of the Future

Designer & XPages are central to the Notes/Domino App Dev Vision

We continue to invest on these technologies

This is not a commitment on the new features being developed

This shows the direction we are taking

This is provided as information to keep you updated and get your feedback

The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion

Page 76: A Deep Dive on building Notes/Domino Applications with XPages

XPages Extensibility APIs

Let people create deployable XPages libraries

Deployed as Eclipse plug-ins in the Notes client and the Domino serverShared by all the applications!

Controls, render kits, data sources, simple actions, servlets, request

customizers, ...

Common custom controls shared in jar files

Make public the XPages Java APIs

Javadoc – articles and samples

Open source library of controls shared on openNTF

The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion

Page 77: A Deep Dive on building Notes/Domino Applications with XPages

XPages Runtime in Notes/Domino (cont.)

CKEditor for rich text editing

Replaces DOJO rich text editor as default RTEDomino Server + Notes Client (Windows, MacOS and Linux)

DOJO editor still available – set dojoType=ibm.xsp.widget.layout.RichText

Added Features

Embedded Images, Tables, Links, Emoticons, Find/Replace, Maximize

Customizable Toolbar

Slim, Medium, Large

The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion

Page 78: A Deep Dive on building Notes/Domino Applications with XPages

XPages Runtime in Notes/Domino (cont.)

New back-end classes capability

Running agents on top of in-memory documents

Support for multiple levels of categorizationcat1\cat2 ... finally !

View Data Source startKeys property

Not a filter, an actual starting point for the view contents

Data collection Pager can force “last” option to be presented

Has performance implications to consider

Document Data Source

Supports “soft delete” through a new property

Data Validation

Documents can be saved without validation

New property disableValidators="true"

Use case = Save As DraftThe information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion

Page 79: A Deep Dive on building Notes/Domino Applications with XPages

XPiNC – What YOU said YOU want!

"The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes

only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release,

and timing of any features or functionality described for our products remains at our sole discretion"

● We have started to address some of these points in 8.5.x

Page 80: A Deep Dive on building Notes/Domino Applications with XPages

XPiNC – Client Consistent Behaviors

8.5.1 8.5.x

Enabling appropriate Menu items

File \ Replicate, Open in Designer etc

"The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes

only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release,

and timing of any features or functionality described for our products remains at our sole discretion"

Page 81: A Deep Dive on building Notes/Domino Applications with XPages

Link Handling & Document Interoperability

XPages & CD|MIME Interoperability

XPages arrival in the Note Client 8.5.1 resurfaced old CD|MIME issues

XPages apps use MIME rich text format everywhere (web & client)

Lossy editing experience when moving client apps to XPages

Round tripping Doc, View & DB links between MIME and native CD

Image resources also adversely affected

XPages 8.5.1 runtime did some work to minimize CD/MIME conflicts

In memory massaging of HAPI Domino server dependent links

e.g. Transient conversion to “notes://” when running on client

Not all use cases addressed

Page 82: A Deep Dive on building Notes/Domino Applications with XPages

8.5.2 Enhancements for CD/MIME

Worked with HAPI team to define new API options

Generate links that are easier to identify, parse and convert

Include replica ids instead of literal NSF names

Take advantage of NSF layer functionality to resolve link

Added new property allowing app developer to define how links are saved

Notes format is the default

Images no longer embedded in link, e.g.

Similar to iNotes behaviour

Simplifies portability

No broken links on client

Link Handling & Document Interoperability

Page 83: A Deep Dive on building Notes/Domino Applications with XPages

Window Management Client Behaviors

Window Management

Lift single-window restriction on XPages client applications

e.g. Allow documents to be opened in new window like traditional Notes client apps

Dictate behavior by preference settings

Leverage existing client preferences

Enable this option for

Links

Page navigations

View column selections

"The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes

only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release,

and timing of any features or functionality described for our products remains at our sole discretion"

Page 84: A Deep Dive on building Notes/Domino Applications with XPages

XPages Next GenerationXPages stateless mode

Generates HTML without the server side life cycle

Rich HTML interfaces – Dojo dijits

Still leverages XPages strengths

Component/renderkit model, Page composition, Localization, i18n, Security,

Dynamic page generation, Simple actions, Script languages for business

logic…

XPages embraces REST services

Generated UI bind to data coming from REST services

Existing or custom services

Should be able to easily produce REST services

On both the Domino server and the Notes client, using the available Web

container

Extend existing services with custom business logic

Page 85: A Deep Dive on building Notes/Domino Applications with XPages

Advanced Dojo Based Controls

Page 86: A Deep Dive on building Notes/Domino Applications with XPages

And also...Improving the reuse of existing assets

LotusScript libraries, existing design elements (forms, views...)

XPiNC

Remove integration pain points (better context menus etc)

Eclipse Selection Manager Integration

XPages Widget Support

Data sources

Relational data access

More XPages Templates

Currently prototyping XPages version of team room template

Mobile devices support

Detecting the devices, dedicated themes, accessing the device capability...

Better Documentation

Including a new XPages app dev book from IBM Press !!!

Page 87: A Deep Dive on building Notes/Domino Applications with XPages

Resources

● Lotus Domino Designer wiki

▬ http://www.lotus.com/ldd/ddwiki.nsf

powered by XPages!

● OpenNTF – Open source developer community

● Planet Lotus – Aggregation of Lotus related blogs. Lots of Domino app

dev related posts

▬ planetlotus.org

● XPages blog: http://xpagesblog.com/

● IBM DeveloperWorks

● XPages Pod Cast: http://www.thexCast.net

● Bleedyellow.com (Sametime: im.bleedyellow.com )

Page 88: A Deep Dive on building Notes/Domino Applications with XPages

IBM Software Group | Rational software

Want to Buy What You’ve Seen Today?

The IBM Software online Catalog makes it easy

to shop for IBM software.

Quickly find the products you need by name,

part # or by category

Obtain up-to-date translated product and

SRP* pricing information

Have questions? Ready to move to the next

step? You can place your order by phone or

online

Learn, Shop and Buy the way that works best

for you!

ibm.com/software/ecatalog Or you can call 1-877-426-3774

Phone number for other countries on website

IBM SW online Catalog

*Suggested Retail Price (SRP) shown. For volume pricing, simply create cart and input existing Web Identity user name and password

Page 89: A Deep Dive on building Notes/Domino Applications with XPages

IBM Software Group | Rational software

Question & Answer Session

No need to submit your questions more than once – Your question will not be posted to this page until it is answered

For more Rational Web events (webcasts, teleconferences, podcasts and videos) visit:

ibm.com/software/rational/talks/

Thank you for participating!

Page 90: A Deep Dive on building Notes/Domino Applications with XPages

Contact information:

[email protected]

[email protected]

Page 91: A Deep Dive on building Notes/Domino Applications with XPages

IBM Software Group | Rational software

© Copyright IBM Corporation 2010. All rights reserved.

The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way.

IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and other IBM Rational products and services are trademarks or registered trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.

Take ActionVisit IBM Rational

http://www.ibm.com/rational

Page 92: A Deep Dive on building Notes/Domino Applications with XPages

Legal Disclaimer© IBM Corporation 2009. All Rights Reserved.

The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS

IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for

any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or

representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.

References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this

presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing

contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.

If the text contains performance statistics or references to benchmarks, insert the following language; otherwise delete:

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many

factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given

that an individual user will achieve results similar to those stated here.

If the text includes any customer examples, please confirm we have prior written approval from such customer and insert the following language; otherwise delete:

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics

may vary by customer.

Please review text for proper trademark attribution of IBM products. At first use, each product name must be the full name and include appropriate trademark symbols (e.g., IBM Lotus® Sametime® Unyte™).

Subsequent references can drop “IBM” but should include the proper branding (e.g., Lotus Sametime Gateway, or WebSphere Application Server). Please refer to http://www.ibm.com/legal/copytrade.shtml for guidance

on which trademarks require the ® or ™ symbol. Do not use abbreviations for IBM product names in your presentation. All product names must be used as adjectives rather than nouns. Please list all of the trademarks

that you use in your presentation as follows; delete any not included in your presentation.

IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, other

countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.

If you reference Adobe® in the text, please mark the first use and include the following; otherwise delete:

Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.

If you reference Java™ in the text, please mark the first use and include the following; otherwise delete:

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

If you reference Microsoft® and/or Windows® in the text, please mark the first use and include the following, as applicable; otherwise delete:

Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

If you reference Intel® and/or any of the following Intel products in the text, please mark the first use and include those that you use as follows; otherwise delete:

Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

If you reference UNIX® in the text, please mark the first use and include the following; otherwise delete:

UNIX is a registered trademark of The Open Group in the United States and other countries.

If you reference Linux® in your presentation, please mark the first use and include the following; otherwise delete:

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.