Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
The new NotesOutline class in Notes 5.0 (continued)

If you've worked with LotusScript and Notes you will notice how similar working with an outline is to working with a view or collection. Basically, you access the first element in the object and continue until the last item has been processed.

In addition to accessing elements in an outline, entries can be added, removed, and moved via LotusScript. The AddEntry method is used to add a new entry, RemoveEnty removes an entry, and MoveEntry allows the location of an entry within an outline to be changed.

A more complex scripting example
Let's take a look at a somewhat more complext routine that makes use of some more outline features.

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim outline As NotesOutline
Dim entry As NotesOutlineEntry, tempEntry As NotesOutlineEntry
Set db = session.CurrentDatabase
Set outline = New NotesOutline(db)
Set entry = outline.GetFirst
While Not (entry Is Nothing)
If (entry.TitleText = "Something") Then
Set tempEntry = entry
Set entry = outline.GetNext(entry)
Call outline.RemoveEntry(tempEntry)
Else
Set entry = outline.GetNext(entry)
End If
Wend
End Sub

It's a slightly more complex routine. Read on to learn how it all works.

  • First, we declare NotesOutlineEntry classes.
  • Next, we check the text of the entry.
  • If a match is found, the entry will be removed. We have to set a temporary variable to the outline entry to be deleted, because we need to keep track of our place in the outline.
  • Then, set the pointer to the next entry from the outline.
  • Remove the entry from the outline; we use the temporary variable as the entry to remove.
  • If a match is not found, we go to the next entry in the outline.

There are numerous properties of the NotesOutlineEntry class that can be used to determine certain characteristics of them. For instance, the IsInThisDB property signals true or false whether the outline entry is in the database (e.g., link to a view, document) or not (e.g., link to an Internet Web site). This can be used in an if/then block to signal its location, like this:

If (entry.IsInThisDB) Then
Print "This entry: " & entry.TitleText & " is in this database."
Else
Print "This entry: " & entry.TitleText & " is not in this database."
End If

Conclusion
Notes Release 5.0 has a number of major improvements for building full-feature applications. This includes Internet support in the Notes client, which makes it much simpler to build applications for the Notes client as well as Web browsers. Next month we will cover more LotusScript enhancements in Notes Release 5.0.

Dan Velasco is a Senior Technical Editor for WebSpherePower Magazine and DominoPower Magazine. He's a Sun Certified Java Programmer, Sun Certified Web Component Developer and an IBM Certified Solution Developer for WebSphere Studio V5.0. He's also a Principal CLP Application Developer (R4, R5 and ND6) as well as a CLP System Administrator (R4 and R5). You can reach him via email at dvelasco@webspherepower.com or on the Web at http://DanVelasco.com.


« Previous  ·  1  ·  2
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login