Learning to run

56
Learning To Run Presenter: Kathy Brown 1 XPages for Lotus Notes Client Developers

description

XPages for Lotus Notes Client Developers

Transcript of Learning to run

Page 1: Learning to run

Learning To Run

Presenter: Kathy Brown

1

XPages for Lotus Notes Client Developers

Page 2: Learning to run

Who am I

• Kathy Brown• Lotus Notes Developer, primarily for the Notes client, until recently•Co-author of the Lotus User Group Notes Developer Tips Newsletter• Speaker at Lotusphere and various LUGs• Twitter addict•Runner

Page 3: Learning to run

What this session is...

• Tips and transitions for Notes client developers

Page 4: Learning to run

What this session is not...

• A step-by-step how to• Best practices• Advanced topics

Page 5: Learning to run

Building Blocks

• Forms• Views• Subforms• Framesets• Outlines• Pages

Page 6: Learning to run

Building Blocks

• XPages• Core Controls• Container Controls• Custom Controls

Page 7: Learning to run

Separation of Data and UI

• Traditional Notes Dev• Forms combine data and UI

• XPages• Separate data from UI•Create forms just as data

holders, no need to prettify•Create views for lookups, no

need to prettify (no need for dual sorting!)

Page 8: Learning to run

Customer NameCustomer IDCustomer AddressCustomer Purchases

Widget IDWidget NameWidget DescriptionWidget Image

Customer NameCustomer AddressWidget IDWidget NameWidget Description

Page 9: Learning to run

Data Binding

• Because data and UI are separate, we need to “bind” data to our elements

• Xpage•Can define a domino document or view as a data source

• Custom Controls and Container Controls like Panel•Can define a domino document or view as a data source

• Repeat Controls and certain Core Controls•Use data binding

Page 10: Learning to run

Data Binding

• Simple data binding• Select a source from a list, or add another source• Select an item to bind to•Example: select a document from the source and a field from that

document to bind to• Javascript•Utilize the JavaScript editor to write Server Side Javascript (SSJS)•Example:

database.getView(“movies”).getAllDocumentsByKey(genre);• Advanced•Use expression language, scoped variable, component parameter or

custom code for data binding

Page 11: Learning to run

DDE

Page 12: Learning to run

Quick Tip

• Window --> Reset Perspective is your friend

Page 13: Learning to run

The Outline

• Easily locate items on the Xpage• Drag & drop items to new locations

Page 14: Learning to run

Source

• Easily change values or properties• See the Matrix

Page 15: Learning to run

Design Pane

Page 16: Learning to run

Properties

Page 17: Learning to run

Core Controls

Page 18: Learning to run

What’s with those “group” controls?

Page 19: Learning to run

Something familiar*

• Edit Box• Rich Text• Multiline Edit Box• List Box• Combo Box

* Sort of

Page 20: Learning to run

Quick Tip

• When adding @formula values for a combo box or list box, the default condition is “Compute on Page Load”. Remember to change that to “Compute Dynamically” in the script editor

OR go to the Source tab and change the “$” to “#”

Page 21: Learning to run

More Core Controls

Page 22: Learning to run

Core Controls - Label

• Why use a label?

• More control• More programmability

Page 23: Learning to run

Core Controls - Errors

• Use to display ... errors

Page 24: Learning to run

Panel Control

• Sort of, kind of, like a layer...on steroids

• Or like an embedded view...on steroids

• Or like if a layer and an embedded view had a baby

Page 25: Learning to run

Repeat Controls

• No traditional Notes Client equivalentand that’s a good thing

• A repeat control allows you place controls inside it (like Edit boxes or computed values, but also more repeat controls!) that repeat on the page

Page 26: Learning to run

Container Controls

• Include Page - allows you to include an Xpage on another Xpage• Table - we all know about this one!• View - kind of like an embedded view, but better• Tabbed Panel - multiple panels with...wait for it...tabs!• Section - we know about these, too

Page 27: Learning to run

Custom Controls

• Closest traditional equivalent are subforms• Create custom controls to hold other controls stored together• Can be a “create once, use multiple times for footers and headers, for

example

Page 28: Learning to run

Quick Tip

• CTRL+SHIFT+F in the source

Page 29: Learning to run

@Formula in Xpages

• @Formula is available for use in Server Side JavaScript (SSJS)• Not all @Formula are supported in Xpages

Page 30: Learning to run

@Functions Not Supported in Xpages

@AbstractSimple @CheckAlarms @DeleteField @DoWhile

@Accessed @CheckFormulaSyntax @DialogBox @EditECL

@ACos @Command @DocChildren @EditUserECL

@AddToFolder @Compare @DocDescendants @EnableAlarms

@AdminECLIsLocked @ConfigFile @DocFields @Environment

@All @Cos @DocLength @Eval

@AllChildren @DB2Schema @DocLevel @Exp

@AllDescendants @DbCommand @DocLock @FileDir

@Ascii @DbExists @DocMark @FloatEq

@ASin @DbManager @DocNumber @FontList

@ATan @DDEExecute @DocOmmittedLength @For

@ATan2 @DDEInitiate @DocParentNumber @FormLanguage

@BrowserInfo @DDEPoke @DocSiblings @GetAddressBooks

@BusinessDays @DDETerminate @DocumentUniqueID @GetCurrentTimeZone

@Certificate @DeleteDocument @Domain @GetDocField

Page 31: Learning to run

@Functions Not Supported in Xpages@GetFocusTable @IsDocBeingRecalculated @Locale @OrgDir

@GetHTTPHeader @IsDocTruncated @Log @Password

@GetIMContactListGroupNames @IsEmbeddedInsideWCT @MailDbName @PasswordQuality

@GetPortsList @IsExpandable @MailEncryptSavedPreference @Pi

@GetProfileField @IsInCompositeApp @MailEncryptSentPreference @PickList

@GetViewInfo @IsModalHelp @MailSavePreference @Platform

@HardDeleteDocument @IsUsingJavaElement @MailSend @PolicyIsFieldLocked

@HashPassword @IsValid @MailSignPreference @PostedCommand

@InheritedDocumentUniqueID @IsVirtualizedDirectory @Matches @Power

@IsAgentEnabled @Keywords @NameLookup @Prompt

@IsAppInstalled @LanguagePreference @Narrow @RefreshECL

@IsCategory @LaunchApp @NoteID @RegQueryValue

@IsDB2 @LDAPServer @Nothing @Responses

@IsDocBeingEdited @Like @OpenInNewWindow @ServerAccess

@IsDocBeingMailed @Ln @OptimizeMailAddress @ServerName

Page 32: Learning to run

@Functions Not Supported in Xpages@Set @TemplateVersion @URLHistory @ViewTitle

@SetDocField @ThisName @URLOpen @WebDbName

@SetEnvironment @ThisValue @UrlQueryString @WhichFolders

@SetHTTPHeader @TimeMerge @UserAccess @While

@SetProfileField @TimeToTextInZone @UserNameLanguage @Wide

@SetTargetFrame @TimeZoneToText @UserNamesList @Zone

@SetViewInfo @ToNumber @UserPrivileges DEFAULT

@ShowParentPreview @ToTime @UserRoles ENVIRONMENT

@Sign @Transform @V2If FIELD

@Sin @Unavailable @V3UserName REM

@Sort @UndeleteDocument @V4UserAccess SELECT

@Soundex @UpdateFormulaContext @ValidateInternetAddress

@Sqrt @URLDecode @VerifyPassword

@StatusBar @URLEncode @Version

@Tan @URLGetHeader @ViewShowThisUnread

Page 33: Learning to run

@Formula Syntax

• Three syntactic changes to use @Formula in Xpages:•Use commas rather than semicolons•Use exact case

Example:var uname = @Name(“[CN]”, @UserName())

• “null” should be used in place of 0 for formulas such as @Adjust

Example:var aDate = @Adjust(@Created(), null, null, 5, null, null, null)

Page 34: Learning to run

@Formula Help

Page 35: Learning to run

@Formula Help

• Help file is not very helpful!• @Name(“[CN]”, name) - needs those quotes! • @UserName() - needs those parentheses!

Page 36: Learning to run

@Name in Help

Page 37: Learning to run

Server Side Javascript (SSJS)

• Server side Javascript is not LotusScript• BUT it is close enough to fool you

var someValue = entry.getColumnValues()[3]• Get a map

http://bit.ly/XpagesMap• Go green!

http://bit.ly/Recycle1http://bit.ly/Recycle2

Page 38: Learning to run

Xpages Domino Object Map

Page 39: Learning to run

Close...

Page 40: Learning to run

But Not Quite

Page 41: Learning to run

Scoped Variables

• applicationScope• sessionScope• viewScope• requestScope

Page 42: Learning to run

Quick Tip

• Turn off “Synchronize Navigator with Editor Tab”

Page 43: Learning to run

CSS and Themes

• Roll your own or• Start with a framework*• http://bit.ly/XpageFramework• http://blueprintcss.org

✴Start with a framework

Page 44: Learning to run

Firebug

• Use it

Page 46: Learning to run

Quick Tip

• Create different search scopes for the not-so-helpful help file

Page 47: Learning to run

Learn Javascript and Java

• Javascript• http://www.w3schools.com/js/default.asp• http://bit.ly/JavaScriptDefinitive

• Java• http://bit.ly/HeadFirstJava• http://www.javavideotutes.com/

Page 48: Learning to run

Test Server - Get One

• Typical Lotus Client development can get away with “testing” on a production server

• Doing that with Xpages...

Page 49: Learning to run

Sample Applications - Get Some

• Download applications and dig through them to see how they were created• Frameworks on OpenNTF•Matt White and Tim Clark’s Show and Tell sample app

Page 50: Learning to run

Quick Tip

• Turn on “Select controls dialog box”

Page 51: Learning to run

Quick Tip

• Visible versus Hide When

Page 52: Learning to run

Quick Tip

• Turn off Build Automatically

Page 53: Learning to run

Quick Tip

Page 54: Learning to run

Quick Tips

• Upgrade whenever possible• Learn Eclipse

Page 55: Learning to run

Resources

• http://xpages101.net• http://notesin9.com• http://xpag.es/?cheatsheet• http://planetlotus.org• http://openntf.org• http://tlcc.com• http://ntf.gbs.com/nathan/escape.nsf/d6plinks/NTFN-8GP6RP

Page 56: Learning to run

THANK YOU

[email protected]• @RunningKathy or @NotesDevTips• http://runningnotes.net