57
Presented by: Kathy Brown Learning To Run - XPages for Lotus Notes Client Developers An IdoSphere webinar

Learning To Run - XPages for Lotus Notes Client Developers

Embed Size (px)

DESCRIPTION

You’re an experienced Lotus Notes developer. You’ve been doing “classic” development for years. You know LotusScript better than your native language. You know @Formula like the back of your hand. But when it comes to Xpages and Javascript, you feel like you’re learning to walk all over again. This session will cover some tips and tricks to get you up and running in Xpages. Learn how to translate what you already know, into what you need to know for Xpages. Find out where to get the information to be just as skillful at Xpages as you are with Notes client development.

Citation preview

Page 1: Learning To Run - XPages for Lotus Notes Client Developers

Presented by: Kathy Brown

Learning To Run - XPages for Lotus Notes Client DevelopersAn IdoSphere webinar

Page 2: Learning To Run - XPages for Lotus Notes Client Developers

Who am I...

Kathy BrownLotus Notes Developer, primarily for the Notes client, until recentlyAuthor for The ViewCo-author of the Lotus User Group’s Notes Developer Tips NewsletterSpeaker at Lotusphere, The View’s Developer conference and several LUGsTwitter addictRunner

Page 3: Learning To Run - XPages for Lotus Notes Client Developers

What this session is...

Tips and transitions for Notes client developers

Page 4: Learning To Run - XPages for Lotus Notes Client Developers

What this session is not...

A step-by-step how toBest practicesAdvanced topics

Page 5: Learning To Run - XPages for Lotus Notes Client Developers

What We’ll Cover

Building BlocksLanguagesMore

Page 6: Learning To Run - XPages for Lotus Notes Client Developers

Building Blocks

FormsViewsSubformsFramesetsOutlinesPages

Page 7: Learning To Run - XPages for Lotus Notes Client Developers

Building Blocks

Xpages Core controlsContainer controlsCustom controls

Page 8: Learning To Run - XPages for Lotus Notes Client Developers

Separation of Data and UI

Traditional Notes DevForms combined data and UI

XpagesSeparate data from UI

Create forms just as data holders, no need to prettifyCreate views for lookups, no need to prettify (no need for dual sorting!)

Page 9: Learning To Run - XPages for Lotus Notes Client Developers

Customer NameCustomer IDCustomer AddressCustomer Purchases

Widget IDWidget NameWidget DescriptionWidget Image

Customer NameCustomer AddressWidget IDWidget NameWidget Description

Page 10: Learning To Run - XPages for Lotus Notes Client Developers

Data binding

Because the data and the UI are separate, we have to “bind” data to our elementsXpage

Can define a domino document or view as a data sourceCustom Controls and Container Controls like Panel

Can define a domino document or view as a data sourceRepeat Controls and certain Core Controls

Use data binding

Page 11: Learning To Run - XPages for Lotus Notes Client Developers

Data binding

Simple data bindingSelect a source from a list, or add anotherSelect an item to bind toExample: select a document from the source and a field from that document to bind to

JavascriptUtilize the JavaScript editor to write server side javascriptExample: database.getView("movies by genre").getAllDocumentsByKey(genre);

AdvancedUse expression language, scoped variable, component parameter or custom code for data binding

Page 12: Learning To Run - XPages for Lotus Notes Client Developers

DDE

Page 13: Learning To Run - XPages for Lotus Notes Client Developers

Quick Tip

Window --> Reset Perspective is your friend

Page 14: Learning To Run - XPages for Lotus Notes Client Developers

The Outline

Easily locate items on the XpageDrag & Drop items to new locations

Page 15: Learning To Run - XPages for Lotus Notes Client Developers

Source

Easily change values or propertiesSee the Matrix

Page 16: Learning To Run - XPages for Lotus Notes Client Developers

Design pane

NOT DONE

Page 17: Learning To Run - XPages for Lotus Notes Client Developers

Properties

Page 18: Learning To Run - XPages for Lotus Notes Client Developers

Core Controls

Page 19: Learning To Run - XPages for Lotus Notes Client Developers

What’s with the “group” controls?

Page 20: Learning To Run - XPages for Lotus Notes Client Developers

Something familiar*

Edit BoxRich TextMultiline Edit BoxList BoxCombo Box

*Sort of

Page 21: Learning To Run - XPages for Lotus Notes Client Developers

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 and change the “$” to “#”

Page 22: Learning To Run - XPages for Lotus Notes Client Developers

More Core Controls

Page 23: Learning To Run - XPages for Lotus Notes Client Developers

Core Controls - Label

Why Use a Label?

More controlMore programmability

Page 24: Learning To Run - XPages for Lotus Notes Client Developers

Core Controls - Errors

Use to ... display errors

Don’t forget to remove!

Page 25: Learning To Run - XPages for Lotus Notes Client Developers

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 26: Learning To Run - XPages for Lotus Notes Client Developers

Repeat Controls

No Traditional Notes Client equivalentAnd that’s a good thing

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

Page 27: Learning To Run - XPages for Lotus Notes Client Developers

Container Controls

Include Page - allows you to include an Xpage inside another Xpage

Table - We know all about this one!

View - kind of like an embedded view, but better

Tabbed Panel - multiple panels with...tabs!

Section - We’ve seen this before, too

Page 28: Learning To Run - XPages for Lotus Notes Client Developers

Custom Controls

Closest traditional equivalent are subformsCreate custom controls to hold other controls stored togetherCan be a “create once, use multiple times” control for footers or headers, for example

Page 29: Learning To Run - XPages for Lotus Notes Client Developers

CTRL+SHIFT+F in the source

Quick Tip

Page 30: Learning To Run - XPages for Lotus Notes Client Developers

@Formula in XPages

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

Page 31: Learning To Run - XPages for Lotus Notes Client Developers

@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 32: Learning To Run - XPages for Lotus Notes Client Developers

@Functions Not Supported in XPages (cont.)

@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 33: Learning To Run - XPages for Lotus Notes Client Developers

@Functions Not Supported in XPages (cont.)

@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 34: Learning To Run - XPages for Lotus Notes Client Developers

@Formula Syntax

Three syntactic changes to use @Formula in XPages:Use commas rather than semicolonsUse exact case

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

“null” should be used in place of 0 for formulas such as @AdjustExample:

var adate = @Adjust (@Created(), null, null, 5, null, null, null)

Page 35: Learning To Run - XPages for Lotus Notes Client Developers

@Formula Help

Page 36: Learning To Run - XPages for Lotus Notes Client Developers

@Formula Help

Help file is not very helpful! @Name(“[CN]”, name) – needs those quotes! But there is no example in the help file to demonstrate that!@UserName() – needs those parentheses! Again, no example in the help file to show that!

Page 37: Learning To Run - XPages for Lotus Notes Client Developers

@Name in Help

Page 38: Learning To Run - XPages for Lotus Notes Client Developers

Server Side Javascript (SSJS)

Server Side JavaScript is not LotusScriptClose enough to fool youGet this - http://bit.ly/XpagesMapLearn about recycling

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

Page 39: Learning To Run - XPages for Lotus Notes Client Developers

Close...

Page 40: Learning To Run - XPages for Lotus Notes Client Developers

But not quite

Page 41: Learning To Run - XPages for Lotus Notes Client Developers

Scoped Variables

applicationScopesessionScopeviewScoperequestScope

Page 42: Learning To Run - XPages for Lotus Notes Client Developers

Xpages Domino Object Map

Page 43: Learning To Run - XPages for Lotus Notes Client Developers

Turn off “Synchronize Navigator with Editor Tab”

Quick Tip

Page 44: Learning To Run - XPages for Lotus Notes Client Developers

CSS and Themes

Roll your own orStart with a framework*

http://bit.ly/XpageFrameworkhttp://blueprintcss.org/

David Leedy may cover this in his session

*Start with a framework

Page 45: Learning To Run - XPages for Lotus Notes Client Developers

Firebug

Page 46: Learning To Run - XPages for Lotus Notes Client Developers

Where to get help...or not

Help files not so helpful

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

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

Page 47: Learning To Run - XPages for Lotus Notes Client Developers

Quick Tip

Create different search scopes for the Help file

Page 48: Learning To Run - XPages for Lotus Notes Client Developers

Learn Javascript and Java

Javascripthttp://www.w3schools.com/js/default.asphttp://bit.ly/JavaScriptDefinitive

Javahttp://bit.ly/HeadFirstJava

Page 49: Learning To Run - XPages for Lotus Notes Client Developers

Test Server - Get one

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

Doing that with Xpages...

Page 50: Learning To Run - XPages for Lotus Notes Client Developers

Sample applications - get some

Download applications and dig through them to see how they were created

Frameworks on OpenNTFMatt White and Tim Clark’s Show and Tell sample app

Page 51: Learning To Run - XPages for Lotus Notes Client Developers

Turn on “Select controls dialog box”

Quick Tip

Page 52: Learning To Run - XPages for Lotus Notes Client Developers

Visible versus Hide When

Quick Tip

Page 53: Learning To Run - XPages for Lotus Notes Client Developers

Upgrade whenever possible

Quick Tip

Page 54: Learning To Run - XPages for Lotus Notes Client Developers

Learn Eclipse

Quick Tip

Page 55: Learning To Run - XPages for Lotus Notes Client Developers

Resources

http://xpages101.net/http://notesin9.com/Wikis - see earlier slidehttp://xpag.es/?cheatsheetPlanetLotus.orgOpenNTF.orgTLCC.com http://bit.ly/fIlpHn - all the bit.ly links bundled

Page 56: Learning To Run - XPages for Lotus Notes Client Developers

THANK YOU!

Any Questions?

Your Logo

Page 57: Learning To Run - XPages for Lotus Notes Client Developers

How to contact me:Kathy Brown

The Consultant in your Pocket webcast series: find us at http://consultantinyourpocket.com

•E-mail: [email protected]•Twitter: kjbrown13 or NotesDevTips

•My Website: http://runningnotes.net