Transcript
Page 1: Ad110 - Unleash the Power of Xpages

AD110 - Unleash the power of XPagesPhilippe Riand | XPages ArchitectMaire Kehoe | Lead XPages Developer

Page 2: Ad110 - Unleash the Power of Xpages

Financial DisclaimerThe 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 3: Ad110 - Unleash the Power of Xpages

3

Agenda● Introduction

● XPages architecture

● Advanced XPages application development

● Extending the XPages Runtime

▬ Controls and other object tags▬ Other Runtime Extensions▬ Packaging a library for the server and client

● Examples

● Conclusion

Page 4: Ad110 - Unleash the Power of Xpages

4

Objectives● Show how XPages can be extended to match your needs and increase

the developer productivity▬ Create new controls and other XPages artifacts▬ Deploy them on your IBM Lotus® Domino® servers

or IBM Lotus Notes® clients

● Expose the technical architecture behind XPages▬ Describe the technology being used▬ Give an overview of how XPages is integrated in both the Domino

server and the Notes client

Page 5: Ad110 - Unleash the Power of Xpages

5

XPages Technology● XPages is a Java™ runtime built on top of JavaServer™ Faces 1.1 (JSF)

▬ JSF has been extended in many ways to make it richer and easier to use (ajax behaviors, script languages, extended control set...)

▬ JSF APIs and concepts fully apply to XPages.

● 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

XPages architecture

Page 6: Ad110 - Unleash the Power of Xpages

6

How can the XPages Runtime be Extended?● By creating Custom Controls design elements

▬ Easy to develop, just uses XPages and script language▬ Embedded inside an NSF▬ Powerful, but don't have access to the full JSF API

● By extending the runtime with your existing Java code▬ Adding Java libraries to the runtime (jar files)▬ By calling Java from XPages (JavaScript bridge, EL, managed

beans...)

● By providing native JSF/XPages libraries▬ Requires knowledge of Java, JSF and XPages native API▬ Gives the full access to the runtime

XPages architecture

Page 7: Ad110 - Unleash the Power of Xpages

7

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

We'll focus on this during this session

XPages architecture

Page 8: Ad110 - Unleash the Power of Xpages

8

OSGi™ bundles● Native XPages libraries are packaged as OSGi bundles

▬ On Notes client 8.5.1▬ On a future 8.5.x Domino server maintenance stream, on top of an

IBM Lotus Expeditor subset● Bundles are versioned .jars that list other bundles they depend on. ● Simplifies debugging absent dependencies and handling multiple

versions of classes.● OSGi bundles also support services.

Installed bundles contribute to a service, to provide objects implementing the service interface, whenever the service objects are requested.

XPages architecture

http://www.osgi.org/Main/HomePagehttps://www.ibm.com/developerworks/lotus/products/expeditor/

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 9: Ad110 - Unleash the Power of Xpages

XPages Architecture - 8.5/8.5.1

9

Domino Server Notes Client

Domino HTTP Task

XPagesRuntime

NSF Applications

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

XPagesRuntime

Profile+Web Container

XPages ExtensionsOSGi bundles

XPages architecture

Page 10: Ad110 - Unleash the Power of Xpages

XPages Architecture – 8.5.x

10

Domino HTTP Task

OSGi Runtime

XPagesRuntime

NSF Applications

XPages ExtensionsOSGi bundles

Notes Client Process

OSGi Runtime

XPagesRuntime

XPD Profile+Web Container

XPD Profile

Domino Server Notes Client

NSF Applications

● Both the Domino server and the Notes client are deployed as OSGi bundlesThe same extension mechanism is used in both platforms; extensions are provided as OSGi bundles.

XPages ExtensionsOSGi bundles

XPages architecture

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 11: Ad110 - Unleash the Power of Xpages

11

Integrating Java Code Inside XPages● Java classes can be either

▬ Embedded in an application, using J2EE packaging capability▬ WEB-INF/classes & WEB-INF/lib

▬ Shared by all the applications▬ The jar files should be copied into <domino>/xsp/nsf/lib▬ Deployed as plug-ins in Notes client or future Domino 8.5.x

● Developing the java code inside IBM Lotus Domino Designer

● Calling Java libraries from an XPage▬ Call Java from JavaScript

Advanced XPages application development

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/09242008095047AMWEBJ9A.htm

Page 12: Ad110 - Unleash the Power of Xpages

12

Working with Managed Beans● What is a managed bean and why should I use it?

▬ It is a Java bean where the lifecycle of the bean is managed by the JSF runtime

▬ Declared in an XML file (faces-config.xml)▬ Created the first time it is used▬ Automatically stored into a scope

application, session, view (new in 8.5.2) or request▬ It can encapsulate data access or business logic▬ Lots of documentation is available on the net

● Binding UI controls to a managed bean▬ Using the EL language▬ Using Managed Beans through JavaScript

Advanced XPages application development

http://www.mindoo.com/web/blog.nsf/dx/16.07.2009095816KLEBCY.htm?opendocument&comments

Page 13: Ad110 - Unleash the Power of Xpages

13

XPages Native API concepts● XPages Library

▬ OSGi bundle (plug-ins) that contains Java code, configuration files and resources

● Controls▬ Reusable components that appear in the Designer palette

● Renderers▬ A renderer defines how a control is rendered at runtime▬ Outputs HTML and client JavaScript to the browser

● Complex types▬ Other XPages objects used by controls to store parameters and

encapsulate behaviors▬ Some examples▬ Data sources, simple actions, validators, converters...

Extending the XPages Runtime

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 14: Ad110 - Unleash the Power of Xpages

14

Extending the XPages RuntimeExample #1New Native Controls in the Palette● Tooltip: basic control that generates a Dojo tag

▬ Requires 2 Java classes: one for the control, and one for its associated renderer

▬ The control definition is located in a xsp-config file▬ Read only control: processing the JSF rendering phase only

● Data bound slider▬ Binding a control to data▬ Processing all the JSF phases

Page 15: Ad110 - Unleash the Power of Xpages

15

Example #2Packaging a Custom Control into a plug-in● A custom control is defined similarly to Native control

▬ A configuration file (.xsp-config) is defining the control properties▬ A Java file is used to create the control object at runtime▬ A custom control can be packaged like a native control

● Example: simple Ok-Cancel toolbar▬ Copy the Java file, generated by Designer, to the plug-in▬ The xsp-config file should also be added to the plug-ins▬ Path to resources should be adapted▬ Extension point to publish images, style sheets, other resources.

● Allows reuse of multiple XPage design elements from different sources, without using templates.

Extending the XPages Runtime

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 16: Ad110 - Unleash the Power of Xpages

16

Example #3Simple Actions● Simple actions are objects, added to events, that can execute code on

either the server or client side▬ Each simple action can have it own set of properties▬ Server Side

▬ Execute some Java code on the server▬ Example: Modify Selected Documents Field,

e.g. if you want to select multiple documents and change status field to "completed".

▬ Client Side▬ Generates a piece of client side JavaScript when the page is

rendered▬ Example: Select Documents with Column Value

e.g. Action to check the check box for each row where the column value is “new”.

Extending the XPages Runtime

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 17: Ad110 - Unleash the Power of Xpages

17

Example #4Json Data Source● A DataSource provides data access to the page through a set of objects

▬ DataSource, complex type tag used in the XPage▬ DataContainer, used to persist data between requests until saved▬ DataModel, used by repeating controls to find individual items

● An example DataSource with underlying data like{ {name: 'Fred', position: 'QE', phone: '5551234' },{name: 'Joe', position: 'Dev', phone: '5551235' } }

Extending the XPages Runtime

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 18: Ad110 - Unleash the Power of Xpages

18

Example #5Providing a ContentType Renderer● A content type renderer is used to format a text

▬ Available as a property to computed fields and view columns

▬ It gets the text to display from the runtime and can generate any markup

▬ Contributed using an extension point

● Examples▬ Lotus Sametime® awareness rendering▬ Lotus Connections VCard

Extending the XPages Runtime

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 19: Ad110 - Unleash the Power of Xpages

19

Example #6Implementing Custom Request Processing● Hooking into the page request

▬ XPages controls can shortcut a request with a “pathinfo” and render any kind of result

▬ http://server/db.nsf/page.xsp/pathinfo?...▬ The request is executed in the context of the page

▬ Any page/user/application data is available

● Example: REST services▬ Formatting Domino data into a JSON stream

▬ Consumed by a Dojo dynamic grid▬ RPC calls between the client and the server

Extending the XPages Runtime

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 20: Ad110 - Unleash the Power of Xpages

20

XPages Library Content● Java files

▬ A library definition file▬ Java files implementing XPages controls, renderers, complex types

● Configuration files▬ faces-config.xml

Runtime JSF configuration file, defining for example the renderers▬ .xsp-config

XPages configuration file defining the controls and complex type. Used by Designer editors to fill the palette and the property panels.Used to generate the compiled XPages.

● Runtime resources▬ CSS, JavaScript...

Extending the XPages Runtime

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 21: Ad110 - Unleash the Power of Xpages

21

Building and Deploying a Library● Building Java plug-ins from Domino Designer

▬ using the Eclipse™ PDE, included in Designer

● Installing into Designer and the developer's Notes Client▬ Optional design time plugin, to get a better user experience in

Designer

● Installing the library on the server▬ Libraries do not replicate between servers.

● Publishing the bundle on a server for other Notes Client users▬ Libraries can be pulled from a server to the Notes Client

Extending the XPages Runtime

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 22: Ad110 - Unleash the Power of Xpages

22

Using a Library in an Application● Pre-installed IBM libraries

▬ Are automatically available

● Explicit libraries▬ A link should be added at the Application level▬ The plug-ins can be downloaded and deployed to the client

● Global libraries▬ When installed, available at runtime to every application▬ Explicitly linked by applications that need them to function

Extending the XPages Runtime

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 23: Ad110 - Unleash the Power of Xpages

23

Enhancing the Design Time Experience● Providing render time markup

▬ XPages markup can be provided to replace the default square tags

● Registering property editors▬ A property editor is used by the “All Properties” panel when the user

edits a property▬ Designer comes with a large set of predefined editors, but custom

ones can be provided

Extending the XPages Runtime

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 24: Ad110 - Unleash the Power of Xpages

24

What We Skipped....● A lot... we'll provide documentation and samples over time

▬ Custom validators/converters▬ Extending language bindings▬ RequestParameters extension to configure themes & other

properties▬ Active Content Filtering engines for processing markup▬ ...

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 25: Ad110 - Unleash the Power of Xpages

25

Q&A - Anticipated!● Can I deploy custom XPages libraries on N/D 8.5, 8.5.1?

▬ This is not supported/documented by IBM.● Can I use OSGi on Domino for purposes other than XPages?

▬ This is a future goal but it hasn't been qualified yet to support those use cases.

● Will you update to JSF 2.0?▬ Not in plan for now. Might be if we have strong business cases. It is

not justified as XPages already implements most of the JSF 2.0 new features.

● Can I contribute to the OSGi framework from a NSF?▬ This is not supported in the next release of Notes/Domino, but we're

thinking about it!

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 26: Ad110 - Unleash the Power of Xpages

26

Q&A – Your Turn!

Page 27: Ad110 - Unleash the Power of Xpages

27

Related SessionsSession ID Description

AD106 XPages Just Keep Getting Better

AD107 Enhance Your Existing Applications with XPages

AD108 XPages in the IBM Lotus Notes Client - A Deep Dive!

AD109 XPages Performance and Scalability

AD111 Harnessing the Power of Server-Side JavaScript and Other Advanced XPage Techniques

BP207 Make Your XPage Apps "Pop!" with CSS and Themes

SHOW112 How to Build an XPages Application from Start to Finish

Page 28: Ad110 - Unleash the Power of Xpages

28

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.

IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Sametime and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both.

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

OSGi is a trademark of the OSGi Alliance in the United States, other countries, or both.

Eclipse is a trademark of Eclipse Foundation, Inc.


Top Related