Getting Started with XPages Presented by Jeff Byrd Agenda Who am

Download Report

Transcript Getting Started with XPages Presented by Jeff Byrd Agenda Who am

Getting Started with XPages
Presented by Jeff Byrd
Agenda







Who am I
XPages Resources
What are XPages
Why Use XPages
XPages Design Elements
XPages CRUD
XPages Template
Jeff Byrd

Senior Developer at MAXIMUS Inc.

Lotus Notes developer since ver. 3.

Blogger at www.DominoTricks.com
◦ Current series is “Roll Your Own Rest Service”.


Developing xPages for 2 Years.
Twitter @byrd1089
XPages Resources

www.notesin9.com
◦ Created by David Leedy
◦ 27 + hours of FREE videos on XPages
◦ Check out “Introduction to XPages”

Xpages.info
◦ Daily aggregate of XPages blogs
◦ XPages Snippets

OpenNTF.org – Free Source Code

PlanetLotus.org

StackOverflow.com – Filter for XPages

The Rabbit Hole – (nathantfreeman.wordpress.com)
◦ Taming IBM Domino Designer
What are XPages?

New Design Elements and tools for creating web applications

Embraces standard languages
◦ HTML, CSS, JavaScript, Java

Built on top of Java Server Faces (JSF)
◦ XPages is a JSF wrapper for Domino Developers

Everything you code gets placed inside of Java Objects
◦ You never need to deal with those Java Objects though!

You do not NEED to know Java to build XPages apps
◦ But it will help and should be something to strive for
◦ Java in XPages is somewhat similar to LotusScript Custom Classes
Why Use XPages?

Separates UI from Data
◦ Allows multiple Data sources per Page
◦ Easy access to data from other databases

Improves Data capabilities
◦ Allows @DbLookup from inside a view
 Similar to a JOIN in relational DB’s.
◦ Use Java Objects (Beans) as data source
◦ Iterate your data anyway you want via “Repeat Control”

Runs inside Notes Client (XPiNC - XPages in Notes Client)
◦ Replicate your web applications.
New Design Elements

XPage
◦ Similar to Notes Form



But not really as you can have none or multiple datasources
Data source can be:
NotesDocuments, NotesViews,Java Beans, and more...
◦ It’s often used more as a container to hold custom controls

Custom Control
◦ Similar to Subform

But not really as you can have none or multiple datasources
 Just like XPages


Can be used more then once on a page
Can accept Parameters that you define later
 Allows high reusability
◦ Can not be viewed in the browser. They only work on an XPage
◦ Often Custom Controls are used to contain the graphical layout of your app
More New Design Elements

Sever Side JavaScript
◦
Can be on the page or in a library.
◦
Library allows you to create reusable SSJS functions using
◦
It’s not really “JavaScript” but it has the same syntax





This allows additional capability
@Formulas
Domino Object Model
Java Objects
Themes
◦
You can assign a CCS file and it’ll be available on every page of your app

Like a Global “Use” statement in LotusScript
◦
Allow consistent look and feel across apps
◦
oneUI and WebStandard are built in
◦
You can create your own

◦
But always extend a server theme as they contain needed Dojo files
Themes can override controls as well

More advanced but very powerful
Scoped Variables

Scoped Variables
◦ In memory objects to store data
◦ No need to rely on cookies / URL parsing
 but you still can if you want

applicationScope
◦ Like a database profile document
◦ Available to all users
 Store Application settings and common lookups that all users need

sessionScope
◦ Life of the user session
 Store things specific to the user.
 Preferences, shopping cart, etc...
Scoped Variables

viewScope
◦ Life of the current Page
 Store value of a current search, or items from a particular
document

requestScope
◦ Life of a single request
◦ Very short - just for data you’re currently processing

Do NOT try and put Domino Objects (document,
view, etc...) in Scope
◦ They will likely get recycled when you least expect it.
◦ For a document, just store a UNID as a string and grab the
document again
Building an Application

I’m using Domino and Designer 8.5.3
◦ Latest version is 9.0
◦ Do not try Xpages development with any version below version 8.5.1
and you should be using the Update Pack or OpenNTF Extension Library
 Update Pack is available from IBM for 8.5.
 Ext. Library is at http://extlib.openntf.org/

What is the Update Pack / Extension Library?
◦ They are add-ons to the Domino Server / Designer
◦ Adds over 50 new tools and controls designed to speed up your
application
 Tools for layout, Dojo integration, etc.
 Application layout control.
◦ Extends the core product without having to wait for next version
Sample Application

Let’s build a quick Contacts Application
◦
◦
◦
◦
◦
◦
◦
One Form – Contact
One View – Contacts
Custom Control – frmContact
Custom Control – vwContacts
xPage – Contact.xsp
xPage – Contacts.xsp
Theme – Blueprint CSS
But there’s more!
Things we haven’t talked about





Server Side Java Script (SSJS)
Client Side Java Script (CSJS)
Repeat Controls
Managed Beans
Java!