Xpages workshop 9. og 10. November 2010

unevenechoΛογισμικό & κατασκευή λογ/κού

30 Οκτ 2013 (πριν από 3 χρόνια και 11 μήνες)

133 εμφανίσεις

Xpages workshop 9. og 10. November 2010
Vidar Svendsen

|

Lotus Techsale
2
XPages workshop 9. og 10. november 2010

Velkommen til dag 2

Erfaringer vi gjorde i går

Xpages “advanced”

Øvelser fortsetter
I dag:
09:00
Start, Kaffe
12:00
lunsj
13:00
frukt, kaffe
16:00
ferdig for i dag
3
What is an XPage?

XML document

Markup and controls aggregated together on a page

Component have properties, events and can emit markup

Markup and components compiled to Java and executed in Domino's (or
Notes client's) servlet container

Compilation happens in IDE
4
Introductions made in 8.5.1
5
XPages on the Notes Client

Enable Notes/Domino users to run XPages web apps offline

Deliver the same UI experience running locally in Notes client

Take advantage of Notes/Domino NSF replication capabilities

Support XPages on all client platforms

Windows, MAC, LINUX

Innovate & Integrate where practical, e.g.

Leverage the client composite application model

Integrate with Notes client workspace features as makes sense

Provide a secure runtime environment for XPages client apps

Leverage client Execution Control Lists (ECLs)

Make it secure through a Java security manager synchronized with the ECLs
6
Performance Improvements

New properties to better control the JSF life cycle

Partial refresh optimized (only rendering the desired controls)

Partial execution of the page

Used as a default option to the pager

Runtime optimization

XPages runtime

JavaScript interpreter performance

Engine optimization

Global JS variables no longer kept in memory

End user experience / browser rendering

Less files (JavaScript & CSS) downloaded

Better compressed files
7
Scalability

Memory usage

JSF libraries optimized to minimize the information held in memory

View data cache

JSF View persistence – New options

No persistence

Persistence can be disabled when not needed

In memory – default in 8.5 & 8.5.1

Consumed memory decreased by x2.5

On disk

Pages are serialized to disk, thus increasing the number of concurrent users.

Can be a mix between memory and disk
8
Improved Developer Experience

Dojo enhancements

New Dojo release (1.3.2)

Support for IE8, Firefox 3.5, Safari 4

Bug fixes & performance enhancements

New Dojo related properties

Ease the use of dojoType & dojo specific attributes

Available to xp:panel, xp:div, xp:span...

JavaScript engine

Better support of ECMA 262 specification

Better use of the security manager
9
Active Content Filtering

Goal

HTML, and particularly from Rich Text fields, can carry malicious code that executes unwanted
operations on the behalf of the user accessing the page

JavaScript snippets embedded within the HTML


href” pointing a REST action

...

Example: Blog entry

One can add a reply to a blog entry, that will be read by the blog owner and execute malicious
code on his behalf

XPages solution

Removing malicious code from HTML by applying a filter

Filters can be applied on requests and/or responses
10
Domino iWidget

Being able to run any XPage as an iWidget

A developer just needs to register the XPage as an iWidget

No changes are requested to the page

Add some entry in the Lotus Mashup catalog

Share the artifacts with the Rich Client –> Widget = Component

Incrementally add iWidget related behaviors

Event Publishing/Handling

Component parameters

Support for modes (view, edit, help...)

Make the user experience easy through Domino Designer
11
Integration into Eclipse

Designer is fully integrated on Eclipse

Uses the Eclipse layout system

Projects NSF as projects and design elements as Eclipse resources (files)

Each design element is projected as one of more files

Complex design elements are projected through DXL (XML format)
Warn: 100% roundtrip is
not
guaranteed yet

The Eclipse views, editors and perspective

What are they?

Showing/hidding views, restoring the “old” layout (perspective)

Interesting views

Navigator, Problems, Java Package Explorer...

Leveraging Eclipse capability

Searching an NSF

Importing/Exporting content
12
Eclipse Search Service
Define
scope
Open DXL
representation
of design
element
13
Code Compare
Compares DXL
representation
14
Leveraging Eclipse Editors
Property broker editor
15
Web UI in XPages
You need 7 good reasons not to use IBM OneUI*
http://www-12.lotus.com/ldd/doc/oneuidoc/docpublic/index.htm
* (Haven't found 7 reasons yet)
16
IBM OneUI
http://www-12.lotus.com/ldd/doc/oneuidoc/docpublic/index.htm
17
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
18
When to Execute - # vs $

#

Executed every time the page is rendered

Use for values that are likely to change

$

Executed when the page is first loaded

Use for values that don't change
19
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
20
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
21
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!
22
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
23
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
24
Localizing XPages Applications

One default language

Render language defined through browser language property

Can be overwritten using the
context
object

Strings are stored in standard Java properties files

Special characters are stored as Unicode numbers

Good use for ANT automation scripts
(free Domino Designer plug-in)

No translation of HTML
25
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
26
XPages & Composite Applications

Full 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

Uses iWidget format

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
27
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 m
anually
28
XPages in Composite Applications
XPages Discussion
Component
Notes Mail View
Google
Widget
29
* http://www.ibm.com/developerworks/java/library/j-jsf2/
30
Understanding the problems

The six phase server-side XPages lifecycle finishes by rendering the
response to the requesting browser

Several processing stages are then executed on the response content
before it is viewable or completed within the requesting browser

How you design and implement your XPages code has an impact on the
efficiency of these processing stages

Factors to consider include:

Number of components on the page

Complexity of script (both server- and client-side)

Mass weight of resources (images, CSS, etc)

Use of Ajax requests

And so on...
31
Tools – Profiling Your Application

Firebug

Firefox extension

PageSpeed

Firefox/Firebug extension

YSlow!

Firefox/Firebug extension

Speed Tracer

Google Chrome Extension
32
Integrating business logic

When making use of the scoped variables (sessionScope, ...), it is better to
use native Java
TM
objects over JavaScript variables

Most beneficial when implementing caching mechanisms

Prefer use of Java HashMap over JavaScript Array

Load Java objects into the HashMap

Minimize instantiation of Java objects with the
new
operator, instead use
static
classes and methods
var
utilityObject
= new
com.foo.logic.Utility
();
var
result
= utilityObject.processDocument(document.getId());
var
result
=
com.foo.logic.Utility.processDocument
(document.getId());
33
Scopes

viewScope


Exists for the life a view (rendering of a page)

requestScope


Exists for the life of a request ( can span pages)

sessionScope


Exists for the life of user session
i.e. Until they log-off, timeout or close browser

applicationScope


Exists for the first loading of the application until a timeout (default is 30
mins)
34
A Glimpse to the Future

XPages is strategic for Notes/Domino

We continue to invest on this technology

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
35
XPages Next Generation

XPages 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
36
Advanced Dojo Based Controls
Scrollable Grid
Dynamic Tooltips
Popup Dialogs
Calendar Control
Tag Cloud
Dynamic Outline
37
Better Rich Client Integration
"
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
38
And also...

Improving the reuse of existing assets

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

Data sources

Relational data access

Mobile devices support

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

Integration with other products in the portfolio

Sametime, Connections...
39
Resources

Domino designer wiki:

http://www-10.lotus.com/ldd/ddwiki.nsf

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-intro-to-XPages.htm

http://www-10.lotus.com/ldd/ddwiki.nsf/xpViewTags.xsp?categoryFilter=xpages&category=none

Xpages.info

http://www.xpages.info/

Learning xpages blog

http://www.qtzar.com/blogs/qtzar.nsf/htdocs/LearningXPages.htm

OpenNTF.org

http://www.openntf.org/Internal/home.nsf

DeveloperWorks

http://www.ibm.com/developerworks/

Google ...
40
Dato
Hva
For målgruppe
Holdes av
Hvor
Link
Påmelding til/via
9/11
og
10/11
Workshop X-pages
via LSBG
Teknisk
Lotus Techsales
IBM Oslo Forum,
Kolbotn
http://www.lsbg.org
/datateam/symfoni/
cms.nsf/
$all/F106980DE943
141CC12577C7006
CB399?
Open&sti=LSBG
http://www.lsbg.org
/paameldinger.nsf/f
rmRegistration?
Openform
17/11
Lotus Software
Brukergruppe
Lotuskunder
LSBG styret, kunder,
partnere,IBM
PWC, Bjørvika
http://www.lsbg.org
/datateam/symfoni/
cms.nsf/
$all/45934F41FE4E
74F1C1257792005
DC184?
Open&sti=LSBG
http://www.lsbg.org
/paameldinger.nsf/f
rmRegistration?
Openform
22/11
Sikker Mobil
Samhandling
Offentlig sektor
Wizor, BlackBerry Security
Group, IBM
IBM Oslo Forum,
Kolbotn
EDDIE@no.ibm.co
m

24/11
Webinar : Xpages
for "Dummies"!
Administratorer/utvikle
re ++
Lotus Techsales
Lotus Live
https://apps.lotusliv
e.com/meetings/joi
n?id=156-530
https://events.w
ebdialogs.com/r
egister.php?
id=b8f99f784b
&l=en-US
26/11
Webinar :
Websphere Portal
v7
Forretningsutvikling,
ITsjefer
Lotus Techsales
Lotus Live
https://apps.lotusliv
e.com/meetings/joi
n?id=156-530
https://events.w
ebdialogs.com/r
egister.php?
id=09c77fac0a
&l=en-US
1/12
Webinar : Lotus
Protector for Mail!
ITsjefer,
administratorer
Lotus Techsales
Lotus Live
https://apps.lotusliv
e.com/meetings/joi
n?id=156-530
https://events.w
ebdialogs.com/r
egister.php?
id=767e64d8b3
&l=en-US
41

Skrik ut” om det er noe!!

Vidar Svendsen
Emmar Hoel

Vidar.Svendsen@no.ibm.com
Emmar.Hoel@no.ibm.com

Mobil: 41 53 53 08
Mobil: 41 53 53 19