Você está na página 1de 15

CIB306

Lotus Notes and Domino 8:


What's New in LotusScript
and Formula Language
Rocky Oliver
Template 2.0 Architect
Lotus Software/IBM
rock@notesdev.ibm.com

Advisor.com

Before we begin…

 Please turn off:


 Pagers
 Cellphones
 Anything else that buzzes, sings, beeps, chirps, barks,
etc.

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 1


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Who am I?
 Began my Notes/Domino life with Lotus - Word Processing
Division in 1992; re-joined IBM/Lotus Software June 2005

 Co-author, Notes and Domino 6 Programming Bible


(Wiley, April 2003)

 Contributing author, Special Edition: Using Notes/Domino


6 (Que, 2001)

 Co-author, Teach Yourself…LotusScript for Notes/Domino


4.6 (MIS Press, 1997)

 Written many articles for Lotus ADVISOR & WebSphere


ADVISOR; technical editor for Lotus ADVISOR

 Speak at numerous technology conventions, such as


Lotusphere, Lotus Devcon/IBM DeveloperWorks Live,
ADVISOR Devcons, and various European conferences

 Lotus Geek (blog): www.LotusGeek.com Advisor.com

Purpose

 This session is designed to introduce you to the


new features found in LotusScript and Formulas
in Lotus Notes and Domino 8

 It should convince you that LotusScript continues


to be an important part of the Domino
development environment

 Hopefully it will also convince you that formulas


continue to be an important part of your
development toolkit

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 2


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Agenda

 Why are formulas still important?

 Review of what’s new in Formulas in ND8

 New features in LotusScript in ND8

 Questions

Advisor.com

Why are formulas still important?


 Given like functionality, formulas are ALWAYS
faster
 All languages map to the same core functionality
 Formulas are highly optimized
 LotusScript and Java are “higher level”
languages
 Formulas are “closer to the iron”

LotuScript Java @FORMULAS


Bytecode Interpreter Formula Engine
Core API
Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 3


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
New Formulas in ND8

 @AbstractSimple
 Creates a short abstract of a text or rich text
field, but is a lot easier to use than the old
@Abstract function
 @GetViewInfo (new attribute)
 [IsViewFiltered]
 Returns True (1) if the @SetViewInfo command
has been used to filter which documents are
displayed in the view, False (0) otherwise
 @IsUsingJavaElement
 Indicates if a view or outline is using the new
Java interface

Advisor.com

New Formulas in ND8

 @PasswordQuality examples
 added examples using @PasswordQuality with
password encryption
 @URLQueryString
 now allows dynamic DB2 Query Views
 @UserRoles
 no database location limit
 @Version
 added new version numbers

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 4


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
New @Commands in ND8

 @Command ([CalendarFormat])
 added two work week and one work month
formats
 @Command([CopySelectedAsTable])
 Mimics the menu command
 @Command([OpenInNewWindow])
 Mimics the menu command

Advisor.com

New in ND 8.0.1 (MAYBE)

 Off the record, what I heard, could be…


 You can guess at what these may do

 @GetComponentViewPreference
 @IsInCompositeApp
 @ManageECL
 @Now ([NoCache]) – more on this in a minute
 @ShowParentPreview
 @RecoverIDFile
 @WhichFolders

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 5


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
New in ND8.0.1- @Now([NoCache])

 @Now([NoCache]) - when checking the time


on a server forces a server transaction to fetch
the time.
 Without this keyword, @Now would cache the
server time on the first call, and compute the
current time by adding the cached time and
elapsed time.
 This causes problems if the system time on the
client or server machine changes once the server
time is cached.
 Note that using [NoCache] adds the significant
overhead of doing a server transaction on each
call.
Advisor.com

What’s New in LotusScript?

 New Classes
 NotesDirectory, NotesDirectoryNavigator,
NotesPropertyBroker, NotesProperty

 New Properties and Methods in…


 NotesDatabase, NotesDocumentCollection,
NotesDocument, NotesDXLExporter,
NotesViewEntryCollection, NotesView, and more…

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 6


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Directory Searching

 The new NotesDirectory object represents the


Domino Directory (ies) on the specified server

 Allows for Directory searching and navigation

 NOT available in Java

Advisor.com

Directory Searching

 NotesDirectory.GetMailInfo
 For a given username, returns the following:
 Mail server
 Mail file
 Mail domain
 Internet mail address
 Out of Office status
 …and more

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 7


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Directory Searching

 NotesDirectory.LookupNames
 Creates a NotesDirectoryNavigator with the
results of the search
 You specify the view, the name(s), and the
item(s) to return
 Iterate the results using FindNextMatch and/or
FindNextName navigator methods
 Retrieve items using GetFirstItemValue and/or
GetNextItemValue methods of the navigator

Advisor.com

Working with Composite Apps

 NotesPropertyBroker
 Supports the new Composite Application
functionality
 Intermediary for communication between
components (Notes-to-Notes or Notes-to-Java)
 Instantiated through the NotesSession object
 NOT available in Java

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 8


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Using NotesPropertyBroker

 Use the InputPropertyContext to retrieve an


array of NotesProperty objects
 Read the property value(s) using the
NotesProperty methods
 Use the Publish method to publish back to the
Property Broker
 Set the property value using the NotesProperty
method SetPropertyValue

Advisor.com

Example of NotesProperyBroker

 You have an example of NotesPropertyBroker


that you can look at right now
 It is a part of Notes 8 Mail
 Provided to you as basic functionality for PIM
connectivity in Composite Apps, and as basic
examples for creating actions in Composite Apps

 Review of Actions in Mail file

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 9


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
NotesDocumentCollection
 Some interesting new methods
 Clone – returns a NotesDocumentCollection
object which is a copy of the original
 Contains – you provide either a NoteID (string),
various other objects (such as NotesDocument,
NotesDocumentCollection, etc.) and it tells you if
the NotesDocumentCollection contains all of the
specified documents
 Intersect – you provide either a NoteID (string),
various other objects (such as NotesDocument,
NotesDocumentCollection, etc.) , and it removes
all docs not a member of both the collection and
the provided docs

Advisor.com

NotesDocumentCollection
 Some more interesting new methods
 Merge – you provide either a NoteID (string),
various other objects (such as NotesDocument,
NotesDocumentCollection, etc.) , and this merges
the provided objects with the collection
 Subtract - you provide either a NoteID (string),
various other objects (such as NotesDocument,
NotesDocumentCollection, etc.), and it removes
them from the collection

 Same methods in the NotesViewEntryCollection


class
 NOT available in Java

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 10


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Changes to Web Services

 ND7 introduced a new design element to make it


easier to surface web services
 Consuming a web service from the client
required some hoop jumping
 With ND8 there is a new design element to make
it easier
 Web service enabled script library

Advisor.com

Web Service-Enabled Script Library

 Can be either Java or LotusScript

 Creates a class that can be used in other scripts

 All of the over-the-wire communication with the


web service is obfuscated
 Hidden, wrapped in a class

 Simply call the desired method

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 11


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Creating a Web Service Script Lib

 First, have the WSDL file on your machine

 Create a new script library

 Click the new button at the bottom labeled


“WSDL...”

 Import the WSDL file

 This operation creates a class that represents the


service

Advisor.com

Using a Web Service Script Lib

 Include in the agent/action


 LotusScript: Use “MyScriptLibrary”
 Java: Edit Project – Shared Java Libraries

 Create an object of the class defined in the script


library
 You may need to use the XSD data types to pass
data

 Call the desired method

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 12


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
More Interesting Toys

 ReadViewEntries URL command


 &Outputformat=JSON
 JSON text instead of XML
 &EndView=1
 Used with &Count=n to view the last n documents
in the view
 &KeyType
 Specifies the type of StartKey
 text/time/number

Advisor.com

And Finally…

 New CGI variable


 Request_Content_nnn (000, 001, etc)
 Allows HTTP POST requests to exceed 64 K

 Expands on the existing Request_Content


variable
 Set doc = session.DocumentContext
 sRequest =
doc.GetItemValue(“Request_Content_000”)(0)

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 13


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
BIG THANKS!!

 To TROY REIMER of SNAPPS for help with these


slides
We did this deck together

Advisor.com

Resources
 Lotus Developer Domain (formerly Notes.Net)
 www.lotus.com/ldd or www.notes.net
 Notes/Domino Gold Forum
 ND6 - ND8: www.lotus.com/ldd/nd6forum.nsf
 Lotus Notes FAQ
 www.keysolutions.com/NotesFAQ
 Advisor Forum
 www.advisor.com/dNotes002.nsf
 Bob Balaban’s Blog
 www.BobzBlog.com
 My blog – Lotus Geek
 www.LotusGeek.com
 BPs ONLY: BP Forum 2007 (via LNN)
Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 14


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.
Q & A (aka “Stump the Chump”)

 Ask anything about Formulas or LotusScript


 Ask anything else about development in general
 Thanks, and remember to fill out your
evaluations!

Advisor.com

ADVISOR SUMMIT Web


Update Page

advisor.com/cte0710p.nsf/w/cte0710ud

This session WILL NOT


have updates.

Advisor.com

CIB306: What’s New in Formulas and LotusScript in ND8 - Page 15


2007 ADVISOR MEDIA, Inc. and Speaker. All Rights Reserved.

Você também pode gostar