DISCLAIMER
THIS DOCUMENTATION IS PROVIDED FOR REFERENCE PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS DOCUMENTATION, THIS DOCUMENTATION IS PROVIDED “AS IS” WITHOUT ANY WARRANTY WHATSOEVER AND TO THE MAXIMUM EXTENT PERMITTED, LOTUS DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SAME. LOTUS SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL DAMAGES, ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS DOCUMENTATION OR ANY OTHER DOCUMENTATION. NOTWITHSTANDING ANYTHING TO THE CONTRARY, NOTHING CONTAINED IN THIS DOCUMENTATION OR ANY OTHER DOCUMENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM LOTUS (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT GOVERNING THE USE OF THIS SOFTWARE.

COPYRIGHT
Under the copyright laws, neither the documentation nor the software may be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent of Lotus Development Corporation, except in the manner described in the documentation or the applicable licensing agreement governing the use of the software. © Copyright 1985 – 1999 Lotus Development Corporation 55 Cambridge Parkway Cambridge, MA 02142

All rights reserved. Printed in the United States.

LIST OF TRADEMARKS
Domino, cc:Mail, Notes, NotesBench, NotesFlow, and Notes/FX are trademarks and Freelance, Freelance Graphics, Lotus, Lotus Components, Lotus Notes, LotusScript, Notes Mail, NotesSQL, NotesView, 1-2-3, Organizer, SmartIcons, and SmartSuite are registered trademarks of Lotus Development Corporation. AS/400, OS/2 Warp, RS/6000, and PowerPC are trademarks and AIX, IBM, OS/2, Presentation Manager, and SNA are registered trademarks of International Business Machines Corporation. Tivoli/Courier is a trademark of Tivoli Systems Inc., a wholly owned subsidiary of International Business Machines Corporation. All other trademarks are the property of their respective owners.

Contents
Preface . . . . . . . . . . . . . . . . . . . xxxvii Volume I 1 Programming Overview . . . . . . . 1
Programming in Domino ................ 1 ......... 1 Where to use scripts and formulas Event descriptions . . . . . . . . . . . . . . . . . . . . . 25 Event sequencing . . . . . . . . . . . . . . . . . . . . . . 29

2 User Interface

. . . . . . . . . . . . . . 33

Exploring the Programmer’s pane . . . . . . . . . 33 Exploring the Java interface in the Programmer’s pane . . . . . . . . . . . . . . . 35 Accessing the Programmer’s pane . . . . . . 36 Using the Info List . . . . . . . . . . . . . . . . . . . . . 37 Using the Objects tab . . . . . . . . . . . . . . . . . . . 37 Programming an object’s properties and events . . . . . . . . . . . . . . . . . . . . . . 37 Using the Reference tab . . . . . . . . . . . . . . . . . 38 Pasting information from the Reference tab into the Script area . . . . . . . . . . . . . 38 Using short-cut keys to access the Reference tab . . . . . . . . . . . . . . . . . . . . 39 Using the Errors box . . . . . . . . . . . . . . . . . . . 39 Using the Script area . . . . . . . . . . . . . . . . . . . 39 Setting text properties . . . . . . . . . . . . . . . . 40 Moving the insertion point while editing text in the Script area . . . . . . . . 40 Selecting text . . . . . . . . . . . . . . . . . . . . . . . 41 Editing text with key combinations . . . . . 42 Editing text with menu commands . . . . . . 42 Saving and deleting text in the Script area . . . . . . . . . . . . . . . . . . . . . . 42 Renaming an object, subprogram, or class . . . . . . . . . . . . . . . . . . . . . . . . . 43 Writing Java in an agent . . . . . . . . . . . . . . . . 43 Compiling Java . . . . . . . . . . . . . . . . . . . . . 44 Importing Java into the Programmer’s pane . . . . . . . . . . . . . . . 44

Table of Domino Objects . . . . . . . . . . . . . . . . . 3 SmartIcons . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Replication formulas . . . . . . . . . . . . . . . . . . . . 6 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Actions Hotspots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 . . . . . . . . . . . . . . . . . . . . . 15

Form, selection, and column formulas . . . . . . 15 Form formulas Selection formulas . . . . . . . . . . . . . . . . . . . 15 Column formulas . . . . . . . . . . . . . . . . . . . 16 Window title, section access, and insert subform formulas . . . . . . . . . . . . . . . . . 17 Window title formulas . . . . . . . . . . . . . . . 17 Section access formulas . . . . . . . . . . . . . . . 18 Insert subform formulas . . . . . . . . . . . . . . 18 Section title and hidden paragraph formulas . . . . . . . . . . . . . . . 19 Section title formulas . . . . . . . . . . . . . . . . 19 Hidden paragraph formulas . . . . . . . . . . . 19 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Field design formulas . . . . . . . . . . . . . . . . . . 22 Default value formulas . . . . . . . . . . . . . . . 23 Input translation formulas . . . . . . . . . . . . 23 Input validation formulas . . . . . . . . . . . . . 23 Value formulas for a computed fields . . . . 24 Keyword field formulas . . . . . . . . . . . . . . 24

iii

Using AgentRunner . . . . . . . . . . . . . . . . . . . . 45 Creating a project for AgentRunner . . . . . 45 Generating an AgentContext document . . . 46 Debugging a Java agent with AgentRunner . . . . . . . . . . . . . . . . . . . . 46 Writing JavaScript in the Programmer’s pane . . . . . . . . . . . . . . . 47 Writing JavaScript in a page header . . . . . 48 Compiling JavaScript . . . . . . . . . . . . . . . . 48 Writing LotusScript in the Programmer’s pane . . . . . . . . . . . . . . . 48 Defining global variables and subprograms . . . . . . . . . . . . . . . . . 48 Create an additional script in LotusScript . . . . . . . . . . . . . . . . . . . . 49 Completing a LotusScript block statement automatically . . . . . . . . . . . . 50 Completing a LotusScript %directive automatically . . . . . . . . . . . 50 Compiling LotusScript . . . . . . . . . . . . . . . 50 Exploring the LotusScript Debugger . . . . . . . 51 Using the LotusScript Debugger . . . . . . . . 52 Selecting a subprogram . . . . . . . . . . . . . . 53 . . . . . . . . . . 54 Stepping through a script . . . . . . . . . . . . . 53 Debugging with breakpoints Using the debugger utilities . . . . . . . . . . . . . 55

Using variables . . . . . . . . . . . . . . . . . . . . . . . 63 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Temporary variables . . . . . . . . . . . . . . . . . 65 Using constants . . . . . . . . . . . . . . . . . . . . . . . 66 Text constants . . . . . . . . . . . . . . . . . . . . . . 66 Numeric constants . . . . . . . . . . . . . . . . . . 67 Time-date constants . . . . . . . . . . . . . . . . . 67 Using operators . . . . . . . . . . . . . . . . . . . . . . . 68 Operator overview and precedence . . . . . 69 Order of evaluation for operations . . . . . . 70 Assignment operator . . . . . . . . . . . . . . . . 70 List operator . . . . . . . . . . . . . . . . . . . . . . . 70 Unary operators . . . . . . . . . . . . . . . . . . . . 71 Arithmetic operators . . . . . . . . . . . . . . . . . 71 Text operator . . . . . . . . . . . . . . . . . . . . . . 71 . . . . . . . . . . . . . . . 72 . . . . . . . . . . . . . . . . . . . 72 Comparison operators Logical operators

Operations on lists . . . . . . . . . . . . . . . . . . 72 Using @functions . . . . . . . . . . . . . . . . . . . . . . 75 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Return value . . . . . . . . . . . . . . . . . . . . . . . 76 Side-effects . . . . . . . . . . . . . . . . . . . . . . . . 76 @Commands . . . . . . . . . . . . . . . . . . . . . . . 77 Order of evaluation for formula statements . . . . . . . . . . . . . . . 77 Using keywords . . . . . . . . . . . . . . . . . . . . . . 79 Specifying form and view names in formulas . . . . . . . . . . . . . . . . . . . . . . 81 Debugging formulas . . . . . . . . . . . . . . . . . . . 81

Using Script Libraries . . . . . . . . . . . . . . . . . . 56 Using LotusScript in a Script Library . . . . 56 Using Java in a Script Library . . . . . . . . . . 57 Writing formulas in the Programmer’s pane . . . . . . . . . . . . . . . 58 Using the formula window . . . . . . . . . . . . 58 Using the Programmer’s pane for Simple action(s) . . . . . . . . . . . . . . . . . . 59

4 Formula Language Coding Guidelines . . . . . . . . . . . . . 83
Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Writing formulas that evaluate to a result . . . . . . . . . . . . . . . . . . . . . . . . . 84 Writing formulas that perform actions . . . 85 Working with lists . . . . . . . . . . . . . . . . . . 86

3 Formula Language Rules . . . . . 61
Using the syntax rules . . . . . . . . . . . . . . . . . . 61 Lexical elements . . . . . . . . . . . . . . . . . . . . 61 General syntax rules . . . . . . . . . . . . . . . . . 62 iv Domino Designer Programming Guide

Using conditional statements . . . . . . . . . . 90 Writing messages and getting user input . . . . . . . . . . . . . . . . . . . . . . . 92 Handling errors . . . . . . . . . . . . . . . . . . . . 98 Working with @functions . . . . . . . . . . . . . 101 Working with @commands . . . . . . . . . . . . 103 Performing string operations . . . . . . . . . . . . . 104 Concatenating, comparing, and determining length . . . . . . . . . . . . . . . 106 Locating and extracting substrings . . . . . . 109 Trimming, repeating, adding a new line, and changing case . . . . . . . . . . . . 112 Performing arithmetic operations . . . . . . . . . 113 Performing time-date operations . . . . . . . . . . 118 Accessing the user environment . . . . . . . . . . 120 Accessing the current database and view . . . 122 Accessing the current document in the formula language . . . . . . . . . . . . . . . . . 125 Accessing data outside the current document and database . . . . . . . . . . . . 128 Accessing external databases through ODBC using @functions . . . . . . . . . . . . 131

Where does this @function work? (Part 2 S–Z) . . . . . . . . . . . . . . . . . . . . . 151 @Functions with ECL security . . . . . . . . . . . . 153 @Abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 @Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 @Accessed . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 @Acos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 @AddToFolder . . . . . . . . . . . . . . . . . . . . . . . 164 @Adjust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 @All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 @AllChildren . . . . . . . . . . . . . . . . . . . . . . . . . 167 @AllDescendants . . . . . . . . . . . . . . . . . . . . . . 168 @Ascii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 @Asin @Atan2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 . . . . . . . . . . . . . . . . . . . 176 @Atan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 @AttachmentLengths . . . . . . . . . . . . . . . . . . . 175 @AttachmentNames @Author @Attachments . . . . . . . . . . . . . . . . . . . . . . . . 176 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 . . . . . . . . . . . . . . . . . . . . . . . . 179 @Begins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 @BrowserInfo @Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . 181 @Char . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 @CheckAlarms @ClientType . . . . . . . . . . . . . . . . . . . . . . . 183 . . . . . . . . . . . . . . . . . . . . . . . . . 184

5 Formula Language @Functions A–Z . . . . . . . . . . . . . 133
Where does this @function work? (Part 1 A–D) . . . . . . . . . . . . . . . . . . . . . 133 Where does this @function work? (Part 1 E–K) . . . . . . . . . . . . . . . . . . . . . 136 Where does this @function work? (Part 1 L–R) . . . . . . . . . . . . . . . . . . . . . 138 Where does this @function work? (Part 1 S–Z) . . . . . . . . . . . . . . . . . . . . . 141 Where does this @function work? (Part 2 A–D) . . . . . . . . . . . . . . . . . . . . . 143 Where does this @function work? (Part 2 E–K) . . . . . . . . . . . . . . . . . . . . . 146 Where does this @function work? (Part 2 L–R) . . . . . . . . . . . . . . . . . . . . . 148

@Command . . . . . . . . . . . . . . . . . . . . . . . . . . 184 @Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 @Cos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 @Created . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 @Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 @Day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 @DbColumn (Notes databases) . . . . . . . . . . . 190 @DbColumn (ODBC) . . . . . . . . . . . . . . . . . . . 195 @DbCommand (ODBC) . . . . . . . . . . . . . . . . . 201 @DbExists . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 @DbLookup (Notes databases) . . . . . . . . . . . 207 v

@DbLookup (ODBC) . . . . . . . . . . . . . . . . . . . 214 @DbManager . . . . . . . . . . . . . . . . . . . . . . . . . 220 @DbName . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 @DbTitle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 @DDEExecute . . . . . . . . . . . . . . . . . . . . . . . . 223 @DDEInitiate . . . . . . . . . . . . . . . . . . . . . . . . . 225 @DDEPoke . . . . . . . . . . . . . . . . . . . . . . . . . . 227 @DDETerminate . . . . . . . . . . . . . . . . . . . . . . 228 DEFAULT . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 @DeleteDocument . . . . . . . . . . . . . . . . . . . . . 229 @DeleteField . . . . . . . . . . . . . . . . . . . . . . . . . 230 @DialogBox . . . . . . . . . . . . . . . . . . . . . . . . . . 230 @Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 @DocChildren . . . . . . . . . . . . . . . . . . . . . . . . 234 @DocDescendants . . . . . . . . . . . . . . . . . . . . . 236 @DocFields @DocLength . . . . . . . . . . . . . . . . . . . . . . . . . . 238 . . . . . . . . . . . . . . . . . . . . . . . . . 238

FIELD

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

@Fontlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 @GetDocField . . . . . . . . . . . . . . . . . . . . . . . . 259 @GetPortsList . . . . . . . . . . . . . . . . . . . . . . . . 260 @GetProfileField . . . . . . . . . . . . . . . . . . . . . . 261 @Hour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 @If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 @Implode . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 @InheritedDocumentUniqueID . . . . . . . . . . . 266 @Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 @IsAgentEnabled . . . . . . . . . . . . . . . . . . . . . 267 @IsAvailable . . . . . . . . . . . . . . . . . . . . . . . . . 268 @IsCategory . . . . . . . . . . . . . . . . . . . . . . . . . . 269 @IsDocBeingEdited . . . . . . . . . . . . . . . . . . . . 270 @IsDocBeingLoaded . . . . . . . . . . . . . . . . . . . 270 @IsDocBeingMailed . . . . . . . . . . . . . . . . . . . . 271 @IsDocBeingRecalculated . . . . . . . . . . . . . . . 272 @IsDocBeingSaved . . . . . . . . . . . . . . . . . . . . 273 @IsDocTruncated . . . . . . . . . . . . . . . . . . . . . . 274 @IsError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 @IsExpandable . . . . . . . . . . . . . . . . . . . . . . . 275 @IsMember . . . . . . . . . . . . . . . . . . . . . . . . . . 276 @IsModalHelp . . . . . . . . . . . . . . . . . . . . . . . . 277 @IsNewDoc . . . . . . . . . . . . . . . . . . . . . . . . . . 278 @IsNotMember . . . . . . . . . . . . . . . . . . . . . . . 278 @IsNumber . . . . . . . . . . . . . . . . . . . . . . . . . . 280 @IsResponseDoc . . . . . . . . . . . . . . . . . . . . . . 280 @IsText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 . . . . . . . . . . . . . . . . . . . . . . . 282 @IsTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 @IsUnavailable @IsValid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

@DocLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 @DocMark . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 @DocNumber . . . . . . . . . . . . . . . . . . . . . . . . 240 @DocParentNumber . . . . . . . . . . . . . . . . . . . 241 @DocSiblings . . . . . . . . . . . . . . . . . . . . . . . . . 242 @DocumentUniqueID . . . . . . . . . . . . . . . . . . 243 @Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 @EditECL . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 @EditUserECL . . . . . . . . . . . . . . . . . . . . . . . . 247 @Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 @EnableAlarms . . . . . . . . . . . . . . . . . . . . . . . 248 @Ends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 ENVIRONMENT . . . . . . . . . . . . . . . . . . . . . . 249 @Environment . . . . . . . . . . . . . . . . . . . . . . . . 250 @Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 @Exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 @Explode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 @Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 @False . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

@Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . 284 @LanguagePreference . . . . . . . . . . . . . . . . . . 285 @Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 @LeftBack . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 @Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

vi Domino Designer Programming Guide

@Like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 @Ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 @Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 @Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 @LowerCase . . . . . . . . . . . . . . . . . . . . . . . . . 293 @MailDbName . . . . . . . . . . . . . . . . . . . . . . . 294 @MailEncryptSavedPreference . . . . . . . . . . . 295 @MailEncryptSentPreference . . . . . . . . . . . . . 296 @MailSavePreference . . . . . . . . . . . . . . . . . . . 296 @MailSend . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 @MailSignPreference . . . . . . . . . . . . . . . . . . . 301 @Matches . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 @Max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 @Member . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 @Middle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 @MiddleBack . . . . . . . . . . . . . . . . . . . . . . . . . 307 @Min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 @Minute . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 @Modified . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 @Modulo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 @Month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 @Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 @NameLookup . . . . . . . . . . . . . . . . . . . . . . . 317 @Narrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 @NewLine . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 @No . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 @NoteID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 . . . . . . . . . . . . . . . . 322 @Now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 @OptimizeMailAddress @Password . . . . . . . . . . . . . . . . . . . . . . . . . . 323

@ProperCase . . . . . . . . . . . . . . . . . . . . . . . . . 336 @Random . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 @RefreshECL . . . . . . . . . . . . . . . . . . . . . . . . . 338 REM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 @Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 @Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 @ReplaceSubstring . . . . . . . . . . . . . . . . . . . . 341 @Responses . . . . . . . . . . . . . . . . . . . . . . . . . . 342 @Return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 @Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 @RightBack . . . . . . . . . . . . . . . . . . . . . . . . . . 345 @Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 @Second . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 SELECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 @Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 @Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 @SetDocField . . . . . . . . . . . . . . . . . . . . . . . . . 351 @SetEnvironment . . . . . . . . . . . . . . . . . . . . . 352 @SetField . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 @SetProfileField . . . . . . . . . . . . . . . . . . . . . . . 354 @SetTargetFrame . . . . . . . . . . . . . . . . . . . . . . 354 @Sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 @Sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 @Soundex . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 @Sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 @Subset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 @Success . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 @Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 @Tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 @Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 @TextToNumber . . . . . . . . . . . . . . . . . . . . . . 363 @TextToTime . . . . . . . . . . . . . . . . . . . . . . . . . 364 @Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 @Today . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 @Tomorrow . . . . . . . . . . . . . . . . . . . . . . . . . . 367 @Trim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

@Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 @PickList . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 @Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 @PostedCommand . . . . . . . . . . . . . . . . . . . . 330 @Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 @Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

vii

@True

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

AdminCrossCertifyKey . . . . . . . . . . . . . . . . . 403 AdminDatabaseAnalysis . . . . . . . . . . . . . . . . 403 AdminDatabaseQuotas . . . . . . . . . . . . . . . . . 404 AdminIDFileClearPassword . . . . . . . . . . . . . 404 AdminIDFileExamine . . . . . . . . . . . . . . . . . . 404 AdminIDFileSetPassword . . . . . . . . . . . . . . . 405 Administration . . . . . . . . . . . . . . . . . . . . . . . 405 . . . . . . . . . . . . . . . . . . . 406 . . . . . . . . . . . . . . . . . . . 406 . . . . . . . . . . . . . . . 407 AdminNewOrganization . . . . . . . . . . . . . . . . 405 AdminNewOrgUnit AdminOpenCatalog AdminOpenAddressBook . . . . . . . . . . . . . . . 406 AdminOpenCertLog . . . . . . . . . . . . . . . . . . . 407 AdminOpenGroupsView AdminOpenServerLog . . . . . . . . . . . . . . . . . 407

@Unavailable . . . . . . . . . . . . . . . . . . . . . . . . . 369 @UndeleteDocument . . . . . . . . . . . . . . . . . . . 369 @Unique . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 . . . . . . . . . . . . . . . . . . . . . . . . . 370 . . . . . . . . . . . . . . . . . . . . . . . . 373 @UpperCase @URLHistory

@URLGetHeader . . . . . . . . . . . . . . . . . . . . . . 371 @URLOpen . . . . . . . . . . . . . . . . . . . . . . . . . . 374 @UserAccess . . . . . . . . . . . . . . . . . . . . . . . . . 377 @UserName . . . . . . . . . . . . . . . . . . . . . . . . . . 379 @UserNameLanguage . . . . . . . . . . . . . . . . . . 381 @UserNamesList . . . . . . . . . . . . . . . . . . . . . . 382 @UserPrivileges . . . . . . . . . . . . . . . . . . . . . . . 383 @UserRoles . . . . . . . . . . . . . . . . . . . . . . . . . . 383 @V2If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 @V3UserName . . . . . . . . . . . . . . . . . . . . . . . 385 @ValidateInternetAddress . . . . . . . . . . . . . . . 386 @Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 @ViewTitle . . . . . . . . . . . . . . . . . . . . . . . . . . 389 @Weekday . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 @Wide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 @Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 @Year . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 @Yes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 @Yesterday . . . . . . . . . . . . . . . . . . . . . . . . . . 393 @Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394

AdminOpenServersView . . . . . . . . . . . . . . . . 408 AdminOpenStatistics . . . . . . . . . . . . . . . . . . . 408 AdminOpenUsersView . . . . . . . . . . . . . . . . . 408 AdminOutgoingMail . . . . . . . . . . . . . . . . . . . 409 AdminRegisterFromFile AdminRegisterServer AdminRemoteConsole . . . . . . . . . . . . . . . . 409 . . . . . . . . . . . . . . . . . . 409 . . . . . . . . . . . . . . . . . 410

AdminRegisterUser . . . . . . . . . . . . . . . . . . . . 410 AdminSendMailTrace . . . . . . . . . . . . . . . . . . 410 AdminStatisticsConfig . . . . . . . . . . . . . . . . . . 411 AdminTraceConnection AgentEdit AgentEnableDisable AgentRun . . . . . . . . . . . . . . . . 411 . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 . . . . . . . . . . . . . . . . . . . 412

6 Formula Language @Commands A–Z . . . . . . . . . . . . 397
Using @Commands . . . . . . . . . . . . . . . . . . . . 397 @Commands with ECL security . . . . . . . . . . 397 AddBookmark . . . . . . . . . . . . . . . . . . . . . . . . 400 AddDatabase . . . . . . . . . . . . . . . . . . . . . . . . . 400 AddDatabaseRepID . . . . . . . . . . . . . . . . . . . . 401 AdminCertify . . . . . . . . . . . . . . . . . . . . . . . . 402 AdminCreateGroup . . . . . . . . . . . . . . . . . . . . 402 AdminCrossCertifyIDFile . . . . . . . . . . . . . . . 403 viii Domino Designer Programming Guide

AgentLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 . . . . . . . . . . . . . . . . . . 413 AgentSetServerName

AgentTestRun . . . . . . . . . . . . . . . . . . . . . . . . 413 AttachmentDetachAll . . . . . . . . . . . . . . . . . . 414 AttachmentLaunch . . . . . . . . . . . . . . . . . . . . 414 AttachmentProperties . . . . . . . . . . . . . . . . . . 414 AttachmentView . . . . . . . . . . . . . . . . . . . . . . 415 CalendarFormat . . . . . . . . . . . . . . . . . . . . . . 415

CalendarGoTo . . . . . . . . . . . . . . . . . . . . . . . . 416 ChooseFolders . . . . . . . . . . . . . . . . . . . . . . . . 416 Compose . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 CreateAction . . . . . . . . . . . . . . . . . . . . . . . . . 418 CreateAgent . . . . . . . . . . . . . . . . . . . . . . . . . 418 CreateControlledAccessSection . . . . . . . . . . . 419 CreateEllipse . . . . . . . . . . . . . . . . . . . . . . . . . 419 CreateFolder . . . . . . . . . . . . . . . . . . . . . . . . . 419 CreateForm . . . . . . . . . . . . . . . . . . . . . . . . . . 420 CreateLayoutRegion . . . . . . . . . . . . . . . . . . . 420 CreateNavigator . . . . . . . . . . . . . . . . . . . . . . 420 CreatePolygon . . . . . . . . . . . . . . . . . . . . . . . . 421 CreatePolyline . . . . . . . . . . . . . . . . . . . . . . . . 421 CreateRectangle . . . . . . . . . . . . . . . . . . . . . . . 421 CreateRectangularHotspot . . . . . . . . . . . . . . 422 CreateSection . . . . . . . . . . . . . . . . . . . . . . . . . 422 CreateSubForm . . . . . . . . . . . . . . . . . . . . . . . 422 CreateTextbox . . . . . . . . . . . . . . . . . . . . . . . . 423 CreateView . . . . . . . . . . . . . . . . . . . . . . . . . . 423 DatabaseReplSettings DesignDocumentInfo . . . . . . . . . . . . . . . . . . 423 . . . . . . . . . . . . . . . . . . 424 DebugLotusScript . . . . . . . . . . . . . . . . . . . . . 424 DesignFormAttributes . . . . . . . . . . . . . . . . . . 424 DesignFormFieldDef . . . . . . . . . . . . . . . . . . . 425 DesignFormNewField . . . . . . . . . . . . . . . . . . 425 DesignForms . . . . . . . . . . . . . . . . . . . . . . . . . 425 DesignFormShareField . . . . . . . . . . . . . . . . . 425 DesignFormUseField . . . . . . . . . . . . . . . . . . . 426 DesignFormWindowTitle . . . . . . . . . . . . . . . 426 DesignHelpAboutDocument . . . . . . . . . . . . . 426 DesignHelpUsingDocument . . . . . . . . . . . . . 427 DesignIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 DesignMacros . . . . . . . . . . . . . . . . . . . . . . . . 427 DesignRefresh . . . . . . . . . . . . . . . . . . . . . . . . 428 DesignReplace . . . . . . . . . . . . . . . . . . . . . . . . 428 DesignSharedFields . . . . . . . . . . . . . . . . . . . . 428

DesignSynopsis . . . . . . . . . . . . . . . . . . . . . . . 429 DesignViewAppendColumn . . . . . . . . . . . . . 429 DesignViewAttributes . . . . . . . . . . . . . . . . . . 429 DesignViewColumnDef . . . . . . . . . . . . . . . . . 429 DesignViewEditActions . . . . . . . . . . . . . . . . 430 DesignViewFormFormula . . . . . . . . . . . . . . . 430 DesignViewNewColumn . . . . . . . . . . . . . . . . 430 DesignViews . . . . . . . . . . . . . . . . . . . . . . . . . 430 DesignViewSelectFormula . . . . . . . . . . . . . . . 431 DialingRules . . . . . . . . . . . . . . . . . . . . . . . . . 431 EditBottom . . . . . . . . . . . . . . . . . . . . . . . . . . 431 EditButton . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 EditClear . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 EditCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 EditCut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 EditDeselectAll . . . . . . . . . . . . . . . . . . . . . . . 433 EditDetach . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 EditDocument . . . . . . . . . . . . . . . . . . . . . . . . 435 EditDown . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 EditEncryptionKeys . . . . . . . . . . . . . . . . . . . . 436 EditFind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 EditFindInPreview . . . . . . . . . . . . . . . . . . . . 437 EditFindNext . . . . . . . . . . . . . . . . . . . . . . . . . 438 EditGoToField . . . . . . . . . . . . . . . . . . . . . . . . 438 EditHeaderFooter . . . . . . . . . . . . . . . . . . . . . 439 EditHorizScrollbar . . . . . . . . . . . . . . . . . . . . . 439 EditIndent . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 EditIndentFirstLine . . . . . . . . . . . . . . . . . . . . 440 EditInsertButton . . . . . . . . . . . . . . . . . . . . . . 440 . . . . . . . . . . . . . . . 440 EditInsertFileAttachment

EditInsertObject . . . . . . . . . . . . . . . . . . . . . . . 441 EditInsertPageBreak . . . . . . . . . . . . . . . . . . . 442 EditInsertPopup EditInsertTable . . . . . . . . . . . . . . . . . . . . . . 442 . . . . . . . . . . . . . . . . . . . . . . . 443

EditInsertText . . . . . . . . . . . . . . . . . . . . . . . . 443 EditLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444

ix

EditLinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 EditLocations . . . . . . . . . . . . . . . . . . . . . . . . . 445 EditMakeDocLink . . . . . . . . . . . . . . . . . . . . . 445 EditNextField . . . . . . . . . . . . . . . . . . . . . . . . 445 EditOpenLink . . . . . . . . . . . . . . . . . . . . . . . . 445 EditPaste . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 EditPasteSpecial . . . . . . . . . . . . . . . . . . . . . . 446 EditPhoneNumbers . . . . . . . . . . . . . . . . . . . . 446 EditPrevField . . . . . . . . . . . . . . . . . . . . . . . . . 447 EditProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 EditResizePicture . . . . . . . . . . . . . . . . . . . . . . 448 EditRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 EditSelectAll . . . . . . . . . . . . . . . . . . . . . . . . . 449 EditSelectByDate . . . . . . . . . . . . . . . . . . . . . . 450 EditShowHideHiddenChars . . . . . . . . . . . . . 450 EditTableDeleteRowColumn . . . . . . . . . . . . . 450 EditTableFormat . . . . . . . . . . . . . . . . . . . . . . 451 EditTableInsertRowColumn . . . . . . . . . . . . . 451 EditTop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 EditUndo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 EditUntruncate . . . . . . . . . . . . . . . . . . . . . . . 452 EditUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 EmptyTrash . . . . . . . . . . . . . . . . . . . . . . . . . . 453 ExchangeUnreadMarks . . . . . . . . . . . . . . . . . 454 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 . . . . . . . . . . . . . . . . . . . . . 455 FileCloseWindow

FileFullTextDelete . . . . . . . . . . . . . . . . . . . . . 460 FileFullTextInfo . . . . . . . . . . . . . . . . . . . . . . . 460 FileFullTextUpdate . . . . . . . . . . . . . . . . . . . . 461 FileImport . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 FileNewDatabase . . . . . . . . . . . . . . . . . . . . . . 463 FileNewReplica . . . . . . . . . . . . . . . . . . . . . . . 463 FileOpenDatabase . . . . . . . . . . . . . . . . . . . . . 464 FileOpenDBRepID . . . . . . . . . . . . . . . . . . . . . 466 FilePageSetup . . . . . . . . . . . . . . . . . . . . . . . . 467 FilePrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 FilePrintSetup . . . . . . . . . . . . . . . . . . . . . . . . 470 FileSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 FileSaveNewVersion . . . . . . . . . . . . . . . . . . . 470 FindFreeTimeDialog . . . . . . . . . . . . . . . . . . . 471 Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 . . . . . . . . . . . . . . . . . . . . . . . 473 FolderCollapse

FolderCustomize . . . . . . . . . . . . . . . . . . . . . . 473 FolderExpand . . . . . . . . . . . . . . . . . . . . . . . . 474 FolderExpandAll . . . . . . . . . . . . . . . . . . . . . . 474 FolderExpandWithChildren . . . . . . . . . . . . . 474 FolderMove . . . . . . . . . . . . . . . . . . . . . . . . . . 475 FolderProperties . . . . . . . . . . . . . . . . . . . . . . 475 FolderRename . . . . . . . . . . . . . . . . . . . . . . . . 475 FormActions . . . . . . . . . . . . . . . . . . . . . . . . . 476 FormTestDocument . . . . . . . . . . . . . . . . . . . . 476 GoUpLevel . . . . . . . . . . . . . . . . . . . . . . . . . . 476 . . . . . . . . . . . . . . . . . . . 477 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 HelpAboutDatabase HelpAboutNotes . . . . . . . . . . . . . . . . . . . . . . 477 HelpFunctions . . . . . . . . . . . . . . . . . . . . . . . . 477 HelpIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 HelpKeyboard . . . . . . . . . . . . . . . . . . . . . . . . 478 HelpMessages . . . . . . . . . . . . . . . . . . . . . . . . 478 HelpRelease3MenuFinder . . . . . . . . . . . . . . . 478 HelpReleaseNotes . . . . . . . . . . . . . . . . . . . . . 478 HelpTableOfContents . . . . . . . . . . . . . . . . . . 478

FileDatabaseACL . . . . . . . . . . . . . . . . . . . . . . 455 FileDatabaseCompact . . . . . . . . . . . . . . . . . . 455 FileDatabaseCopy . . . . . . . . . . . . . . . . . . . . . 456 FileDatabaseDelete . . . . . . . . . . . . . . . . . . . . 456 FileDatabaseInfo . . . . . . . . . . . . . . . . . . . . . . 456 FileDatabaseRemove . . . . . . . . . . . . . . . . . . . 457 FileDatabaseUseServer FileExit . . . . . . . . . . . . . . . . . 457 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

FileExport . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 FileFullTextCreate . . . . . . . . . . . . . . . . . . . . . 460

x Domino Designer Programming Guide

HelpUsingDatabase . . . . . . . . . . . . . . . . . . . . 479 HotSpotClear . . . . . . . . . . . . . . . . . . . . . . . . . 479 HotSpotProperties . . . . . . . . . . . . . . . . . . . . . 479 InsertSubForm . . . . . . . . . . . . . . . . . . . . . . . . 480 LayoutAddGraphic . . . . . . . . . . . . . . . . . . . . 480 LayoutAddText . . . . . . . . . . . . . . . . . . . . . . . 480 LayoutElementBringToFront . . . . . . . . . . . . . 481 LayoutElementProperties . . . . . . . . . . . . . . . 481 LayoutElementSendToBack . . . . . . . . . . . . . . 481 LayoutProperties . . . . . . . . . . . . . . . . . . . . . . 482 MailAddress . . . . . . . . . . . . . . . . . . . . . . . . . 482 MailComposeMemo . . . . . . . . . . . . . . . . . . . 482 MailForward . . . . . . . . . . . . . . . . . . . . . . . . . 483 MailForwardAsAttachment . . . . . . . . . . . . . . 483 MailOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 MailRequestCrossCert . . . . . . . . . . . . . . . . . . 483 MailRequestNewName . . . . . . . . . . . . . . . . . 484 MailRequestNewPublicKey . . . . . . . . . . . . . . 484 MailScanUnread . . . . . . . . . . . . . . . . . . . . . . 484 MailSend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 MailSendCertificateRequest . . . . . . . . . . . . . 485 MailSendEncryptionKey . . . . . . . . . . . . . . . . 485 MailSendPublicKey . . . . . . . . . . . . . . . . . . . . 486 NavigateNext . . . . . . . . . . . . . . . . . . . . . . . . 486 NavigateNextHighlight . . . . . . . . . . . . . . . . . 486 NavigateNextMain . . . . . . . . . . . . . . . . . . . . 487 NavigateNextSelected . . . . . . . . . . . . . . . . . . 487 NavigateNextUnread . . . . . . . . . . . . . . . . . . 488 NavigatePrev . . . . . . . . . . . . . . . . . . . . . . . . . 488 NavigatePrevHighlight . . . . . . . . . . . . . . . . . 489 NavigatePrevMain . . . . . . . . . . . . . . . . . . . . 489 NavigatePrevSelected . . . . . . . . . . . . . . . . . . 490 NavigatePrevUnread . . . . . . . . . . . . . . . . . . . 490 NavigateToBackLink . . . . . . . . . . . . . . . . . . . 490 NavigatorProperties . . . . . . . . . . . . . . . . . . . 491 NavigatorTest . . . . . . . . . . . . . . . . . . . . . . . . 491

ObjectDisplayAs . . . . . . . . . . . . . . . . . . . . . . 491 ObjectOpen . . . . . . . . . . . . . . . . . . . . . . . . . . 492 ObjectProperties . . . . . . . . . . . . . . . . . . . . . . 492 OpenCalendar . . . . . . . . . . . . . . . . . . . . . . . . 492 OpenDocument . . . . . . . . . . . . . . . . . . . . . . . 493 OpenFrameset . . . . . . . . . . . . . . . . . . . . . . . . 494 OpenHelpDocument . . . . . . . . . . . . . . . . . . . 494 OpenNavigator . . . . . . . . . . . . . . . . . . . . . . . 495 OpenPage . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 OpenView . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 PasteBitmapAsBackground . . . . . . . . . . . . . . 497 PasteBitmapAsObject . . . . . . . . . . . . . . . . . . 498 PictureProperties . . . . . . . . . . . . . . . . . . . . . . 498 PublishDatabase . . . . . . . . . . . . . . . . . . . . . . 498 RefreshHideFormulas . . . . . . . . . . . . . . . . . . 498 RefreshParentNote . . . . . . . . . . . . . . . . . . . . 499 RemoveFromFolder . . . . . . . . . . . . . . . . . . . . 499 RenameDatabase . . . . . . . . . . . . . . . . . . . . . . 499 Replicator . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 . . . . . . . . . . . . . . . . 501 ReplicatorReplicateHigh . . . . . . . . . . . . . . . . 500 ReplicatorReplicateNext ReplicatorReplicateSelected . . . . . . . . . . . . . . 501 ReplicatorReplicateWithServer . . . . . . . . . . . 501 ReplicatorSendMail . . . . . . . . . . . . . . . . . . . . 502 ReplicatorSendReceiveMail . . . . . . . . . . . . . . 502 ReplicatorStart . . . . . . . . . . . . . . . . . . . . . . . . 502 ReplicatorStop . . . . . . . . . . . . . . . . . . . . . . . . 502 SectionCollapse . . . . . . . . . . . . . . . . . . . . . . . 503 SectionCollapseAll . . . . . . . . . . . . . . . . . . . . . 503 SectionDefineEditors . . . . . . . . . . . . . . . . . . . 503 SectionExpand . . . . . . . . . . . . . . . . . . . . . . . . 504 SectionExpandAll . . . . . . . . . . . . . . . . . . . . . 504 SectionProperties . . . . . . . . . . . . . . . . . . . . . . 504 SectionRemoveHeader . . . . . . . . . . . . . . . . . 505 SetCurrentLocation . . . . . . . . . . . . . . . . . . . . 505 ShowHideLinkPreview . . . . . . . . . . . . . . . . . 505

xi

ShowHideParentPreview

. . . . . . . . . . . . . . . 506

ToolsMarkSelectedRead

. . . . . . . . . . . . . . . . 521 . . . . . . . . . . . . . . 521

ShowHidePreviewPane . . . . . . . . . . . . . . . . . 506 ShowProperties . . . . . . . . . . . . . . . . . . . . . . . 506 SmartIconsFloating . . . . . . . . . . . . . . . . . . . . 507 SmartIconsNextSet . . . . . . . . . . . . . . . . . . . . 507 StyleCycleKey . . . . . . . . . . . . . . . . . . . . . . . . 507 TextAlignCenter . . . . . . . . . . . . . . . . . . . . . . 508 TextAlignFull TextAlignLeft . . . . . . . . . . . . . . . . . . . . . . . . 508 . . . . . . . . . . . . . . . . . . . . . . . . 508

ToolsMarkSelectedUnread

ToolsRefreshAllDocs . . . . . . . . . . . . . . . . . . . 522 ToolsRefreshSelectedDocs . . . . . . . . . . . . . . . 522 ToolsReplicate . . . . . . . . . . . . . . . . . . . . . . . . 522 ToolsRunBackgroundMacros . . . . . . . . . . . . 523 ToolsRunMacro . . . . . . . . . . . . . . . . . . . . . . . 523 ToolsScanUnreadChoose . . . . . . . . . . . . . . . . 524 ToolsScanUnreadPreferred . . . . . . . . . . . . . . 524 ToolsScanUnreadSelected . . . . . . . . . . . . . . . 524 ToolsSetupLocation . . . . . . . . . . . . . . . . . . . . 525 ToolsSetupMail . . . . . . . . . . . . . . . . . . . . . . . 525 ToolsSetupPorts . . . . . . . . . . . . . . . . . . . . . . . 525 ToolsSetupUserSetup ToolsSmartIcons ToolsSpellCheck . . . . . . . . . . . . . . . . . . 526 . . . . . . . . . . . . . . . . . . . . . . 526 . . . . . . . . . . . . . . . . . . . . . . 526

TextAlignNone . . . . . . . . . . . . . . . . . . . . . . . 509 TextAlignRight . . . . . . . . . . . . . . . . . . . . . . . 509 TextBold TextBullet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 . . . . . . . . . . . . . . . . . . . . . 510 . . . . . . . . . . . . . . . . . . . . . . 511

TextCycleSpacing TextEnlargeFont TextFont

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 511

TextItalic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512 TextNormal . . . . . . . . . . . . . . . . . . . . . . . . . . 512 TextNumbers . . . . . . . . . . . . . . . . . . . . . . . . . 513 TextOutdent . . . . . . . . . . . . . . . . . . . . . . . . . 513 TextParagraph . . . . . . . . . . . . . . . . . . . . . . . . 514 TextParagraphStyles . . . . . . . . . . . . . . . . . . . 514 TextPermanentPen . . . . . . . . . . . . . . . . . . . . 514 TextReduceFont . . . . . . . . . . . . . . . . . . . . . . . 515 TextSetFontColor . . . . . . . . . . . . . . . . . . . . . . 515 TextSetFontFace . . . . . . . . . . . . . . . . . . . . . . . 516 TextSetFontSize . . . . . . . . . . . . . . . . . . . . . . . 517 TextSpacingDouble . . . . . . . . . . . . . . . . . . . . 517 TextSpacingOneAndAHalf . . . . . . . . . . . . . . 518 TextSpacingSingle . . . . . . . . . . . . . . . . . . . . . 518 TextUnderline . . . . . . . . . . . . . . . . . . . . . . . . 518 ToolsCall . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 ToolsCategorize . . . . . . . . . . . . . . . . . . . . . . . 519 ToolsHangUp . . . . . . . . . . . . . . . . . . . . . . . . 520 . . . . . . . . . . . . . . . . . . . . 520 . . . . . . . . . . . . . . . . . . 520 ToolsMarkAllRead

ToolsUserLogoff . . . . . . . . . . . . . . . . . . . . . . 527 UserIDCertificates . . . . . . . . . . . . . . . . . . . . . 527 UserIDClearPassword . . . . . . . . . . . . . . . . . . 527 UserIDCreateSafeCopy . . . . . . . . . . . . . . . . . 528 UserIDEncryptionKeys . . . . . . . . . . . . . . . . . 528 UserIDInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 UserIDMergeCopy UserIDSwitch . . . . . . . . . . . . . . . . . . . . 529 UserIDSetPassword . . . . . . . . . . . . . . . . . . . . 529 . . . . . . . . . . . . . . . . . . . . . . . . 529 . . . . . . . . . . . . . . . . . . . . . . 530 . . . . . . . . . . . . . . . . . . . . 531 V3EditNextField . . . . . . . . . . . . . . . . . . . . . . 530 V3EditPrevField ViewArrangeIcons . . . . . . . . . . . . . . . . . . . . . 531 ViewBelowFolders ViewBesideFolders . . . . . . . . . . . . . . . . . . . . 531 ViewCertify . . . . . . . . . . . . . . . . . . . . . . . . . . 531 ViewChange . . . . . . . . . . . . . . . . . . . . . . . . . 532 ViewCollapse . . . . . . . . . . . . . . . . . . . . . . . . 533 ViewCollapseAll . . . . . . . . . . . . . . . . . . . . . . 533 ViewExpand . . . . . . . . . . . . . . . . . . . . . . . . . 534 ViewExpandAll . . . . . . . . . . . . . . . . . . . . . . . 534

ToolsMarkAllUnread

xii Domino Designer Programming Guide

ViewExpandWithChildren . . . . . . . . . . . . . . 534 ViewHorizScrollBar . . . . . . . . . . . . . . . . . . . . 535 ViewMoveName . . . . . . . . . . . . . . . . . . . . . . 535 ViewNavigatorsFolders . . . . . . . . . . . . . . . . . 535 ViewNavigatorsNone . . . . . . . . . . . . . . . . . . 536 ViewRefreshFields . . . . . . . . . . . . . . . . . . . . . 536 ViewRefreshUnread . . . . . . . . . . . . . . . . . . . 536 ViewRenamePerson . . . . . . . . . . . . . . . . . . . . 537 ViewShowFieldHelp . . . . . . . . . . . . . . . . . . . 537 ViewShowObject . . . . . . . . . . . . . . . . . . . . . . 537 ViewShowOnlyCategories . . . . . . . . . . . . . . . 538 ViewShowOnlySearchResults . . . . . . . . . . . . 538 ViewShowOnlySelected . . . . . . . . . . . . . . . . 538 ViewShowOnlyUnread . . . . . . . . . . . . . . . . . 539 ViewShowPageBreaks . . . . . . . . . . . . . . . . . . 539 ViewShowRuler . . . . . . . . . . . . . . . . . . . . . . . 539 ViewShowSearchBar . . . . . . . . . . . . . . . . . . . 539 ViewShowServerNames . . . . . . . . . . . . . . . . 540 ViewShowUnread . . . . . . . . . . . . . . . . . . . . . 540 ViewSwitchForm . . . . . . . . . . . . . . . . . . . . . . 540 WindowMaximize . . . . . . . . . . . . . . . . . . . . . 541 WindowMaximizeAll . . . . . . . . . . . . . . . . . . 541 WindowMinimize . . . . . . . . . . . . . . . . . . . . . 541 WindowMinimizeAll . . . . . . . . . . . . . . . . . . . 542 WindowWorkspace . . . . . . . . . . . . . . . . . . . . 542 WorkspaceProperties . . . . . . . . . . . . . . . . . . . 542 WorkspaceStackReplicaIcons ZoomPreview . . . . . . . . . . . . 543 . . . . . . . . . . . . . . . . . . . . . . . . 543

Using the Evaluate statement . . . . . . . . . . 549 Using an object . . . . . . . . . . . . . . . . . . . . . 550 Using Bind, Command, Execute, InputBox, MessageBox, Print, SendKeys, Use, and UseLSX . . . . . . . . 551 Calling a function or subroutine . . . . . . . . 552 Using parentheses to pass by value . . . . . 553 Accessing Domino databases . . . . . . . . . . . . . 553 Accessing database properties . . . . . . . . . 554 Locating a database on a server and local disk . . . . . . . . . . . . . . . . . . . . . . . 557 Opening a database Creating a database . . . . . . . . . . . . . . . . . 558 . . . . . . . . . . . . . . . . . 561

Accessing an outline . . . . . . . . . . . . . . . . . 562 Examining and adjusting an access control list . . . . . . . . . . . . . . . . . . . . . . 565 Examining and adjusting database replication settings . . . . . . . . . . . . . . . . 570 Resetting the replication properties of a database . . . . . . . . . . . . . . . . . . . . . . 574 Saving database replication properties . . . 574 Accessing a document . . . . . . . . . . . . . . . 575 Accessing a form . . . . . . . . . . . . . . . . . . . . 575 Accessing views and folders . . . . . . . . . . . . . 577 Accessing view or folder properties . . . . . 578 Locating a view or folder . . . . . . . . . . . . . 580 Accessing view or folder columns . . . . . . 581 Refreshing a view or folder . . . . . . . . . . . . 584 Removing a view or folder . . . . . . . . . . . . 585 Retrieving multiple entries from a view . . . 585 Retrieving an entry from a view . . . . . . . . 585 Creating view navigators . . . . . . . . . . . . . 586 Accessing view entry properties . . . . . . . . 587 Getting the position of a view entry . . . . . 590 Accessing a view entry collection . . . . . . . 590 Adding an entry to a view entry collection . . . . . . . . . . . . . . . . . . . 591

Volume II 7 LotusScript Classes Coding Guidelines . . . . . . . . . . . . . . . . . . 545
Using the Domino classes . . . . . . . . . . . . . . . 545 Using LotusScript features in Domino . . . . . . 547 Using %Include and %If . . . . . . . . . . . . . . 548 Closing a file . . . . . . . . . . . . . . . . . . . . . . . 548 Using OLE . . . . . . . . . . . . . . . . . . . . . . . . 549

xiii

Deleting an entry from a view entry collection . . . . . . . . . . . . . . . . . . . 591 Searching for entries in a view entry collection . . . . . . . . . . . . . . . . . . . 591 Retrieving entries from a view entry collection . . . . . . . . . . . . . . . . . . . 592 Removing documents from a view entry collection . . . . . . . . . . . . . . . . . . . 593 Accessing NotesViewNavigator properties . . . . . . . . . . . . . . . . . . . . . . . 594 Accessing entries in a view navigator . . . . 595 Accessing documents in a view navigator . . . . . . . . . . . . . . . . . . . 596 Accessing an entry by position . . . . . . . . . 598 Accessing documents . . . . . . . . . . . . . . . . . . 599 Accessing document properties . . . . . . . . 599 Accessing the current document . . . . . . . . 603 Collecting all documents and all unprocessed documents . . . . . . . . . . . . 610 Collecting documents by searching . . . . . 612 Adding a document . . . . . . . . . . . . . . . . . 614 Locating a document by ID . . . . . . . . . . . . 614 Accessing a NotesDocument object through a view . . . . . . . . . . . . . . . . . . . 615 Locating documents within a view or folder . . . . . . . . . . . . . . . . . . . . . . . . 615 Creating a document . . . . . . . . . . . . . . . . 621 Deleting a document . . . . . . . . . . . . . . . . . 621 Removing a document . . . . . . . . . . . . . . . 622 Copying a document . . . . . . . . . . . . . . . . 622 Mailing a document . . . . . . . . . . . . . . . . . 623 Accessing items . . . . . . . . . . . . . . . . . . . . . . . 624 Accessing item properties . . . . . . . . . . . . . 625 Creating an item and assigning values . . . 630 Copying an item . . . . . . . . . . . . . . . . . . . . 633 Removing an item . . . . . . . . . . . . . . . . . . . 634 Working with a rich text item . . . . . . . . . . 635 Working with an embedded object . . . . . . 639 Accessing rich-text style properties . . . . . 641

Accessing rich-text paragraph style properties . . . . . . . . . . . . . . . . . . 643 Working with tabs . . . . . . . . . . . . . . . . . . 645 Accessing sessions . . . . . . . . . . . . . . . . . . . . . 646 Accessing session properties . . . . . . . . . . . 646 Using environment variables . . . . . . . . . . 649 Accessing agents . . . . . . . . . . . . . . . . . . . . 650 Accessing international settings . . . . . . . . 653 Accessing supporting Domino objects . . . . . . 654 Converting between Domino Designer and LotusScript time . . . . . . . . . . . . . . 655 Making a Domino log . . . . . . . . . . . . . . . . 656 Making a Domino newsletter . . . . . . . . . . 658 Setting up a timer . . . . . . . . . . . . . . . . . . . 659 Representing a name . . . . . . . . . . . . . . . . 659 Accessing external databases through LS:DO . . . . . . . . . . . . . . . . . . . 661 Setting up LS:DO . . . . . . . . . . . . . . . . . . . . . . 662 LS:DO requirements . . . . . . . . . . . . . . . . . 663 Setting up LS:DO with ODBC . . . . . . . . . . 664 Creating your script . . . . . . . . . . . . . . . . . 666 Using LS:DO . . . . . . . . . . . . . . . . . . . . . . . . . 667 Connecting to an external database . . . . . 667 Retrieving data from an external database . . . . . . . . . . . . . . . . . 672 Working with data retrieved from an external database . . . . . . . . . . . . . . . . . 676 Tips and techniques . . . . . . . . . . . . . . . . . . . . 690 Handling an ODBC event . . . . . . . . . . . . . 690 Handling an ODBC error . . . . . . . . . . . . . 693 Transaction processing . . . . . . . . . . . . . . . 695 Caching data . . . . . . . . . . . . . . . . . . . . . . . 697 Multi-threading agents . . . . . . . . . . . . . . . 697 Handling run-time errors . . . . . . . . . . . . . . . 698 Using OLE custom controls . . . . . . . . . . . . . . 715 Using Domino Designer classes in Visual Basic . . . . . . . . . . . . . . . . . . . . . 719

xiv Domino Designer Programming Guide

8 LotusScript Classes A-Z . . . . . 721
Properties and methods with ECL security . . . . . . . . . . . . . . . . . . . . . 721 NotesACL class . . . . . . . . . . . . . . . . . . . . . . . 728 InternetLevel property . . . . . . . . . . . . . . . . . . 729 Parent property . . . . . . . . . . . . . . . . . . . . . . . 730 Roles property . . . . . . . . . . . . . . . . . . . . . . . . 731 UniformAccess property . . . . . . . . . . . . . . . . 732 AddRole method . . . . . . . . . . . . . . . . . . . . . . 733 CreateACLEntry method . . . . . . . . . . . . . . . . 734 DeleteRole method . . . . . . . . . . . . . . . . . . . . 735 GetEntry method . . . . . . . . . . . . . . . . . . . . . . 736 GetFirstEntry method . . . . . . . . . . . . . . . . . . 737 GetNextEntry method . . . . . . . . . . . . . . . . . . 738 RenameRole method . . . . . . . . . . . . . . . . . . . 738 Save method . . . . . . . . . . . . . . . . . . . . . . . . . 739 NotesACLEntry class . . . . . . . . . . . . . . . . . . 740 CanCreateDocuments property . . . . . . . . . . . 743 CanCreateLSOrJavaAgent property . . . . . . . 744 CanCreatePersonalAgent property . . . . . . . . 745 CanCreatePersonalFolder property . . . . . . . . 746 CanCreateSharedFolder property . . . . . . . . . 747 CanDeleteDocuments property . . . . . . . . . . . 748 IsAdminReaderAuthor property . . . . . . . . . . 749 IsAdminServer property . . . . . . . . . . . . . . . . 750 IsGroup property . . . . . . . . . . . . . . . . . . . . . . 751 IsPerson property . . . . . . . . . . . . . . . . . . . . . 752 IsPublicReader property . . . . . . . . . . . . . . . . 753 IsPublicWriter property . . . . . . . . . . . . . . . . . 754 IsServer property . . . . . . . . . . . . . . . . . . . . . . 755 Level property . . . . . . . . . . . . . . . . . . . . . . . . 756 Name property . . . . . . . . . . . . . . . . . . . . . . . 757 Parent property . . . . . . . . . . . . . . . . . . . . . . . 759 Roles property . . . . . . . . . . . . . . . . . . . . . . . . 760 UserType property DisableRole method . . . . . . . . . . . . . . . . . . . . 761 . . . . . . . . . . . . . . . . . . . 761

EnableRole method . . . . . . . . . . . . . . . . . . . . 762 IsRoleEnabled method . . . . . . . . . . . . . . . . . . 763 Remove method NotesAgent class . . . . . . . . . . . . . . . . . . . . . . 764 . . . . . . . . . . . . . . . . . . . . . 765

Comment property . . . . . . . . . . . . . . . . . . . . 766 CommonOwner property . . . . . . . . . . . . . . . 767 IsEnabled property . . . . . . . . . . . . . . . . . . . . 768 IsNotesAgent property . . . . . . . . . . . . . . . . . 769 IsPublic property . . . . . . . . . . . . . . . . . . . . . . 770 IsWebAgent property LastRun property . . . . . . . . . . . . . . . . . . 771 . . . . . . . . . . . . . . . . . . . . . 772

Name property . . . . . . . . . . . . . . . . . . . . . . . 773 Owner property . . . . . . . . . . . . . . . . . . . . . . . 773 Parent property . . . . . . . . . . . . . . . . . . . . . . . 775 Query property . . . . . . . . . . . . . . . . . . . . . . . 775 ServerName property . . . . . . . . . . . . . . . . . . 777 Target property . . . . . . . . . . . . . . . . . . . . . . . 778 Trigger property . . . . . . . . . . . . . . . . . . . . . . 779 Remove method . . . . . . . . . . . . . . . . . . . . . . 780 Run method . . . . . . . . . . . . . . . . . . . . . . . . . . 782 RunOnServer method . . . . . . . . . . . . . . . . . . 783 Save method . . . . . . . . . . . . . . . . . . . . . . . . . 784 Button class . . . . . . . . . . . . . . . . . . . . . . . . . . 784 Click event . . . . . . . . . . . . . . . . . . . . . . . . . . . 784 ObjectExecute event . . . . . . . . . . . . . . . . . . . . 785 NotesDatabase class . . . . . . . . . . . . . . . . . . . 785 ACL property . . . . . . . . . . . . . . . . . . . . . . . . 793 . . . . . . . . . . . . . . . . . . . . . . 793 Agents property

AllDocuments property . . . . . . . . . . . . . . . . . 794 Categories property . . . . . . . . . . . . . . . . . . . . 796 Created property . . . . . . . . . . . . . . . . . . . . . . 796 CurrentAccessLevel property . . . . . . . . . . . . 797 DelayUpdates property . . . . . . . . . . . . . . . . . 799 DesignTemplateName property FileName property . . . . . . . . . . 799 . . . . . . . . . . . . . . . . . . . . 801

FilePath property . . . . . . . . . . . . . . . . . . . . . . 801

xv

FolderReferencesEnabled property . . . . . . . . 802 Forms property . . . . . . . . . . . . . . . . . . . . . . . 804 IsDirectoryCatalog property . . . . . . . . . . . . . 804 IsFTIndexed property . . . . . . . . . . . . . . . . . . 805 IsMultiDbSearch property . . . . . . . . . . . . . . . 807 IsOpen property . . . . . . . . . . . . . . . . . . . . . . 807 . . . . . . . . . . 808 IsPrivateAddressBook property

GetDocumentByURL method . . . . . . . . . . . . 842 GetForm method . . . . . . . . . . . . . . . . . . . . . . 844 GetOutline method . . . . . . . . . . . . . . . . . . . . 845 GetProfileDocument method . . . . . . . . . . . . . 845 GetProfileDocCollection method . . . . . . . . . . 847 GetURLHeaderInfo method . . . . . . . . . . . . . 847 GetView method . . . . . . . . . . . . . . . . . . . . . . 849 GrantAccess method . . . . . . . . . . . . . . . . . . . 850 Open method . . . . . . . . . . . . . . . . . . . . . . . . . 852 OpenByReplicaID method . . . . . . . . . . . . . . . 854 OpenIfModified method . . . . . . . . . . . . . . . . 854 OpenMail method . . . . . . . . . . . . . . . . . . . . . 855 OpenURLDb method . . . . . . . . . . . . . . . . . . . 856 OpenWithFailover method . . . . . . . . . . . . . . 857 QueryAccess method . . . . . . . . . . . . . . . . . . . 858 Remove method . . . . . . . . . . . . . . . . . . . . . . 860 Replicate method . . . . . . . . . . . . . . . . . . . . . . 861 RevokeAccess method . . . . . . . . . . . . . . . . . . 861 Search method . . . . . . . . . . . . . . . . . . . . . . . . 862 UnprocessedFTSearch method UnprocessedSearch method UpdateFTIndex method NotesDateRange class . . . . . . . . . . . 864 . . . . . . . . . . . . . 869

IsPublicAddressBook property . . . . . . . . . . . 809 LastFTIndexed property . . . . . . . . . . . . . . . . 810 LastModified property MaxSize property . . . . . . . . . . . . . . . . . 810 Managers property . . . . . . . . . . . . . . . . . . . . 811 . . . . . . . . . . . . . . . . . . . . . 813 Parent property . . . . . . . . . . . . . . . . . . . . . . . 813 PercentUsed property . . . . . . . . . . . . . . . . . . 814 ReplicaID property . . . . . . . . . . . . . . . . . . . . 815 ReplicationInfo property . . . . . . . . . . . . . . . . 815 Server property . . . . . . . . . . . . . . . . . . . . . . . 816 Size property . . . . . . . . . . . . . . . . . . . . . . . . . 817 SizeQuota property . . . . . . . . . . . . . . . . . . . . 817 TemplateName property . . . . . . . . . . . . . . . . 818 Title property . . . . . . . . . . . . . . . . . . . . . . . . . 819 UnprocessedDocuments property . . . . . . . . . 820 Views property . . . . . . . . . . . . . . . . . . . . . . . 824 Compact method . . . . . . . . . . . . . . . . . . . . . . 825 Create method . . . . . . . . . . . . . . . . . . . . . . . . 826 CreateCopy method . . . . . . . . . . . . . . . . . . . 827 CreateDocument method . . . . . . . . . . . . . . . . 829 CreateFromTemplate method . . . . . . . . . . . . 830 CreateOutline method . . . . . . . . . . . . . . . . . . 831 CreateReplica method . . . . . . . . . . . . . . . . . . 832 EnableFolder method . . . . . . . . . . . . . . . . . . 833 FTDomainSearch method . . . . . . . . . . . . . . . 834 FTSearch method . . . . . . . . . . . . . . . . . . . . . . 835 GetAgent method . . . . . . . . . . . . . . . . . . . . . 838 GetDocumentByID method . . . . . . . . . . . . . . 839 GetDocumentByUNID method . . . . . . . . . . . 841

. . . . . . . . . . . . . . . . 874 . . . . . . . . . . . . . . . . . 876

EndDateTime property . . . . . . . . . . . . . . . . . 877 StartDateTime property . . . . . . . . . . . . . . . . . 878 Text property . . . . . . . . . . . . . . . . . . . . . . . . . 878 NotesDateTime class DateOnly property IsDST property . . . . . . . . . . . . . . . . . . 879 . . . . . . . . . . . . . . . . . . . . 883

GMTTime property . . . . . . . . . . . . . . . . . . . . 884 . . . . . . . . . . . . . . . . . . . . . . . 885 IsValidDate property . . . . . . . . . . . . . . . . . . . 886 LocalTime property . . . . . . . . . . . . . . . . . . . . 887 LSGMTTime property . . . . . . . . . . . . . . . . . . 887 LSLocalTime property . . . . . . . . . . . . . . . . . . 888 TimeOnly property . . . . . . . . . . . . . . . . . . . . 889 TimeZone property . . . . . . . . . . . . . . . . . . . . 889

xvi Domino Designer Programming Guide

ZoneTime property . . . . . . . . . . . . . . . . . . . . 890 AdjustDay method AdjustHour method AdjustMonth method . . . . . . . . . . . . . . . . . . . . 891 . . . . . . . . . . . . . . . . . . . 892 . . . . . . . . . . . . . . . . . . 894

LastAccessed property LastModified property

. . . . . . . . . . . . . . . . . 928 . . . . . . . . . . . . . . . . . 929

NameOfProfile property . . . . . . . . . . . . . . . . 930 NoteID property . . . . . . . . . . . . . . . . . . . . . . 930 ParentDatabase property . . . . . . . . . . . . . . . . 931 ParentDocumentUNID property . . . . . . . . . . 932 ParentView property . . . . . . . . . . . . . . . . . . . 933 Responses property . . . . . . . . . . . . . . . . . . . . 933 SaveMessageOnSend property . . . . . . . . . . . 935 SentByAgent property . . . . . . . . . . . . . . . . . . 936 Signer property . . . . . . . . . . . . . . . . . . . . . . . 937 SignOnSend property . . . . . . . . . . . . . . . . . . 938 Size property . . . . . . . . . . . . . . . . . . . . . . . . . 939 UniversalID property . . . . . . . . . . . . . . . . . . 939 Verifier property . . . . . . . . . . . . . . . . . . . . . . 941 AppendItemValue method . . . . . . . . . . . . . . 942 ComputeWithForm method . . . . . . . . . . . . . 944 CopyAllItems method . . . . . . . . . . . . . . . . . . 946 CopyItem method . . . . . . . . . . . . . . . . . . . . . 947 CopyToDatabase method . . . . . . . . . . . . . . . 948 . . . . . . . . . . . . 949 CreateReplyMessage method

AdjustMinute method . . . . . . . . . . . . . . . . . . 893 AdjustSecond method . . . . . . . . . . . . . . . . . . 895 AdjustYear method . . . . . . . . . . . . . . . . . . . . 896 ConvertToZone method SetAnyDate method . . . . . . . . . . . . . . . . 897 . . . . . . . . . . . . . . . . . . . 898

SetAnyTime method . . . . . . . . . . . . . . . . . . . 898 SetNow method . . . . . . . . . . . . . . . . . . . . . . . 898 TimeDifference method . . . . . . . . . . . . . . . . . 899 TimeDifferenceDouble method . . . . . . . . . . . 900 NotesDbDirectory class . . . . . . . . . . . . . . . . 901 Name property . . . . . . . . . . . . . . . . . . . . . . . 902 GetFirstDatabase method . . . . . . . . . . . . . . . 902 GetNextDatabase method . . . . . . . . . . . . . . . 903 NotesDocument class . . . . . . . . . . . . . . . . . . 904 Authors property . . . . . . . . . . . . . . . . . . . . . . 909 ColumnValues property . . . . . . . . . . . . . . . . 911 Created property . . . . . . . . . . . . . . . . . . . . . . 912 EmbeddedObjects property . . . . . . . . . . . . . . 913 EncryptionKeys property EncryptOnSend property FolderReferences property HasEmbedded property . . . . . . . . . . . . . . . 915 . . . . . . . . . . . . . . . 916 . . . . . . . . . . . . . . 917

CreateRichTextItem method . . . . . . . . . . . . . 950 Encrypt method . . . . . . . . . . . . . . . . . . . . . . . 951 GetAttachment method . . . . . . . . . . . . . . . . . 952 GetFirstItem method . . . . . . . . . . . . . . . . . . . 953 GetItemValue method . . . . . . . . . . . . . . . . . . 956 HasItem method . . . . . . . . . . . . . . . . . . . . . . 958 MakeResponse method . . . . . . . . . . . . . . . . . 960 PutInFolder method Remove method . . . . . . . . . . . . . . . . . . . 961 . . . . . . . . . . . . . . . . . . . . . . 963

FTSearchScore property . . . . . . . . . . . . . . . . . 919 . . . . . . . . . . . . . . . . 920 IsDeleted property . . . . . . . . . . . . . . . . . . . . . 921 IsNewNote property . . . . . . . . . . . . . . . . . . . 922 IsProfile property IsSigned property IsValid property . . . . . . . . . . . . . . . . . . . . . 923 . . . . . . . . . . . . . . . . . . . . . 924 . . . . . . . . . . . . . . . . . . . . . . 926 IsResponse property . . . . . . . . . . . . . . . . . . . 924 IsUIDocOpen property . . . . . . . . . . . . . . . . . 925 Items property . . . . . . . . . . . . . . . . . . . . . . . . 927 Key property . . . . . . . . . . . . . . . . . . . . . . . . . 928

RemoveFromFolder method . . . . . . . . . . . . . 964 RemoveItem method . . . . . . . . . . . . . . . . . . . 965 RenderToRTItem method . . . . . . . . . . . . . . . 966 ReplaceItemValue method . . . . . . . . . . . . . . . 967 Save method . . . . . . . . . . . . . . . . . . . . . . . . . 969 Send method . . . . . . . . . . . . . . . . . . . . . . . . . 972

xvii

1026 ThousandsSep property . . . . . . . . . . . . . . . . . . . . . 1016 Remove method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009 . . . . . . . . . 1028 Tomorrow property . . . . . . . . . . . . . . . 982 GetFirstDocument method . . . . . . . . . . . . . . . . . . . . 1006 xviii Domino Designer Programming Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 979 AddDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015 Readers property . . . . . . . . . . . . 1014 ProtectUsers property . . . . . . . . . . . . . . . . . . . . . . . . 1005 FormUsers property IsSubForm property . . . . . . . . . . . . . . . 987 PutAllInFolder method . . . . . . . . . . . 1010 . . . . 983 GetLastDocument method . . . . 1012 Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027 Today property . . . 1008 Aliases property Fields property . . . . . . . . 1001 Verbs property Activate method . . . . . . . . . . . . . . 1028 Yesterday property . . . . . . . 988 RemoveAll method . . . . . . . . . . . . . . . 981 GetDocument method . . . . 1027 TimeZone property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 998 Object property . . . . . . . . . . . 977 IsSorted property . . . . . . . . . . . . . . . . . . . . . . 1018 AMString property . 1011 NotesDocumentCollection class Count property . . . . . . . . . . . . . . . . . . . . . . . 995 FitBelowFields property . . . . . . . . . . . . 1019 CurrencyDigits property . . . . . . 1026 PMString property . .Sign method . . . . . . . . . . . 1033 DoVerb method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1002 . . . . . . . 1024 IsDateMDY property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000 Source property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1028 NotesItem class . . . . . . . . . . 1022 IsCurrencySpace property . . . . . . . . . . . . . . . . . . . . . 992 Class property . . . . . . . . . . . . 974 . . . . 1007 Entering event . . . . . . . . . . . . . . . . . . . 1027 TimeSep property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024 IsDateDMY property . . . . . . . . . . . . . . . . . . . . . . 1007 NotesForm class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013 ProtectReaders property . . . . . . . . . . . . . . . . 991 NotesEmbeddedObject class . . . . . . . . . . . . . . . . . . . . . . . 989 StampAll method . . . . . . . . 974 Field class . . . . . . . . . . . . . . . . . . . . 1003 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007 Exiting event . . 984 GetNthDocument method . . . . . . 1020 DateSep property . . . . . . . . . . . . . 1025 IsTime24Hour property . . . . . . . . . . . . . . . . . . . . . . . . 984 GetNextDocument method . . . . . . . . 985 GetPrevDocument method . . . . . . . . . . . . . . . . . . 978 Query property . . . . . . . . . . . 1029 DateTimeValue property . . . . . . . . . . . . . 1025 IsDateYMD property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 980 DeleteDocument method . . . . . . 1021 DecimalSep property . 980 FTSearch method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994 FileSize property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996 FitToWindow property . . . . . . . . 1023 IsCurrencySuffix property . . . . . . 1025 IsDST property . . . . . . . . . . . . . . . . . . . . 1017 NotesInternational class . . . . . . . . . . . . . . . . . 999 RunReadOnly property . . . . . . . . . . . . . . . . 990 UpdateAll method . 1005 ExtractFile method Remove method . . 1023 IsCurrencyZero property . . . . . . . . 999 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000 Type property . . . . . . . . . . . . . 989 RemoveAllFromFolder method . . 977 Parent property . 997 Name property . . . . . . . . . . . . . 1020 CurrencySymbol property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . 1086 OrgUnit4 property . . . . . . . . . . . . . . . . . . . . . . . . . 1078 Common property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079 . . . . . . . . . . . . . . . . . . . 1046 Abstract method . . . . . . 1100 IsSummary property . . . . . . 1061 LogAction method . . . . . . . . . . . . . . . . . . . . . . . . . .IsAuthors property . . . . . 1099 AutoCommit property . . . . . . . . . . . . . . . . . . . . . . . . . . 1052 LogActions property . . . . . . . . . . . 1075 Addr821 property . . . . . . . . . . . . . . . . . . . . . . . . 1055 LogErrors property . . . . . . . . . . . . . . . . . . . 1067 OpenAgentLog method . . . . . . . . . . . . . . . . . . . . . . . . . 1098 CommitOnDisconnect property DataSourceName property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051 Remove method NotesLog class . . . . . . . 1094 ODBCConnection class . 1046 Values property . . . . . 1048 Contains method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077 ADMD property . . . . . . . . . . . . . . . . . . . . . . . . 1076 . . . . . . . . . . . . . . . . . . . . 1038 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078 Canonical property . . . . . . . . . . . 1085 OrgUnit2 property . . . . . . . 1061 LogError method . . . . . 1041 Text property . . . . . . . 1091 SubjectItemName property . . . . . . . . . . 1086 PRMD property . 1080 Language property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092 FormatMsgWithDoclinks method . . . . . . . . . . . . . . . . . . . 1085 OrgUnit3 property . . . . . . . . . . . . 1040 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091 FormatDocument method . 1057 NumErrors property . . . 1079 Initials property . . . . . . . . . . . . . . . . . . . . . . . . . 1077 Addr822Phrase property . . . . . . . . . . . . . . . . . . 1086 Surname property . . . . . . . . . . . . . . . . . . . . . . . . 1068 OpenFileLog method . . . . . . . . . . . . . . . . . . . . . . . . . 1073 xix . . . . . . . . . . . . . . . 1034 IsEncrypted property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041 SaveToDisk property . . . . . . . . . . 1060 Close method . . 1037 IsReaders property IsSigned property . . . . . . . . 1042 Type property . . . . . . . . . . . . . 1037 . . . . . . . . . . . . . . . . 1068 OpenMailLog method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058 OverwriteFile property . . . 1076 . . . 1085 OrgUnit1 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080 Keyword property . . . . . . . . . . . 1087 Navigator class . 1050 CopyItemToDocument method . . . 1039 LastModified property Name property . . . . . . . . . . . . . . . . . . . . 1087 NotesNewsletter class . . . . . . . . . . . . . 1059 ProgramName property . . . . . . . 1035 IsNames property . . . . 1056 NumActions property . . 1090 DoSubject property . . . . . . . . . . . . . . . . . . . 1048 AppendToTextList method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1069 OpenNotesLog method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1044 ValueLength property . . . . . . . . 1076 Addr822Comment1 property Addr822Comment2 property Addr822Comment3 property . . . . . . . . . . . 1088 DoScore property . . . . . . . . . . . . . 1080 IsHierarchical property . . 1081 Organization property . . . . . . . . . . . . . . . . . . . . . . . . . . 1078 Country property Given property . . . . . . . . . . . . . . . . . 1040 Abbreviated property . . . 1079 Generation property . . . . . . . . . . . . . . . . 1052 . . . . . . . . . . . . . 1036 IsProtected property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1071 NotesName class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1097 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063 LogEvent method . . . 1077 Addr822LocalPart property . . . . . . . 1087 Click event . . . . . . . . . . . . . . . . . . . . .

. 1176 IsValueAltered method . . . . 1173 IsEndOfData method . . . . . . . . . . . . 1112 RollbackTransactions method . . . . . . . . . . . . . . . . . . . . 1158 FieldNativeDataType method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1106 GetErrorMessage method . 1109 ListFields method . . . . . . . . . . . . . . 1140 Close method . 1166 GetRowStatus method . . . . . . . . . . . . 1164 GetParameter method . . . . . . . . . 1180 LocateRow method . . . . . . . . 1138 ReadOnly property . . . . . . . . . . . . . . . . . . . . 1110 ListProcedures method . . . . . . . . . . . . . . . . . . . . . . . . 1164 GetErrorMessage method . . . . . . . . . . . . . . . . . . 1164 GetExtendedErrorMessage method . . . . 1175 IsResultSetAvailable method . . . . . . . . . . . . . . . . . 1121 GetErrorMessage method . . . . . . . . . . . . . . 1185 NumParameters method . . . . . . . . . . . . 1147 Execute method . . . 1167 GetValue method . 1169 HasRowChanged method . . . . . . . . . . . . . . . . 1114 Connection property . 1117 SQL property . . . . . . . . . . . . . . . . . . 1106 IsConnected method . . . . . . . . 1121 GetExtendedErrorMessage method . . . . . 1120 GetError method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1159 FieldSize method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1199 AddEntry method . . . . . 1149 xx Domino Designer Programming Guide . . 1115 QueryExecuteTimeOut property . 1200 Disconnect method . . . . . . . . . . . . . . . . . . . . . . 1135 MaxRows property . . . . . . . . . . . . . . . . 1177 IsValueNull method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1127 ODBCResultSet class . . . . . . . . . 1171 IsBeginOfData method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1183 NumColumns method . . . . . . . . . . . . . . . . . . . . 1106 IsSupported method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1107 ListDataSources method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1101 SilentMode property . . . . . . . . . . . . . . . . . . . 1153 FieldInfo method . . . . . . . . . . . . . . . . . . . 1106 GetExtendedErrorMessage method . . . . . . 1187 . . . . . . . . . . . . . . . . . . . 1200 GetFirst method . . . . . . . . . . . . . . . . . 1113 ODBCQuery class . . . . . 1162 GetError method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .GetLSDOMasterRevision property . . . . 1181 NextRow method . . . . . . . . . . . . . . . . . . . . 1118 UseRowID property . . . . . 1161 FirstRow method . . . . . . . . . . . 1139 AddRow method . . . . . . . . 1128 CacheLimit property . . . . . . 1196 Alias property . . . . . . . . . . . 1111 ListTables method . . . . . . . . 1133 FetchBatchSize property . . . . . . . . . . . . . . . . . 1192 NotesOutline class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145 ExecProcedure Method . . . . . . . . . . . . . . . . . . . 1190 . . . . . . . . . . . . . . . . . . . . . . . . 1101 CommitTransactions method ConnectTo method . . . . . . . . . . . . . . . 1102 . . . 1189 SetParameter method UpdateRow method SetValue method . . . . . . . 1131 CurrentRow property . . . . 1186 NumRows method . 1147 FieldExpectedDataType method . 1154 FieldName method . . . . . . . . . . 1197 Comment property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103 FieldID method . . . 1198 Name property . . . . . . . . . . . 1105 GetError method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1194 PrevRow method . 1199 CreateEntry method . . . . . . . . . . . . . 1137 Query property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1179 LastRow method . . . . . . . . . . 1143 DeleteRow method . . . . . . . . . . . 1164 GetParameterName method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1232 AddUserToAddressbook method . . . . . . . . . 1236 GetUserInfo method . . . . . . . . . . . 1219 View property . . . . . 1212 IsHidden property . . . . . . . . . . 1219 SetAction method SetNamedElement method . . . 1230 AddUserProfile method . . . 1207 NotesOutlineEntry class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1254 NoChronos property . . . . . 1222 CertifierIDFile property . . . . . . . . . . . . . . . . . . . . . . . . 1249 DoNotBrowse property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235 GetIDFromServer method . . . . . 1253 MultiDbIndex property . . 1202 GetParent method . . . . . . . . . . . . . . . . . . . . . . . . . . 1230 AddServerToAddressbook method . . . . . . . . 1201 GetNext method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217 Type property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215 Level property . . . 1254 NeverReplicate property . . . . . . . . . . . . . . . . . . 1244 Abstract property . 1257 Reset method . . . . . . . . . . . . . . . . . . . . 1209 Document property . . . . . . . . . . . . . . . . . . . 1215 Label property . . . . . . . . . . 1238 RegisterNewCertifier method . . . . . . . . . . . . . 1205 MoveEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1210 . . . . . . . . . . . . . . . . . . . 1220 SetURL method . . . . . . . . . . . . . . . . . . . 1225 Expiration property . . . . . . . . . . . . . 1213 IsInThisDB property . . . . . . . . . . . . . . . . . . . . . . . 1226 IDType property . . . 1204 GetPrevSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217 URL property . . . . . . . . . . . 1229 AddCertifierToAddressbook method . . . . . . . 1243 NotesReplication class . . . . . 1247 CutoffDate property FrameText property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1226 CutoffDelete property . 1257 xxi . . 1248 CutoffInterval property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240 RegisterNewUser method . . . . . . 1228 . . . . . . . . . 1241 SwitchToID method . . . . . . . 1227 MinPasswordLength property OrgUnit property RegistrationLog property . . . . . 1228 RegistrationServer property StoreIDInAddressbook property . . . . . . . . . . 1203 GetPrev method . . . . . . . . . . 1221 NotesRegistration class . . 1210 IsNorthAmerican property . . . . . . . . . . 1209 EntryClass property Formula property . . . . . . . . . . . . . . . . . . . . . . 1248 Disabled property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1208 Database property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1228 . . . . 1211 HasChildren property . . . . . . . . . . . . . . . . . . . . . . . . . 1216 NamedElement property . 1250 DoNotCatalog property . . . . . . . . . . . . . . . . . . . . . . . . 1232 CrossCertify method . . . . . . . . . . . . . . . . . . . . . 1212 ImagesText property . . . . . . . . 1220 SetNoteLink method . . . . . . . . . . . . . . . . . . . 1256 ClearHistory method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1202 GetNextSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246 . . . . . . . . . . . . . . . . . . . . . . . . . . . 1255 Priority property . . . . . . . . . . 1251 HideDesign property . . . . . . . . . . . . . . . . . . .GetLast method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214 IsPrivate property . . . . . . 1218 . . . . . . 1205 RemoveEntry method . . . . . 1239 RegisterNewServer method . . . 1234 DeleteIDOnServer method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1252 IgnoreDestDeletes property . . . . . . . . . . . . . . . . . . . . . . . . . 1207 Alias property . . . . . . . . . . . . . . . . . . . . 1227 . . . . . . 1225 CreateMailDb property . 1237 ReCertify method . . . . . . . . . . . . . . . . . . . 1206 Save method . . . . . 1251 IgnoreDeletes property . .

. . . . . 1285 Tabs property . . . . . . . . . . . . . . . . . . . . . 1278 FirstLineLeftMargin property . 1261 AddNewLine method . . . . . . . . . . 1297 PassThruHTML property . . . . . . . . . . . . . . . . . . . . . . . . 1328 CreateRichTextStyle method . . . . 1333 GetDbDirectory method . . . . . . . 1300 NotesRichTextTab class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1308 CurrentDatabase property . . . . . . . . . . . 1316 . . . . . 1263 AddTab method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1318 NotesBuildVersion property . . . . . . . . . 1299 xxii Domino Designer Programming Guide . . . . . . . . . . 1322 CreateDateRange method . . . . . . . . . . . . . . . . . . . . 1324 CreateName method . . 1268 AppendRTItem method . . . . . . . . . . . . . . 1335 GetEnvironmentValue method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321 UserNameList property . . . . 1329 FreeTimeSearch method . . . . . 1290 Bold property . . . . . . . . . . . . . . . . . . . . . . . . 1313 International property . . . . . . . . . . . . . . . . . . . 1317 NotesVersion property Platform property . 1338 Alignment property . . . . . . . . . . . . . . . . . 1298 Strikethrough property . . . 1284 SpacingBelow property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1329 CreateTimer method . . . . . . . 1287 SetTabs method . . . . . . . . . . . . . . . . . . 1262 AddPageBreak method . . . . . 1294 Effects property . 1302 Type property . . . . . . . . . . . . 1303 Clear method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1315 LastExitStatus property . . . . . . . . . . . 1279 InterLineSpacing property . . . . . . . . . . . . . . . . . . . . . . . 1270 AppendText method . . .Save method . . 1271 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271 EmbedObject method . . . . . . . . . . . . . . . . . . . 1301 Position property . . . . . . . 1269 AppendStyle method . . . . . . . . . . . . . . . . . . . . . . . . 1276 . . . . . . . 1327 CreateRichTextParagraphStyle method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307 CurrentAgent property . . . . . . . . . . . . . . . . . . . . . . . . . . 1292 . . 1296 NotesFont property . . . . . . . . . . . . 1319 SavedData property . . . 1334 GetEnvironmentString method . . . . . . . . . . 1264 AppendDocLink method . . . . . . . . . . . . 1277 GetEmbeddedObject method . . . . . . . . . . . . . . . . . . . . . . . . . . 1274 GetFormattedText method NotesRichTextParagraphStyle class Underline property . . . . . 1281 Pagination property . . . . . . . . 1314 IsOnServer property . . . . . . . . . . 1331 GetDatabase method . . . . . . . . . . . . . . . . . . . . 1320 UserName property . . . . . . . 1266 AppendParagraphStyle method . . 1258 EmbeddedObjects property . . . . . . . . . . . 1309 DocumentContext property . . . . . . . . . . 1305 CommonUserName property . . . . . 1303 AddressBooks property . . . . . . . . . . . 1283 SpacingAbove property . . . . . . . . 1303 NotesSession class . . . . 1323 CreateDateTime method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295 NotesColor property . . . . . . . . . . . . . . . . . . . . . . 1286 ClearAllTabs method . . . . . . . . . . 1325 CreateNewsletter method . . 1310 EffectiveUserName property . . . . . . . . . . . . . . . . 1336 SetEnvironmentVar method . . . . . . . . . . . . . 1323 CreateLog method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1289 NotesRichTextStyle class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258 NotesRichTextItem class . . . . . . . 1293 FontSize property Italic property . . . . . . . . . . . . . . . . . . . 1287 SetTab method . . . . . . . . . . 1316 LastRun property . . . . . . . 1282 RightMargin property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 LeftMargin property . . . . . . . . . . . . . . . . .

. . . . . . . . 1379 Clear method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1405 QueryDocumentUndelete event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351 Documents property . . . . . . . 1359 . . . . . . . . . . . . . . . . . . . . . . 1352 OpenNavigator method . . . . . . . . . . . . . . . . 1374 xxiii . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1382 Copy method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1389 FieldContains method . . . . . . . . . 1375 PreviewDocLink property . . . . . . . . . . . . . . . . . . . . . . . . . 1378 WindowTitle property . . . . . . 1383 Cut method . . . . . . . 1361 . . . . . . . . . 1344 Comment property . . 1353 PostModeChange event . . . . . . . . . . . . . . . . . . . . . 1377 Ruler property . . . . . . . . . . . . . . 1350 Database property . . 1376 PreviewParentDoc property . . . . . . 1370 EditMode property . . . . . . . . . . . . . . 1381 CollapseAllSections method . . . . . . . . . . . 1339 NotesTimer class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1347 PostOpen event . . . . . . . . . . . . . . . . 1379 Categorize method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1349 QueryDocumentDelete event IsNewDoc property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390 FieldGetText method . . . . . . . . . . . . . . . . 1344 Enabled property . . . . . . . . . . . . . 1402 GotoPrevField method Import method . . . 1399 GetSelectedText method . . . . . . . . . . . . . . . . . 1405 NavBarSpinnerStop method . . . . . . . . . . . . . . . . . . . 1403 InsertText method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1393 FindFreeTimeDialogEx method . . . . . . 1391 FieldSetText method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1395 FindString method . . . . . . . . . . . . . . . . . 1385 DeselectAll method . . . . . . . . . . . . . . 1357 PostRecalc event QueryClose event QueryOpen event . . . 1352 NotesUIDocument class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1392 FindFreeTimeDialog method . . . . 1350 QueryDragDrop event . . . . . . . 1402 . 1400 GotoBottom method . . . . 1384 DeleteDocument method . . . 1386 ExpandAllSections method . . . . . . . 1372 HiddenChars property . . . . . . . . 1398 GetObject method . . . . 1345 NotesUIDatabase class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1382 CreateObject method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1368 DialogBoxCanceled property . . . 1397 Forward method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401 GotoField method . . . . . . . . . . . . . 1349 . . . . . . . . . . . . . . . . . . . . . . . . 1362 QuerySave event . . . . . . 1402 GotoTop method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1404 NavBarSetText method . . . . . 1360 QueryModeChange event . . . . . . . . . . . . . . . . . . . . 1374 InPreviewPane property . . . . . . . . . . . 1356 PostOpen event . . . . . . . 1373 HorzScrollBar property . . . . . . . 1352 OpenView method . . . . . . . . . . . 1369 Document property . . . . . 1363 PostSave event . . . . . . . . . . 1387 FieldClear method . 1345 PostDocumentDelete event . . 1371 FieldHelp property . . . . . . . . . . . . . . . . . . . . . 1367 CurrentField property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401 GotoNextField method . . . . . . . . 1341 Alarm event . . . . . 1404 NavBarSpinnerStart method . . . . . . . . . . . . 1365 AutoReload property . . . . . . . . .UpdateProcessedDoc method . . . . . . . . . . . . . . . . . . . . . 1380 Close method . . . . . . . . . . . . . . . . . 1344 Interval property . . . . . . . . . . . . . . . . . . . . . . . . . 1348 QueryClose event . . 1387 FieldAppendText method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1347 PostDragDrop event . . . .

. . . . . . 1447 Prompt method . 1437 . . . 1440 . . . 1409 ComposeDocument method . . . . . . . . . . . . . . . . . . . . . . 1438 EnableAlarms method . . . . . . . . . 1443 PickListCollection method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1451 SaveFileDialog method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1430 CheckAlarms method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1418 QueryOpenDocument event . . . . . . . . 1417 . . . . . . . . . . . 1405 Print method . . . . . . . . . . . . . . . . . . . . . . . 1441 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421 RegionDoubleClick event . . . . . . . 1461 BackgroundColor property . . . . . . . . . . . . . . . . . . 1467 IsDefaultView property . . . . . 1407 RefreshHideFormulas method Reload method . . . . . . . . . . . . . .Paste method . . . . . . . . 1410 SelectAll method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1450 SetCurrentLocation method SetTargetFrame method . 1416 QueryClose event QueryOpen event . . . . . . . . . 1464 Created property . . . . . . . . 1419 QueryPaste event . . . . . . . . . . . . . 1413 NotesUIView class . . . 1464 Columns property . . . . 1460 AllEntries property . . . . . . 1455 ViewRefresh method . . . . . . . . . . . . . 1431 OpenFrameSet method . . . . . 1410 SaveNewVersion method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1452 UseLSX method . . . . . . . . . . . . . . . . . . . . . . . . . . . 1455 NotesView class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1411 Send method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1418 QueryDragDrop event . . . . . . . . . . . . . . 1447 RefreshParentNote method . . . . . . . 1468 IsCategorized property . . . . . 1430 AddDatabase method . . . . . . . . . . . . . . . . . . . . . . . 1415 QueryAddToFolder event . . . 1450 . . . . . . . . . . . . . . . . . . . . . . . 1431 DialogBox method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1443 OpenPage method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1465 HeaderLines property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1429 CurrentView property . . 1412 SpellCheck method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1452 URLOpen method . . . . . . . . . . . . . . . . . . . . . . . 1439 GetListOfTunes method OpenDatabase method OpenFileDialog method . . . . . . . . . . . . . . . . . . . 1424 Print method . . . . . . . . . . . . . . . . . . . . . . 1442 Save method . . . . . . . . . . . . . . . 1424 Viewname property . . . . . . . . . . . . . . . . . . 1422 CaretCategory property . . . . . . . . . . . . . . . . . . . 1406 Refresh method . . 1428 CurrentDocument property . . . . . . . . . . . . . . . . . . . . 1426 CurrentCalendarDateTime property . . . . . . . . . . . . . 1415 PostPaste event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1457 Aliases property . . . . . . . . . . . . . . . . . . 1428 CurrentDatabase property . . . . . . . . 1424 View property . 1449 ReloadWindow method . . . . . . . . . . . . . . . . . . . 1462 ColumnCount property . . . 1461 AutoUpdate property . . . . . . . . . . . . . . . . . . 1408 . 1423 Documents property . 1466 IsCalendar property IsConflict property . . . . . . . . . . . . 1444 PickListStrings method . . . . . . . . 1445 PlayTune method . . . . 1422 CalendarDateTime property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466 . . . . . . . . . . . . . . . . . . . . 1425 SelectDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1468 xxiv Domino Designer Programming Guide . . . . . . . . . 1426 NotesUIWorkspace class . . . . 1413 PostDragDrop event . . . 1420 QueryRecalc event . . . . . . . . . . . . . . . . 1414 PostOpen event . . . . . 1439 Folder method . . . . . . . 1433 EditDocument method EditProfile method . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . 1523 . 1477 TopLevelEntryCount property . . 1483 FTSearch method . . . . . . . . 1478 Clear method . . . . . . . . . . . . . 1512 FontPointSize property . . . . . . . . . . . . . . . . . . . . 1520 IsIcon property . 1504 Remove method . . . . . . . . . . . . 1518 IsFormula property . . . 1474 Readers property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .IsFolder property . . . . . . . . . . . . . . 1522 IsResortDescending property IsResortToView property . . . . . . . . . . . . . . . . . . . . . . . . 1472 IsPrivate property . . . . . . 1493 GetFirstDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1472 LastModified property Name property . . 1534 Position property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1517 HeaderAlignment property . . . . . . . . . . . . . . . . . 1521 IsResize property . . . . . . . . . . . 1494 GetLastDocument method . . . . . 1503 Refresh method . . . . . . . . . . . . . . . . . . . . . . 1514 . . . . . . . . . . . . . . . . . . . . . . 1518 IsHidden property . . . 1510 FontColor property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1506 . . . . . . . . . . . . . . . . . . . 1482 CreateViewNavFromChildren method . 1489 GetDocumentByKey method . . . . . . . 1476 Spacing property . . . . . . . 1490 GetEntryByKey method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1478 UniversalID property . . . . . . . . . . . . . . . . . . . . . . . 1535 TimeDateFmt property . . . 1479 CreateViewNav method . . . . . . . . . . . . . . . . . . . . . . 1470 IsModified property . 1499 GetParentDocument method . . . . . . . . . . 1475 RowLines property . . . 1527 IsResponse property . . . . . . . . . 1529 IsSorted property . . . . . . . . . . . . . . 1471 . . . 1529 ItemName property . . . . . . . . . . . . . . . . . . . 1480 CreateViewNavFrom method . . 1537 Title property . . . . . . . . . 1516 IsField property . . . . . . . . . . . . 1538 xxv . . . . . . . . . . . . . . . . 1506 NotesViewColumn class Alignment property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1533 NumberFormat property . . 1481 CreateViewNavFromCategory method . . . . . . . . . . . . . . . . . . . . . . . . . . . 1536 TimeZoneFmt property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1497 GetNthDocument method . . . . . . . 1496 GetNextSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1473 Parent property . . . . . . . . . . . . . . . . . . . . . . . . 1512 FontStyle property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1469 IsHierarchical property . . . . . . . 1473 ProtectReaders property . . . . . . . . . . . . . . . . . 1486 GetAllEntriesByKey method . . . . . . . . . . . . . . . . . . . . . . 1513 Formula property . 1510 FontFace property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1495 GetNextDocument method . . . . . . . . . . . 1524 IsSecondaryResort property IsShowTwistie property IsSecondaryResortDescending property . . . . . 1483 CreateViewNavFromDescendants method . 1484 GetAllDocumentsByKey method . . . . . . . . . 1519 IsHideDetail property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1521 IsResortAscending property . . . . . 1501 GetPrevDocument method . . . . 1528 IsSortDescending property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1509 DateFmt property . . . . . . . . . . . . . . . . . . . . . . . . 1523 . . 1502 GetPrevSibling method . . . . . . . . 1531 ListSep property . . . . . . . . . . 1533 NumberDigits property . . . . . . . 1527 . . . . . . . . . . . . . 1488 GetChild method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515 IsAccentSensitiveSort IsCategory property IsCaseSensitiveSort property . . 1536 TimeFmt property . . . . . . . . . . 1532 NumberAttrib property . . . . . . .

. . . . . . . . . . . . . . . . . . . . 1563 GetNthEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579 GetNextCategory method . . . . . . . . . 1554 Count property . . . . . . . . . . . . . . . . . . . . . . . . 1539 NotesViewEntry class . . 1585 GetPrev method . 1587 GetPrevDocument method . . . . . . . . . . . . . . . . 1559 GetEntry method . 1588 GetPrevSibling method . . . . . . . . . . . . . . . . . . 1545 IsCategory property IsConflict property IsDocument property IsValid property . 1610 Creating. . . 1558 FTSearch method . . 1552 UniversalID property . . . . . . 1603 Locating a database on a server or the local directory . . . . . . . . . . . . . . 1561 GetLastEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1547 . . . . . . . . . . . . . 1565 PutAllInFolder method . . . . . . . . . . . . . . . . . . . . . . 1580 GetNextDocument method . . . . . . . . . . . . . . . . . . . . . . . . 1579 GetNext method . . 1620 Accessing views and folders . . . . . . . . . . . . . . . . . . . . . . . . . 1550 Parent property . . . . . . . . . . . . . . . . 1614 Examining and adjusting an access control list . . . . . . . . . . . . . 1583 GetParent method . . . . . . 1546 . . . . . . . 1582 GetNth method . . . . . . . . . . . . . 1591 Java Classes Coding Guidelines Accessing databases . . . . . . . . . . 1566 RemoveAll method . . . . . . . . . . . . compacting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . and replicating a database . . . . . . . . . . . . . . . . . . . . . . . 1574 GetChild method . . .Width property . . . . . . 1584 GetPos method . . . . . . . . . . 1560 GetFirstEntry method . . . . . . . . . . . . . . . . . . . . . . 1616 Accessing a form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581 GetNextSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1577 GetLast method . . . . . . . . . . . . 1589 IsTotal property . . . . . . . . . . . . . 1549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1541 ColumnIndentLevel property . . . 1556 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . 1551 SiblingCount property . . . . . . . . . . . . . . . . . . . . . . . . . 1539 ChildCount property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1544 FTSearchScore property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1568 Volume III 9 Java Classes . 1544 IndentLevel property . . . . . . 1548 UpdateAll method . . . . . . . . . . . . . 1574 GetEntry method . . . . . . . . . . . . 1591 . 1542 ColumnValues property . . . . . . . . . . . . . . . . . 1603 Accessing database properties . 1573 ParentView property . . . 1542 DescendantCount property . . . . . . . . 1562 GetNextEntry method . . . . . . 1621 xxvi Domino Designer Programming Guide . 1569 NotesViewNavigator class . . . . . . . . 1557 AddEntry method . 1586 GetPrevCategory method . . . . . . . . . . . . . . . . . . . . 1558 DeleteEntry method . . . . . . . . . . 1609 Opening a database . . . 1564 GetPrevEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1543 Document property . 1578 GetLastDocument method . . . . . . . . . . . . . . . . . . . . . . 1556 Query property . . . . . . . . . . 1591 Running a Java program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567 StampAll method . . . . . . . . . . . . . . . . . . . 1570 MaxLevel property . . . . . . . . . . . 1567 RemoveAllFromFolder method . . . . . 1549 NoteID property . . . . . . . . . . 1552 GetPosition method . . . . . . . . 1619 Accessing an outline . . . . . . . . . 1576 GetFirstDocument method . . . . . . 1575 GetFirst method . . . . . . 1553 NotesViewEntryCollection class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . removing. . . . . . . . . . . . . . . .

. 1700 Roles property . . . . . . . . . . . . . . . . . . . . . . . 1705 getFirstEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1702 createACLEntry method . . 1669 NotesFactory class . . . . . . . . . . . . . . . 1696 InternetLevel property . . . . . . . . . . . . . . . . 1641 Creating an item and assigning values . . . . . 1661 AgentBase class . . . . . . . . 1711 IsAdminReaderAuthor property . . . . . . . . . . 1654 Making a log . . . . . . . . . . . . . . . . . 1704 getEntry method . . . . . . . 1710 removeACLEntry method . . . . . . . . . . . 1657 Making a newsletter . . . . . . . 1621 AppletBase class . . 1638 . 1709 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723 10 Java Classes A-Z . . . . . . . . . . . . . . 1639 Mailing a document . . 1714 IsCanCreateDocuments property . . . . . . 1631 . 1723 IsServer property . . . . 1640 Accessing item properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1631 . . . . . . . . . . . . . 1640 Accessing items . . . . . . . . . . . . . . . 1625 Accessing view columns . . . . 1721 IsPublicReader property . . . . . . 1716 IsCanCreatePersonalFolder property IsCanDeleteDocuments property IsPerson property . . . . . . . . . . . . . 1648 Using environment variables . . . . . . . . . . 1646 Accessing Domino sessions . . . . . . . . 1652 Working with time . . . . . . . . . . . . . . . 1701 addRole method . . . 1719 . . . . . . 1640 Removing a document . . . . 1694 recycle method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1658 Representing a name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1708 . . . . 1694 toString method . . . . . . . . . . . . . . 1644 Copying an item . . 1711 Locating a view . . . . . . . . . . . . . . . 1644 Removing an item . . . 1713 IsAdminServer property . . . . . 1699 Parent property . . . . . . . . . . . 1692 getURL method . . . . . . . 1717 IsCanCreateSharedFolder property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1649 Accessing agents . . . . . . . 1697 IsUniformAccess property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1632 Accessing document properties Collecting all documents and all unprocessed documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1645 Working with an embedded object . . . . . . . 1626 Working with view entries and navigators . . . . . . . . . . 1691 NotesThread class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1722 IsPublicWriter property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1639 . . . . . . . . 1661 Properties and methods with ECL security . . . . . . . . . . . . 1628 Removing a view Accessing documents . . . . . . . . . . . . . . . 1635 Collecting documents by searching Creating a document Copying a document . . 1715 IsCanCreatePersonalAgent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1695 Visibility interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Accessing view properties . . . . 1703 deleteRole method . . . . . . . . 1695 ACL class . 1668 NotesError and NotesException classes . 1647 Accessing session properties . 1650 Accessing international settings . . . . . . . . . . . . . . . . . . . . . . . . 1645 Working with a rich text item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1714 IsCanCreateLSOrJavaAgent property . . . . . . . . . . . . . . . . . . . . . . . . . . 1637 Locating a document by ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1707 getNextEntry method renameRole method save method . . . . . . 1721 . . 1658 ACLEntry class . . . . . . . 1668 xxvii . . . . . . . . . . . . 1719 IsGroup property . . . . . . . . . . . .

. . . . . . . . . 1747 Query property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797 IsOpen property . . . . . . 1810 TemplateName property . . . . . . . . . . . . . . . . . . . 1749 Target property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1776 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1729 UserType property . . . . . . . . . . . . . . .Level property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768 unprocessedSearch method . . . . . . . . . . . . 1753 run method . 1746 Owner property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1744 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1796 IsMultiDbSearch property . . 1784 Agents property AllDocuments property . . . . . . . . . . . . . . . . . . 1757 CurrentAgent property . . . . . . . . . 1735 Agent class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1744 SavedData property . . 1740 IsNotesAgent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1805 PercentUsed property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1788 DesignTemplateName property FileName property . . . . . . . . . . . . . . . 1738 CommonOwner property . . . . . . . . . . . . 1794 IsDelayUpdates property . . . . 1751 Trigger property . . 1765 UnprocessedDocuments property . . . . . . . . . . . . . . . . . . . . . . 1791 FilePath property . . . . . . 1812 xxviii Domino Designer Programming Guide . . . . 1775 Database class . . . . . . . . . 1764 IsPublicAddressBook property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1748 ServerName property . . . . . . . . . . . . . . 1772 updateProcessedDoc method ACL property . . . . . . . 1724 Name property . . . . 1803 . . . 1762 LastExitStatus property . . . . . . . . . . 1730 disableRole method . . . . . . . 1757 AgentContext class . . . . . . . . . . 1732 enableRole method . . 1739 IsEnabled property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1786 Created property . . . . . . . . . . 1798 . . 1791 FolderReferencesEnabled property . . . 1811 Title property . 1761 EffectiveUserName property . . . . . . . . . . . . . 1790 . . . . 1727 Parent property . . . . . . . 1808 Size property . . . . . . . 1755 runOnServer method . . . . . . . . 1742 IsPublic property . . . . . . . . . . . . . . . . . . . . . 1799 IsPrivateAddressBook property Name property . . . . . . . 1743 IsWebAgent property LastRun property . . . . . . 1783 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1802 Managers property . . . . . . . . . . . . . . . . . . . . . . . . 1756 save method . . . . . . . . . . . . 1792 Forms property . 1726 NameObject property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1753 remove method . . . . . . . . . 1804 Parent property . . . . . . . . . . 1800 LastFTIndexed property . 1785 Categories property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1766 unprocessedFTSearch method . . . . . . . . . . . . . . . . . . . 1806 ReplicationInfo property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1809 SizeQuota property . . 1746 Parent property . . . . . . . . . . . 1787 CurrentAccessLevel property . . . . . . . 1759 CurrentDatabase property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1801 LastModified property MaxSize property . . 1734 remove method . . . . . . . . . . . . . . . . . . . . . . . . . . 1794 IsFTIndexed property . . . . . . . . . . . . . . . . . . . . . 1805 ReplicaID property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1733 isRoleEnabled method . . . . . . 1763 LastRun property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1736 Comment property . . . . . . . . . . . . . . . . . . . . . . . 1760 DocumentContext property . . 1807 Server property . . . . . . . . . . . . . 1728 Roles property . . . . . . . . . . . .

1875 setAnyTime method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1876 setNow method . . . . . . . . . . . . . . . . 1899 . . . . . . . . . . 1841 remove method . . . . 1847 updateFTIndex method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1888 Document class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1815 createDocument method . . . . . . . . 1869 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1834 getProfileDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1878 DbDirectory class . . . . . . . . . . 1827 getDocumentByUNID method . . . . . . . . . . . . . . . . . . . . 1848 DateRange class . . . . . . . . . . . . . . . . . . . . 1879 Name property . . . 1867 adjustMinute method adjustSecond method adjustYear method . . . . . . . . . . . . . . . . . . . . . . . . . 1900 open method . . . . . . . . . . . . . . . . 1859 FTSearchScore property . . . . . . . . . 1877 toJavaDate method . . . 1816 createFromTemplate method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1853 StartDateTime property . . . . . 1858 GMTTime property . . . . . . . . . . . . . . . . . . . . . . . 1833 getProfileDocCollection . . . . . . . . 1845 search method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1886 openDatabaseIfModified method . . . . . . . . . . . . . . . . . . . . . 1889 Authors property . . . . . . . . . . . . . . . . . . . . 1844 revokeAccess method . . . . . . . . 1900 xxix . . . . . . . . . . . . . . . . . . . . . . . . . . . .Views property . . . . . . . . . . . . . . . . . . 1854 DateTime class . . . 1880 Parent property . . . . . . . . 1817 createOutline method createReplica method . . . . . . . . . . . . . 1854 DateOnly property . . . . . . . 1852 Parent property . . . . . . . . . . . . . . . 1863 TimeOnly property . . . . . . . . . . . . 1838 . . . . . . . . . 1828 getDocumentByURL method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1843 replicate method . . . . . . 1884 openDatabase method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897 EncryptionKeys property FolderReferences property . . . . . . . . . . . . . 1853 Text property . . . . . . . . . . 1826 getDocumentByID method . . . . 1887 openMailDatabase method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1820 IsDST property . . . . . . . . . . . . . . 1864 ZoneTime property . . . 1870 . . . . . 1893 ColumnValues property . . . . . . . . . 1885 openDatabaseByReplicaID method . . . . . . . . . 1876 timeDifference method . . . . . 1832 getOutline method . . . . . . 1871 adjustMonth method . . . . . . . . . . 1872 enableFolder method . . . . . . . . . . . . . 1881 createDatabase method . . . . . . . . . . . . . . . . . . . . . . . . 1821 FTDomainSearch method . . . . . . . . . . . 1874 setAnyDate method . . . . . . 1860 LocalTime property . . . . 1836 getView method . . . . . 1822 FTSearch method . . 1866 adjustHour method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1881 getFirstDatabase method . . 1830 getForm method . . . . 1883 getNextDatabase method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1849 EndDateTime property . 1896 EmbeddedObjects property . . . . . . . . . . . . . . . . . . . . . . . . 1835 getURLHeaderInfo method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1895 Created property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1839 grantAccess method convertToZone method . . . . . . . . . . . 1863 TimeZone property . . . 1861 Parent property . . . . . . . . . 1813 compact method . . . . . . . . . . . . . . . . . . . . . 1840 queryAccess method . . . . . . . . . . . . . . 1823 getAgent method . . . . . . . . . . 1866 adjustDay method . . . . . . . . 1814 createCopy method . . . . . . . . . . . . . . . . . . 1819 . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . 1939 hasItem method . . . . . . . 1916 Signer property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1980 FileSize property . . . . . . . . . . . . . . . . 1911 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1951 sign method . . . . . . . . . . . . . . . . . . . . . 1914 ParentView property . . . . . . . . . . . . . . . . . 1938 getItemValueString method . . . 1967 getNthDocument method . . . . . . . . . . . . . . . . . . . . . . . . . 1945 renderToRTItem method . . . . . . . . . 1972 removeAll method . . . . . . . . . . . . . . . . . . . 1940 makeResponse method . . . . . . . . 1930 encrypt method . . . . . 1947 save method . . . . . . . 1944 removeItem method . 1928 createReplyMessage method . . . . . . . . . . . . . . . . . 1934 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961 deleteDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1981 IsEncryptOnSend property . . . . . . . . . . . . . . . . 1974 removeAllFromFolder method . . . . . . . . . . . 1913 ParentDocumentUNID property . . . . . . . . . . . . 1962 FTSearch method . . . . . . . . . . . . . . . . . 1909 IsSignOnSend property . . . . . . . . . . . . . 1967 getNextDocument method . . . . . . . . . . . . . . . . . 1975 stampAll method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918 Size property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1978 ClassName property . . 1931 getAttachment method . . . . . . . . . . . . . . 1912 NameOfProfile property . . . . . . . 1971 putAllInFolder method . 1964 getDocument method . . . . . . . . . . . . . . . . . . . . . 1954 Count property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912 ParentDatabase property . . . . . . . . . . . . . . . . . . . . . . 1920 appendItemValue method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1946 replaceItemValue method . . . 1938 xxx Domino Designer Programming Guide . . . . . . . . . . . 1936 getItemValueDouble method . . . . . . . . . . . . . 1919 Verifier property . . . . . 1954 DocumentCollection class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933 getFirstItem method getItemValue method . . . . 1923 copyAllItems method . . . . . . . . . . . . . . 1957 IsSorted property . . . . . . . . . . . . . . . . . . . . . . . . 1905 IsSaveMessageOnSend property . 1943 removeFromFolder method . . 1969 getPrevDocument method . . . . . 1957 Parent property . . . . . . . . . . . . . . . . . 1908 Items property . . . . . . . . . . . . . . . 1921 computeWithForm method . . . . . . . . . . . . . . . . 1918 UniversalID property . . . . . . . . . . . . . . . . . . . 1959 Query property . 1940 putInFolder method . . . . . . . . . . . . . . . . 1912 NoteID property . . . 1901 getItemValueInteger method . . . . . . . . . . . . . . . . . 1911 LastAccessed property LastModified property . . . . . . . . . 1915 Responses property . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1977 EmbeddedObject class . . 1907 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1960 addDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906 . . 1941 remove method .HasEmbedded property . . . . . . . 1910 Key property . . . . . . . . . . . . . . 1905 IsSentByAgent property IsSigned property IsValid property . . . . . . . . . . . . . . 1904 IsResponse property . . . . . . . . . . . 1967 getLastDocument method . . . . 1981 Name property . . . . . . . . . . . . . . . . . . . . . . . . . 1965 getFirstDocument method . . . . . . 1929 createRichTextItem method . . . 1903 IsProfile property . . . . . . 1950 send method . . . . 1925 copyItem method . . . . . . 1926 copyToDatabase method . . . . . . . . . . . 1902 IsNewNote property . . . . . . . . . . . . . . . . . . . . . . . . . . 1976 updateAll method . . . . . . . . .

. . . . . . . . . . . . . . . . . 2016 IsEncrypted property . . . . . . . . . 2010 TimeZone property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2024 IsSaveToDisk property FormUsers property IsProtectReaders property . . 2020 IsProtected property . . . . . . . . . . . . . . . . . . . . . . . 2005 IsCurrencySuffix property . . . . . . . . . . . . . . . . . . . . 2021 IsReaders property IsSigned property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1983 activate method . 2007 IsDST property . . . . . . . . . . . . . . . . . . 2022 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2031 ValueString property . . . . . . . . . . 2029 ValueInteger property . . . . . . . . . . . . . . 2023 LastModified property Name property . 2021 . . . . . . . . . . . . . . . . . . . . 2022 . . . . . . . . . . . . 1990 ThousandsSep property . . . . . . . . . . . . . . . . . . . 2001 DateSep property . 2018 IsNames property . . . . . . . . . . . . . . . 1997 International class . . . . . . . 2026 ValueDouble property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1984 doVerb method . . . . 2038 remove method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1986 Form class . 1984 extractFile method . . . . . . . . . . . . . . . . 2048 xxxi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2034 . . . . . . . . . . . . . . . . . 2012 DateTimeValue property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2006 IsDateMDY property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2010 Today property . . . . . . . . . . . . . 1996 remove method . . . . . . . . . . . . . . . . . . . . . . 1983 Verbs property . 2012 Item class . . 2041 IsLogActions property . . . . . . . . . . . . . . . . . . . . . . . . . . . .Object property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2046 NumActions property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1989 . . . . . . . . . . . . . . 1985 remove method . . . . . . . . . . . . . . . . . . . 2004 IsCurrencySpace property . . . . . 1982 Source property . . . . . . . 2024 Text property . . . . . . . . . . . . . . . . . . . . . . . . . 1996 Readers property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2005 IsCurrencyZero property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2009 IsSummary property . . . . . . . . . . . . . . . . . . . . . 1992 IsProtectUsers property . . . . . . . . . . . . . . . . . . . . 2011 Yesterday property . . 2045 IsOverwriteFile property . . 2009 PMString property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2016 IsAuthors property . . . . . . . . . . . . . . . . . . 1982 Type property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2008 IsTime24Hour property . 1994 Name property . . . . . . 2030 Values property . . . . . . 1982 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2001 CurrencySymbol property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2030 ValueLength property . . . . . . . . . . . . . . . . . . . . . . 2040 Log class . . . . . . . . . . 1995 Parent property . . . . 2007 IsDateYMD property . . . . . . . . . . . . . . . . . . . . 2008 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2037 copyItemToDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2000 CurrencyDigits property . . . . . . . . . . . . . . . . . . . . . . 1988 . . . . . 1998 AMString property . . . . . . . . . . . 2044 IsLogErrors property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2026 Type property . . . . . . . . . . 2035 appendToTextList method containsValue method . . . . . . . . . . . . 2011 Tomorrow property . . . . . . . . . . . . 1986 Aliases property Fields property . . . . . . . . . . . . . . . 2006 IsDateDMY property . . . 2033 abstractText method . . . . . 2024 Parent property . . 2010 TimeSep property . . . . . . . . . . . . . 1993 IsSubForm property . . 2002 DecimalSep property . . . . .

. . . . . . . . . 2089 Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2093 getParent method . . . . . . . . . . . . . . . . . . 2050 ProgramName property . . . . 2101 Document property . . . . 2068 Country property Given property . . . . . . . . . . . . . 2095 getPrevSibling method moveEntry method . . . . . . . . . . . . . . . . . 2101 EntryClass property Formula property . . . . . 2100 Database property . 2068 Generation property . . . . . . . . . . . . . . . . . 2066 Addr822Phrase property . . . . 2067 ADMD property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2092 getNext method . 2070 Organization property . . . . . . . . . . . . . . . . . . . . . 2070 Language property . . . . . . . 2069 IsHierarchical property . . . . . . . . . . . . 2088 Comment property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2080 formatDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2085 Alias property . . . . . . . . . . . . . . . . . . . . . . . . . 2099 . . . . . . . . . . . . . . . . . . . . . . . 2074 OrgUnit1 property . . . . . . . . . . . . . . . . . . . . . . . . 2091 getLast method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2065 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074 OrgUnit2 property . . . . . . . . . . . . . . 2065 Addr821 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2062 Abbreviated property . . . . . . . . . . . . 2074 OrgUnit3 property . . . . . . . . . . . 2076 Alias property . . . . . . . . . . . . . . . . 2053 logEvent method . . . . . 2103 ImagesText property . . . . . . . . . . . . . . . . . . . . . 2075 PRMD property . . . . . . . . . . . . 2051 logAction method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068 . . . . . . . . . . . . . . . . . 2093 getNextSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2049 Parent property . . . . . . . . . . . . . . . . . . . 2067 Common property . . . . . . . . . . . . . . . . 2079 IsDoSubject property . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2106 xxxii Domino Designer Programming Guide . . . . . . . . . . . . . . . . . 2076 Newsletter class . . . . . . . . . . . . . . . . . 2102 FrameText property . . . . . . . . 2083 Outline class . . . . . 2105 IsHidden property . . . . . . . . . . . . . . . 2105 IsInThisDB property . . . . . . . . . . . . . . . . . . . . . . . 2089 addEntry method . 2103 HasChildren property . . . . . . . . . . . . . . 2075 Parent property . . . . . . . 2089 createEntry method . . . . . . . . . . 2066 Addr822LocalPart property . . . . . . .NumErrors property . . . . . 2069 Initials property . . . . . . 2056 openFileLog method . . . . . . . . . . . . . . . . 2090 getFirst method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2076 IsDoScore property . . . . . . . 2098 save method . . . . . . . . . . . . . . . . . . . 2060 SurName property . . . . . . . . . . . . . . . . . . . . . . 2052 logError method . . . . 2050 close method . . . 2095 getPrev method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2055 openAgentLog method . . . . . . . . . . . . . . . 2102 . . . . . . . . . . . . . . . . . . . . . . . . 2067 Canonical property . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2066 . . . . . . . . . . . . . . . . . . . . . . . . . . 2057 openMailLog method openNotesLog method Name class . . . . 2065 Addr822Comment1 property Addr822Comment2 property Addr822Comment3 property . . . . . . . . . . . . . . . . . . 2079 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2094 . 2081 formatMsgWithDoclinks method . . . . . . . . . . . . . . . . . . . . . . . . . 2106 IsPrivate property . . . . . . . 2075 OrgUnit4 property . . . . . . . . . . . . . . . . . 2059 . . . . . . . . . . . . . . . 2099 OutlineEntry class . . . . . . . . . . . . . . . 2080 SubjectItemName property . . . . . . . . . . . 2069 Keyword property . . . . . . . . . . . 2096 removeEntry method . . .

. . . 2119 addServerToAddressbook method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2110 View property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2108 . . . . . 2115 IDType property . . 2128 switchToID method . . . . . . . . . . . . 2109 setAction method setNamedElement method IsAbstract property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2153 appendParagraphStyle method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125 registerNewCertifier method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2155 appendStyle method . . . . . . . . 2109 . . . . . . . . . . . . 2117 . 2114 CreateMailDb property . . . . . . . . . . . . . . . 2111 setURL method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2144 clearHistory method . . . . . . . . . 2166 Pagination property . . . . . . . . . . . 2123 deleteIDOnServer method . . . . . . . . . . 2138 IsHideDesign property . . . . . . . . 2117 RegistrationServer property StoreIDInAddressBook property . . . . . . . . . . . . . . . . . . . 2124 recertify method . . . . 2124 getUserInfo method . . . . . 2108 URL property . 2143 IsNoChronos property . . . . . . . . 2121 . . . 2160 RichTextParagraphStyle class . 2120 addUserProfile method . 2133 CutoffDate property . . . . . . . . . . . . 2127 registerNewUser method . . . 2141 IsMultiDbIndex property . . . . . . . . 2146 save method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2147 EmbeddedObjects property . . . . . . . . . . . . . . . . . . . . 2149 addNewLine method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2136 IsDoNotBrowse property . . . . . . . . . . . . . . 2135 IsCutoffDelete property . . . . . . . . . . . . . . . . . . . . 2142 IsNeverReplicate property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2146 RichTextItem class . . . . . . . . 2166 setNoteLink method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2165 InterLineSpacing property . . . . . 2140 IsIgnoreDestDeletes property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Label property . . . . . . . . . . . . . . . . . . . . . . . 2112 CertifierIDFile property . . . . . . . . . . 2155 appendRTItem method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2135 IsDisabled property . . . 2117 . . . 2165 LeftMargin property . . . . . . . 2150 addPageBreak method . 2118 addCertifierToAddressbook method . . . . . . . . . . . . . . . . . . . . . . . . . . . 2152 addTab method . . 2157 getEmbeddedObject method . . . . . . . 2156 appendText method . . . . . . . . . . . . . 2139 IsIgnoreDeletes property . . . . . . . . . . . . . . 2114 Expiration property . . . . 2137 IsDoNotCatalog property . 2143 Priority property . . . . . . 2146 reset method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2129 Replication class . 2159 getFormattedText method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2116 . . . . . . . . 2152 appendDocLink method . . . . . . . . 2126 registerNewServer method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2116 MinPasswordLength property OrgUnit property RegistrationLog property . . 2107 Type property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2157 embedObject method . . . . 2130 xxxiii . . . . . . . . . . . 2162 Alignment property . . 2107 NamedElement property . 2134 CutoffInterval property . . . . . . . 2107 Level property . . . . . . . . 2115 IsNorthAmerican property . . . . . . . . . . . . . . . . . . 2118 UpdateAddressbook property . . . . . . . . . . . . . 2164 FirstLineLeftMargin property . . . . . . . . . . . . . . . 2121 addUserToAddressbook method crossCertify method . . 2112 Registration class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2123 getIDFromServer method . . . . . . . . . .

. . . . . 2179 RichTextTab class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2217 AllEntries property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2182 Session class . . . . . . . . . 2212 . . . . 2185 AgentContext property . . . . 2204 getEnvironmentString method getEnvironmentValue method . . . . . . . . . . . . 2230 IsPrivate property . . . . . . . . . . . . . . . 2178 StrikeThrough property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2177 Parent property . . . . . 2198 createRegistration method . . . . . . . . . 2221 ColumnNames property . . . . . . . . . . . . . . 2189 NotesVersion property . 2203 getDbDirectory method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2177 FontSize property createName method . . . . . . . . . . . . . . . . . . . . . . . . . . . 2230 IsModified property . . . . . . . . . . 2222 Created property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2234 Parent property . . 2223 HeaderLines property . . . . . . . . . . . . . 2176 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2229 IsHierarchical property . . . . . . . . . . . . . . . . . . . 2210 View class . . . . . . . . . . . . . . . . . . . . . . . . . . . 2222 Columns property . 2197 xxxiv Domino Designer Programming Guide . . . . . . . . . . . . 2187 International property . . . . . . . . . . . . . . . . . . . . . . . . . 2168 Tabs property . . . . . . . 2200 freeTimeSearch method . . . . . . . . . . . . . . . . . . . 2202 getDatabase method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2167 SpacingAbove property . . . . . . . 2191 ServerName property . . . . . . . . . . 2195 createDateTime method . 2193 UserNameList property . . . . . . . . . . . . . . . . 2174 Color property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2226 . . . . . . . . . . . . . . . . . 2227 IsDefaultView property . . . . . . . . . . . . . . . . 2192 UserName property . . . . . . . . . . . . . . . . . . . 2228 IsCategorized property . 2170 setTabs method . . . . . . . . . . 2170 RichTextStyle class . . . . . . . . .RightMargin property . . . . . . . . . . . 2172 Bold property . . . . 2198 createRichTextParagraphStyle method . . . . . 2228 IsFolder property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2168 SpacingBelow property . . . . . . . . . . . . . . . . . . . 2205 . . . . . . 2209 resolve method . . . . . . . . 2169 clearAllTabs method . . . . . 2224 IsAutoUpdate property . 2232 LastModified property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2179 Position property . . . . . . . . 2218 BackgroundColor property . . . . . . . . . . 2207 getURLDatabase method . . . . . . . . . . . . . . . . . . . 2210 setEnvironmentVar method Aliases property . . . . . . . . . . . . 2175 Font property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2194 UserNameObject property . . . . . . . . . . . . . . . . . . . . . 2233 Name property . . . . . . . 2235 Italic property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2199 evaluate method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2197 createNewsletter method . . . . . . . . . . . . . . . . . . . . 2190 Platform property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2225 IsCalendar property IsConflict property . . . . . . . . . . . . . . . . . . . . . . . 2196 createLog method . . . . 2188 IsOnServer property . . . 2231 IsProtectReaders property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2174 Effects property . . . . . . . . . . . . . . . . . . . . . . . . 2219 ColumnCount property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2178 Underline property . . . . . . . . . . 2169 setTab method . . . . . . . . . . . . . . . . . . . . . . . . . . . 2199 createRichTextStyle method . . . . . . . 2194 createDateRange method . . . . . . . . . . . . . . . . . . . . . . . . . . . 2182 AddressBooks property . . . . 2181 Type property . . . 2187 CommonUserName property . . . . . 2182 clear method . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . 2245 createViewNavMaxLevel method . 2283 xxxv . . 2284 HeaderAlignment property . . . 2307 remove method . . . . . . . . . . . . . . . . . . . . . . . 2264 getNextSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2272 Formula property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2282 FontPointSize property . . . . . . . 2253 getChild method . . . . . . . . . . . . 2270 getPrevSibling method refresh method . . . . . . . . . . . . . . . . 2238 UniversalID property . . . . . . . . . . . . . . 2258 getEntryByKey method . . . . . 2293 IsResponse property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2248 getAllDocumentsByKey method . . . . . . . . . . . 2294 IsSorted property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2306 ColumnIndentLevel property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2296 ListSep property . 2262 getLastDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2263 getNextDocument method . 2241 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2302 Title property . . . . . 2288 IsIcon property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2277 DateFmt property . . . . 2271 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2257 getDocumentByKey method . . 2299 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2290 IsResize property . . . . 2267 getParentDocument method . . . . . . . . . . . . . . . . . . . . . . 2268 getPrevDocument method . . . . . . . . . 2288 IsHideDetail property . . . . . . . . 2278 FontColor property . . . . . . . . . . . 2287 IsFormula property . . . . . . . . . . . . . . 2302 ViewEntry class . . 2291 . . . . . . . . . . . . . . . . . . . . . . . . . . 2294 IsSortDescending property . . . . 2292 IsSecondaryResort property IsShowTwistie property IsSecondaryResortDescending property . . . . . . . . . . . . . . . . 2285 IsAccentSensitiveSort property . . . . . . . . . 2236 RowLines property . . . . . . . . . . . . . . . . . . . . . . . . 2297 NumberDigits property . . . . . . . . . . . . . . . . . . . . 2239 createViewNavFrom method . . . . . . . . . . . . . . . . . . . 2244 createViewNavFromCategory method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2286 IsCategory property . . . . . . . . . . . . . . . . . . . 2304 ChildCount property . . . . . . . . . . . . . . . . . . . . . 2237 Spacing property . . . 2293 . . . . . . . . . . . . . . . . . . . . . . . . . . . 2256 getColumn method . . . . . . . . . . . . . . . 2266 getNthDocument method . . . 2300 Position property . . . . . . . . . . . . 2306 ColumnValues property . . . . . . . . . . . . . . . . 2291 . . . . . . . 2290 IsResortDescending property IsResortToView property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2285 IsCaseSensitiveSort property . . . . . 2247 FTSearch method . . . . . . . . . 2274 Alignment property . . . . . . . . . . . . 2238 clear method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2239 createViewNav method . . . . . 2290 IsResortAscending property . . . . 2287 IsHidden property . . . . 2237 TopLevelEntryCount property . . . . . . . . . . . . 2302 Width property . . . . . . . . . . . . . . . . . . . . . . . . . . . 2297 NumberAttrib property . . . . . . . . . . . 2283 FontStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2280 FontFace property . . . . . . . . . . . . . . . . . . . . . 2242 createViewNavFromChildren method createViewNavFromDescendants method . . . . . . . . . . . 2299 NumberFormat property . 2301 TimeZoneFmt property . . . . . . . . . . 2295 ItemName property . . . . 2273 ViewColumn class . . . . . . . 2300 TimeDateFmt property . . . . . . . . . . 2301 TimeFmt property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2251 getAllEntriesByKey method . . . . . . . . . 2286 IsField property . . . . . . . 2260 getFirstDocument method . . . . . .Readers property .

. . . . . . . . . . . . . . . . . . . . . . 2342 getLast method . . . . . . . . . . . . . . . . . 2310 . . . . . . . . . . . . . . . . 2308 FTSearchScore property . . . . . . . . . . . . . . . . . 2337 getNextSibling method . . . . . . . . . . . . 2353 getPrevDocument method . . . . . . . . . . . . . . . . . . . . . . 2355 gotoEntry method . . . . . . . . 2346 . . . . . . . . . . . . . . . . 2352 getPrevCategory method . . . . . . . . . . . 2312 SiblingCount property . . . . . . 2332 ViewNavigator class . . . . . . . . . . . . . . . . . . . . . . 2321 getFirstEntry method . . . 2333 CacheSize property . . . . . . . . . . . . . . 2362 gotoNext method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2354 gotoChild method . . . . . . . . . . . 2317 deleteEntry method . . . . . 2346 getNextCategory method getNextDocument method getNth method . 2313 UniversalID property . . . . . . . . . 2310 getChild method . . . . . . . . . . . . . . . . . . . 2348 . . . . . . . . . . . . . 2323 getLastEntry method . . . . . . . . . . 2316 Query property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313 getPosition method . . . . . . 2365 gotoNextSibling method . . . . . . . . . . . . . . . . . . . . 2363 gotoNextCategory method gotoNextDocument method . . . . . . . . . . 2340 getFirst method . . . . 2350 getParent method getPos method . . . . . . . . . . . . . . . . . . . . . 2366 gotoPos method . . 2318 FTSearch method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2360 gotoLastDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2359 gotoLast method . . . . . . . . . . . . . . . . . . . . . . . . . . 2316 Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2308 Document property . . . . . . . . . . . . . . . . . . . . . . . . 2327 removeAll method . . . . . . . . . . . . . . . . . . . . . . 2327 getNthEntry method . . . . . . . . . . . . . . 2336 ParentView property . 2354 getPrevSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2314 Count property . 2311 . . . . . . . . . . . . . . 2336 MaxLevel property . . . . . . . . . . . . . . . . . 2330 stampAll method . . . . . . . . . . . . 2329 removeAllFromFolder method . . . . 2367 gotoPrevDocument method . . . . . 2325 . . . . . . . . 2369 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2357 gotoFirst method . . . . . . . . . . . . . . . . . 2364 . . . . . . . . . . . . . . . . . . . . . . 2347 IsTotal property . . . . . . . . . . . . . . . . . . . 2317 addEntry method . . . . . . . . . . . . . . . . . . . . . . . . . . 2365 gotoParent method . . . . 2320 getEntry method . . . . . . . . . . . 2345 getNext method . . . 2351 getPrev method . . . . . . . . . . . . . 2367 gotoPrevCategory method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2324 getNextEntry method getPrevEntry method . . . . . . . . . . . . . . . . . . 2313 ViewEntryCollection class . . . . . . . . . . . 2337 getCurrent method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DescendantCount property . . . . . . . . . . . . . . . . . . . . Index-1 xxxvi Domino Designer Programming Guide . . . . . . . . . . . . . . . . . . . . . . . 2366 gotoPrev method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2349 . . . . . . . . . . 2358 gotoFirstDocument method . . . . . . . . . 2368 gotoPrevSibling method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2309 IndentLevel property . . . . . . . 2343 getLastDocument method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2310 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2312 Parent property . 2311 NoteID property . . . . . . . . . . 2340 getFirstDocument method . . . 2326 putAllInFolder method . . . . . . . . . . . . . . . . . . . . . . . . 2331 updateAll method . . . . . . . . . . . . . . . . . . 2309 IsCategory property IsConflict property IsDocument property IsValid property . . . . .

Structure of this guide The Domino Designer Programming Guide contains ten chapters and is printed in three volumes. “Formula Language @Commands A–Z. “Formula Language @Functions A–Z.” provides guidelines for working in Domino through LotusScript. xxxvii . This book is intended for developers who already understand their workstation’s operating environment. Volume 2: LotusScript Classes Chapter 7. Chapter 2.” is an A–Z reference of the Domino classes. “Programming Overview. Volume 1: Formula Language Chapter 1.” explains the rules of formula language. and formulas can be attached. LotusScript. Chapter 3. Chapter 6. This chapter describes where Java. “LotusScript Classes A–Z. and events.” provides guidelines for working in Domino through formulas. “User Interface.” is an A–Z reference of the Domino @commands. “Formula Language Rules. Chapter 5. know how to use Domino. and Java to Domino™ applications. Chapter 4.Preface The Domino Designer Programming Guide shows how to attach scripts. Chapter 8. formulas. JavaScript.” is an A–Z reference of the Domino @functions. have an understanding of application development in Domino Designer. and provides examples. properties.” provides an overview of Domino programming. and have an understanding of LotusScript™ and JavaScript if applicable. methods. “Formula Language Coding Guidelines.” explains the user interface to writing and debugging scripts in Domino. “LotusScript Classes Coding Guidelines.

“Java Classes A–Z. parameters which appear in brackets are optional. The information in these books is also found in the Domino 5 Administration Help online database.” provides guidelines for working in Domino through Java. keywords listed under “Syntax” are enclosed in brackets and bold face type. “Java Classes Coding Guidelines. Documentation for Domino Administration The following table shows the printed books that comprise the Administration documentation set. In Volume 2. You can order books from the Lotus Education Web site at: www. In Notes. the Administration and Designer documentation is available as printed books. Moving to Notes and Domino Release 5 Describes how to upgrade existing Domino servers and Notes clients to Release 5.com/education.OtherHelp to see a table of all the available documentation. Conventions In Volume 1. Also describes how to move users to Domino from other messaging systems. Chapter 10.” is an A–Z reference of the Java Domino methods. Structure of Notes and Domino documentation Documentation for Notes and Domino is provided online in three databases available from the Help menu: Notes 5 Client Help Domino 5 Administration Help Domino 5 Designer Help In addition. select File .Volume 3: Java Classes Chapter 9. the printed book Step by Step provides a tutorial for beginning Notes users. Documentation for the Notes Client In addition to the online Help. xxxviii Domino Designer Programming Guide .lotus.

Domino Designer Provides reference information on the Programming Guide LotusScript classes. and TCP/IP. server connections. mail. which provide access to databases and other Domino structures. and the @commands. Describes how to set up. Novell SPX (NetWare). Domino Designer Programming Guide Volume 1: Formula Language Introduces programming in Domino Designer and describes the formula language. manage. Volumes 1 and 2 Administering Domino Clusters Managing Domino Databases Documentation for Domino Designer The following table shows the printed books that comprise the Domino Designer documentation set. Preface xxxix . Describes how to troubleshoot system problems. setting up access control lists and replication. and system monitoring. the @functions. and troubleshoot Domino clusters. how to share information with other applications. Also illustrates how to run Notes using multiple network protocols and individual protocols. Banyan VINES. NetBIOS. such as AppleTalk. Administering the Domino System.Configuring the Domino Network Explains how to configure a specific network to work with Domino. and how to customize applications. security. Domino Designer Programming Guide Volume 3: Java Classes Provides reference information on the Java classes. and maintaining databases. Provides information on managing databases. Describes how to set up and manage servers. The information in these books is also found in the Domino 5 Designer Help online database. users. Web servers. billing. including putting databases into production. calendars and scheduling. Application Development with Explains how to create all the design Domino Designer elements used in building Domino applications. replication. NNTP services. which provide access to Volume 2: LotusScript Classes databases and other Domino structures.

Volume 2 Managing Domino Databases Designer Help * not available in print ** print only Application Development with Domino Designer Domino Objects Domino Designer Templates Guide Posters Domino Designer Programming Guide. Provides information on how to set up Domino Connectors. including putting databases into production. Volume 2: LotusScript Classes Domino Designer Programming Guide. and reference material for programming with the LotusScript Extension for Domino Connectors. Volume 1: Formula Language Domino Designer Programming Guide. how to utilize Domino Enterprise Connection Services (DECS) to access enterprise data in real-time. an overview of the LotusScript programming language. Volume 3: Java Classes LotusScript Language Guide Domino Enterprise Integration Guide * xl Domino Designer Programming Guide .LotusScript Language Guide Describes the basic building blocks of LotusScript. Volume 1 Administering the Domino System. Domino Enterprise Integration Guide Managing Domino Databases Notes Help * Step by Step ** Release Notes Administration Help Setting up a Domino Server Moving to Notes and Domino Release 5 Configuring the Domino Network Administering Domino Clusters Administering the Domino System. Provides information on managing databases. how to use the language to create applications. and a comprehensive list of language elements. setting up access control lists and replication. and maintaining databases.

Remote (IIOP) calls access run-time code from a remote Domino server. an applet. Local calls access run-time code on the local machine. which must have Domino installed.6 lotus. Inc. The server tasks HTTP and DIIOP must be running. Compilation must be on a machine with Domino Designer Release 5 installed. it does not contain the new classes. The Release 4.domino package has the same content as the Release 4. Java Classes Coding Guidelines These are guidelines for writing Java programs using the Domino Objects. and other enhancements. See http://java. methods. which is a product of Sun Microsystems. in this case.notes package continues to be supported for backwards compatibility only. This documentation does not cover the Java language. Ensure that the server notes. Note The lotus.diiop Or you can start the tasks later with the load console command.ini file contains the following line: ServerTasks=<any other tasks>. a Domino agent. The program can be coded as an application. or a servlet. methods. Requirements Server requirements Remote calls require access to a Release 5 Domino server. 1591 .notes package plus new classes.Chapter 9 Java Classes The documentation for the Java classes consists of guidelines and an A-to-Z reference.domino package. See “Java Classes A-Z” for a reference. and other enhancements. the local machine need not have Domino installed.sun. Running a Java program You can call into the object interface from a Java program by importing the lotus.6 lotus.http.com/products/jdk.

Strictly.jar if you are not compiling local calls or old calls.jar and Notes. Create new databases.local package for local calls.jar contains the high-level lotus. For example: set CLASSPATH=. Your class code must import the high-level lotus. The console command “tell diiop refresh” forces an immediate refresh. Not access server.domino package and the lotus.notes package.DIIOP Restrictions as desired.domino package: import lotus. and whether anonymous access is allowed. Designer requirements Compilation of a Java program using the lotus. Indicate whether access is permitted by name and password.Server Access.jar Notes. SSL security for CORBA based Domino Object applications/applets builds on the Web Server SSL security.c:\notes\domino\java\NCSO. 1592 Domino Designer Programming Guide.IIOP. A server refreshes its cache of security options approximately every half hour. you do not need NCSO. and Create replica databases as desired.ini file of the Designer machine contains the following line: ALLOW_NOTES_PACKAGE_APPLETS=1 For stand-alone applications.The server document in the Domino Directory (under Server\Servers) must permit and restrict remote calls as desired: Under Internet Protocols . fill in Access server.corba package for remote calls.domino. NCSO.c:\notes\Notes. set up the TCP/IP port for non-encrypted transfers and the SSL port for encrypted transfers.*..jar if you are not compiling remote calls and you do not need Notes. Under Ports . Volume 3: JavaScript Classes .jar.DIIOP.jar contains the high-level lotus.domino. Ensure that the notes.domino. Under Security . specify the number of threads to be allocated for handling remote calls.domino package. include domino\java\NCSO. Fill in Security . the lotus.domino package requires installation of Domino Designer Release 5.Internet Ports . You must first setup the Web server security using the “Domino R5 Certificate Authority” application.jar from the Notes directory in the CLASSPATH environment variable. and the old lotus.

or use the static NotesThread methods sinitThread() and stermThread().Run-time requirements A machine running a Java application that makes local Domino calls must contain Domino Release 5 (Client. See the examples for clarification. If you extend NotesThread. the entry point to the functional code must be public void runNotes(). An applet extends AppletBase and puts its functional code in the methods notesAppletInit(). Listener threads must use the static methods because they cannot inherit from NotesThread. Calling the lotus. Each thread of an application making local calls must initialize a NotesThread object. Chapter 9: Java Classes 1593 . which extends the NotesThread class. You can extend NotesThread. You do not have to distinguish between local and remote access in the main code.jar in the CLASSPATH. An agent extends the AgentBase class. or Server) and must include Notes.jar in the CLASSPATH. but must contain NCSO. This includes AWT threads that access the Domino Objects. See the examples for clarification.domino package: An application or servlet that makes local calls uses the NotesThread class. The class that contains the agent code must be public.jar in the CLASSPATH. If you implement Runnable. An application that makes remote calls does not use the NotesThread class.lang. A machine running a Domino Release 5 agent that makes Domino calls must include Notes. The entry point to the functional code must be public void NotesMain(). the entry point must be public void run().jar and must include NCSO.Thread. implement the Runnable interface. A machine running an applet that makes Domino calls needs no Domino software or CLASSPATH assignments. be sure to call stermThread exactly one time for each call to sinitThread. A machine running a Java application that makes remote Domino calls need not contain Domino Release 5. which extends java. notesAppletStart().domino package The following guidelines apply to Java programs calling into the lotus. If you use the static NotesThread methods. and notesAppletStop(). Designer. AppletBase makes local calls if the applet is running through the Notes client and remote (IIOP) calls if it is running through a browser.

anonymous access must be permitted by the server.getSession(). See the examples for clarification. System.If an applet creates a thread containing Domino calls. The Session class is the root of the Domino back-end object containment hierarchy.exit must not be used to terminate a program using the NotesThread class (and by extension the AgentBase class). System.err output goes to the Java debug console. use the method NotesFactory. In an agent. String pwd) and AppletBase. For locally scheduled agents.err output goes to the Domino log. To enable SSL (Secure Socket Layer). For agents.createSession(String host. 1594 Domino Designer Programming Guide.openSession(String user.stermThread for termination.openSession(String user. System. String pwd) must be a user name and Internet password in the Domino Directory on the server being accessed. String pwd) and specify “-ORBEnableSSLSecurity” for args(0).createSession() to create a Session object. This method works for output to Notes clients as well.createSession(String host.createSession(String host.out and System. If a name and password are not specified. String pwd) and AppletBase.io. Thread creation includes handling AWT events. For applications making remote calls. The user and pwd parameters of NotesFactory. String args[]. use NotesFactory. Use NotesThread. the thread code must use NotesThread for local Domino calls but not remote (IIOP) calls. See the examples for clarification.PrintWriter object with the getAgentOutput() method of AgentBase. you must assign a java. use the method NotesFactory. See the examples for clarification. For applications making local calls. Volume 3: JavaScript Classes .exit throws SecurityException.closeSession(Session session). String user. For applets. and write using the println method of the PrintWriter object. String user. For output to Web browsers from agents (but not applets). String pwd).openSession() or AppletBase.exit may cause corruption problems. System. Use AppletBase.out and System. String user. use the method AgentBase. use the method AppletBase. System. In an application.isLocal() to determine the environment. For foreground agents.sinitThread for initialization and NotesThread.createSession(String host) or NotesFactory.

NewsLetter represents a summary document that contains information from. links. views. RichTextTab represents rich text tab attributes. Agent represents the attributes of an agent. Log represents actions and errors that occur during execution of a script. or links to. Registration represents the creation or administration of an ID file. public use: ACL represents a collection of all the access control list entries for a database.Using the lotus. Item represents an item of data in a document. International represents the international settings in the operating system. and file attachments.domino classes The lotus. AgentContext represents the context of the current agent if the program is running as an agent. OutlineEntry represents an entry in an outline. DocumentCollection represents a collection of documents. RichTextParagraphStyle represents rich text paragraph style attributes. DbDirectory represents the database files on a server or the local machine.domino classes are for direct. and other back-end objects. several other documents. DateRange represents a range of dates and times.domino classes allow you to access named databases. The following lotus. Outline represents an outline. Chapter 9: Java Classes 1595 . RichTextItem represents items that contain rich text. EmbeddedObject represents embedded objects. Database represents a Domino database. DateTime represents a Domino date-time. Form represents a form in a database. RichTextStyle represents rich text style attributes. Document represents a document in a database. documents. ACLEntry represents a single entry in an access control list. Name represents a user or server name. Replication represents the replication attributes of a Domino database.

ViewColumn represents a column of a view. } } } 2.out.domino. } public void runNotes() { try { Session s = NotesFactory. } catch (Exception e) { e. Volume 3: JavaScript Classes .Session represents the context of the current program.start(). This is an application that makes local calls and implements the Runnable interface: import lotus.createSession(). View represents a view or folder in a database. public class platform1 extends NotesThread { public static void main(String argv[]) { platform1 t = new platform1(). ViewNavigator represents a view navigator.*. ViewEntryCollection represents a collection of view entries.domino. 1. String p = s. Examples: Running a Java program The following examples demonstrate the minimal code needed for a Java program that uses the Domino classes. This is an application that makes local calls and extends the NotesThread class: import lotus.getPlatform(). public class platform2 implements Runnable { public static void main(String argv[]) { 1596 Domino Designer Programming Guide. This class is the root of the Domino database objects. Also shown are several servlet configuration files. The examples instantiate a Session object and print the String output of its getPlatform method (Platform property).printStackTrace().*. System. t. ViewEntry represents an entry in a view.println("Platform = " + p).

platform2 t = new platform2(). nt.println("Platform = " + p). } public void run() { try { Session s = NotesFactory. } finally { NotesThread.createSession().createSession().out. public class platform3 { public static void main(String argv[]) { try { NotesThread.start(). String p = s. String p = s. } } } 3. Session s = NotesFactory.domino. } catch (Exception e) { e.getPlatform().stermThread(). This is an application that makes local calls and uses the static NotesThread methods: import lotus. NotesThread nt = new NotesThread((Runnable)t). } catch(Exception e) { e. System. System.out.printStackTrace().*.printStackTrace().println("Platform = " + p).getPlatform(). } } } Chapter 9: Java Classes 1597 .sinitThread().

io. This is an agent program where the code is imported into Domino Designer: import lotus. The UI generates everything in the example except the two lines following // (Your code goes here). import lotus.PrintWriter.printStackTrace().println("Platform =" + p). public class platform5 extends AgentBase { public void NotesMain() { try 1598 Domino Designer Programming Guide. // (Your code goes here) String p = session.domino.domino. This is an agent program with print output that can be seen by a browser: import lotus. This is an agent program where the code is entered through the Domino Designer UI. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext().*.*. } } } 5.println("Platform = " + p). System.out. System. import java.4. } } } 6. Volume 3: JavaScript Classes . String p = s.printStackTrace().getPlatform(). AgentContext agentContext = session. public class platform4 extends AgentBase { public void NotesMain() { try { Session s = getSession().getPlatform().*. } catch(Exception e) { e.out.domino. } catch (Exception e) { e.

pwd="". } platform6 t = new platform3(argv).start().{ Session s = getSession().println("Platform = " + p).domino. } catch (Exception e) { e.length >= 2) user = argv[1]. String p = s.out. } } } 7. nt. System.println("Platform = " + p). pwd).getPlatform(). Chapter 9: Java Classes 1599 . import lotus. } public platform6(String argv[]) { host = argv[0]. PrintWriter pw = getAgentOutput(). This example demonstrates an application that makes remote (IIOP) calls. user="". String p = s. return. if(argv. If a user name and password is not supplied. if(argv. the server must allow anonymous access. The example requires the user to enter the name of the host Domino server and optionally a user name and password. pw.out.length<1) { System.getPlatform(). Thread nt = new Thread((Runnable)t). user. public class platform6 implements Runnable { String host=null.println( "Need to supply Domino server name").*.printStackTrace().length >= 3) pwd = argv[2].createSession( host. } public void run() { try { Session s = NotesFactory. public static void main(String argv[]) { if(argv.

createSession( host. add(ta). the Java classpath must be setup so that the class “TrustedCerts.TextArea ta. import lotus. ta. remotely otherwise. With: String args = new String[1].printStackTrace(). This class file is generated every time the diiop server starts and contains the server’s certificate.0. public void notesAppletInit() { setLayout(null).100).setEditable(false). user. try { // Can also do openSession(user.awt. } } } 8.setBounds(0. pwd).*. setSize(100. To enable SSL in the previous application example. setVisible(true). pwd) 1600 Domino Designer Programming Guide. AppletBase makes the calls locally if possible. you should also enable the attribute “Applet uses CORBA SSL Security” in the “Java Applet Properties” dialog.TextArea(). user. In order to enable SSL for an applet.class” is found. It is normally found in the server’s data directory\domino\java. 9.98). ta = new java. ta.} catch (Exception e) { e. public class platformApplet extends AppletBase { java. This example demonstrates an applet that makes Domino calls. In addition.awt. Session s = NotesFactory. replace: Session s = NotesFactory. } public void notesAppletStart() { Session s.createSession( host. args.98. Volume 3: JavaScript Classes . args[0] = "-ORBEnableSSLSecurity". pwd).domino.

awt.closeSession(s). add(b2).30).Applet.printStackTrace(). warn user ta.TextArea(15. public class commonUserNameApplet extends AppletBase { private Button b2.TextArea ta.awt.getScreenSize().*. b2.openSession().awt. ta. } } ) 10. public Session s.applet.getPlatform(). public void notesAppletInit() { g1 = getGraphics().*.s = this. import java. public java. This code must initialize and terminate a Domino session if the code is running locally. int j = 0. dScreen = this.requestFocus().getToolkit(). This example demonstrates an applet that makes Domino calls in code that responds to an event. private String text = "". add(ta). } String p = s.append("Platform = " + p).domino. import lotus. } catch(Exception e) { e. } finally { this. } Chapter 9: Java Classes 1601 . k = 0. b2 = new Button("b2 Java Notes Classes"). Dimension dScreen. import java. if (s == null) { //not able to make the connection.append("Unable to create a session with the server"). and must not if the code is running remotely (IIOP). ta = new java. Graphics g1. return.

ta. Volume 3: JavaScript Classes .append(text + "\n"). text = "User " + s. } return true.id + " " + e.id + " " + e.sinitThread(). } ta.getSession().getCommonUserName()+ "\n"). } catch(NotesException e) { text = e.0). } public void notesAppletStart() { try { s = this. 1602 Domino Designer Programming Guide. if(e.target instanceof Button) { text = "". } } public boolean action(Event e.equals(b2)) { this.move(0. } catch(NotesException e) { text = e. 0).move(200.text.append("User " + s.printStackTrace().target. } // Java Notes Classes public void b2Test() { try { if (isNotesLocal() == true) NotesThread.getCommonUserName().b2Test(). ta. } catch(Exception e) { e.text.public void paint(Graphics g) { b2. Object o) { if(e.

getCreated returns a DateTime object representing the date and time the database was created. See Examining and adjusting an access control list. and properties. getAgents (database must be open) returns a java. getCategories returns a String value containing the categories in the database. forms. setCategories (database must be open) sets the database categories to a String value. See Collecting all documents and unprocessed documents. documents.stermThread().} catch(Exception e) { e. } } } // end of Applet Accessing databases The Database class represents a Domino database and provides access to the constituent views. getAllDocuments (database must be open) returns a DocumentCollection object representing all the documents in the database. } finally { if (isNotesLocal() == true) NotesThread. access control list. removing. Chapter 9: Java Classes 1603 . Accessing database properties Locating a database on a server or the local directory Opening a database Creating.Vector of Agent objects representing all the agents in the database.util.printStackTrace(). compacting. and replicating a database Examining and adjusting an access control list Accessing a form Accessing an outline Accessing database properties The following methods access the Database properties: getACL returns an ACL object representing the access control list of the database. See Accessing agents.

See Accessing a form. See Examining and adjusting an access control list. valid only through getAddressBooks in Session. getParent returns a Session object representing the current Domino session.util. valid only through getAddressBooks in Session. getPercentUsed (database must be open to get the correct value) returns a double value that contains the percent of the total size of a database that is occupied by real data. if any. isFTIndexed returns true if the database is full-text indexed. getForms returns a java. getLastFTIndexed (database must be open) returns a DateTime object representing the date and time the full-text index. 1604 Domino Designer Programming Guide. getFilePath returns a String value containing the database file path. getDesignTemplateName returns a String value containing the name of the design template. getFolderRefsEnabled returns true if this database maintains folder references.util.getCurrentAccessLevel returns an integer containing the user’s access level to the database.Vector of Form objects representing the forms in the database. getLastModified (database must be open) returns a DateTime object representing the date and time the database was last modified. Volume 3: JavaScript Classes . if any. getMaxSize returns a long value containing the maximum size of the database. was last modified.Vector of String values that contain the names of users that have Manager access to the database. isOpen returns true if the database is open. isMultiDbSearch returns true if the search index is multi-database. getReplicaID returns a String value containing the database replica ID in hexadecimal. getManagers returns a java. isPrivateAddressBook returns true if the database is a Personal Address Book. in kilobytes. getFileName returns a String value containing the database file name. isDelayUpdates returns true if server updates are delayed (batched) for better performance. isPublicAddressBook returns true if the database is a Domino Directory. setDelayUpdates (database must be open) batches updates if set to true.

Unlike NeverReplicate. setHideDesign hides a database design. isDoNotCatalog returns true if a database is not listed in the database catalog (catalog. getCutoffInterval returns a long value containing the number of days after which documents are automatically deleted. getCutoffDate returns an int value containing today’s date minus the cutoff interval. Each Database object has exactly one Replication object. setSizeQuota (the database must be open) sets the database size quota to an int value. See below. setDisabled disables replication. Chapter 9: Java Classes 1605 . isDoNotBrowse returns true if a database is not shown in the “Open Database” dialog box. getSize (the database must be open) returns a double value containing the database size. getSizeQuota returns an int value containing the database size quota. getServer returns a String value containing the name of the server on which the database resides. setDoNotBrowse prevents a database from being shown in the “Open Database” dialog box. or null for the local directory. See Locating a view or folder.util. getTitle returns a String value containing the database title. isCutoffDelete returns true if documents older than the cutoff date are deleted. setCutoffDelete deletes documents older than the cutoff date. this property is accessible through the UI. isDisabled returns true if replication is disabled.nsf). in bytes. isHideDesign returns true if a database design is hidden. setCutoffInterval sets the cutoff interval. The following methods access the Replication properties: getAbstract returns true if large documents are truncated and attachments removed.getReplication returns a Replication object representing the replication information for this database. getViews returns a java. You must be an administrator to use setSizeQuota. setDoNotCatalog prevents a database from being listed in the database catalog. getTemplateName returns a String value containing the template name of the database if it is a template. setAbstract truncates large documents and removes attachments if set to true. if any.Vector of View objects representing the named views in the database. setTitle (database must be open) sets the title.

You can reset the current property values back to the last saved values. Volume 3: JavaScript Classes .createSession(). public class accessing extends NotesThread { public static void main(String argv[]) { accessing t = new accessing().util. If you set replication properties. isNeverReplicate returns true if replication is disabled. setIgnoreDestDeletes prevents replication of deletions to destination databases. t.DATABASE).getFirstDatabase(Dir. setNeverReplicate disables replication. You can clear the replication history with clearHistory. setMultiDbIndex includes a database in multi-database indexing. DbDirectory Dir = s. System. setIgnoreDeletes prevents replication of deletions.start(). } public void runNotes() { try { Session s = NotesFactory. isIgnoreDestDeletes returns true if deletions are not replicated to destination databases.println ("Title:\t\t\t" + db. Database db = Dir. setPriority sets the replication priority.out.println ("DATABASE NOT OPEN"). isMultiDbIndex returns true if a database can be included in multi-database indexing. isNoChronos returns true if background agents are disabled. getPriority returns an int value containing the replication priority.isIgnoreDeletes returns true if deletions are not replicated. setNoChronos disables background agents. Unlike Disabled.getDbDirectory(null).*. // Database does not have to be open System.getTitle()). this property is not accessible through the UI. import java. import lotus.out. 1606 Domino Designer Programming Guide.Vector. Example: Accessing database properties This application gets the first database in the local directory and prints its database properties.domino. The example demonstrates which properties require that the database be open. you must save them to make them permanent.

println ("IsFTIndexed:\t\t" + db. System.out.out.getTitle() + " Redux"). else db.println ("FilePath:\t\t\t" + db.isOpen()). db.println ("Server:\t\t\t" + db.out. System.println ("ReplicaID:\t\t" + db.setCategories("Example databases"). System.getReplicationInfo().println ("Categories:\t\t" + db.println ("SizeQuota:\t\t" + db.getCategories()). System. System. to set properties db.getReplicaID()).getFilePath())..System.setTitle(db.println ("DesignTemplateName:\t" + db.out. // Database must be open .getPlatform()).println ("Replication Disabled:\t" + db.println ("Parent platform:\t\t" + ps.out.getSizeQuota()).getFileName()).Example databases").out. if (db. System.isPublicAddressBook())..println("DATABASE OPEN")..out.getServer()). System.open().out.out. System.println ("IsPrivateAddressBook:\t" + db. Session ps = db.getTemplateName()).isFTIndexed())..out.println ("IsPublicAddressBook:\t" + db. System.setDelayUpdates(true).getParent(). System.setCategories(db. System.println ("FileName:\t\t" + db. db. System.println ("Categories set to:\t\t" + db.isDisabled()).out.out.getCategories() + ".out. System.getDesignTemplateName()). System.out.out.getCategories() == null) db. // .out.out.out.println ("TemplateName:\t\t" + db. Chapter 9: Java Classes 1607 .isDelayUpdates()).getCategories()).println ("DelayUpdates:\t\t" + db. System.println ("IsOpen:\t\t\t" + db.isPrivateAddressBook()). System.println ("Title set to:\t\t" + db. System.getTitle()).

System. } catch (Exception e) { e.println ("ACL UniformAccess:\t" + acl.print("[" + (String)managers. System.getSize() + " bytes").getLastModified().out.printStackTrace().out.size().getACL().isMultiDbSearch()). System.out.println ("IsMultiDbSearch:\t\t" + db.elementAt(i) + "] ").println ("SizeQuota set to:\t\t" + db. System.print("Managers:\t\t"). // .getName() + "]").out.out.println().setSizeQuota(20000000).out.getFolderReferencesEnabled()). Vector views = db.isUniformAccess()).getPercentUsed()). i<managers.getLocalTime()).out.getSizeQuota()).getViews().println ("FolderReferencessEnabled:\t" + db.out.out. System.print("[" + ((View)views. System.println ("LastFTIndexed:\t\t" + db. i<views.out.getCreated(). Vector managers = db.out.. System.getLocalTime()).out.println ("PercentUsed:\t\t" + db. } } } 1608 Domino Designer Programming Guide. System. System.println ("Size:\t\t\t" + (int)db.out. and to get these properties System.getLastFTIndexed(). for (int i=0.println ("DelayUpdates set to:\t" + db.getManagers(). System.System. System. ACL acl = db.out. System. i++) System. for (int i=0.size().getCurrentAccessLevel()).println ("Created:\t\t\t" + db.println ("CurrentAccessLevel:\t" + db. Volume 3: JavaScript Classes .out.print("Views:\t\t\t").out. db..println().getLocalTime()). System.elementAt(i)).println ("LastModified:\t\t" + db. i++) System.isDelayUpdates()).out.

out.getDbDirectory(null)." + title).getTitle().Locating a database on a server or the local directory The DbDirectory class provides a means to locate databases on servers and the local directory. System.println(fn.out. if (server == null) server = "Local".out.getAgentContext()." + title). String title = db.*.getTitle().getFirstDatabase(DbDirectory.getFileName(). See isOpen for details. You can access a subset of the Database methods on the closed database. db = dir. The Database object returned by getFirstDatabase and getNextDatabase is not open. db = dir.getFileName(). // (Your code goes here) DbDirectory dir = session.getNextDatabase(). db = dir. System. } Chapter 9: Java Classes 1609 .DATABASE).toUpperCase() + " .println("***DATABASES***\n"). String server = dir.getName().println("\n***TEMPLATES***\n"). The Parent property returns a Session object representing the current session.toUpperCase() + " . while (db != null) { String fn = db. specify its name as the argument to the getDbDirectory method of Session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } System. Example: Locating a database on a server or the local directory This agent prints the file name and title of each database and template in the local directory. The getFirstDatabase and getNextDatabase methods of DbDirectory return handles to Database objects. System.println ("Database directory list on server"+ server + "\n"). System. To access a particular server.out. AgentContext agentContext = session. The Name property contains the name of the server or workstation. while (db != null) { String fn = db.getNextDatabase(). import lotus. Database db = dir. You must explicitly call the open method of Database to open the database to access all methods.domino. String title = db.getFirstDatabase(DbDirectory.TEMPLATE).out.println(fn.

The user supplies the database file name. with getFirstDatabase. For remote sessions only. } } } Opening a database Use the getDatabase method of Session or the openDatabase method of DbDirectory to open a specified database. You can access a subset of the Database methods on a closed database.*. openMailDatabase of DbDirectory opens the user’s mail database. The AddressBooks property of Session accesses the Domino Directories and Personal Address Books available to the current session. or Agent object that a URL addresses. getNextDatabase. Form. as the agent comment.printStackTrace(). This agent opens a local database and prints its title. or getAddressBooks. Databases can be accessed through the Parent or ParentDatabase property of objects that the database contains. for example. Use the CurrentDatabase property of AgentContext to open the current database. The isPrivateAddressBook and isPublicAddressBook properties of Database distinguish between Domino Directories and Private Address Books. Examples: Opening a database 1. Volume 3: JavaScript Classes .domino. import lotus. See isOpen for details. the resolve method of Session returns the Database. Document. but must explicitly open the database to access all methods. You can obtain the replica ID from a database that is already open with the ReplicaID property of Database.} catch(Exception e) { e. which does not need the . View. openIfModified of DbDirectory opens a database only if it was modified after a specified date.nsf extension. if your program is an agent. Use: openByReplicaID of DbDirectory to open a database whose server and replica ID are known. Use the open method of Database to open a database whose object you set. getURLDatabase of Session opens the default Web Navigator database. public class JavaAgent extends AgentBase { public void NotesMain() { 1610 Domino Designer Programming Guide.

println( "Database open failed").out.getTitle()).try { Session session = getSession().text).getAgentContext(). } } catch(Exception e) { e.*.out.NOTES_MIN_ERROR_CODE == NotesError. if (db.id + " " + e.openDatabase(agent.out.NOTES_ERR_NOTAFILE) System. else { System. } } } 2.getTitle()).out. AgentContext agentContext = session. AgentContext agentContext = session. Database db = dir. // (Your code goes here) Database db = agentContext.printStackTrace(). } catch(NotesException e) { if (e. e. System. System. DbDirectory dir = session.id + NotesError.println("Database is " + msg). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase().getDbDirectory(null). String msg = "closed". import lotus. System.domino.println ("Title:\t\t" + db. if (db == null) System.out.isOpen()) msg = "open".out.println("No such database").println("Title:\t\t" + db.getAgentContext(). else System. } } } Chapter 9: Java Classes 1611 . } catch(Exception e) { e.println(e.getFileName()). // (Your code goes here) Agent agent = agentContext.println ("File name:\t" + db. This agent opens the current database.printStackTrace().getCurrentAgent().out.getComment()).printStackTrace().

open(). j<=dc. import lotus.out.getCurrentAgent().getDbDirectory(null).isOpen()) System.*.println("Is open").out.getAgentContext().getNthDocument(j). Database db = dir. AgentContext agentContext = session.getDbDirectory(null). This agent shows that the database returned by getFirstDatabase is closed until opened with the open method.println("Is closed").open(). for (int j=1. } 1612 Domino Designer Programming Guide.printStackTrace().DATABASE). // (Your code goes here) DbDirectory dir = session.getTitle().DATABASE). else System.*. Volume 3: JavaScript Classes .getTitle() != null) if (db. This agent traverses the local databases and opens the database whose title is specified as the agent comment. Database db = dir.domino. AgentContext agentContext = session. import lotus. if (db. DbDirectory dir = session.isOpen()) System.out. db.out.println("Is open").3. while (db != null) { if (db. } } } 4. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.getCount(). System. } catch(Exception e) { e.println (doc. j++) { Document doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getFirstDatabase( DbDirectory. if (db. DocumentCollection dc = db.getComment())) { db.getAgentContext().println("Is closed").getFirstDatabase( DbDirectory.getItemValueString("Subject")).equalsIgnoreCase( agent. else System.getAllDocuments(). // (Your code goes here) Agent agent = agentContext.domino.

domino. System.printStackTrace(). Chapter 9: Java Classes 1613 .getAgentContext().*. System. AgentContext agentContext = session.printStackTrace(). // (Your code goes here) DbDirectory dir = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). if (db. AgentContext agentContext = session. Database dbRemote = dir.getTitle()).out. import lotus. } } } 5. Database dbLocal = agentContext. } } } 6. // (Your code goes here) DbDirectory dir = session.break. String msg = "closed".isOpen()) msg = "open".out.getNextDatabase(). This agent opens the user’s mail database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getReplicaID()).getCurrentDatabase(). import lotus.out.getDbDirectory( "NotesUA1"). } catch(Exception e) { e.openDatabaseByReplicaID (dbLocal.*. This agent opens the database on the server NotesUA1 whose replica ID is the same as the current database.getAgentContext().getFileName()). } } catch(Exception e) { e. System.openMailDatabase().println("Database is " + msg).println("File name:\t" + db.domino.getDbDirectory(null). Database db = dir.println ("Title:\t\t" + dbRemote. } db = dir.

if (dbRemote.getServer()). AgentContext agentContext = session. The replica must be initialized either by you with the replicate method or by the user accessing it from the workspace upon first use. This database has the design and documents of the template and can be accessed from the workspace. 1614 Domino Designer Programming Guide.printStackTrace(). Examples: Creating.println ("File path:\t\t" + dbRemote.*.createCopy creates a copy of the design of an existing database. compacting. removing.isOpen()) msg = "open". and replicating a database 1. but a user cannot access it through the user interface because it has no forms or views. This agent creates a local database named salesdisc.createDatabase creates an uninitialized database. This database is useful for storing data programmatically but cannot be used through the workspace. Database.getFilePath()).println ("Server:\t\t" + dbRemote. String msg = "closed".out. compacting. import lotus. } } } Creating. and replicating a database Use one of the following methods to create a database.nsf. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System. Database.replicate replicates a database. A program can access it.remove removes (deletes) a database.createReplica creates an uninitialized replica of an existing database. The database is not initialized.out. System.println("Database is " + msg). Database.createFromTemplate creates an initialized database based on an existing template. removing. } catch(Exception e) { e.getAgentContext().compact compacts a database.domino.out. Volume 3: JavaScript Classes .System. Database. The following methods are available for an existing database: Database. DbDirectory. Database.

Database db = basedb. // (Your code goes here) DbDirectory dir = session.setTitle("Sales Discussion Database").*.domino.printStackTrace(). The third argument to createFromTemplate is for inheriting design changes.domino.getAgentContext().openDatabase("salesdisc"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().openDatabase( "discsw50. "salesdisc"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } catch(Exception e) { e. } } } 3. This agent creates a local replica of a database on a server and initializes it.createDatabase("salesdisc").ntf"). AgentContext agentContext = session.createReplica(null. db. } catch(Exception e) { e. import lotus.getDbDirectory(null). import lotus.// (Your code goes here) DbDirectory dir = session. "salesdisc". true).getDbDirectory(null).*. Database basedb = dir.nsf based on a template and changes the title. // (Your code goes here) DbDirectory dir = session. Database db = template.replicate("market")) System. Chapter 9: Java Classes 1615 . if (db. This agent creates a local database named salesdisc. Database template = dir. Database db = dir.createFromTemplate (null.out.printStackTrace().getDbDirectory("market"). AgentContext agentContext = session.getAgentContext().println("Replication OK"). } } } 2.

This agent creates a copy of names. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). "namescpy"). getFirstEntry. Database db = basedb.printStackTrace(). } catch(Exception e) { e.println("Replication errors"). import lotus. a Roles property (getRoles method) and addRole.printStackTrace().getDbDirectory(null). db. a CurrentAccessLevel property (getCurrentAccessLevel) for determining the current user’s access level. } catch(Exception e) { e. removing.openDatabase("names"). and queryAccess methods for creating.nsf in the local directory.nsf"). } } } Examining and adjusting an access control list You examine and adjust the access control list (ACL) of a database through the following classes: Database contains an ACL property (getACL method) for accessing an ACL object. and checking ACL entries.getAgentContext().out.setTitle("Copy of names. // (Your code goes here) DbDirectory dir = session. grantAccess. Volume 3: JavaScript Classes . a createACLEntry method for creating ACL entries and a removeACLEntry method for removing ACL entries. and renameRole methods for accessing roles. and getNextEntry methods for accessing ACL entries. an InternetLevel property (getInternetLevel and setInternetLevel methods) to examine and adjust the maximum internet 1616 Domino Designer Programming Guide. deleteRole.*. } } } 4.domino. AgentContext agentContext = session. Database basedb = dir. ACL contains getEntry. revokeAccess. and a Managers property for getting the names of users with Manager access.else System. a Parent property (getParent method).createCopy(null.

Chapter 9: Java Classes 1617 . a remove method for removing an entry. IsCanCreateLSOrJavaAgent (isCanCreateLSOrJavaAgent and setCanCreateLSOrJavaAgent methods).LEVEL_READER ACL. IsGroup (isGroup and setGroup methods). a Roles property (getRoles method) and isRoleEnabled. a consistent ACL across all replicas of a database.LEVEL_DEPOSITOR ACL. IsCanCreatePersonalFolder (isCanCreatePersonalFolder and setCanCreatePersonalFolder methods). ACLEntry contains IsAdminReaderAuthor (isAdminReaderAuthor and setAdminReaderAuthor methods). IsCanCreatePersonalAgent (isCanCreatePersonalAgent and setCanCreatePersonalAgent methods). IsServer (isServer and setServer methods).LEVEL_DESIGNER ACL.LEVEL_NOACCESS ACL. IsAdminServer (isAdminServer and setAdminServer methods). Level. IsCanCreateDocuments (isCanCreateDocuments and setCanCreateDocuments methods). IsPerson (isPerson and setPerson methods). and UserType (getUserType and setUserType methods) properties for examining and adjusting an ACL entry. or not enforce. Name (getName and setName methods). “Def yes” means that the permission is true by default at that access level and can be adjusted. and a UniformAccess property (isUniformAccess and setUniformAccess methods) to enforce. enableRole. and disableRole methods for associating ACL entries with roles. and IsPublicReader (isPublicReader and setPublicReader methods) and IsPublicWriter (isPublicWriter and setPublicWriter methods) properties for becoming public readers and writers. “Always” means the permission is always true at that access level. “Def no” means that the permission is false by default at that access level and can be adjusted. IsCanDeleteDocuments(isCanDeleteDocuments and setCanDeleteDocuments methods). The access levels used by the Level and InternetLevel properties are as follows: ACL. NameObject (getNameObject method). “never” means the permission is never true at that access level.LEVEL_MANAGER The permissions properties apply to the access levels as shown in the following table.LEVEL_EDITOR ACL. IsCanCreateSharedlFolder (isCanCreateSharedFolder and setCanCreateSharedFolder methods).level.LEVEL_AUTHOR ACL. Parent (getParent method).

Otherwise.out. } while ((entry = acl.println("Uniform access is not in effect").Manager CanCreateDocuments CanCreateLSOrJava CanCreatePersonalAgent CanCreatePersonalFolder CanCreateSharedFolder CanDeleteDocuments PublicReader PublicWriter Always Always Always Always Always Def yes Always Always Designer Always Def no Always Always Always Def yes Always Always Editor Always Def no Def no Def no Def no Def yes Always Always Author Def yes Def no Def no Def no Never Def yes Always Def no Reader Never Def no Def no Def no Never Never Always Def no Depositor Always Never Never Never Never Never Def no Def no No access Never Never Never Never Never Never Def no Def no You must use the save method of ACL to write to permanent storage changes you make to the ACL and ACL entries.*.getFirstEntry(). ACL acl = db.isUniformAccess()) System.out. ACLEntry entry = acl.println("Names of ACL entries:").println("Uniform access is in effect").out. then accesses each entry in the ACL of the current database and displays its name. Volume 3: JavaScript Classes .getAgentContext(). } } } 1618 Domino Designer Programming Guide. // (Your code goes here) Database db = agentContext. do { System.out.getACL().getCurrentDatabase(). the changes are lost when your program exits.printStackTrace().getNextEntry(entry)) != null).getName()). AgentContext agentContext = session. } catch(Exception e) { e.domino. import lotus.println(" " + entry. Example: Examining and adjusting an access control list This agent displays whether uniform access is enforced. else System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). if (acl. System.

Vector of String values. setFormUsers sets the $FormUsers field to a java. getReaders returns a java.util.Vector of String values. setProtectReaders protects $Readers items from being overwritten when set to true. isSubform returns true if the form is a subform.util.Accessing a form You can access existing forms in a database as follows: The Forms property of Database returns an array of Form objects. getParent returns a Database object representing the database containing the form.util. You can remove an existing form from the database with the remove method of Form.Vector of String values containing the names of all the fields on the form.Vector of String values containing the $FormUsers field. setReaders sets the $Readers field to a java. The Form class provides access to properties through the following methods: getAliases returns a java.Vector of String values containing the $Readers field. getFields returns a java. setProtectUsers protects $FormUsers items from being overwritten when set to true. isProtectUsers returns true if $FormUsers items are protected from being overwritten. The getForm method of Database returns a named Form object.Vector of String values containing the aliases of the form. getFormUsers returns a java.util.util.util. getName returns a String value containing the name of the form. isProtectReaders returns true if $Readers items are protected from being overwritten. Chapter 9: Java Classes 1619 .

1620 Domino Designer Programming Guide. getLevel returns an int value containing the level of the entry. isInThisDB returns true if entry refers to an element in the current database. getType returns an int constant containing the type of entry. getLast.Accessing an outline You can access and create outlines in a database as follows: getOutline in Database returns an Outline object representing an existing outline. getNamedElement returns a String value containing the name for a named element outline entry. createEntry. setFrameText sets the value. getLabel returns a String value containing the entry label. The Outline class provides getName as a property. getDocument returns a Database object representing the link for a database outline entry. getEntryClass returns an int constant containing the class of entry. and getPrevSibling methods return OutlineEntry objects that represent entries in the outline. You must save an outline after manipulating an entry. getDatabase returns a Database object representing the link for a database outline entry. getFrameText returns a String value containing the name of the entry’s frame. Volume 3: JavaScript Classes . The addEntry. and removeEntry methods manipulate entries in the outline. hasChildren returns true if the entry has child entries. getNext. createOutline in Database returns an Outline object representing a newly created outline. getImagesText returns a String value containing the name of the entry’s frame. isHidden returns true if the entry is hidden. getFormula returns a String value containing the formula of an action outline entry. setImagesText sets the value. moveEntry. The OutlineEntry class provides access to properties through the following methods: getAlias returns a String value containing the programming name of all the outline. getNextSibling. isPrivate returns true if an entry is specific to an individual. getPrev. setLabel sets the value. The getFirst.

document. You can set class and type attributes with the following methods: setAction specifies the formula for an outline entry. You access views and folders through getView and getViews in Database and getParentView in Document. Accessing views and folders The View class lets you locate documents within views and folders. setNoteLink sets the link for a database. Accessing view properties Locating a view Accessing view columns Working with view entries and navigators Removing a view Accessing view properties The following methods access the View properties: getAliases returns a vector of String values containing the aliases of the view or folder. or view outline entry. setURL specifies the URL for an outline entry.getURL returns a String value containing the formula of an action outline entry. getAllEntries returns a ViewEntryCollection object representing all the document entries in the view or folder. and perform operations on views and folders. setNamedElement specifies the database and named element for an outline entry. getColumnCount returns an int value containing the number of columns in the view or folder. getBackgroundColor returns an int value containing a color code for the background color of the view or folder. or null if there are no aliases. getColumnNames returns a vector of String values containing the names of the columns in the view or folder. Chapter 9: Java Classes 1621 . Operations that apply to views apply to folders unless explicitly prohibited. getView returns a View object representing the for link for a view outline entry.

getReaders returns a vector of String values containing the contents of the $Readers field for the view or folder. isAutoUpdate returns true if the front-end view is updated each time a change occurs in the back-end and false if the updates occur when the program ends. setProtectReaders protects the $Readers field or not. getHeaderLines returns an int value containing the number of lines in the header of the view or folder. or null. getTopLevelEntryCount returns an int value containing the number of top-level entries in a view.getColumns returns a vector of ViewColumn objects representing the columns in the view or folder. getUniversalID returns a String value containing the universal ID of the view or folder. isCalendar returns true if this is a calendar view. isCategorized returns true if the view or folder is categorized. getName returns a String value containing the name of the view or folder. isConflict returns true if a calendar view is enabled for conflict checking. isProtectReaders returns true if the $Readers field is protected from being overwritten during replication. 1622 Domino Designer Programming Guide. setReaders sets the value of the $Readers field. getParent returns a Database object representing the database containing the view or folder. getSpacing returns an int value containing a code for the spacing between rows. isModified returns true if the view is modified. isHierarchical returns true if a view or folder shows response documents in a hierarchy. Volume 3: JavaScript Classes . getLastModified returns a DateTime object representing the modification date and time of the view or folder. setAutoUpdate causes updates to occur automatically or not. isDefaultView returns true if this is the default view. getCreated returns a DateTime object representing the creation date and time of the view or folder. isFolder returns true if this is a folder. getRowLines returns an int value containing the number of lines in each row.

j<aliases.getColumnCount() + " columns in \"" + view. import lotus.size(). System.getCreated()).Example: Accessing view or folder properties This agent gets the properties of all the views and folders in the current database.elementAt(j).getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.elementAt(i).println ("\tUniversal ID: " + view. for (int i=0. if (columnName. System.Vector. System.out.getTitle() + "\"").trim().getAgentContext(). j<columns.length() == 0) columnName = "No Name". for (int j=0. ViewColumn column = (ViewColumn)columns. i++) { View view = (View)views.*. j++) { String columnName = ((String)columnNames.getLastModified()).println Chapter 9: Java Classes 1623 . j++) System.elementAt(j) + "\""). import java. System.getParent().out.getUniversalID()).println ("\t[" + columnName + "] has width of " + column.getWidth()). ViewEntryCollection entries = view. System. AgentContext agentContext = session.out.println ("\tNumber of document entries = " + entries.util.println ("\tLast modified: " + view.getAliases().getCount()). System.out. } Vector aliases = view.println ("\tAlias \"" + aliases.out. for (int j=0.getAllEntries(). Vector columnNames = view.getColumnNames(). i<views.out. Vector columns = view.size().getColumns().out.getViews().out.size().println ("\tCreated: " + view. // (Your code goes here) Database db = agentContext.elementAt(j)). Vector views = db.println (view.domino.getName() + " with " + view.

println ("\tHierarchical? " + view. for (int j=0.println ("\tFolder? " + view.isDefaultView()). j++) System. switch (view.getRowLines()).25".println( "\tBackground color is white"). String spacing = null. break. case View.SPACING_ONE_POINT_50 : spacing = "1. System. System.println ("\tRowLines = " + view.COLOR_WHITE : System.out.out.isConflict()). System.isFolder()).println ("\tCategorized? " + view.SPACING_DOUBLE : spacing = "double". Volume 3: JavaScript Classes .("\tDefault view? " + view.getReaders(). System. break. } System.SPACING_SINGLE : spacing = "single".COLOR_BLACK : System.elementAt(j) + "\"").println( "\tBackground color not black or white").out. j<readers.println ("\tCalendar? " + view. default : System. break. case RichTextStyle.isProtectReaders()). Vector readers = view.out. case View.isModified()). case View.out. break.SPACING_ONE_POINT_75 : spacing = "1. switch (view.println( "\tBackground color is black").println ("\tConflict? " + view. break.out.out.println ("\tProtect readers? " + view.out. System.75". System.getBackgroundColor()) { case RichTextStyle.println ("\tReader \"" + readers.println ("\tAuto update? " + view.out.getSpacing()) { case View.size().getHeaderLines()).isAutoUpdate()).out. System.isCalendar()).out.out.5".isCategorized()). break. System.println ("\tModified? " + view. default : spacing = "unknown".println ("\tHeaderLines = " + view.SPACING_ONE_POINT_25 : spacing = "1. break.out.isHierarchical()).out. System. case View. } 1624 Domino Designer Programming Guide.

getCurrentDatabase(). System.out. specify it to getView in Database.out. You can use an alias in place of the name.getCreated()).println Chapter 9: Java Classes 1625 .System. or getParent in ViewEntryCollection. getParentView in ViewNavigator. To locate the view or folder from which a document or view entry is accessed.*. This example finds a view or folder in the current database.out.println ("Last modified:\t" + view. To get all views and folders.domino.getName()).getLastModified()). or to locate a view or folder when the name or an alias is not known.getView(agent. remembering to escape backslashes. View view = db.println ("\tTopLevelEntryCount = " + view. Examples: Locating a view 1.printStackTrace().println ("View name:\t" + view. The view or folder name must be specified exactly. Agent agent = agentContext. } } } Locating a view If the name of the view or folder is known. AgentContext agentContext = session.println ("\tSpacing = " + spacing). use getViews in Database. For example. } } catch(Exception e) { e. including cascades. System.out. as specified by the user in the agent comment.getAgentContext(). System.out. getParent in ViewEntry. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext.println ("Created:\t\t" + view. “Certificates and ID Information\Cross Certificates” must be specified as “Certificates and ID Information\\Cross Certificates” if it is a Java string literal. System.out. import lotus.getCurrentAgent().getTopLevelEntryCount()). use getParentView in Document.getComment()).

This object gives you access to properties through the following methods: getAlignment returns an int value containing the alignment (justification) of data in the column. // (Your code goes here) Database db = agentContext.printStackTrace().Vector. which returns a ViewColumn object.*. } catch(Exception e) { e.getName() + "\""). break.size().("Universal ID:\t" + view. i<views. Vector views = db. 1626 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes . } } } Accessing view columns You can access view or folder columns through getColumns in View.getViews(). getFontColor returns an int value containing the font color of data in the column. getDateFmt returns an int value containing the specific format of date data in the column. import java. This example finds the default view in the current database. } } } catch(Exception e) { e. AgentContext agentContext = session.printStackTrace().getAgentContext(). i++) { View view = (View)views.domino. } } } 2.println ("The default view is \"" + view.out.getUniversalID()).isDefaultView()) { System. for (int i=0.util. if (view. import lotus. getFontFace returns an int value containing the font face of data in the column.getCurrentDatabase().elementAt(i).

getFontStyle returns an int value containing the font style of data in the column. isAccentSensitiveSort if the column is sorted without regard to accent. getListSep returns an int value containing the list (multi-value) separator for values in the column. isCategory returns true if the column is categorized. if the user can click on the column header to resort. Chapter 9: Java Classes 1627 . isField if the column value is based on a field value. isResortAscending returns true if the column can be resorted in ascending order. isSecondaryResort returns true if the column is a secondary resortable column. isIcon returns true if the column value is displayed as an icon. isSortDescending returns true if the sorted column is descending. getFormula returns a String value containing the column formula or null if the column is the value of a field. isHideDetail returns true if the details for a total column are hidden. isResize returns true if the column is resizable. isCaseSensitiveSort if the column is sorted without regard to case.getFontPointSize returns an int value containing the font point size of data in the column. getItemName returns a String value containing the name of the item whose value is in the column or null if the column is a formula. isSecondaryResortDescending returns true if the secondary resort is descending. isResponse returns true if the column contains only response documents. that is. getHeaderAlignment returns an int value containing the alignment (justification) of the header in the column. isFormula returns true if the column value is based on a formula. isSorted returns true if the column is sorted. isResortToView returns true if the column is resortable. isResortDescending returns true if the column can be resorted in descending order. isShowTwistie returns true if the expandable column displays a twistie. isHidden returns true if the column is hidden.

or total. getWidth returns an int value containing the width of the column.getNumberAttrib returns an int value containing the attributes for numeric values in the column. Working with view entries and navigators For navigation and access. document. getTimeDateFmt returns an int value containing the format of time-date data in the column. and view navigators. getPosition returns an int value containing the position of the column in the view. getNumberDigits returns an int value containing the number of decimal places for numeric values in the column. view entry collections. getTimeFmt returns an int value containing the format of time data in a column. The following methods access a ViewEntry object: getChildCount getColumnIndentLevel getColumnValues getDescendantCount getDocument getFTSearchScore getIndentLevel getPosition isCategory isConflict isDocument 1628 Domino Designer Programming Guide. View entries A ViewEntry object represents a row in a view and can be of type category. Volume 3: JavaScript Classes . getParent returns a View object representing the view that contains the column. getTimeZoneFmt returns an int value containing the format of the zone in time-date data in a column. a view or folder supports view entries. getNumberFormat returns an int value containing the format for numeric values in the column. getTitle returns a String value containing the title of the item or null if the column has no title.

getLast. updateAll marks all documents of a view entry collection as processed by an agent. gotoNextDocument. addEntry adds an entry to the collection and deleteEntry deletes an entry from the collection. View navigators A ViewNavigator object provides goto methods to position you at a view entry and get methods to both position you at a view entry and return it. getParent returns the parent View object. removeAll removes all the underlying documents of a view entry collection from the database. Chapter 9: Java Classes 1629 . getPrevCategory. The methods getAllEntries and getAllEntriesByKey in View return ViewEntryCollection objects. stampAll writes to an item in all the documents. FTSearch filters the collection so that only those entries that meet the requirements of a search query remain. getFirstEntry. gotoFirstDocument. getQuery returns the search query if the collection is filtered or is the result of a search. getFirst. getLastDocument. getNextCategory. getEntry. getNextDocument. View entry collections A ViewEntryCollection object represents zero or more ViewEntry objects of type document (excluding entries of type category and total). gotoNext. getCount returns the number of entries in the view entry collection. getFirstDocument. getLastEntry. gotoPrev. gotoFirst. removeAllFromFolder removes all the documents from a folder. getNext. gotoPrevDocument. gotoLastDocument. and getPrevEntry return ViewEntry objects from the collection. and getPrev navigate sequentially. and getPrevDocument navigate sequentially by type of entry. getNextEntry. gotoNextCategory. gotoLast.isTotal isValid getNoteID getParent getSiblingCount getUniversalID The ViewNavigator methods (discussed below) return ViewEntry objects. as does getEntryByKey in View. gotoPrevCategory. putAllInFolder puts all the documents in a folder.

getChild. getCacheSize and setCacheSize specify the cache for remote operations only. getParentView gets the parent View object.domino. This agent gets all the entries in a view of type category.getView("By Category"). getCurrent. entry = nav.createViewNav().println ("\tPosition " + entry. gotoPrevSibling. while (entry != null) { if (entry. createViewNavMaxLevel creates a view navigator for all entries in a view down to a specified level. getNth.println("Categories:").getNext(). createViewNavFrom creates a view navigator for all the entries in a view starting at a specified entry. gotoParent. ViewEntry entry = nav.getDescendantCount() + " descendants").gotoEntry. // (Your code goes here) Database db = agentContext. getNextSibling.isCategory()) System. createViewNavFromCategory creates a view navigator for all the entries in a view under a specified category.out. A navigator is based on the view calling the method. Volume 3: JavaScript Classes . createViewNavFromChildren creates a view navigator for the immediate children of a specified entry. and getParent getMaxLevel and setMaxLevel specify the maximum level of navigation 0-30 (30 by default). The following View methods create ViewNavigator objects. View view = db.getAgentContext(). Examples: Working with view entries and navigators 1. createViewNavFromDescendants creates a view navigator for all the descendants of a specified entry. and getPos navigate to a specified entry.getCurrentDatabase().out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). gotoChild. System.*. gotoPos. getPrevSibling. import lotus. ViewNavigator nav = view.') + " has " + entry.getFirst(). gotoNextSibling. createViewNav creates a view navigator for all the entries in a view.getPosition('. AgentContext agentContext = session. } 1630 Domino Designer Programming Guide.

This agent gets all the entries in a view of type document.out.') + "\t" + entry.*.getAllEntries().getItemValueString("Subject")). entry = vec. View view = db.} catch(Exception e) { e. You gain access to a Document object through methods in the Database. } } } Removing a view The remove method of View removes a view or folder from a database. } } catch(Exception e) { e. ViewEntry entry = vec.printStackTrace(). View. You can: Access document properties Collect all documents and unprocessed documents Chapter 9: Java Classes 1631 . import lotus.println ("\tPosition " + entry. System.getDocument(). } } } 2.println("Documents:"). ViewEntryCollection vec = view. while (entry != null) { System.getAgentContext().getView("By Category"). Accessing documents The Document class lets you examine and manipulate document attributes and contents.getCurrentDatabase(). AgentContext agentContext = session.getPosition('.printStackTrace().getNextEntry(). and DocumentCollection classes. ViewEntry.domino. // (Your code goes here) Database db = agentContext.getFirstEntry().out. See “Accessing views and folders” for accessing documents through views. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

getColumnValues returns an Object vector containing the column values in the parent view. setEncryptionKey sets the keys. isNewNote returns true if the document is created but does not yet exist on disk. 1632 Domino Designer Programming Guide. getEncryptionKeys returns a String vector containing the keys used to encrypt the document. setEncryptOnSend sets the encryption attribute. getFTSearchScore returns an int value containing the relevance value if the document was retrieved from a full-text search. isDeleted returns true if the document is deleted. or an empty vector if the document is not accessed through a view. getFolderReferences returns a String vector containing the universal IDs of the folders that contain the document.Collect documents by searching Locate a document by ID Create a document Remove a document Copy a document Mail a document Accessing document properties You access the document properties through the following methods: getAuthors returns a String vector containing the names of users who have saved the document. isProfile returns true if the document is a profile document. getEmbeddedObjects returns an EmbeddedObject object vector representing the embedded objects in the document (but not file attachments). isResponse returns true if the document is a response document. isEncryptOnSend returns true if the document is encrypted when mailed. isSigned returns true if the document is signed. isSaveMessageOnSend returns true if a document is saved when mailed. isSentByAgent returns true if the document was mailed by a program. getCreated returns a DateTime object representing the date and time the document was created. Volume 3: JavaScript Classes . hasEmbedded returns true if the document has embedded objects.

setSignOnSend sets the sign-on-send attribute. getParentDocumentUNID returns a String value containing the universal ID of the parent if the document is a response. if any. getNameOfProfile returns a String value containing the profile name of a profile document. getVerifier returns a String value containing the name of the certificate verifying a signature if the document is signed. getItems returns an Item vector representing all the items in the document. getLastAccessed returns a DateTime object representing the date and time the document was last accessed. including any attachments. getParentView returns a View object representing the view from which the document was retrieved. getUniversalID returns a String value containing the universal ID of the document. getNoteID returns a String value containing the NoteID of the document.isSignOnSend returns true if the document is signed when mailed. getResponses returns a DocumentCollection object representing the immediate responses to this document. getSize returns an int value containing the size of the document in bytes. getSigner returns a String value name of signer if the document is signed. Chapter 9: Java Classes 1633 . if any. getParentDatabase returns a Database object representing the database that contains the document. getKey returns a String value containing the profile key of a profile document. getLastModified returns a DateTime object representing the date and time the document was last modified. isValid returns true if the document exists (is not a deletion stub).

println( doc. import java.out.getAgentContext().isResponse()) System. while (doc != null) { System.elements().getAllDocuments(). } System. System.getLastAccessed()).println("Universal ID: " + doc.util. if (doc.println("Signed by: " + doc. System. import java.util. } } } 1634 Domino Designer Programming Guide.getAuthors().out.printStackTrace().*.Example: Accessing document properties This agent prints properties of a document.println("Verified by: " + doc.println("******").out.println("Is new note").getNoteID()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.domino. if (doc. if (doc.hasMoreElements()) System.getItemValueString("Subject")).getParentDocumentUNID()). System. import lotus.println("Author: " + e. Volume 3: JavaScript Classes . // (Your code goes here) Database db = agentContext. Document doc = dc.out. DocumentCollection dc = db.out. } } catch(Exception e) { e.println("Created: " + doc.getLastModified()).println("Parent UNID: " + doc.getSigner()).out.getCurrentDatabase().getFirstDocument(). System.out.getVerifier()). Enumeration e = doc.Enumeration.isSigned()) { System.println("Last accessed: " + doc.out.isNewNote()) System.Vector.getUniversalID()).println("Verified by: " + doc.nextElement()).getCreated()).out. while (e.getNextDocument().out.out.out. doc = dc.println("Note ID: " + doc. System. AgentContext agentContext = session.

Chapter 9: Java Classes 1635 . Do not use getCount and getNthDocument for loops for performance reasons. Otherwise. Use addDocument and deleteDocument to adjust a DocumentCollection object after you create it. These methods provide better performance than the methods that take a Document parameter. those documents that are selected or those documents modified since the agent last ran. use the getNextDocument and getPrevDocument methods that do not take a parameter. Use getUnprocessedDocuments in AgentContext to get documents that depend on the specifications of the current agent. getCount to get the number of documents in the collection. In loops. When you use an agent to work on unprocessed documents. Use either updateAll of NotesDocumentCollection or updateProcessedDoc of AgentContext. which can be used to get a particular document in the sequence. the methods that take a parameter invalidate the cache for remote (IIOP) operations. which can be used to get the first and next documents in a loop until the next document is null. The DocumentCollection class contains the following properties: getCount returns an int value containing the number of documents in the collection. getLastDocument and getPrevDocument. you must mark those documents as updated so that they are recognized as old documents in subsequent runs. for example. and getNthDocument. The DocumentCollection class has the following properties and methods for accessing documents: getFirstDocument and getNextDocument. you cannot depend on the documents to be a particular sequence. isSorted returns true if the document collection is sorted.Collecting all documents and all unprocessed documents Use getAllDocuments of Database to get a DocumentCollection object that contains all the data documents in a database. which can be used to get the last and previous documents in a loop until the previous document is null. getDocument locates a specified document in the current document collection. The documents in a document collection are ordered only if the collection is the result of a search. in particular.

If the agent. Volume 3: JavaScript Classes .getNextDocument().out.getAllDocuments().getParent returns a Database object representing the database that contains the collection. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session.out. while (doc != null) { System. doc = dc. AgentContext agentContext = session.printStackTrace(). This agent traverses all the documents in a database.getFirstDocument(). // (Your code goes here) Database db = agentContext. import lotus. while (doc != null) { System. for example. DocumentCollection dc = db. processes selected documents. Document doc = dc. } } catch(Exception e) { e.getNextDocument().println( doc. // (Your code goes here) DocumentCollection dc = agentContext.getFirstDocument().getAgentContext().getAgentContext(). Document doc = dc.println( doc.getItemValueString("Subject")).getCurrentDatabase(). import lotus.domino.domino.*.getUnprocessedDocuments().getItemValueString("Subject")). this code traverses all selected documents. } } } 2. } } catch(Exception e) { 1636 Domino Designer Programming Guide. Examples: Collecting all documents and unprocessed documents 1. This agent traverses all the unprocessed documents associated with the current agent.*. doc = dc. getQuery returns a String value that contains the text of the query that created the collection.

Examples: Collecting documents by searching 1. Use FTDomainSearch to search domain. the search query is a Domino formula. Use updateFTIndex to create or update a full-text index.println( doc. FTSearch in DatabaseCollection refines a DocumentCollection so that only documents that match a search query are retained.getAgentContext().e. Search entities can include ? and * wildcards. import lotus. requiring that a search entity be a single word or multiple words enclosed in quotes (escape the quotes in string constants). while (doc != null) { System.getItemValueString("Subject")). // (Your code goes here) Database db = agentContext. Chapter 9: Java Classes 1637 . For FTSearch and unprocessedFTSearch.getCurrentDatabase().isFTIndexed()) db.getFirstDocument(). A database does not have to be full-text indexed for FTSearch and unprocessedFTSearch to work.updateFTIndex(true). DocumentCollection dc = db. the search query is a string that meets the Notes rules for full-text search queries. but the search is slower.FTSearch("alpha | \"string beta\""). AgentContext agentContext = session.out. and unprocessedFTSearch and UnprocessedSearch in AgentContext return a DocumentCollection object containing documents that match a search query.*. For search and unprocessedSearch. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). For the complete syntax rules. Document doc = dc.domino. Use isFTIndexed to test for the existence of an index. and | (or) operators. } } } Collecting documents by searching FTSearch and Search in Database. FTSearch in View and FTSearch in ViewEntryCollection do the same for those objects. see search operators in client help.printStackTrace(). if (!db. This agent finds all documents containing the word “alpha” or the string “string beta” through a full-text search. and can be combined by ! (not). & (and).

You can get these IDs from getNoteID and getUniversalID in Document. import java.getFirstDocument().id + " " + e.util. public class JavaAgent extends AgentBase { Vector v. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } } 2. DocumentCollection dc = db. \"Alpha\")").*. This agent finds all documents whose Subject item contains the word “Alpha” through an @Contains Domino formula.getCurrentDatabase().printStackTrace(). } } catch(NotesException e) { System. import java. Volume 3: JavaScript Classes . } } } Locating a document by ID If you have saved or acquired the note ID or universal ID of a document. while (doc != null) { System. you can find a single document by specifying the ID in getDocumentByID or getDocumentByUNID of Database. e.printStackTrace(). // (Your code goes here) Database db = agentContext. Example: Locating a document by ID This agent demonstrates getting documents whose IDs are stored in a vector.*.getNextDocument(). doc = dc.domino.doc = dc.domino.util.Enumeration.getNextDocument(). } } catch(Exception e) { e.getItemValueString("Subject")). public void NotesMain() { 1638 Domino Designer Programming Guide.getAgentContext(). import lotus.println( doc.text).println(e. Document doc = dc. AgentContext agentContext = session.out.Vector. import lotus.out.search("@Contains(Subject.

try { Session session = getSession().printStackTrace().nextElement().getItemValueString("Subject")). } } } Creating a document Use createDocument in Database to create a new document.elements(). Document doc = db. Removing a document Use remove in Document to remove a document from a database. See “Creating an item and assigning values” for instructions on adding item values. Otherwise.getAgentContext(). } } catch(Exception e) { e. System.println( doc. doc = dc. saveIDs(db). } } public void saveIDs(Database db) { try { DocumentCollection dc = db.getNoteID()). the new document is lost when the program exits.getNextDocument().out.printStackTrace(). } } catch(Exception e) { e. Chapter 9: Java Classes 1639 . Enumeration e = v.getAllDocuments(). Use save in Document to post the new document to the database in storage. AgentContext agentContext = session. Use removeAll in DocumentCollection to remove all documents in a collection from a database.hasMoreElements()) { String id = (String)e. while (e.addElement(doc. Document doc = dc.getCurrentDatabase(). while (doc != null) { v. v = new Vector(). // (Your code goes here) Database db = agentContext.getFirstDocument().getDocumentByID(id).

Do not use the encrypt method. You gain access to an Item or RichTextItem object through various methods in the Document class. You can: Access item properties Get an item and its values Create an item and assign values Copy an item Remove an item Work with a rich text item Work with an embedded object 1640 Domino Designer Programming Guide. Volume 3: JavaScript Classes . Use isSentByAgent in Document to determine if a message was generated programmatically. You can specify the recipient in the second parameter or omit the parameter and use the SendTo field of the document. To encrypt the mail. To sign the mail. To save the document after it is mailed. use isSignOnSend or sign in Document before sending the mail. Mailing a document Use the send method of Document to mail a document. Specify the first parameter as true to include the form in the mailed document. The new document uses the default mail form for replies.Copying a document Use copyToDatabase to copy a document to a specified database (which can be the same database in which the document exists). Accessing items The Item and RichTextItem classes let you examine and manipulate item properties and contents. set encryptOnSend in Document to true before sending the mail. and get the signer and signature verifier with getSigner and getVerifier. meaning that RichTextItem objects can use all the properties and methods of Item. Use save afterwards if you want to save the signature. Use createReplyMessage in Document to create a new document that is a reply to the current document. You can check for a signature with isSigned. you can set saveMessageOnSend to true before mailing the document. The RichTextItem class inherits from Item.

getParent returns a Document object representing the document that contains the item. setDateTimeValue sets the item value. setValueDouble sets the item value. setValueInteger sets the item value. isSaveToDisk returns true if the item is saved when the document is saved. getValues returns a vector of Object objects representing the value or values of an item. isNames returns true if the item is of type Names. setNames sets the item type regarding Names. setValues sets the item values(). getLastModified returns a DateTime object representing the date and time the item was last modified. setSigned sets the item signed status. setSummary sets the item summary status. Chapter 9: Java Classes 1641 . getValueLength returns an int value containing the item’s storage requirements in bytes. setSaveToDisk sets the item save status. isEncrypted returns true if the item is to be encrypted.Accessing item properties You access item properties through the following methods: getDateTimeValue returns a DateTime object representing the value of a date-time item. getValueString returns a String value containing the value of a text item. isSummary returns true if the item value can appear in a view. setReaders sets the item type regarding Readers. setEncrypted sets the item encrypted status. setValueString sets the item value. isSigned returns true if the item is signed. isProtected returns true if editor access is required to modify the item. isReaders returns true if the item is of type Readers. getText returns a String value containing a text rendition of the item’s value. getValueInteger returns an int value containing the value of a numeric item. getValueDouble returns a double value containing the value of a numeric item. setAuthors set the item type regarding Authors. getType returns an int constant representing the item type. getName returns a String value containing the name of the item. setProtected sets the item protected status. isAuthors returns true if the item is of type Authors.

String type = "Undefined".getType()) { case Item. case Item.AUTHORS : type = "Authors".ERRORITEM : type = "Error item".println("Name: " + item.READERS : type = "Readers". import java.elements(). Document doc = dc.util. Enumeration items = doc.out.Enumeration.getName()). switch (item. case Item. Volume 3: JavaScript Classes .getItems(). break. break. case Item. while (items. break.NUMBERS : type = "Numbers". break.getAllDocuments().EMBEDDEDOBJECT : type = "Embedded object". break. case Item.RICHTEXT : type = "Rich text".Example: Accessing item properties This agent gets properties for all the items in the first document in a database. import lotus. case Item.util. DocumentCollection dc = db.*. System. case Item.nextElement(). // (Your code goes here) Database db = agentContext. case Item.getAgentContext(). import java.println("******"). Item item = (Item)items.hasMoreElements()) { System. AgentContext agentContext = session. break.out. break.Vector.TEXT : type = "Text". break. break. break. case Item.SIGNATURE : type = "Signature".domino. break. break. case Item.getFirstDocument().NAMES : type = "Names". case Item. case Item.ATTACHMENT : type = "Attachment". case Item.NOTEREFS : type = "Note references".getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().DATETIMES : 1642 Domino Designer Programming Guide.NOTELINKS : type = "Note links".

type = "Date-times". use getItems in Document. if (item. } } catch(Exception e) { e. From the Item level. and getValueString to get a single date-time. } } Getting an item and its values If you do not know the name of an item or want to traverse the items in a document. System. usegetFirstItem in Document. getItem returns a vector of Item objects.out. case Item. Use hasItem in Document to determine if a document contains a named item. or text value.println("Is protected"). As you access each vector element.isEncrypted()) System.isProtected()) System. To access an item whose name is known.out. to access other than the first item. if (item.println("Is signed"). if (item.USERDATA : type = "User data". use the Item methods to interrogate and manipulate the object.println("Text:\n" + item.println("Is encrypted").UNKNOWN : type = "Unknown".out. although this practice is discouraged. case Item.isSummary()) System. break. if (item.USERID : type = "User ID". Items can have the same name. break. you must use getItems.out.println("Type: " + type). which must be cast to DateTime. case Item. containsValue determines the existence of elements in multi-value text items.out. and getItemValueString are convenient for obtaining the value of a numeric or text item that holds a single value. break. use getDateTimeValue. break. getValueInteger.getText()). Double. getValues returns a vector of Object objects. getItemValueInteger. case Item.println("Is summary").isSigned()) System. Use getValues in Item to get the values of a single or multi-value item. In Item.UNAVAILABLE : type = "Unavailable".printStackTrace(). Integer. } System. getValueDouble. getItemValueDouble. or String. break. numeric.out. Chapter 9: Java Classes 1643 . From the Document level.

1644 Domino Designer Programming Guide. or String values. You can replace the value of an item in every document of a document collection with the stampAll method of DocumentCollection. Use copyAllItems in Document to copy all items in the current document to another document. Prefer replaceItemValue unless your intent is to create another item with the same name.Use getText of Item to get a text rendition of an item of any type. setValueInteger. or text value. This method writes immediately to the documents in storage. Computed fields are not recalculated when you save a document. You can run a form’s default value. you must calculate the value in the program. setValueDouble. the item exists and can be accessed programmatically. The user cannot see an item as a field in the document unless you add the field to the form design. After creating or replacing an item. You do not have to save after stampAll. Volume 3: JavaScript Classes . translation. and validation formulas on the item that corresponds to a field with computeWithForm in Document. If you change items that affect a computed field and want the new value to be available immediately (for example. between elements. qppendToTextList is convenient for adding values to a multi-value text item. if you want the user to see the new value in a view or you want to use the new value in a calculation). From the Item level. Be sure to save all documents (save method of Document) that you have modified before using stampAll on them. Double. However. and setValueString to set a single date-time. setValues passes a vector of DateTime. Use abstract to get a condensed text rendition of an item. use replaceItemValue to assign single values to items (providing that two items do not have the same name). Copying an item Use copyItemToDocument in Item to copy the current item to another document. Creating an item and assigning values Use replaceItemValue or appendItemValue in Document to create an item and assign a single value. use setDateTimeValue. you must call save on the Document object containing the item or the update is lost when the program exits. Multi-value items are rendered with a separator. Use copyItem in Document to copy an item to another item in the same document. In Item. numeric. Use setValues in Item to set the values of a single or multi-value item. From the Document level. Integer. typically the semicolon.

font type. After removing an item. Working with a rich text item The RichTextItem class inherits from Item and so has the same properties and methods. font size. Use createRichTextParagraphStyle and createRichTextStyle in Session to create RichTextParagraphStyle and RichTextStyle objects. If you do not need the additional methods. RichTextItem has methods for working with rich text and embedded objects. appendDocLink. When a rich text item is the return value of a method such as getFirstItem in Document and you want to use the rich text methods. and addPageBreak build content into a rich text item. color. addNewLine. interline spacing. Removing an item Use either remove in Item or removeItem in Document to remove an item from a document. spacing above. The NotesRichTextItem methods are: getFormattedText returns the value of the rich text item as formatted text. pagination. getEmbeddedObjects. object links. appendRTItem. you must call save for the Document object that contained the item or the update is lost when the program exits. Chapter 9: Java Classes 1645 . italics. and embedObject deal with embedded objects. Use createRichTextItem in Document to create a rich text item. appendParagraphStyle and appendStyle build style attributes into a rich text item. getEmbeddedObject. you can access a rich text item as either an Item or RichTextItem object. left margin. underlines. addTab. The text styles affect bold. and file attachments. and strike through. Use getTabs in RichTextParagraphStyle to get a vector of RichTextTab objects. you must cast the return value to RichTextItem. The removeItem method removes all items with the specified name. appendText. and tabs (position and type). special effects. you must call save for the Document object containing the new item or the update is lost when the program exits.After copying an item. spacing below. right margin. The remove method removes only the current object — other items with the same name remain in existence. first line left margin. The paragraph styles affect alignment.

linked objects. To get an attachment of this type. under UNIX. getFileSize returns an int value containing the size of the object (does not apply to embedded and linked objects). or EmbeddedObject.EMBED_ATTACHMENT. getParent returns a RichTextItem object representing the item that contains the object.Working with an embedded object Use getEmbeddedObjects of RichTextItem to get a vector of EmbeddedObject objects containing all the embedded objects. To locate pre-R4 file attachments not associated with a rich text item. 1646 Domino Designer Programming Guide. getVerbs returns a vector of String objects representing the verbs that an OLE/2 embedded object supports. This property does not include file attachments. getObject returns an int value containing the OLE handle for the object. use getEmbeddedObjects of Document. and file attachments in a rich text item. Note This feature is not supported under OS/2. EmbeddedObject. by using getItems of Document. To get all the embedded objects in a document.ATTACHMENT. Volume 3: JavaScript Classes .EMBED_OBJECTLINK. get all the items in the document. for example. Use hasEmbedded of Document to see whether a document contains any embedded objects. including objects that were originally embedded in the form from which the document was created. and on the Macintosh. Test getType property of each item for Item. getSource returns a String value containing the file name or OLE syntax for the source document/item of the embedded object. getType returns an int value containing the type of the object: EmbeddedObject. getName returns a String value containing the name used to reference an object that was embedded programmatically.EMBED_OBJECT. use getAttachment of Document. You access EmbeddedObject properties through the following methods: getClass returns a String value containing the name of the application that created the object (does not apply to attachments).

See the following topics: Accessing session properties Using environment variables Accessing agents Accessing international settings Working with time Making a log Making a newsletter Representing a name Evaluating a formula Searching for free time slots The Session class also contains the following methods for creating new Domino objects: createDateRange createDateTime createLog createName createNewsletter createRegistration Chapter 9: Java Classes 1647 . For remote (IIOP) calls. Accessing Domino sessions The Session class is the root of the Domino Objects containment hierarchy. doVerb executes an object verb (on systems supporting OLE). remove removes the object from its rich text item. the Domino environment is the local Domino directory. extractFile copies a file attachment to a file.EmbeddedObject has the following methods: activate causes OLE to load the object and returns a handle to the OLE object (on systems supporting OLE). which can belong to a server or a user. For local calls. You must call save of Document to implement the removal in storage. providing access to the other Domino objects. the Domino environment is the server handling the remote requests. and represents the Domino environment of the current program.

getServerName returns a String value containing the full name of the session’s server. getUserName returns a String value containing the full name of the session’s server or user. getInternational returns an International object representing the international settings in the operating environment. Volume 3: JavaScript Classes .util.Vector object of Database objects representing all accessible Domino Directories and Personal Address Books. isOnServer returns true if the environment is a server. getPlatform returns a String value containing the operating system platform. getCommonUserName returns a String value containing the common name of the session’s server or user. 1648 Domino Designer Programming Guide. getAgentContext returns an AgentContext object representing the current agent environment for programs being run as agents.createRichTextParagraphStyle createRichTextStyle getDatabase getDbDirectory getURLDatabase Accessing session properties The following methods access the Session properties: getAddressBooks returns a java. getUserNameObject returns a Name object representing the name of the session’s server or user. and the alternate name if applicable. getUserNameList returns a vector of Name objects representing the name of the session’s server or user. getNotesVersion returns a String value containing the version of the session’s server or user.

ini file. intValue(). Directory. Domain. else seq = ((Integer)s. The dollar sign distinguishes user environment variables (name starts with a dollar sign) and system environment variables (name does not start with a dollar sign). int seq. System. System. such as KitType. t. Example: Using environment variables This example increments the environment variable $SeqNo by one and prints the result.getEnvironmentValue("SeqNo")). Preferences.start(). and do not prepend a dollar sign if the second parameter is true. s. They are also useful for obtaining Domino environment information. getEnvironmentString. new Integer(seq)).Using environment variables The getEnvironmentValue. Use getEnvironmentString for strings and numeric values. which are stored in the local notes.getEnvironmentValue("SeqNo")).out.*.println(s. Port. and so on. if the third parameter is false or omitted.createSession(). the name of the environment variable. Chapter 9: Java Classes 1649 . and setEnvironmentVar methods retrieve and set environment variables.getEnvironmentValue("SeqNo") == null) seq = 0. } public void runNotes() { try { Session s = NotesFactory. if (s. GetEnvironmentValue and getEnvironmentString prepend a dollar sign if the second parameter is false or omitted. seq++. SetEnvironmentVar prepends a dollar sign ($) to parameter 1.domino.setEnvironmentVar("SeqNo".out. class seqno extends NotesThread { public static void main(String argv[]) { seqno t = new seqno().println(seq). (This program would not be reliable on a server for maintaining a system of sequential numbers. Environment variables are useful for saving state and data between program invocations where no conflicts are possible.) import lotus. Use getEnvironmentValue only for numeric environment variables.

} } } Accessing agents Two classes provide access to agents: AgentContext and Agent. The following methods access the AgentContext properties: getCurrentAgent returns an Agent object representing the current agent. Volume 3: JavaScript Classes . getLastExitStatus returns an int value containing the exit status for the last time the agent ran. The updateProcessedDoc method marks documents as “processed” for future searches for new and modified documents. 1650 Domino Designer Programming Guide.} catch (Exception e) { e.printStackTrace(). Call getAgentContext in Session to get the current agent context. getEffectiveUserName returns a String value containing the user name that is in effect for the agent. getDocumentContext returns a Document object representing the in-memory document when the agent starts. AgentContext The AgentContext class provides a means to access attributes of the current agent environment for programs that are running as agents. getCurrentDatabase returns a Database object representing the database containing the current agent. getAgentContext returns null if the program is not running as an agent.” The unprocessedFTSearch and unprocessedSearch methods return DocumentCollection objects representing “unprocessed” documents that meet search criteria. getLastRun returns a DateTime object representing the last time the agent ran. getSavedData returns a Document object representing information stored between invocations of the agent. getUnprocessedDocuments returns a DocumentCollection object representing the documents in the database that the agent considers “unprocessed.

a run method to run the agent on a local database. You can access a specified agent through getAgent in Database.Agent The Agent class represents an agent. isNotesAgent returns true if the agent can be activated from a Notes client. getServerName returns a String value containing the name of the server on which the agent runs. The Agent class contains a remove method to remove the agent from the database. setServerName sets the server name to a string value (including * for all servers). getOwner returns a String value containing the name of the person who last modified the agent. setEnabled enables (true) or disables (false) a scheduled agent. getParent returns a Database object representing the database that contains the agent. and a save method to save changes made by setServerName and setEnabled. isPublic returns true if the agent is public. Chapter 9: Java Classes 1651 . getName returns a String value containing the name of the agent. getLastRun returns a DateTime object representing the last time the agent ran. getQuery returns a String value containing the query used by the agent to select documents. isWebAgent returns true if the agent can be activated from a browser. getTrigger returns an int value defining when the agent runs. getCommonOwner returns a String value containing the common name of the user who last modified the agent. a runOnServer method to run the agent on a remote database. You can access the current agent through getCurrentAgent in AgentContex. You can access all agents in a database through getAgents in Database. The following methods access the Agent properties: getComment returns a String value containing the comment associated with the agent. getTarget returns an int value defining what documents the agent runs on. isEnabled returns true if the agent is enabled.

size(). rti.printStackTrace().util. Vector agents = db. doc. // (Your code goes here) Database db = agentContext.appendItemValue("Subject". i++) { Agent agent = (Agent)agents.getAgentContext().getAgents(). AgentContext agentContext = session.addTab(2). if (agent.createDocument(). rti.*. } catch(Exception e) { e. The following methods access the International properties: getCurrencyDigits returns an int value containing the number of decimal digits for number format.getCurrentDatabase(). "Public agent summary for " + db.getTitle()). } } } Accessing international settings The International class represents the international (regional) settings of the operating environment.getComment()).createRichTextItem("Body").addNewLine(1).getName()).Example: Accessing agents This agent sends a memo to the managers of the current database containing the name and comment of each agent in the database. 1652 Domino Designer Programming Guide. Document doc = db.appendText(agent. db.isEnabled()) { rti.appendText(agent. You can access the international settings through getInternational in Session. Volume 3: JavaScript Classes . rti.elementAt(i). i<agents.isPublic() & agent. } } doc. RichTextItem rti = doc.send(false. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import java.getManagers()). for (int i=0.Vector. import lotus.domino.

isDateDMY returns a boolean value that is true if the order of the date format is day-month-year. isDateMDY returns a boolean value that is true if the order of the date format is month-day-year. days. getParent returns a Session object representing the current session. getToday returns a String value containing the today designator for time-date format. getDateSep returns a String value containing the character used to separate months. getTimeZone returns an int value containing the time zone. Chapter 9: Java Classes 1653 . and years. getPMString returns a String value containing the PM designator. minutes. isDST returns a boolean value that is true if the date format reflects daylight savings time. and seconds. isCurrencySpace returns a boolean value that is true if currency format has a space between the currency symbol and the number. isDateYMD returns a boolean value that is true if the order of the date format is year-month-day. getYesterday returns a String value containing the yesterday designator for time-date format. getTomorrow returns a String value containing the tomorrow designator for time-date format. getAMString returns a String value containing the AM designator. isTime24Hour returns a boolean value that is true if the time format is 24-hour. getThousandsSep returns a String value containing the thousands separator for number format. getCurrencySymbol returns a String value containing the symbol that indicates a number is currency. isCurrencySuffix returns a boolean value that is true if the currency symbol follows the number in currency format.getDecimalSep returns a String value containing the decimal separator for number format. isCurrencyZero returns a boolean value that is true if fractions have a zero before the decimal point for number format. getTimeSep returns a String value containing the character used to separate hours.

The following methods access the DateTime properties: getLocalTime returns a String value containing a date-time in local time. adjustMonth. setLocalTime with int parameters sets the time component of the date-time. setAnyDate. sets the date component of the date-time. which can be changed with convertToZone. adjustHour.domino package return DateTime objects. Use createDateTime in Session to create a DateTime object. and adjustYear. The following methods access the DateTime properties: getEndDateTime returns a DateTime object representing the end date of the range. setEndDateTime sets the end date of the range to the specification of a DateTime object. setLocalDate. Various methods throughout the lotus. adjustDay.util. getGMTTime returns a String value containing a date-time in GMT. setTimeZone sets the time zone. Volume 3: JavaScript Classes . and setAnyTime. 1654 Domino Designer Programming Guide. adjustMinute. getZoneTime returns a String value containing a date-time adjusted for the time zone and daylight savings time. which takes int parameters. You can initialize a date-time or date-time component with the following methods: setNow. getParent returns a Session object representing the current session. You can convert a date-time to a java. You can get the difference in seconds between two times with timeDifference. setStartDateTime sets the start date of the range to the specification of a DateTime object. isDST returns true if a date-time is in daylight-saving time. getDateOnly returns a String value containing the date component of a date-time in local time. getTimeZone returns an int value containing the time zone of a date-time.Date object with toJavaDate.Working with time The DateTime class represents a date-time. setLocalTime with a String parameter sets the date-time to the local time represented by the String. The DateRange class represents a range of dates. You can change a date-time with the following methods: adjustSecond. getStartDateTime returns a DateTime object representing the start date of the range. getTimeOnly returns a String value containing the date component of a date-time in local time.

println (" Time in zone 15: " + dt.println (" Local time: " + dt.println ("Creation date of current database"). System.printStackTrace().getAgentContext(). } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). DateTime dt = db. setText sets the range to the specification of a String value.println (" GMT time: " + dt. Values written to StartDate or EndDate are immediately transcribed to Text. dt.getGMTTime()). or Text.domino.getZoneTime()). AgentContext agentContext = session. write to either StartDate and EndDate.getCurrentDatabase(). Any changes made to the DateTime object that is the basis for StartDateTime or EndDateTime also affect the DateRange object. converts the time to zone 15 time. Examples: Working with time 1.out. and prints the zone 15 time. When you set a DateRange object. boolean dst = dt. System. import lotus. } } } Chapter 9: Java Classes 1655 .*.convertToZone(15.out. // (Your code goes here) Database db = agentContext. but not both. System. and vice-versa. System.out. prints the date-time in local time and GMT time. dst). This agent gets the creation date of the current database into a DateTime object.getLocalTime()).getText returns a String value containing the range (two date-times in String format separated by a hyphen).out.isDST().getCreated(). getParent returns a Session object representing the current session.

timeDifference(doc. else { DateTime dt1 = doc. } } } 1656 Domino Designer Programming Guide.getFirstDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase(). DocumentCollection dc = db. doc = dc.out.getCreated().createDateRange(dt1.out.printStackTrace(). // (Your code goes here) Database db = agentContext.getCreated()) < 0) dt2 = doc.println("Date range of documents:"). } } catch(Exception e) { e. System. Created -> dt2 if (dt2.out. AgentContext agentContext = session.getCreated(). Document doc = dc. System. } DateRange dr = session.getAllDocuments().*.2.getAgentContext(). // if dt2 < Created. doc = dc. import lotus. dt2).getText()). and creates a DateRange object using these dates.timeDifference(doc.domino. Volume 3: JavaScript Classes .getNextDocument(doc). while (doc != null) { // if dt1 > Created.getCreated().println(dr. This agent determines the earliest and latest creation dates for all the documents in the current database.println("No documents"). DateTime dt2 = doc. if (doc == null) System.getNextDocument().getCreated()) > 0) dt1 = doc. Created -> dt1 if (dt1.getCreated().

A$ACTION. isLogErrors returns true if error logging is enabled. A$ERRCODE. Use the system template alog. The memo is mailed when the log is closed.Making a log The Log class provides these methods for opening a log: openFileLog opens a file for logging. setOverwriteFile sets this property to true or false (default) to enable or disable file overwriting. setLogActions sets this property to true (default) or false to enable or disable action logging. A$LOGTYPE. The logEvent method can be used on servers to generate events on the network. openAgentLog opens an agent log for logging. A$USER. Each log entry is a document with the items A$PROGNAME. getNumActions returns an int value containing the number of actions logged so far.ntf to create databases suitable for logging. logError logs an error. openMailLog opens a mail memo for logging. including events that can be seen by the NotesView product. Chapter 9: Java Classes 1657 . The following methods access the Log properties: isLogActions returns true if action logging is enabled. openNotesLog opens a Domino database for logging. and A$ERRMSG. getNumErrors returns an int value containing the number of errors logged so far. These methods make entries in the log: logAction logs an action. A$LOGTIME. Each agent has an associated log that is accessible through Agent . getParent returns a Session object representing the current session. setProgramName sets this property. The close method closes a log. isOverwriteFile returns true if existing files are written over rather than appended to.Log when the agent is selected. getProgramName returns a String value containing the name of the script to which the entries apply. This method is valid only in an agent. setLogErrors sets this property to true (default) or false to enable or disable error logging.

set this property to true or false (default) with setDoSubject before calling formatMsgWithDoclinks. You can use the send method of Document to mail documents based on newsletters. Volume 3: JavaScript Classes . The following methods access the Newsletter properties. isDoScore returns true if the formatted newsletter is to contain each document’s relevance score. set this property with setSubjectItemName if you set setDoSubject to true. isDoSubject returns true if the formatted newsletter is to contain the content of each document’s subject field. use getUserNameObject in Session to get a Name object representing the current user or server. If the name is in the form of a hierarchical name.Making a newsletter A newsletter is a summary document containing a picture of another document or links to other documents. Representing a name A Name object allows you to represent a user or server name so that you can access the parts of the name as properties. Use the createNewsletter method of Session to create a Newsletter object based on a document collection. set this property to true or false with setDoScore before calling formatMsgWithDoclinks. getParent returns a Session object representing the current session. 1658 Domino Designer Programming Guide. Use getUserNameList to get a vector of Name objects representing the user name and alternate user name. formatMsgWithDoclinks formats the newsletter to contain links to all the documents in the document collection that is the basis for the newsletter. getSubjectItemName returns the name of the field associated with isDoSubject. it is treated as a hierarchical name. it is treated as a flat name. You must iterate through the document collection to format all the documents. otherwise. The boolean properties are useful only with formatMsgWithDoclinks. Use one of the following methods to format the newsletter: formatDocument formats the newsletter to contain a picture of one document in the document collection that is the basis for the newsletter. Use createName in Session to create a Name object and specify a name. You can use the save method of Document to save documents based on newsletters.

getSurname returns a String value containing the surname part of a name. getOrgUnit4 returns a String value containing the fourth organizational unit (OU=) component of a hierarchical name. getOrgUnit2 returns a String value containing the second organizational unit (OU=) component of a hierarchical name. getCountry returns a String value containing the country (C=) component of a hierarchical name. getADMD returns a String value containing the administration management domain name component of a hierarchical name (A=). getGeneration returns a String value containing the generation component of a hierarchical name (Q=). Chapter 9: Java Classes 1659 . getOrganization returns a String value containing the organization (O=) component of a hierarchical name. getCanonical returns a String value containing the canonical form of a hierarchical name. “Jr. getCommon returns a String value containing the common name (CN=) component of a hierarchical name. getKeyword returns a String value containing the country\organization\organizational unit 1\organizational unit 2\organizational unit 3\organizational unit 4. getInitials returns a String value containing the initials component of a hierarchical name (I=). isHierarchical returns true if the name is hierarchical.The following methods access the Name properties. for example. getOrgUnit1 returns a String value containing the first organizational unit (OU=) component of a hierarchical name.” getGiven returns a String value containing the given component of a hierarchical name (G=). These methods return null for undefined properties. getOrgUnit3 returns a String value containing the third organizational unit (OU=) component of a hierarchical name. getLanguage returns a String value containing the language associated with a name. getAbbreviated returns a String value containing the abbreviated form of a hierarchical name. getPRMD returns a String value containing the private management domain name component of a hierarchical name (P=).

1660 Domino Designer Programming Guide. getAddr822Comment1 returns a String value containing the Comment1 part of an Internet address in RFC 822 format.getParent returns a Session object representing the current session. getAddr822Phrase returns a String value containing the Phrase part of an Internet address in RFC 822 format. getAddr821 returns a String value containing an Internet address in RFC 821 format. getAddr822Comment3 returns a String value containing the Comment3 part of an Internet address in RFC 822 format. getAddr822Comment2 returns a String value containing the Comment2 part of an Internet address in RFC 822 format. Volume 3: JavaScript Classes . getAddr822LocalPart returns a String value containing the LocalPart part of an Internet address in RFC 822 format.

A “property” consists of the Java methods that get/set properties of Domino Objects. Preceding them are the specifications for the supporting classes AgentBase. Base. recycle. NotesError. turn to the class that the property or method belongs to. Also listed are the constants used by the Domiono Objects classes. and toString. The Domino Objects classes start with ACL.Chapter 10 Java Classes A-Z These are the lotus. Properties and methods with ECL security The following tables list the properties and methods affected by an execute control list (ECL). NotesFactory. the general methods getURL. AppletBase. Those properties cannot be accessed or set and those methods do not execute on the workstation unless the marked ECL priveleges are granted to the formula’s signer.domino classes that access the Domino Objects. Following each class are alphabetical descriptions of the properties and methods for that class. and NotesThread. NotesException. To find the property or method you want. and the Visibility interface. The ECL flags listed in the table are: Access to current file system (file) Access to current database (cur) Access to environment variables (env) Access to external programs (prog) Ability to send mail (mail) Ability to read other databases (read) Ability to modify other databases (mod) ACL createACLEntry deleteRole file cur X X env prog mail read X X continued mod 1661 .

ACL getEntry getFirstEntry getNextEntry renameRole save ACLEntry disableRole enableRole isRoleEnabled remove Agent remove run runOnServer AgentContext unprocessedFTSearch updateProcessedDoc Database setCategories isDelayUpdates setSizeQuota setTitle compact createDocument FTSearch getAgent getDocumentByID getDocumentByUNID file cur X X X X X env prog mail read X X X X X mod X mod file cur X X X X env prog mail read X X X X file cur X X env prog mail read mod X X X file cur X env prog mail read X mod X file cur X X X X X X X X X X env prog mail read mod X X X X X X X X X continued 1662 Domino Designer Programming Guide. Volume 3: JavaScript Classes .

Database getDocumentByURL getForm getProfileDocument getURLHeader getView grantAccess queryAccess replicate revokeAccess search unprocessedFTSearch updateFTIndex Document appendItemValue computeWithForm copyAllItems setEncryptionKeys setUniversalID copyItem copyToDatabase createReplyMessage createRichTextItem encrypt makeResponse putInFolder remove removeFromFolder removeItem renderToRTItem replaceItemValue file cur X X X X X X X X X X X X env prog mail read X X X X X X X X X X X X mod file cur X X X X X X X X X X X X X X X X X env prog mail read mod X X X X X X X X X X X X X X X X X X continued Chapter 10: Java Classes A–Z 1663 .

Volume 3: JavaScript Classes . access to read a database implies access to elements within the database without explicitly checking for ECL privileges. EmbeddedObject extractFile remove Form setFormUsers setProtectReaders setProtectUsers setReaders remove file file X X cur X X X X X env prog mail read mod cur env prog mail read mod 1664 Domino Designer Programming Guide.Document save send sign DocumentCollection FTSearch getFirstDocument getLastDocument getNextDocument getNthDocument getPrevDocument putAllInFolder removeAll removeAllFromFolder stampAll updateAll file cur X X X env prog mail X read mod X X X file cur env prog mail read X* X* X* X* X* X* mod X X X X X X X X X * For these methods in DocumentCollection.

access to read a database implies access to elements within the database without explicitly checking for ECL privileges.Item setDateTimeValue setAuthors setEncrypted setNames setProtected setReaders setSaveToDisk setSigned setSummary setValueDouble setValueInteger setValues setValueString abstractText appendToTextList containsValue copyToDocument remove file cur X X X X X X X X X X X X X env prog mail read mod X X X X X X X X X X X X* X X* X X X X X * For abstractText and containsValue. Log close logAction (to database) logAction (to file) logAction (to mail message) logAction (to agent) logError (to database) logError (to file) X continued X X X X X file cur env prog mail X X read mod Chapter 10: Java Classes A–Z 1665 .

Log logError (to mail message) logError (to agent) openFileLog Newsletter formatDocument formatMsgWithDoclinks RichTextItem addNewLine addTab appendDocLink getEmbeddedObject (OLE) appendRTItem appendText embedObject (file) embedObject (OLE) Session freeTimeSearch getDatabase getEnvironmentString setEnvironmentVar updateProcessedDoc View getAliases getColumns getCreated isAutoUpdate isCalendar file cur env prog mail X read mod X X X file cur env prog mail read mod X X file cur X X X X X X X X file cur env X X prog mail read X X X X X file cur env prog mail read X* X* X* X X* X* continued X mod X X X X mod env prog mail read mod X X X 1666 Domino Designer Programming Guide. Volume 3: JavaScript Classes .

View isDefaultView isFolder isProtectReaders getLastModified getName getParent getReaders getUniversalID FTSearch getAllDocumentsByKey getChild getDocumentByKey getFirstDocument getLastDocument getNextDocument getNextSibling getNthDocument getParentDocument getPrevDocument getPrevSibling refresh remove file cur env prog mail read X* X* mod X X* X* X* X* X* X* X* X* X* X* X* X* X* X* X* X* X* X* X* X X X X* X * For the View class. access to read a database implies access to elements within the database without explicitly checking for ECL privileges. Chapter 10: Java Classes A–Z 1667 .

public void closeSession(Session session) throws NotesException. String pwd) to create a Session object.AgentBase class AgentBase class Notes agents must extend AgentBase and use NotesMain() as the entry point for their functional code. public void dbgMsg(String msg. public final void startup(AgentInfo info). Use getSession() or getSession(String user. and notesAppletStop() as the entry points for their functional code. public boolean isRestricted(). PrintWriter pw). create a PrintWriter object with getAgentOutput(). public final void start(). public AgentBase(). 1668 Domino Designer Programming Guide. PrintStream ps). String pwd) throws NotesException. public void notesAppletInit(). } AppletBase class Applets must extend AppletBase or JAppletBase and use notesAppletInit(). public void dbgMsg(String msg. String pwd) throws NotesException. public void setDebug(boolean debug). public void NotesMain(). For output to browsers as well as Notes clients (the Java console). notesAppletStart(). public final void init(). public Session getSession(String user. The specification (public methods) of the AppletBase class is as follows: public class AppletBase extends Applet implements DominoAppletBase { public Session getSession() throws NotesException. public void dbgMsg(String msg). Volume 3: JavaScript Classes . public Session openSession() throws NotesException. public void setTrace(boolean trace). Use getSession() to create a Session object. public Session openSession(String user. public Session getSession(). public final void runNotes() throws NotesException. The specification (public methods) of the AgentBase class is as follows: public class AgentBase extends NotesThread { protected Session m_session. public PrintWriter getAgentOutput().

specify the parameter of the catch clause as type NotesException.*.Exception to include exception handling for Domino. contains the error text.println( "Title:\t\t" + db.out.println( "Database open failed").sun. void notesAppletStop(). final void stop().” NotesError and NotesException classes The NotesException class extends java. of type String. The NotesError class defines public static final variables for Domino error codes. Catching a Domino exception To catch a Domino exception.swing. The NotesException class contains the following public variables: NotesException. if (db == null) System. For more information.id. AgentContext agentContext = session.NotesError and NotesException classes public public public public public public } void notesAppletStart(). else System. see “Running a Java program” in the chapter “Java Classes Coding Guidelines. NotesException.getDbDirectory(null).* and extends JApplet rather than Applet.getAgentContext(). The following example prints the error code and text if a Domino exception is thrown.lang.getComment()).text.getCurrentAgent(). DbDirectory dir = session. import lotus. of type int.openDatabase(agent. void notesAppletDestroy().out.getTitle()). final void destroy(). Chapter 10: Java Classes A–Z 1669 . contains the error code. Database db = dir. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. boolean isNotesLocal(). JAppletBase class is the same except that it imports com.java. // (Your code goes here) Agent agent = agentContext.

else System.NotesError and NotesException classes } catch(NotesException e) { System.printStackTrace(). } } catch(Exception e) { e.id + " " + e. Database db = dir.out.out. } } } 1670 Domino Designer Programming Guide.text). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().NOTES_ERR_NOTAFILE) System.printStackTrace(). else { System.openDatabase(agent.getCurrentAgent(). } } } The following example demonstrates checking for the Domino error NOTES_ERR_NOTAFILE.text). } catch(NotesException e) { if (e.printStackTrace().println("Database open failed").id == NotesError.getTitle()).out.println("Database open failed").getDbDirectory(null).out.getAgentContext().println(e.out.println( "Title:\t\t" + db. if (db == null) System. AgentContext agentContext = session.getComment()). DbDirectory dir = session.println(e. e.printStackTrace(). e.id + " " + e.*.domino. // (Your code goes here) Agent agent = agentContext. } catch(Exception e) { e. Volume 3: JavaScript Classes . import lotus.

const long NOTES_ERR_SYS_DICT_NOT_ON_PATH = NOTES_MIN_ERROR_CODE+4. const long NOTES_ERR_SYS_RESOURCE_NOT_FOUND = NOTES_MIN_ERROR_CODE+8. String _text).NOTES_MIN_ERROR_CODE.domino classes. const long NOTES_ERR_SYS_LOADING_RESOURCE = NOTES_MIN_ERROR_CODE+9. const long NOTES_ERR_SYS_NOSUCH_RESOURCE = NOTES_MIN_ERROR_CODE+12. const long NOTES_ERR_SYS_LOAD_OUT_OF_MEM = NOTES_MIN_ERROR_CODE+2. which start with NotesError. public NotesException(int _id. const long NOTES_ERR_SYS_FREEING_RESOURCE = NOTES_MIN_ERROR_CODE+11. const long NOTES_ERR_SYS_LOCKING_RESOURCE = NOTES_MIN_ERROR_CODE+10. const long NOTES_ERR_ERROR2 = NOTES_MIN_ERROR_CODE+5. } UserException extends java. interface NotesError{ const long NOTES_MIN_ERROR_CODE = 4000. This value is 4000.NotesError and NotesException classes The class NotesException The specification of the NotesException class is as follows: public final class NotesException extends UserException { public int id. The constants defined in NotesError are for the lotus. public String text.Exception. const long NOTES_ERR_ERROR = NOTES_MIN_ERROR_CODE+0 const long NOTES_ERR_SYS_OUT_OF_MEMORY = NOTES_MIN_ERROR_CODE+1. const long NOTES_ERR_SYS_FILE_NOT_FOUND = NOTES_MIN_ERROR_CODE+3. const long NOTES_ERR_SYS_WARNING_TITLE = NOTES_MIN_ERROR_CODE+16. Chapter 10: Java Classes A–Z 1671 .lang. The class NotesError The specification of the NotesError interface follows. public NotesException().

const long NOTES_ERR_MAIL_GRPCREATE_FAILED = NOTES_MIN_ERROR_CODE+35. const long NOTES_ERR_MAIL_INVALID_MSG = NOTES_MIN_ERROR_CODE+32. 1672 Domino Designer Programming Guide. const long NOTES_ERR_DBCREATE_FAILED = NOTES_MIN_ERROR_CODE+41. const long NOTES_ERR_NOFTINDEX = NOTES_MIN_ERROR_CODE+40. const long NOTES_ERR_MAIL_UNKNOWN_PROP = NOTES_MIN_ERROR_CODE+31. const long NOTES_ERR_INVALID_FORMULA = NOTES_MIN_ERROR_CODE+44. const long NOTES_ERR_MAIL_GROUP_DELETED = NOTES_MIN_ERROR_CODE+36. const long NOTES_ERR_COPY_FAILED = NOTES_MIN_ERROR_CODE+46. const long NOTES_ERR_DBOPEN_FAILED = NOTES_MIN_ERROR_CODE+43. const long NOTES_ERR_MAIL_CANT_CREATE = NOTES_MIN_ERROR_CODE+30. const long NOTES_ERR_MAIL_NOPRIVATE_GRP = NOTES_MIN_ERROR_CODE+34. const long NOTES_ERR_MAIL_LAOPEN_FAILED = NOTES_MIN_ERROR_CODE+28. Volume 3: JavaScript Classes . const long NOTES_ERR_DBDELETE_FAILED = NOTES_MIN_ERROR_CODE+42. const long NOTES_ERR_MAIL_PAOPEN_FAILED = NOTES_MIN_ERROR_CODE+27. const long NOTES_ERR_MAIL_VIM_MESSAGE = NOTES_MIN_ERROR_CODE+29.NotesError and NotesException classes const long NOTES_ERR_MAIL_COPEN_FAILED = NOTES_MIN_ERROR_CODE+26. const long NOTES_ERR_MAIL_NOPUBLIC_GRP = NOTES_MIN_ERROR_CODE+33. const long NOTES_ERR_INVALID_DATE = NOTES_MIN_ERROR_CODE+45. const long NOTES_ERR_MAIL_NAME_REQUIRED = NOTES_MIN_ERROR_CODE+37. const long NOTES_ERR_NOSUCH_VIEW = NOTES_MIN_ERROR_CODE+39. const long NOTES_ERR_FAILURE = NOTES_MIN_ERROR_CODE+38.

const long NOTES_ERR_CANT_GETNTH = NOTES_MIN_ERROR_CODE+66. const long NOTES_ERR_ITEMCOPY_FAILED = NOTES_MIN_ERROR_CODE+58.NotesError and NotesException classes const long NOTES_ERR_VIEWOPEN_FAILED = NOTES_MIN_ERROR_CODE+47. const long NOTES_ERR_RTCONVERT_FAILED = NOTES_MIN_ERROR_CODE+54. const long NOTES_ERR_SESSION_VALNOTSUPP = NOTES_MIN_ERROR_CODE+65. const long NOTES_ERR_DATABASE_NOTOPEN = NOTES_MIN_ERROR_CODE+63. const long NOTES_ERR_RTWRITE_FAILED = NOTES_MIN_ERROR_CODE+53. const long NOTES_ERR_FTSRCH_FAILED = NOTES_MIN_ERROR_CODE+55. const long NOTES_ERR_CREATENOTE_FAILED = NOTES_MIN_ERROR_CODE+59. const long NOTES_ERR_ATTACH_FAILED = NOTES_MIN_ERROR_CODE+67. const long NOTES_ERR_SESSION_DATECONV = NOTES_MIN_ERROR_CODE+64. const long NOTES_ERR_SESOPEN_FAILED = NOTES_MIN_ERROR_CODE+62. const long NOTES_ERR_NEXTITEM_FAILED = NOTES_MIN_ERROR_CODE+49. const long NOTES_ERR_QUERY_FAILED = NOTES_MIN_ERROR_CODE+56. const long NOTES_ERR_MODLOAD_FAILED = NOTES_MIN_ERROR_CODE+51. const long NOTES_ERR_NOTEDEL_FAILED = NOTES_MIN_ERROR_CODE+48. Chapter 10: Java Classes A–Z 1673 . const long NOTES_ERR_FINDITEM_FAILED = NOTES_MIN_ERROR_CODE+50. const long NOTES_ERR_DBNOACCESS = NOTES_MIN_ERROR_CODE+60. const long NOTES_ERR_UNAME_LOOKUP = NOTES_MIN_ERROR_CODE+61. const long NOTES_ERR_DETACH_FAILED = NOTES_MIN_ERROR_CODE+68. const long NOTES_ERR_DOCSEARCH_FAILED = NOTES_MIN_ERROR_CODE+57. const long NOTES_ERR_PROCFIND_FAILED = NOTES_MIN_ERROR_CODE+52.

const long NOTES_ERR_NOTLOCAL_IDX = NOTES_MIN_ERROR_CODE+80. const long NOTES_ERR_BAD_INDEX = NOTES_MIN_ERROR_CODE+71. const long NOTES_ERR_UNKNOWN_TYPE = NOTES_MIN_ERROR_CODE+85. const long NOTES_ERR_NOSUCH_DIRECTORY = NOTES_MIN_ERROR_CODE+72. const long NOTES_ERR_TEMPLCOPY_FAILED = NOTES_MIN_ERROR_CODE+90. const long NOTES_ERR_FORMCOMP_FAILED = NOTES_MIN_ERROR_CODE+76. const long NOTES_ERR_NOT_RT_ITEM = NOTES_MIN_ERROR_CODE+75. const long NOTES_ERR_CDTEXTCREATE_FAILED = NOTES_MIN_ERROR_CODE+73. const long NOTES_ERR_NOTEOPEN_FAILED = NOTES_MIN_ERROR_CODE+82. const long NOTES_ERR_FILEWRITE_FAILED = NOTES_MIN_ERROR_CODE+87. const long NOTES_ERR_BAD_UNID = NOTES_MIN_ERROR_CODE+91.NotesError and NotesException classes const long NOTES_ERR_EXTRACT_FAILED = NOTES_MIN_ERROR_CODE+69. const long NOTES_ERR_CDASSIM_FAILED = NOTES_MIN_ERROR_CODE+74. const long NOTES_ERR_FILEOPEN_FAILED = NOTES_MIN_ERROR_CODE+86. const long NOTES_ERR_FTIDX_FAILED = NOTES_MIN_ERROR_CODE+81. const long NOTES_ERR_DIRSEARCH_FAILED = NOTES_MIN_ERROR_CODE+70. const long NOTES_ERR_FILENOTFOUND = NOTES_MIN_ERROR_CODE+84. const long NOTES_ERR_FORMEVAL_FAILED = NOTES_MIN_ERROR_CODE+77. const long NOTES_ERR_ITEMCREATE_FAILED = NOTES_MIN_ERROR_CODE+78. const long NOTES_ERR_NODBNAME = NOTES_MIN_ERROR_CODE+89. 1674 Domino Designer Programming Guide. const long NOTES_ERR_DECRYPT_FAILED = NOTES_MIN_ERROR_CODE+79. const long NOTES_ERR_RENDER_FAILED = NOTES_MIN_ERROR_CODE+83. const long NOTES_ERR_DATE_NOTSET = NOTES_MIN_ERROR_CODE+88. Volume 3: JavaScript Classes .

const long NOTES_ERR_WRONG_CLASS = NOTES_MIN_ERROR_CODE+102.NotesError and NotesException classes const long NOTES_ERR_UNAME_REQ = NOTES_MIN_ERROR_CODE+92. const long NOTES_ERR_OLEPKG_FAILED = NOTES_MIN_ERROR_CODE+98. const long NOTES_ERR_READFILE_FAILED = NOTES_MIN_ERROR_CODE+100. const long NOTES_ERR_TMPFILE_FAILED = NOTES_MIN_ERROR_CODE+99. const long NOTES_ERR_VIEWCLONE_FAILED = NOTES_MIN_ERROR_CODE+105. const long NOTES_ERR_INVALID_AGENT = NOTES_MIN_ERROR_CODE+104. const long NOTES_ERR_INVALID_ID = NOTES_MIN_ERROR_CODE+103. const long NOTES_ERR_LOG_MAILLOG_FAILED = NOTES_MIN_ERROR_CODE+138. const long NOTES_ERR_ACLENTRY_FAILED = NOTES_MIN_ERROR_CODE+94. const long NOTES_ERR_LOG_CDCREATE_FAILED = NOTES_MIN_ERROR_CODE+137. const long NOTES_ERR_QUERYACL_FAILED = NOTES_MIN_ERROR_CODE+96. const long NOTES_ERR_MEM_HVPOOLFULL = NOTES_MIN_ERROR_CODE+139. const long NOTES_ERR_NEWSGROUPDB_FAILED = NOTES_MIN_ERROR_CODE+107. const long NOTES_ERR_RTRENDER_FAILED = NOTES_MIN_ERROR_CODE+101. const long NOTES_ERR_GETACL_FAILED = NOTES_MIN_ERROR_CODE+93. Chapter 10: Java Classes A–Z 1675 . const long NOTES_ERR_NONEWSGROUPNAME = NOTES_MIN_ERROR_CODE+108. const long NOTES_ERR_NOVIEWNAME = NOTES_MIN_ERROR_CODE+106. const long NOTES_ERR_LOG_FOPEN_FAILED = NOTES_MIN_ERROR_CODE+136. const long NOTES_ERR_REFRESH_FAILED = NOTES_MIN_ERROR_CODE+97. const long NOTES_ERR_LOG_DBOPEN_FAILED = NOTES_MIN_ERROR_CODE+135. const long NOTES_ERR_ACL_INVALID = NOTES_MIN_ERROR_CODE+95.

const long NOTES_ERR_NOFTQUERY = NOTES_MIN_ERROR_CODE+152. const long NOTES_ERR_NOTEUPDATE_FAILED = NOTES_MIN_ERROR_CODE+154. const long NOTES_ERR_VIEWDEL_FAILED = NOTES_MIN_ERROR_CODE+156. const long NOTES_ERR_SEM_ALLOC_FAILED = NOTES_MIN_ERROR_CODE+158. const long NOTES_ERR_NOSENDTO = NOTES_MIN_ERROR_CODE+168. const long NOTES_ERR_LOOKUP_FAILED = NOTES_MIN_ERROR_CODE+159. const long NOTES_ERR_LOG_CONSTRUCT_FAILED = NOTES_MIN_ERROR_CODE+157. const long NOTES_ERR_LOG_INVALID_EVTYPE = NOTES_MIN_ERROR_CODE+170. const long NOTES_ERR_MACRO_RUN_FAILED = NOTES_MIN_ERROR_CODE+163. const long NOTES_ERR_ENCRYPT_NOPERM = NOTES_MIN_ERROR_CODE+166. const long NOTES_ERR_SEND_FAILED = NOTES_MIN_ERROR_CODE+160. Volume 3: JavaScript Classes . const long NOTES_ERR_ENCRYPT_FAILED = NOTES_MIN_ERROR_CODE+167. const long NOTES_ERR_SIGN_NOPERM = NOTES_MIN_ERROR_CODE+165. const long NOTES_ERR_MACRO_IDTBL_FAILED = NOTES_MIN_ERROR_CODE+162. const long NOTES_ERR_NCREATE_FAILED = NOTES_MIN_ERROR_CODE+161. const long NOTES_ERR_DOC_NOTINVIEW = NOTES_MIN_ERROR_CODE+151. const long NOTES_ERR_LOG_EVENTPUT_FAILED = NOTES_MIN_ERROR_CODE+169. 1676 Domino Designer Programming Guide.NotesError and NotesException classes const long NOTES_ERR_COPYACL_FAILED = NOTES_MIN_ERROR_CODE+150. const long NOTES_ERR_NOTELOCATE_FAILED = NOTES_MIN_ERROR_CODE+155. const long NOTES_ERR_DBOPEN_NOTLOCAL = NOTES_MIN_ERROR_CODE+164. const long NOTES_ERR_NOITEMNAME = NOTES_MIN_ERROR_CODE+153.

const long NOTES_ERR_NOSERV_DB = NOTES_MIN_ERROR_CODE+184. const long NOTES_ERR_INVALID_DOC = NOTES_MIN_ERROR_CODE+187. Chapter 10: Java Classes A–Z 1677 . const long NOTES_ERR_DFLT_VID_FAILED = NOTES_MIN_ERROR_CODE+175. const long NOTES_ERR_NOPERM_ENVIRON = NOTES_MIN_ERROR_CODE+182. const long NOTES_ERR_INVALID_CREDEL = NOTES_MIN_ERROR_CODE+186. const long NOTES_ERR_NOPERM_DISKIO = NOTES_MIN_ERROR_CODE+179.NotesError and NotesException classes const long NOTES_ERR_LOG_INVALID_SEVERITY = NOTES_MIN_ERROR_CODE+171. const long NOTES_ERR_RTTEXT_FAILED = NOTES_MIN_ERROR_CODE+177. const long NOTES_ERR_NOPERM_ANY = NOTES_MIN_ERROR_CODE+183. const long NOTES_ERR_NEWSLETTER_FAILED = NOTES_MIN_ERROR_CODE+174. const long NOTES_ERR_NO_NEWSLETTERDOCS = NOTES_MIN_ERROR_CODE+172. const long NOTES_ERR_DBS_MUST_MATCH = NOTES_MIN_ERROR_CODE+188. const long NOTES_ERR_KEYFIND_FAILED = NOTES_MIN_ERROR_CODE+176. const long NOTES_ERR_MAILDBOPEN_FAILED = NOTES_MIN_ERROR_CODE+173. const long NOTES_ERR_RESPONSE_FAILED = NOTES_MIN_ERROR_CODE+189. const long NOTES_ERR_CONTAINS_FAILED = NOTES_MIN_ERROR_CODE+191. const long NOTES_ERR_NOPERM_SIGN = NOTES_MIN_ERROR_CODE+180. const long NOTES_ERR_RTDOCLINK_FAILED = NOTES_MIN_ERROR_CODE+178. const long NOTES_ERR_NOLISTS = NOTES_MIN_ERROR_CODE+190. const long NOTES_ERR_INVALID_DB = NOTES_MIN_ERROR_CODE+185. const long NOTES_ERR_NOPERM_ENCRYPT = NOTES_MIN_ERROR_CODE+181.

const long NOTES_ERR_INVALID_ITYPE = NOTES_MIN_ERROR_CODE+200. const long NOTES_ERR_UNKNOWN_SRCHTYPE = NOTES_MIN_ERROR_CODE+196. const long NOTES_ERR_NOSUCH_FOLDER = NOTES_MIN_ERROR_CODE+201. Volume 3: JavaScript Classes . const long NOTES_ERR_ACLWRITE_FAILED = NOTES_MIN_ERROR_CODE+208. const long NOTES_ERR_RENAME_FAILED = NOTES_MIN_ERROR_CODE+209. const long NOTES_ERR_ITYPENOT_TEXT = NOTES_MIN_ERROR_CODE+199. const long NOTES_ERR_LTDUPDATE_FAILED = NOTES_MIN_ERROR_CODE+205. const long NOTES_ERR_BADVIEW_VERSION = NOTES_MIN_ERROR_CODE+206. const long NOTES_ERR_MUSTCALL_FIRSTDB = NOTES_MIN_ERROR_CODE+197. const long NOTES_ERR_DESVIEW_FAILED = NOTES_MIN_ERROR_CODE+193. const long NOTES_ERR_ALLDOCS_FAILED = NOTES_MIN_ERROR_CODE+198. const long NOTES_ERR_LTDACCESS_FAILED = NOTES_MIN_ERROR_CODE+204. 1678 Domino Designer Programming Guide. const long NOTES_ERR_SRVSEARCH_FAILED = NOTES_MIN_ERROR_CODE+195. const long NOTES_ERR_ITEMARR_FAILED = NOTES_MIN_ERROR_CODE+194. const long NOTES_ERR_NOSUCH_ROLENAME = NOTES_MIN_ERROR_CODE+210.NotesError and NotesException classes const long NOTES_ERR_MUSTBE_STRING = NOTES_MIN_ERROR_CODE+192. const long NOTES_ERR_NEED_ADT = NOTES_MIN_ERROR_CODE+207. const long NOTES_ERR_ADDRBOOK_FAILED = NOTES_MIN_ERROR_CODE+202. const long NOTES_ERR_NOTCONTEXT_DB = NOTES_MIN_ERROR_CODE+203.

const long NOTES_ERR_DUP_ROLENAME = NOTES_MIN_ERROR_CODE+228. const long NOTES_ERR_NOADDRS_FOUND = NOTES_MIN_ERROR_CODE+227. const long NOTES_ERR_DELENTRY_FAILED = NOTES_MIN_ERROR_CODE+214. const long NOTES_ERR_NOFROMFIELD = NOTES_MIN_ERROR_CODE+231.NotesError and NotesException classes const long NOTES_ERR_PRIVNAME_FAILED = NOTES_MIN_ERROR_CODE+211. const long NOTES_ERR_REPL_FAILED = NOTES_MIN_ERROR_CODE+219. const long NOTES_ERR_INVALID_ACLENTRYNAME = NOTES_MIN_ERROR_CODE+216. Chapter 10: Java Classes A–Z 1679 . const long NOTES_ERR_TIMEADJUST_FAILED = NOTES_MIN_ERROR_CODE+222. const long NOTES_ERR_DELPRIV_FAILED = NOTES_MIN_ERROR_CODE+213. const long NOTES_ERR_READPRIV_FAILED = NOTES_MIN_ERROR_CODE+212. const long NOTES_ERR_NOSUCH_EOFILE = NOTES_MIN_ERROR_CODE+224. const long NOTES_ERR_COMPACT_FAILED = NOTES_MIN_ERROR_CODE+221. const long NOTES_ERR_NOSUCH_PATH = NOTES_MIN_ERROR_CODE+225. const long NOTES_ERR_EMBEDARR_FAILED = NOTES_MIN_ERROR_CODE+226. const long NOTES_ERR_ENTRYNAME_FAILED = NOTES_MIN_ERROR_CODE+217. const long NOTES_ERR_CANTCREATE_FOLDER = NOTES_MIN_ERROR_CODE+229. const long NOTES_ERR_NOTLOCAL_REPL = NOTES_MIN_ERROR_CODE+218. const long NOTES_ERR_NOSUCH_EMBED = NOTES_MIN_ERROR_CODE+223. const long NOTES_ERR_NOTERENDER_FAILED = NOTES_MIN_ERROR_CODE+230. const long NOTES_ERR_NOSERV_EVENTS = NOTES_MIN_ERROR_CODE+215. const long NOTES_ERR_NOTLOCAL_COMPACT = NOTES_MIN_ERROR_CODE+220.

const long NOTES_ERR_VALIDATE_FAILED = NOTES_MIN_ERROR_CODE+234. const long NOTES_ERR_INVALID_DOCLINK = NOTES_MIN_ERROR_CODE+239. const long NOTES_ERR_TEXTLIST_BAD_INPUT = NOTES_MIN_ERROR_CODE+240. const long NOTES_ERR_CANTSHOW_OLEOBJ = NOTES_MIN_ERROR_CODE+245. Volume 3: JavaScript Classes . const long NOTES_ERR_CANTCLOSEDB = NOTES_MIN_ERROR_CODE+243. const long NOTES_ERR_NEED_DB = NOTES_MIN_ERROR_CODE+250. const long NOTES_ERR_ABSTRACT_BUFFER = NOTES_MIN_ERROR_CODE+235. const long NOTES_ERR_ABSTRACTING_TEXT = NOTES_MIN_ERROR_CODE+236. const long NOTES_ERR_CANT_LINK_OLE1 = NOTES_MIN_ERROR_CODE+252. 1680 Domino Designer Programming Guide. const long NOTES_ERR_MIXED_ARRAY = NOTES_MIN_ERROR_CODE+238. const long NOTES_ERR_CANTREMOVE = NOTES_MIN_ERROR_CODE+241. const long NOTES_ERR_NOSUCH_EMBEDCLASS = NOTES_MIN_ERROR_CODE+247. const long NOTES_ERR_CANTENCRYPT = NOTES_MIN_ERROR_CODE+242. const long NOTES_ERR_NOTA_DOCUMENT = NOTES_MIN_ERROR_CODE+233. const long NOTES_ERR_DESAGENT_FAILED = NOTES_MIN_ERROR_CODE+237. const long NOTES_ERR_CANTCOPY_ITEMTYPE = NOTES_MIN_ERROR_CODE+249. const long NOTES_ERR_NEED_NOTE = NOTES_MIN_ERROR_CODE+251.NotesError and NotesException classes const long NOTES_ERR_TEXTLIST_FAILED = NOTES_MIN_ERROR_CODE+232. const long NOTES_ERR_CANTRUN_OLEOBJ = NOTES_MIN_ERROR_CODE+244. const long NOTES_ERR_NOEMBEDDED_OBJ = NOTES_MIN_ERROR_CODE+246. const long NOTES_ERR_CANTGET_DBSUMMARY = NOTES_MIN_ERROR_CODE+248.

const long NOTES_ERR_QUOTAINFO_FAILED = NOTES_MIN_ERROR_CODE+256. const long NOTES_ERR_EOARRAY_FAILED = NOTES_MIN_ERROR_CODE+254. const long NOTES_ERR_AGENT_NO_RECURSION = NOTES_MIN_ERROR_CODE+268. const long NOTES_ERR_CANTGET_MAILSERVER = NOTES_MIN_ERROR_CODE+269. const long NOTES_ERR_DELETE_AGENT = NOTES_MIN_ERROR_CODE+272. Chapter 10: Java Classes A–Z 1681 . const long NOTES_ERR_ACLNEXT_INVALID = NOTES_MIN_ERROR_CODE+258. const long NOTES_ERR_BAD_UNPROCFT = NOTES_MIN_ERROR_CODE+267. const long NOTES_ERR_FTQUERY_FAILED = NOTES_MIN_ERROR_CODE+264. const long NOTES_ERR_RUN_AGENT = NOTES_MIN_ERROR_CODE+273. const long NOTES_ERR_NOSUCH_DBID = NOTES_MIN_ERROR_CODE+265. const long NOTES_ERR_NOSUCH_VERB = NOTES_MIN_ERROR_CODE+261. const long NOTES_ERR_INVALID_ADTTYPE = NOTES_MIN_ERROR_CODE+263. const long NOTES_ERR_DOVERB_FAILED = NOTES_MIN_ERROR_CODE+262.NotesError and NotesException classes const long NOTES_ERR_ROLENAME_TOOBIG = NOTES_MIN_ERROR_CODE+253. const long NOTES_ERR_NOTAFILE = NOTES_MIN_ERROR_CODE+259. const long NOTES_ERR_ATTACHINFO_FAILED = NOTES_MIN_ERROR_CODE+255. const long NOTES_ERR_CANTFIND_ATTACHMENT = NOTES_MIN_ERROR_CODE+260. const long NOTES_ERR_DOCNOTSAVED = NOTES_MIN_ERROR_CODE+257. const long NOTES_ERR_NOSUCH_DOCINDEX = NOTES_MIN_ERROR_CODE+274. const long NOTES_ERR_BAD_NOTEID = NOTES_MIN_ERROR_CODE+270. const long NOTES_ERR_OPENBYRID_FAILED = NOTES_MIN_ERROR_CODE+266. const long NOTES_ERR_DBSECURITY = NOTES_MIN_ERROR_CODE+271.

const long NOTES_ERR_EMBED_FAILED = NOTES_MIN_ERROR_CODE+286. const long NOTES_ERR_INVALID_URL = NOTES_MIN_ERROR_CODE+282. const long NOTES_ERR_CANTOPEN_URLDB = NOTES_MIN_ERROR_CODE+280. const long NOTES_ERR_DBALREADY_OPEN = NOTES_MIN_ERROR_CODE+296. const long NOTES_ERR_INVALID_URLHEADER = NOTES_MIN_ERROR_CODE+283. Volume 3: JavaScript Classes .NotesError and NotesException classes const long NOTES_ERR_BAD_SOURCE_CLASS = NOTES_MIN_ERROR_CODE+275. 1682 Domino Designer Programming Guide. const long NOTES_ERR_NOMOVETO_PRIV1STUSE = NOTES_MIN_ERROR_CODE+291. const long NOTES_ERR_INVALID_TIMEEXPR = NOTES_MIN_ERROR_CODE+288. const long NOTES_ERR_CANT_SIGN = NOTES_MIN_ERROR_CODE+293. const long NOTES_ERR_NOSUCH_URLHEADER = NOTES_MIN_ERROR_CODE+284. const long NOTES_ERR_NO_MATCH = NOTES_MIN_ERROR_CODE+294. const long NOTES_ERR_SESSION_CLOSED = NOTES_MIN_ERROR_CODE+279. const long NOTES_ERR_NEED_URL = NOTES_MIN_ERROR_CODE+281. const long NOTES_ERR_NODEL_CURRENTDB = NOTES_MIN_ERROR_CODE+287. const long NOTES_ERR_INVALID_ITEM = NOTES_MIN_ERROR_CODE+290. const long NOTES_ERR_AMBIGUOUS_MATCH = NOTES_MIN_ERROR_CODE+295. const long NOTES_ERR_CANTDO_ARRAYOFARRAY = NOTES_MIN_ERROR_CODE+278. const long NOTES_ERR_SAMESRV_REPLICA = NOTES_MIN_ERROR_CODE+292. const long NOTES_ERR_CANT_CHANGE_DEFACL = NOTES_MIN_ERROR_CODE+276. const long NOTES_ERR_NOUNPROC_DOCS = NOTES_MIN_ERROR_CODE+285. const long NOTES_ERR_RECURSIVE_RENDER = NOTES_MIN_ERROR_CODE+289. const long NOTES_ERR_LINKNOCLASS = NOTES_MIN_ERROR_CODE+277.

const long NOTES_ERR_SRVREGFAILED = NOTES_MIN_ERROR_CODE+303. const long NOTES_ERR_NOSUCH_MAILPATH = NOTES_MIN_ERROR_CODE+309. const long NOTES_ERR_NOSUCH_PROFILE = NOTES_MIN_ERROR_CODE+320. const long NOTES_ERR_REGFAILED = NOTES_MIN_ERROR_CODE+302. const long NOTES_ERR_CANTADD_USER = NOTES_MIN_ERROR_CODE+311. const long NOTES_ERR_RECERTFAILED = NOTES_MIN_ERROR_CODE+306. const long NOTES_ERR_BAD_IDFILE = NOTES_MIN_ERROR_CODE+310. const long NOTES_ERR_NOCERT_CTX = NOTES_MIN_ERROR_CODE+301. const long NOTES_ERR_MISSING_CERTID = NOTES_MIN_ERROR_CODE+300. const long NOTES_ERR_NOSUCH_BOOL = NOTES_MIN_ERROR_CODE+307. const long NOTES_ERR_REGARG_NOTGIVEN = NOTES_MIN_ERROR_CODE+299. const long NOTES_ERR_CERTREGFAILED = NOTES_MIN_ERROR_CODE+304. const long NOTES_ERR_CANTSWITCH_ID = NOTES_MIN_ERROR_CODE+308. const long NOTES_ERR_NOCURRENT_FTRESULT = NOTES_MIN_ERROR_CODE+317. const long NOTES_ERR_NOCURRENT_AGENT = NOTES_MIN_ERROR_CODE+314. const long NOTES_ERR_XCERTFAILED = NOTES_MIN_ERROR_CODE+305. const long NOTES_ERR_AGENTLOG_FAILED = NOTES_MIN_ERROR_CODE+315. const long NOTES_ERR_PROF_ARG_MISSING = NOTES_MIN_ERROR_CODE+319. const long NOTES_ERR_NOSUCH_CERTIDTYPE = NOTES_MIN_ERROR_CODE+316.NotesError and NotesException classes const long NOTES_ERR_OLE_NOTAVAIL = NOTES_MIN_ERROR_CODE+297. const long NOTES_ERR_CANTADD_SERV = NOTES_MIN_ERROR_CODE+312. const long NOTES_ERR_IDTBL_FAILED = NOTES_MIN_ERROR_CODE+318. const long NOTES_ERR_CANTADD_CERT = NOTES_MIN_ERROR_CODE+313. Chapter 10: Java Classes A–Z 1683 . const long NOTES_ERR_ARRAY_NOGOOD = NOTES_MIN_ERROR_CODE+298.

const long NOTES_ERR_FREETIME_FAILED = NOTES_MIN_ERROR_CODE+328. const long NOTES_ERR_MARKREAD_FAILED = NOTES_MIN_ERROR_CODE+331. const long NOTES_ERR_WRONG_UNID_LEN = NOTES_MIN_ERROR_CODE+324. const long NOTES_ERR_MULTIDB_FAILED = NOTES_MIN_ERROR_CODE+333. const long NOTES_ERR_NOCLOSE_CURRDB = NOTES_MIN_ERROR_CODE+327. const long NOTES_ERR_GETOPTION_FAILED = NOTES_MIN_ERROR_CODE+330. const long NOTES_ERR_NOSUCH_ARG = NOTES_MIN_ERROR_CODE+323. const long NOTES_ERR_ADDPROF_FAILED = NOTES_MIN_ERROR_CODE+334. const long NOTES_ERR_MARKUNREAD_FAILED = NOTES_MIN_ERROR_CODE+332. const long NOTES_ERR_FORMDEL_FAILED = NOTES_MIN_ERROR_CODE+326. const long NOTES_ERR_STAMP_FAILED = NOTES_MIN_ERROR_CODE+337. const long NOTES_ERR_NOTCONTEXT_COLLEC = NOTES_MIN_ERROR_CODE+340. const long NOTES_ERR_BAD_ORGUNIT = NOTES_MIN_ERROR_CODE+338. Volume 3: JavaScript Classes . const long NOTES_ERR_INVALID_OBJECT = NOTES_MIN_ERROR_CODE+336. const long NOTES_ERR_BAD_FTSORT = NOTES_MIN_ERROR_CODE+339.NotesError and NotesException classes const long NOTES_ERR_PROFUPDATE_FAILED = NOTES_MIN_ERROR_CODE+321. const long NOTES_ERR_PROFDELETE_FAILED = NOTES_MIN_ERROR_CODE+322. 1684 Domino Designer Programming Guide. const long NOTES_ERR_ULOOKUP_FAILED = NOTES_MIN_ERROR_CODE+335. const long NOTES_ERR_DESFORM_FAILED = NOTES_MIN_ERROR_CODE+325. const long NOTES_ERR_UNIFORM_FAILED = NOTES_MIN_ERROR_CODE+329.

Chapter 10: Java Classes A–Z 1685 . const long NOTES_ERR_RTSTYLE_APPENDFAILED = NOTES_MIN_ERROR_CODE+357. const long NOTES_ERR_RTSTYLE_BADFONT = NOTES_MIN_ERROR_CODE+358. const long NOTES_ERR_NO_CONTEXTDB = NOTES_MIN_ERROR_CODE+359. const long NOTES_ERR_W32DOM_FAILED = NOTES_MIN_ERROR_CODE+342. const long NOTES_ERR_W32DOM_BADPLATFORM = NOTES_MIN_ERROR_CODE+344. const long NOTES_ERR_CANTREMOVE_AGC = NOTES_MIN_ERROR_CODE+354. const long NOTES_ERR_W32DOM_BADNETAPI32 = NOTES_MIN_ERROR_CODE+345. const long NOTES_ERR_W32DOM_DOMAIN_CONTROLLER = NOTES_MIN_ERROR_CODE+346. const long NOTES_ERR_CANTENCRYPT_AGC = NOTES_MIN_ERROR_CODE+355. const long NOTES_ERR_W32DOM_NOFIRSTUSER = NOTES_MIN_ERROR_CODE+343. const long NOTES_ERR_AGSAVE_FAILED = NOTES_MIN_ERROR_CODE+353. const long NOTES_ERR_NULL_APPENDLIST = NOTES_MIN_ERROR_CODE+360. const long NOTES_ERR_CANT_SELF_ASSIMILATE = NOTES_MIN_ERROR_CODE+349. const long NOTES_ERR_BAD_KEYTYPE = NOTES_MIN_ERROR_CODE+348. const long NOTES_ERR_POP3_FAILED = NOTES_MIN_ERROR_CODE+351. const long NOTES_ERR_TOOMANY_SORT_KEYS = NOTES_MIN_ERROR_CODE+347.NotesError and NotesException classes const long NOTES_ERR_ECLACCESS_FAILED = NOTES_MIN_ERROR_CODE+341. const long NOTES_ERR_CANT_SELF_COPY = NOTES_MIN_ERROR_CODE+350. const long NOTES_ERR_RTSTYLE_CREATEFAILED = NOTES_MIN_ERROR_CODE+356. const long NOTES_ERR_ARRCREATE_FAILED = NOTES_MIN_ERROR_CODE+352.

const long NOTES_ERR_OBJECT_NOT_FOUND = NOTES_MIN_ERROR_CODE+379. const long NOTES_ERR_RTSTYLE_BADCOLOR = NOTES_MIN_ERROR_CODE+365. const long NOTES_ERR_INVALID_NAME = NOTES_MIN_ERROR_CODE+375. const long NOTES_ERR_FOLDERREFS_NOT_SUPPORTED_BY_DB = NOTES_MIN_ERROR_CODE+386. const long NOTES_ERR_RTITEM_EXISTS = NOTES_MIN_ERROR_CODE+368. const long NOTES_ERR_DBFOLDERREFS_NOT_ENABLED = NOTES_MIN_ERROR_CODE+387. const long NOTES_ERR_INVALID_JARRAY = NOTES_MIN_ERROR_CODE+362. const long NOTES_ERR_NOTA_VECTOR = NOTES_MIN_ERROR_CODE+370. const long NOTES_ERR_NO_COLLECTION = NOTES_MIN_ERROR_CODE+373. const long NOTES_ERR_NOFORM = NOTES_MIN_ERROR_CODE+369. Volume 3: JavaScript Classes . const long NOTES_ERR_NOT_LOCAL = NOTES_MIN_ERROR_CODE+377. const long NOTES_ERR_RTSTYLE_BADEFFECT = NOTES_MIN_ERROR_CODE+366. const long NOTES_ERR_SERVER_SWITCH = NOTES_MIN_ERROR_CODE+371. const long NOTES_ERR_DELETED = NOTES_MIN_ERROR_CODE+376. const long NOTES_ERR_RTSTYLE_BADBOOL = NOTES_MIN_ERROR_CODE+363. 1686 Domino Designer Programming Guide. const long NOTES_ERR_INVALID_TIMEZONE = NOTES_MIN_ERROR_CODE+383. const long NOTES_ERR_NOTREMOTE_DB = NOTES_MIN_ERROR_CODE+367.NotesError and NotesException classes const long NOTES_ERR_NOSUCH_JAVA_TYPE = NOTES_MIN_ERROR_CODE+361. const long NOTES_ERR_DBDIR_THREAD = NOTES_MIN_ERROR_CODE+372. const long NOTES_ERR_RTSTYLE_BADFONTSIZE = NOTES_MIN_ERROR_CODE+364. const long NOTES_ERR_NOT_IN_SESSION = NOTES_MIN_ERROR_CODE+374. const long NOTES_ERR_INVALID_RANGE = NOTES_MIN_ERROR_CODE+378.

const long NOTES_ERR_RTPSTYLE_BADPAGINATE = NOTES_MIN_ERROR_CODE+402. const long NOTES_ERR_VIEW_MISSING = NOTES_MIN_ERROR_CODE+407. const long NOTES_ERR_ACL_MISSING = NOTES_MIN_ERROR_CODE+403. Chapter 10: Java Classes A–Z 1687 . const long NOTES_ERR_RTPSTYLE_BADALIGN = NOTES_MIN_ERROR_CODE+400. const long NOTES_ERR_RTPSTYLE_TOOMANYTABS = NOTES_MIN_ERROR_CODE+398.NotesError and NotesException classes const long NOTES_ERR_VIEWNAV_BAD_ENTRY = NOTES_MIN_ERROR_CODE+391. const long NOTES_ERR_RTPSTYLE_OUTOFRANGE = NOTES_MIN_ERROR_CODE+399. const long NOTES_ERR_PSTYLE_MISSING = NOTES_MIN_ERROR_CODE+410. const long NOTES_ERR_VIEWNAV_BAD_MAX = NOTES_MIN_ERROR_CODE+392. const long NOTES_ERR_DOCUMENT_MISSING = NOTES_MIN_ERROR_CODE+406. const long NOTES_ERR_VIEW_INVALID_COLUMN = NOTES_MIN_ERROR_CODE+396. const long NOTES_ERR_RTPSTYLE_APPENDFAILED = NOTES_MIN_ERROR_CODE+397. const long NOTES_ERR_RTPSTYLE_BADSPACING = NOTES_MIN_ERROR_CODE+401. const long NOTES_ERR_NOT_IMPLEMENTED = NOTES_MIN_ERROR_CODE+395. const long NOTES_ERR_PARENT_MISSING = NOTES_MIN_ERROR_CODE+408. const long NOTES_ERR_VIEWNAV_BAD_PARENT = NOTES_MIN_ERROR_CODE+394. const long NOTES_ERR_NOT_RICHTEXT = NOTES_MIN_ERROR_CODE+409. const long NOTES_ERR_VIEWNAV_BAD_POS = NOTES_MIN_ERROR_CODE+393. const long NOTES_ERR_DATABASE_MISSING = NOTES_MIN_ERROR_CODE+405. const long NOTES_ERR_SESSION_MISSING = NOTES_MIN_ERROR_CODE+404.

const long NOTES_ERR_PROP_NOT_AVAIL = NOTES_MIN_ERROR_CODE+428. const long NOTES_ERR_VIEW_ENTRY_REMOVED = NOTES_MIN_ERROR_CODE+432. const long NOTES_ERR_NO_LOGS_OPEN = NOTES_MIN_ERROR_CODE+430. const long NOTES_ERR_INVALID_VNLEVEL = NOTES_MIN_ERROR_CODE+424. 1688 Domino Designer Programming Guide. const long NOTES_ERR_NOT_IN_ACL = NOTES_MIN_ERROR_CODE+429. const long NOTES_ERR_RTPSTYLE_BADTABTYPE = NOTES_MIN_ERROR_CODE+419. const long NOTES_ERR_MAXDBSIZE_EXCEEDED = NOTES_MIN_ERROR_CODE+422. const long NOTES_ERR_ENTRY_NOTE_FROM_COLLECTION = NOTES_MIN_ERROR_CODE+412. const long NOTES_ERR_SYNCH_NOOLE = NOTES_MIN_ERROR_CODE+418. const long NOTES_ERR_NOT_IN_VIEW = NOTES_MIN_ERROR_CODE+426. const long NOTES_ERR_ADDENTRY_FAILED = NOTES_MIN_ERROR_CODE+415.NotesError and NotesException classes const long NOTES_ERR_REMOVEALL_FAILED = NOTES_MIN_ERROR_CODE+411. const long NOTES_ERR_EXECUTESETUP_FAILED = NOTES_MIN_ERROR_CODE+421. Volume 3: JavaScript Classes . const long NOTES_ERR_NOTE_NOT_FROM_COLLECTION = NOTES_MIN_ERROR_CODE+413. const long NOTES_ERR_MACRO_SNM_ENABLE_FAILED = NOTES_MIN_ERROR_CODE+416. const long NOTES_ERR_SYNCH_RUN_AGENT = NOTES_MIN_ERROR_CODE+417. const long NOTES_ERR_INVALID_NAV = NOTES_MIN_ERROR_CODE+423. const long NOTES_ERR_SVRACCESS_FAILED = NOTES_MIN_ERROR_CODE+425. const long NOTES_ERR_ADDENTRY_DUP = NOTES_MIN_ERROR_CODE+414. const long NOTES_ERR_GETALLENTRIES_FAILED = NOTES_MIN_ERROR_CODE+420. const long NOTES_ERR_NOT_IN_DB = NOTES_MIN_ERROR_CODE+427. const long NOTES_ERR_CACHE_SZ_INVALID = NOTES_MIN_ERROR_CODE+431.

const long NOTES_ERR_CANTUPDATE_FOLDER = NOTES_MIN_ERROR_CODE+440. const long NOTES_ERR_OUTLINE_MISSING = NOTES_MIN_ERROR_CODE+448. const long NOTES_ERR_CREATEOUTLINE_FAILED = NOTES_MIN_ERROR_CODE+436. const long NOTES_ERR_VNAV_CAT_GOTO = NOTES_MIN_ERROR_CODE+451. const long NOTES_ERR_DOCUMENT_DELETED = NOTES_MIN_ERROR_CODE+434. const long NOTES_ERR_INVALID_SIZE = NOTES_MIN_ERROR_CODE+452.NotesError and NotesException classes const long NOTES_ERR_VIEW_ENTRY_DELETED = NOTES_MIN_ERROR_CODE+433. const long NOTES_ERR_NAME_MISSING = NOTES_MIN_ERROR_CODE+443. const long NOTES_ERR_EXECUTESETUP_FAILED2 = NOTES_MIN_ERROR_CODE+439. const long NOTES_ERR_VIEWENTRY_OR_DOC_MISSING = NOTES_MIN_ERROR_CODE+447. const long NOTES_ERR_VIEWENTRY_MISSING = NOTES_MIN_ERROR_CODE+446. Chapter 10: Java Classes A–Z 1689 . const long NOTES_ERR_ITEM_MISSING = NOTES_MIN_ERROR_CODE+444. const long NOTES_ERR_HTML_GENFAILED = NOTES_MIN_ERROR_CODE+437. const long NOTES_ERR_DATERANGE_MISSING = NOTES_MIN_ERROR_CODE+445. const long NOTES_ERR_CREATE_DOCCOLL_FAILED = NOTES_MIN_ERROR_CODE+438. const long NOTES_ERR_ERR_NOTES_SYNCH_INVALIDOP = NOTES_MIN_ERROR_CODE+435. const long NOTES_ERR_VNAV_CAT_PARENT = NOTES_MIN_ERROR_CODE+450. const long NOTES_ERR_RTITEM_MISSING = NOTES_MIN_ERROR_CODE+441. const long NOTES_ERR_DATETIME_MISSING = NOTES_MIN_ERROR_CODE+449. const long NOTES_ERR_NO_AUTHORIZATION = NOTES_MIN_ERROR_CODE+442.

Volume 3: JavaScript Classes . const long NOTES_ERR_BAD_ENTRYDOC NOTES_MIN_ERROR_CODE+462.NotesError and NotesException classes const long NOTES_ERR_REGSERVER_NOTSET = NOTES_MIN_ERROR_CODE+453. const long NOTES_ERR_INVALID_TIMESPEC = NOTES_MIN_ERROR_CODE+459. const long NOTES_ERR_ACLENTRY_MISSING = NOTES_MIN_ERROR_CODE+467. const long NOTES_ERR_ACL_ROLE_INVALID = NOTES_MIN_ERROR_CODE+465. const long NOTES_ERR_ADDDOC_DUP = NOTES_MIN_ERROR_CODE+469. const long NOTES_ERR_NOT_RESOLVED NOTES_MIN_ERROR_CODE+455. = const long NOTES_ERR_UNINITIALIZED_THREAD = NOTES_MIN_ERROR_CODE+463. const long NOTES_ERR_GETIOR_FAILED = NOTES_MIN_ERROR_CODE+457. const long NOTES_ERR_CANTSAVE_CURRENTAGENT = NOTES_MIN_ERROR_CODE+460. const long NOTES_ERR_INVALIDATED_OBJECT = NOTES_MIN_ERROR_CODE+464. const long NOTES_ERR_NOT_ATTACHMENT = NOTES_MIN_ERROR_CODE+454. wstring getErrorString(in long id). const long NOTES_ERR_ARG_DELETED = NOTES_MIN_ERROR_CODE+466. const long NOTES_ERR_INVALID_DATESPEC = NOTES_MIN_ERROR_CODE+458. const long NOTES_ERR_CANTDISABLE_MANUALAGENT = NOTES_MIN_ERROR_CODE+461. /* end interface */ 1690 Domino Designer Programming Guide. }. = const long NOTES_ERR_INVALID_IOR = NOTES_MIN_ERROR_CODE+456.

Applet app. } Chapter 10: Java Classes A–Z 1691 . use createSession() to create a Session object. String passwd) throws NotesException. String passwd) throws NotesException. String passwd) throws NotesException.applet. For applications making remote (IIOP) calls. String user. static public Session createSession(java. /* Remote (IIOP) session using host name */ static public Session createSession(String host) throws NotesException. String args[]. String passwd) throws NotesException. static public Session createSessionWithIOR(String IOR.ORB orb. /* Remote (IIOP) session using IOR */ static public Session createSessionWithIOR(String IOR) throws NotesException. String user. static public Session createSession(String host. /* Remote (IIOP) session for applet */ static public Session createSession(java. /* Get ORB from host */ static public String getIOR(String host) throws Exception.Notes client must be installed */ static public Session createSession() throws NotesException.Applet app. String user. static public Session createSession(String host. String user. String user. use a createSession method with the host parameter. String passwd) throws NotesException. String user. String passwd) throws NotesException.omg.NotesFactory class NotesFactory class For applications making local calls.applet. The specification of the NotesFactory class is as follows: public class NotesFactory { /* Local session . static public Session createSessionWithIOR(String IOR. String args[].CORBA. org.

This includes threads invoked by AWT that access Domino objects. public void finalize(). This extension to Thread is required to run Java programs that make local calls to the Domino classes. public void initThread(). extend NotesThread instead of Thread and include a runNotes method instead of run: public class myClass extends NotesThread { public void runNotes() { // my code } } 1692 Domino Designer Programming Guide. public static void load(boolean debug) throws NotesException. public NotesThread(Runnable t.lang. String name). Runnable t). as this capability is provided in the base code. public NotesThread(ThreadGroup group. but is not allowed for applications that make remote calls. } Executing threads through inheritance To execute threads through inheritance. Applets and agents that extend AppletBase and AgentBase do not need to code for local versus remote calls. public NotesThread(String name).Thread to include special initialization and termination code for Domino. Volume 3: JavaScript Classes . String name). public void termThread(). String name). public NotesThread(ThreadGroup group. public static void stermThread().lang. The class NotesThread The specification of the class NotesThread is as follows: public class NotesThread extends java. public static void sinitThread().NotesThread class NotesThread class The NotesThread class extends java. public void runNotes() throws NotesException. Runnable t. public final void run(). public NotesThread(ThreadGroup group. public NotesThread(Runnable t).Thread { public NotesThread(). An application that makes both local and remote calls must determine dynamically when to use the static methods sinitThread and stermThread.

Executing threads through the Runnable interface To execute threads through the Runnable interface.start().runNotes(). m. // my code } //my code Chapter 10: Java Classes A–Z 1693 .sinitThread(). Call stermThread() exactly one time for each call to sinitThread(). call sinitThread() to initialize a thread and stermThread() to terminate the thread.NotesThread class Start a Domino thread the same as any thread: myClass m = new myClass(). putting stermThread in a finally block is recommended. public class myClass { public static void main(String argv[]) { try { NotesThread. implement Runnable and include a run method as you would for any class using threads: public class myClass implements Runnable { public void run() { // my code } } You might include both run and runNotes methods so the class works whether you specify “implements Runnable” or “extends NotesThread”: public class myClass implements Runnable { public void run() { this. } public void runNotes() { // my code } } Executing threads through the static methods To execute threads through the static methods.

} } } getURL method The following method: public String getURL() Returns the Domino URL for its parent object when called in the following classes: Agent Database Document Form Session (returns an empty string if called locally) View recycle method All lotus. This method effectively batches recycle operations and is especially efficient for remote (IIOP) calls. Recycle an object in the same thread in which it is created. In Session. Recycling a parent recycles all the children.stermThread().domino classes contain the following method: public void recycle() Session contains the following method.Vector objects) The recycle method returns an object’s memory to the system and is provided because the garbage collector is not effective in recovering Domino resources. If you appear to have memory problems. try recycle but adhere to the following guidelines: Recycle an object only if it is no longer needed. where the vector contains the Domino Objects to be recycled. Volume 3: JavaScript Classes . public void recycle(java. you should call recycle only after all threads exit. 1694 Domino Designer Programming Guide.NotesThread class finally { NotesThread.util.

domino classes implement the java. Chapter 10: Java Classes A–Z 1695 . Results are undefined if you attempt to use a recycled object. In a remote environment.domino classes override the toString method of java. the Java object can no longer communicate with its remote counterpart. toString method The following lotus. recycle can be called from any thread on any object.Visibility interface and are configured to be invisible. avoidingGUI() always returns true. In a remote environment.Object and return values as indicated: ACLEntry (same as getName) Agent (same as getName) AgentContext (same as getEffectiveUserName) Database (same as getFilePath) DateRange (same as getText) DateTime (same as getLocalTime) DbDirectory (same as getName) Document (same as getUniversalID) EmbeddedObject (same as getName) Form (same as getName) Item (same as getName) Log (same as getProgramName) Name (same as getCanonical) Session (same as getUserName) View (same as getName) ViewColumn (same as getTitle) Visibility interface All lotus.beans. Although a client-side cache exists. The following methods return values as indicated: needsGui() always returns false. recycle releases resources on the server.NotesThread class Loops enumerating documents or items are good candidates for recycling. No error is guaranteed.lang.

Volume 3: JavaScript Classes . grantAccess. using these methods at the same time an ACL object is in use may produce inconsistent results.ACL class ACL class Represents the access control list (ACL) of a database. 1696 Domino Designer Programming Guide. Usage The Database class has three methods you can use to access and modify an ACL without getting an ACL object: queryAccess. To get it. Syntax public class ACL extends Base Containment Contained by: Database Contains: ACLEntry Properties InternetLevel through getInternetLevel and setInternetLevel IsUniformAccess through isUniformAccess and setUniformAccess Parent through getParent Roles through getRoles Methods addRole createACLEntry deleteRole getEntry getFirstEntry getNextEntry renameRole removeACLEntry save Access Every Database object contains an ACL object representing the access control list of that database. use getACL in Database. However. and revokeAccess.

getNextEntry(entry)) != null).ACL class Example: ACL class This agent prints the name of each entry in the ACL for the current database.*.getACL(). } catch(Exception e) { e.getFirstEntry(). import lotus.printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The maximum Internet access level for this database.LEVEL_READER ACL. // (Your code goes here) Database db = agentContext.domino.println(entry. ACL acl = db. AgentContext agentContext = session. } } } InternetLevel property Read-write. } while ((entry = acl.getAgentContext(). do { System.getCurrentDatabase().LEVEL_NOACCESS ACL. ACLEntry entry = acl.getName()).LEVEL_DEPOSITOR ACL.out. Defined in ACL Data type int Syntax public int getInternetLevel() throws NotesException public void setInternetLevel(int level) throws NotesException Legal values ACL.LEVEL_AUTHOR Chapter 10: Java Classes A–Z 1697 .

break. if (ilev < ACL.LEVEL_DESIGNER: lev = "designer".LEVEL_EDITOR: lev = "editor". case ACL. Example: InternetLevel property This agent prints the maximum Internet level for the current database.getInternetLevel()) { case ACL. break. case ACL. case ACL.LEVEL_MANAGER Usage You must call save if you want the modified ACL to be saved to disk.getInternetLevel().LEVEL_MANAGER: lev = "manager". case ACL.LEVEL_NOACCESS: lev = "no". ACL acl = db. int ilev = acl.LEVEL_DESIGNER) acl.*. String lev = null.domino.save(). break. acl. case ACL. case ACL.LEVEL_EDITOR ACL. // (Your code goes here) Database db = agentContext. import lotus.ACL class ACL.out. switch(acl. break. } System. AgentContext agentContext = session. } catch(Exception e) { e.LEVEL_READER: lev = "reader".println( "Maximum internet access is " + lev + " access").LEVEL_DEPOSITOR: lev = "depositor".printStackTrace().getACL().getCurrentDatabase().getAgentContext(). break. Volume 3: JavaScript Classes .LEVEL_DESIGNER ACL. break. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setInternetLevel(ilev + 1). break. } } } 1698 Domino Designer Programming Guide.LEVEL_AUTHOR: lev = "author".

save().isUniformAccess()).*.out.println ("Uniform access is " + acl.getAgentContext(). if (acl. acl.isUniformAccess()) acl.out. Example: IsUniformAccess property The following agent toggles the IsUniformAccess property. // (Your code goes here) Database db = agentContext. Chapter 10: Java Classes A–Z 1699 . System. you must call save on the ACL if you want the modified ACL to be saved to disk.getACL(). System. Defined in ACL class Data type boolean Syntax public boolean isUniformAccess() throws NotesException public void setUniformAccess(boolean flag) throws NotesException Legal values true indicates that uniform access is set false indicates that uniform access is not set Usage For setUniformAccess. else acl.setUniformAccess(true). import lotus. ACL acl = db.isUniformAccess()). AgentContext agentContext = session. Indicates if a consistent access control list is enforced across all replicas of a database.getCurrentDatabase().println ("Uniform access is " + acl.ACL class IsUniformAccess property Read-write. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.setUniformAccess(false).

} catch(Exception e) { e.*.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext.getAgentContext().getTitle() + "\""). ACL acl = db.ACL class } catch(Exception e) { e. } } } Parent property Read-only. Defined in ACL Data type Database Syntax public Database getParent() Example: Parent property This agent prints the title of the parent database for the current ACL. Database parent = acl. AgentContext agentContext = session.getACL(). Volume 3: JavaScript Classes .printStackTrace().getParent(). System.println ("Parent database is \"" + db.out.printStackTrace(). The database that owns an ACL. import lotus. } } } 1700 Domino Designer Programming Guide.getCurrentDatabase().

util. All the roles defined in an access control list.) Example: Roles property This agent displays the name of every role in the current database.Vector getRoles() throws NotesException Usage Each element in the vector is the name of a role.println(roles. } } } Chapter 10: Java Classes A–Z 1701 . [Supervisor].domino.ACL class Roles property Read-only. } catch(Exception e) { e. for example.*.getCurrentDatabase().getAgentContext(). it might display [HR Contact]. Each role name is enclosed in square brackets.util. i<roles. import lotus. and [Project Leader].Vector.printStackTrace(). Vector roles = acl.util. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session. for (int i=0.getACL(). (Notes Release 2 “privileges” are enclosed in parentheses.size(). elements are String Syntax public java. For example.Vector. [Supervisor].elementAt(i)). ACL acl = db. import java. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). i++) System.getRoles(). Defined in ACL Data type java.out.

Volume 3: JavaScript Classes . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ACL acl = db.addRole(agent. acl.getACL().save(). // (Your code goes here) Agent agent = agentContext. Database db = agentContext. import lotus. acl.printStackTrace(). The user specifies the role in the agent comment.getCurrentAgent().ACL class addRole method Adds a role to an ACL.getAgentContext().*. } } } 1702 Domino Designer Programming Guide. Example: addRole method This agent adds a role to the ACL of the current database.getCurrentDatabase(). AgentContext agentContext = session. Usage You must call save on the ACL if you want the modified ACL to be saved to disk.getComment()). Defined in ACL Syntax public void addRole(String name) throws NotesException Parameter String name The name of the new role. } catch(Exception e) { e. Do not put square brackets around the name.domino.

Case is not significant. Defined in ACL Syntax public ACLEntry createACLEntry(String name.LEVEL_NOACCESS ACL. int level) throws NotesException Parameters String name The name of the person. or server in the ACL. or server for whom you want to create an entry in the ACL.LEVEL_READER ACL. group.ACL class createACLEntry method Creates an entry in the ACL with the name and level that you specify. Chapter 10: Java Classes A–Z 1703 .LEVEL_DESIGNER ACL.LEVEL_EDITOR ACL.LEVEL_AUTHOR ACL. Usage You must call save on the ACL if you want the modified ACL to be saved to disk. int level The level you want to assign to this person.LEVEL_MANAGER Return value ACLEntry The newly-created entry. You must supply the complete name but hierarchical names can be in abbreviated format. May be any of the following: ACL.LEVEL_DEPOSITOR ACL. group.

createACLEntry(agent.save(). ACL acl = db. Defined in ACL Syntax public void deleteRole(String name) throws NotesException Parameters String name The name of the role to remove.getCurrentDatabase().*. } catch(Exception e) { e. Volume 3: JavaScript Classes . AgentContext agentContext = session.ACL class Example: createACLEntry and save methods This agent creates a new entry for the ACL of the current database.getCurrentAgent(). acl. } } } deleteRole method Deletes a role from an ACL and removes it from any ACL entries that have it. The entry has manager access level. // (Your code goes here) Agent agent = agentContext. Database db = agentContext. Usage You must call save on the ACL if you want the modified ACL to be saved to disk.domino. ACL. 1704 Domino Designer Programming Guide. The user specifies the name of the entry in the agent comment. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace().getACL(). import lotus. acl. Do not put square brackets around the name.getAgentContext().LEVEL_MANAGER).getComment().

returns null.getComment()). ACL acl = db.save(). } catch(Exception e) { e. You must supply the complete name but hierarchical names can be in abbreviated format.deleteRole(agent. Chapter 10: Java Classes A–Z 1705 .domino. Return value ACLEntry The ACL entry that matches the name. // (Your code goes here) Agent agent = agentContext.getCurrentAgent().getCurrentDatabase(). } } } getEntry method Given a name.*. acl. Database db = agentContext.getAgentContext().getACL(). If name is not in the ACL.ACL class Example: deleteRole method This agent deletes a role from the ACL for the current database. Case is not significant. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). acl. The user specifies the role in the agent comment. Defined in ACL Syntax public ACLEntry getEntry(String ename) throws NotesException Parameter String ename The name whose ACL entry you want to find. finds its entry in an ACL. AgentContext agentContext = session.printStackTrace().

*. If you need this capability.domino.} else System. ACL acl = db. Example: getEntry method This agent gets the ACL entry whose name is the agent comment. getEntry does not find that person’s name. Database db = agentContext. AgentContext agentContext = session. else System.ACL class Usage This method can find people.getName() + " can delete documents"). } catch(Exception e) { e.getComment()).out.printStackTrace().out. // (Your code goes here) Agent agent = agentContext.println (entry.getEntry(agent.getCurrentAgent().getAgentContext(). and prints whether the entry can delete documents.out.isCanDeleteDocuments()) System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase().getName() + " cannot delete documents"). If a person is not listed explicitly in the ACL.getACL(). groups.println (entry. but is a member of a group listed in the ACL. Volume 3: JavaScript Classes . if (entry != null) { if (entry. or servers in an ACL. use the queryAccess method in Database.println ("No entry for " + agent. } } } 1706 Domino Designer Programming Guide. import lotus. ACLEntry entry = acl.getComment()).

// (Your code goes here) Agent agent = agentContext.ACL class getFirstEntry method Returns the first entry in an ACL.getACL().getComment() == "") { System.getNameObject(). if (agent. Example: getFirstEntry and getNextEntry methods This agent looks for an ACL entry that matches the agent comment disregarding case.getCommon().getFirstEntry().println("Comment not specified").getCurrentAgent(). import lotus. AgentContext agentContext = session.entry. } } Chapter 10: Java Classes A–Z 1707 .getAgentContext(). ACL acl = db. Usage The first entry is typically the -Default. do { if (entry. ACLEntry entry = acl. Defined in ACL Syntax public ACLEntry getFirstEntry() throws NotesException Return value ACLEntry The first entry in the ACL. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). break.out. equalsIgnoreCase(agent.*.getComment())) { gotIt = true.getCurrentDatabase(). boolean gotIt = false.domino. } else { Database db = agentContext.

getNextEntry(entry)) != null). Return value ACLEntry The ACL entry following the entry specified as the parameter. Defined in ACL Syntax public ACLEntry getNextEntry() throws NotesException public ACLEntry getNextEntry(ACLEntry entry) throws NotesException Parameter ACLEntry entry Any entry in the ACL. } } catch(Exception e) { e. else System. this method returns the entry following the last entry retrieved. if (gotIt) System.printStackTrace().out.getComment() + " is in the ACL"). } } } getNextEntry method Returns the next ACL entry or the one following a specified entry. 1708 Domino Designer Programming Guide. The no-parameter method improves performance for remote operations because ACL entries are cached locally.getComment() + " is not in the ACL"). Usage With no parameter. Cannot be null. Volume 3: JavaScript Classes .out.println (agent. Returns null if there are no more entries.println (agent.ACL class while ((entry = acl.

getAgentContext(). Database db = agentContext.*. import lotus. Usage You must call save on the ACL if you want the modified ACL to be saved to disk. } } } Chapter 10: Java Classes A–Z 1709 .ACL class removeACLEntry method Removes an entry from the ACL.getCurrentAgent(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). or server whose entry you want to remove. acl.removeACLEntry(agent. acl.domino. // (Your code goes here) Agent agent = agentContext. AgentContext agentContext = session. Case is not significant.getComment()). ACL acl = db. You must supply the complete name but hierarchical names can be in abbreviated format. Example: removeACLEntry method This agent removes the ACL entry that matches the agent comment disregarding case.save().getACL().getCurrentDatabase(). } catch(Exception e) { e. Defined in ACL Syntax public void removeACLEntry(String name) throws NotesException Parameter String name The name of the person.printStackTrace(). group.

[Supervisor] becomes [SupervisorRole]. import lotus. Vector roles = acl. The code takes into account the brackets returned by the Roles property. String role.getAgentContext(). Usage You must call save on the ACL if you want the modified ACL to be saved to disk. import java. Example: renameRole method This agent appends “Role” to the name of each role. AgentContext agentContext = session. role = role. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. for (int i=0. String newname The new name you want to give to the role. any entries in the ACL that had the old role get the new role. i++) { role = (String)roles. Defined in ACL Syntax public void renameRole(String oldname.getRoles(). When you rename a role. String newname) throws NotesException Parameters String oldname The current name of the role. Volume 3: JavaScript Classes . i<roles. // (Your code goes here) Database db = agentContext.*. For example.ACL class renameRole method Changes the name of a role.getCurrentDatabase().substring(1.renameRole((String)roles. Do not specify the brackets.elementAt(i). Do not put square brackets around the name.util.elementAt(i). role. acl. ACL acl = db. 1710 Domino Designer Programming Guide.getACL().Vector.size().length()-1).

or a server. } } } save method Saves changes you’ve made to the ACL.save().ACLEntry class "[" + role + "Role]"). a group.printStackTrace(). } acl. the changes you’ve made to its ACL are lost. } catch(Exception e) { e. Syntax public class ACLEntry extends Base Containment Contained by: ACL Properties IsAdminReaderAuthor through isAdminReaderAuthor and setAdminReaderAuthor IsAdminServer through isAdminServer and setAdminServer IsCanCreateDocuments through isCanCreateDocuments and setCanCreateDocuments IsCanCreateLSOrJavaAgent through isCanCreateLSOrJavaAgent and setCanCreateLSOrJavaAgent IsCanCreatePersonalAgent through isCanCreatePersonalAgent and setCanCreatePersonalAgent Chapter 10: Java Classes A–Z 1711 . Defined in ACL Syntax public void save() throws NotesException ACLEntry class Represents a single entry in an access control list. An entry may be for a person. If you don’t call save before closing a database.

you must call the save method on the ACL if you want the modified ACL to be saved to disk.ACLEntry class IsCanCreatePersonalFolder through isCanCreatePersonalFolder and setCanCreatePersonalFolder IsCanCreateSharedlFolder through isCanCreateSharedFolder and setCanCreateSharedFolder IsCanDeleteDocuments through isCanDeleteDocuments and setCanDeleteDocuments IsGroup through isGroup and setGroup IsPerson through isPerson and setPerson IsServer through isServer and setServer IsPublicReader through isPublicReader and setPublicReader IsPublicWriter through isPublicWriter and setPublicWriter Level through getLevel and setLevel Name through getName and setName NameObject through getNameObject Parent through getParent Roles through getRoles UserType through getUserType and setUserType Methods disableRole enableRole isRoleEnabled remove Creation and access To create a new ACLEntry object. use createACLEntry in ACL. use getNextEntry. use getEntry. 1712 Domino Designer Programming Guide. The ACL class provides three ways to access an existing ACLEntry: To access an entry in an ACL when you know its name. To access the first entry in the ACL. Volume 3: JavaScript Classes . To access entries after the first one. After modifying an ACL entry. use getFirstEntry.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). entry. ACLEntry entry = acl.getCurrentDatabase().ACLEntry class Example: ACLEntry class This agent enables the [Supervisor] role for the ACL entry specified as the agent comment.save(). } catch(Exception e) { e.createACLEntry (agent.*.getAgentContext(). Defined in ACLEntry Data type boolean Syntax public boolean isAdminReaderAuthor() throws NotesException public void setAdminReaderAuthor(boolean flag) throws NotesException Usage For setAdminReaderAuthor. ACL acl = db.getCurrentAgent(). // (Your code goes here) Agent agent = agentContext. Indicates if the administration server can modify reader and author fields. acl.LEVEL_DESIGNER). ACL.getComment(). AgentContext agentContext = session.getACL(). } } } IsAdminReaderAuthor property Read-write.enableRole("Supervisor"). Database db = agentContext.domino.printStackTrace(). import lotus. Chapter 10: Java Classes A–Z 1713 . you must call save on the ACL if you want the modified ACL to be saved to disk.

you must call save on the ACL if you want the modified ACL to be saved to disk. indicates if the entry is allowed to create new documents.ACLEntry class IsAdminServer property Read-write. Volume 3: JavaScript Classes . Indicates if this entry is an administration server. Defined in ACLEntry Data type boolean Syntax public boolean isAdminServer() throws NotesException public void setAdminServer(boolean flag) throws NotesException Usage For setAdminServer. For an entry with Author access to a database. IsCanCreateDocuments property Read-write. Defined in ACLEntry Data type boolean Syntax public boolean isCanCreateDocuments() throws NotesException public void setCanCreateDocuments(boolean flag) throws NotesException Legal values true if the entry can create new documents in the database false if the entry cannot create new documents in the database 1714 Domino Designer Programming Guide.

indicates if the entry is allowed to create LotusScript or Java agents. Setting this property has no effect on an ACL entry unless the entry has Author access to a database. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ACL acl = db.getAgentContext().getCurrentAgent().printStackTrace(). Example: IsCanCreateDocuments property This agent creates a new ACL entry with Author access but does not it allow to create documents. import lotus. If an entry has Depositor. } } } IsCanCreateLSOrJavaAgent property Read-write. this property is false for a new entry with Author access.ACLEntry class Usage After setting this property. ACLEntry entry = acl. this property is always true.getACL(). // (Your code goes here) Agent agent = agentContext.LEVEL_AUTHOR). or Manager access. If an entry has Reader or No access. this property is always false. you must call save on the parent ACL for the changes to take effect.*.getCurrentDatabase(). acl. ACL. Defined in ACLEntry Data type boolean Chapter 10: Java Classes A–Z 1715 .getComment(). Database db = agentContext. By default. Designer. AgentContext agentContext = session. For an entry with Reader access to a database.createACLEntry (agent.domino.setCanCreateDocuments(false). entry.save(). Editor.

Volume 3: JavaScript Classes . IsCanCreatePersonalAgent property Read-write. Defined in ACLEntry Data type boolean Syntax public boolean isCanCreatePersonalAgent() throws NotesException public void setCanCreatePersonalAgent(boolean flag) throws NotesException Legal values true if the entry can create personal agents in the database false if the entry cannot create personal agents in the database 1716 Domino Designer Programming Guide. Author. For an entry with Editor.ACLEntry class Syntax public boolean isCanCreateLSOrJavaAgent() throws NotesException public void setCanCreateLSOrJavaAgent(boolean flag) throws NotesException Legal values true if the entry can create LotusScript or Java agents in the database false if the entry cannot create new LotusScript or Java agents in the database Usage After setting this property. If an entry has Depositor or No access. this property is false for a new entry with Designer. this property is always true. Editor. Editor. or Reader access. Setting this property has no effect on an ACL entry unless the entry has Designer. you must call save on the parent ACL for the changes to take effect. or Reader access to a database. By default. Author. Author. If an entry has Manager access. or Reader access. this property is always false. indicates if the entry can create personal agents in a database.

getACL().save(). // (Your code goes here) Agent agent = agentContext. ACL acl = db.setCanCreatePersonalAgent(true).ACLEntry class Usage After setting this property. or Reader access. By default. and Java agents. entry. } } } IsCanCreatePersonalFolder property Read-write. } catch(Exception e) { e.createACLEntry (agent. entry. If an entry has Designer or Manager access. you must call save on the parent ACL for the changes to take effect.getAgentContext().printStackTrace(). AgentContext agentContext = session. Author. Defined in ACLEntry Chapter 10: Java Classes A–Z 1717 . Setting this property has no effect on an ACL entry unless the entry has Editor. ACL. Author. indicates if the entry can create personal folders in a database.setCanCreateLSOrJavaAgent(true). Author. this property is always true. For an entry with Editor. acl.domino.getCurrentDatabase(). LotusScript. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.LEVEL_AUTHOR). Database db = agentContext. this property is always false. or Reader access. Example: IsCanCreatePersonalAgent and IsCanCreateLSOrJavaAgent properties This agent creates a new ACL entry with Author access and allows it to create personal. import lotus. If an entry has Depositor or No access. this property is false for a new entry with Editor. or Reader access to a database. ACLEntry entry = acl.getComment().getCurrentAgent().

LEVEL_AUTHOR). Setting this property has no effect on an ACL entry unless the entry has Editor. or Reader access to a database. Example: IsCanCreatePersonalFolder and IsCanCreateSharedFolder properties This agent creates a new ACL entry with Editor access and allows it to create personal folders. } 1718 Domino Designer Programming Guide. or Reader access. Author.ACLEntry class Data type boolean Syntax public boolean isCanCreatePersonalFolder() throws NotesException public void setCanCreatePersonalFolder(boolean flag) throws NotesException Legal values true if the entry can create personal folders in the database false if the entry cannot create personal folders in the database Usage After setting this property. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes .getCurrentAgent(). this property is false for a new entry with Editor.domino.getACL(). Database db = agentContext.getCurrentDatabase().createACLEntry (agent. acl. If an entry has Designer or Manager access. entry. Author. import lotus.printStackTrace().getComment(). // (Your code goes here) Agent agent = agentContext. this property is always false.save(). this property is always true.*.setCanCreatePersonalFolder(true). ACL acl = db. ACL.getAgentContext(). } catch(Exception e) { e. you must call save on the parent ACL for the changes to take effect. AgentContext agentContext = session. By default. If an entry has Depositor or No access. ACLEntry entry = acl.

Defined in ACLEntry Chapter 10: Java Classes A–Z 1719 . or No access.ACLEntry class } } IsCanCreateSharedFolder property Read-write. you must call save on the parent ACL for the changes to take effect. this property is always false. Setting this property has no effect on an ACL entry unless the entry has Editor access to a database. Reader. For an entry with Author access or above. this property is false for a new entry with Editor access. indicates if the entry can delete documents from a database. If an entry has Author. this property is always true. Depositor. For an entry with Editor access to a database. If an entry has Manager or Designer access. By default. Defined in ACLEntry Data type boolean Syntax public boolean isCanCreateSharedFolder() throws NotesException public void setCanCreateSharedFolder(boolean flag) throws NotesException Legal values true if the entry can create shared folders in the database false if the entry cannot create shared folders in the database Usage After setting this property. indicates if the entry can create shared folders in the database. IsCanDeleteDocuments property Read-write.

} catch(Exception e) { e.ACLEntry class Data type boolean Syntax public boolean isCanDeleteDocuments() throws NotesException public void setCanDeleteDocuments(boolean flag) throws NotesException Legal values true if the entry can delete documents in the database false if the entry cannot delete documents in the database Usage After setting this property. or Author access. // (Your code goes here) Agent agent = agentContext. If an entry has Reader. acl. Setting this property has no effect on an ACL entry unless the entry has Manager.setCanDeleteDocuments(false). entry.*.createACLEntry (agent. } } } 1720 Domino Designer Programming Guide. or Author access to a database. Depositor.getACL(). Volume 3: JavaScript Classes . import lotus. Database db = agentContext. Editor. Designer. ACL. you must call save on the parent ACL for the changes to take effect.getComment().LEVEL_AUTHOR). this property is false for a new entry with Manager.printStackTrace(). or No access.getAgentContext(). this property is always false.getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().save().getCurrentAgent(). ACLEntry entry = acl. AgentContext agentContext = session. Designer. Example: IsCanDeleteDocuments property This agent creates a new ACL entry with Author access but does not allow it to delete documents.domino. By default. Editor. ACL acl = db.

TYPE_MIXED_GROUP. you must call save on the ACL if you want the modified ACL to be saved to disk. Defined in ACLEntry Data type boolean Syntax public boolean isPerson() throws NotesException public void setPerson(boolean flag) throws NotesException Usage IsPerson is true if UserType is TYPE_PERSON. For setGroup. Defined in ACLEntry Data type boolean Syntax public boolean isGroup() throws NotesException public void setGroup(boolean flag) throws NotesException Usage IsGroup is true if UserType is TYPE_MIXED_GROUP. you must call save on the ACL if you want the modified ACL to be saved to disk. Indicates if this is a group ACL entry. Indicates if this is a person ACL entry. or TYPE_PERSON_GROUP. Chapter 10: Java Classes A–Z 1721 . IsPerson property Read-write. For setPerson. TYPE_PERSON_GROUP.ACLEntry class IsGroup property Read-write. or TYPE_SERVER_GROUP.

Editor.setPublicReader(true).getComment(). Defined in ACLEntry class Data type boolean Syntax public boolean isPublicReader() throws NotesException public void setPublicReader(boolean flag) throws NotesException Legal values true if the current entry is a public reader false if the current entry is not a public reader Usage Setting this property has no effect on an ACL entry unless the entry has Depositor or No access to a database.LEVEL_DEPOSITOR). By default. ACLEntry entry = acl. Volume 3: JavaScript Classes . // (Your code goes here) Agent agent = agentContext. import lotus. indicates if the entry is a public reader of the database. ACL.getCurrentAgent(). Designer. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.ACLEntry class IsPublicReader property Read-write.getACL(). or Reader access.createACLEntry (agent. Database db = agentContext. AgentContext agentContext = session. entry.getAgentContext(). this property is always true.getCurrentDatabase().*. this property is false for a new entry with Depositor or No access. 1722 Domino Designer Programming Guide. For an entry with Depositor or No access. Author. Example: IsPublicReader property This agent creates a new ACL entry with Depositor access and makes it a public reader. ACL acl = db. If an entry has Manager.

Defined in ACLEntry class Data type boolean Syntax public boolean isPublicWriter() throws NotesException public void setPublicWriter(boolean flag) throws NotesException Legal values true if the current entry is a public writer false if the current entry is not a public writer Usage Setting this property has no effect on an ACL entry unless the entry has Author. or No access. Indicates if this is a server ACL entry. For an entry with Author. indicates if the entry is a public writer of the database.setPublicWriter(true). IsServer property Read-write. Reader. Designer. Reader. acl. Depositor. or Editor access. } } } IsPublicWriter property Read-write. Depositor. If an entry has Manager. or No access to a database. Depositor. } catch(Exception e) { e. or No access.ACLEntry class entry.printStackTrace(). Reader. By default. this property is false for a new entry with Author. this property is always true.save(). Defined in ACLEntry Chapter 10: Java Classes A–Z 1723 .

Defined in ACLEntry Data type int Syntax public int getLevel() throws NotesException public void setLevel(int level) throws NotesException Legal values ACL. For setServer. Volume 3: JavaScript Classes . TYPE_MIXED_GROUP.LEVEL_EDITOR ACL.LEVEL_READER ACL.LEVEL_DESIGNER ACL.LEVEL_DEPOSITOR ACL. you must call save on the ACL if you want the modified ACL to be saved to disk.ACLEntry class Data type boolean Syntax public boolean isServer() throws NotesException public void setServer(boolean flag) throws NotesException Usage IsServer is true if UserType is TYPE_SERVER.LEVEL_AUTHOR ACL.LEVEL_MANAGER 1724 Domino Designer Programming Guide.LEVEL_NOACCESS ACL. Level property Read-write. or TYPE_SERVER_GROUP. The access level this entry has for this database.

String lev = null.LEVEL_AUTHOR: lev = "author". ACL acl = db. break. case ACL.getNextEntry(entry)) != null).LEVEL_MANAGER: lev = "manager".printStackTrace().*. } } } Chapter 10: Java Classes A–Z 1725 . break.LEVEL_DESIGNER: lev = "designer". case ACL. case ACL.getFirstEntry(). import lotus. // (Your code goes here) Database db = agentContext.LEVEL_DEPOSITOR: lev = "depositor". } while ((entry = acl. } System. break. break.LEVEL_EDITOR: lev = "editor". do { switch(entry. case ACL. case ACL. break. ACLEntry entry = acl. } catch(Exception e) { e. break.out. case ACL. you must call save on the ACL if you want the modified ACL to be saved to disk. AgentContext agentContext = session.domino.LEVEL_NOACCESS: lev = "no". public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getName() + " has " + lev + " access").getACL().getCurrentDatabase(). break. Example: Level property This agent prints the access level for the each entry in the ACL of the current database.LEVEL_READER: lev = "reader".println (entry.getLevel()) { case ACL.getAgentContext().ACLEntry class Usage For setLevel.

getFirstEntry().getAgentContext().*. you must call save on the ACL if you want the modified ACL to be saved to disk. For setName. The name of an ACL entry. you can enter a hierarchical name as a String in abbreviated format.getLevel() == ACL. However. If you change the name of an entry. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out. Volume 3: JavaScript Classes .getTitle() + "\"").domino. ACLEntry entry = acl. Defined in ACLEntry Data type String Name Syntax public String getName() throws NotesException public void setName(String name) throws NotesException public void setName(Name n) throws NotesException Usage Hierarchical names are returned in canonical format. AgentContext agentContext = session.getCurrentDatabase(). // (Your code goes here) Database db = agentContext.ACLEntry class Name property Read-write. do { if (entry.println ("Managers for \"" + db. Example: Name property This agent prints the name of every ACL entry with Manager access.LEVEL_MANAGER) 1726 Domino Designer Programming Guide. import lotus. ACL acl = db. The Name object for setName cannot be null.getACL(). System. the other properties of the entry (such as Level) are preserved.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getNextEntry(entry)) != null).getACL(). Defined in ACLEntry Data type Name Syntax public Name getNameObject() throws NotesException Example: NameObject property This agent prints the name of every ACL entry with Manager access. ACLEntry entry = acl.out. } } } NameObject property Read-only.getTitle() + "\"").println(" " + n. System. do { if (entry.getLevel() == ACL.getFirstEntry(). System.getCommon()). ACL acl = db. // (Your code goes here) Database db = agentContext.println ("Managers for \"" + db.LEVEL_MANAGER) { n = entry.getAgentContext().println(" " + entry. } while ((entry = acl. Name n.getNameObject().getCurrentDatabase(). import lotus.domino. The name of an entry. } catch(Exception e) { e. AgentContext agentContext = session.getNextEntry(entry)) != null).*.printStackTrace().out. }} while ((entry = acl.ACLEntry class System.out.getName()). } catch(Exception e) { Chapter 10: Java Classes A–Z 1727 .

getAgentContext(). // (Your code goes here) Agent agent = agentContext.getComment())) System.getACL(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().equals(agent. if (n. String n. Database db = dir.open().ACLEntry class e.getFirstDatabase(DbDirectory.printStackTrace(). Defined in ACLEntry Data type ACL Syntax public ACL getParent() throws NotesException Example: Parent property This agent prints the title of every database in the local Notes directory that contains the ACL entry specified as the agent comment. ACL acl. DbDirectory dir = session. while (entry != null) { n = entry. AgentContext agentContext = session.getCurrentAgent(). ACLEntry entry.getDbDirectory(null). import lotus.getCommon().*.getNameObject(). acl = db.println 1728 Domino Designer Programming Guide.getFirstEntry().out.DATABASE). } } } Parent property Read-only. if (acl != null) { entry = acl. while (db != null) { db. Volume 3: JavaScript Classes . The access control list that contains an entry.domino.

ACLEntry class (n + " is in the database \"" + entry. if (entry != null) { Vector roles = acl. The roles that are enabled for an entry. for example.getTitle() + "\""). Database db = agentContext. [Project Leader].getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Example: Roles property This agent prints the roles for the ACL entry specified as the agent comment.getNextEntry(entry). import java.getParent().*. // (Your code goes here) Agent agent = agentContext.getRoles(). Chapter 10: Java Classes A–Z 1729 . elements are String Syntax public java.getCurrentAgent(). entry = acl.util.Vector. import lotus.getEntry(agent.getNextDatabase().getParent().getComment()). } } catch(Exception e) { e. AgentContext agentContext = session.getCurrentDatabase().Vector getRoles() throws NotesException Usage Each role name is surrounded by brackets. ACL acl = db.domino.printStackTrace().getACL(). Defined in ACLEntry Data type Vector.util. ACLEntry entry = acl. } } } Roles property Read-only. }} db = dir.

TYPE_SERVER_GROUP ACLEntry.TYPE_MIXED_GROUP ACLEntry. Volume 3: JavaScript Classes .out.TYPE_PERSON_GROUP ACLEntry. you must call save on the ACL if you want the modified ACL to be saved to disk.TYPE_SERVER ACLEntry.size().ACLEntry class if (roles. }} } catch(Exception e) { e. } } } UserType property Read-write.printStackTrace().getName() + " has no roles"). for (int i=0.println(" " + roles. The user type this entry has for this database. Defined in ACLEntry Data type int Syntax public int getUserType() throws NotesException public void setUserType(int tp) throws NotesException Legal values ACLEntry.size() == 0) System.out.println(entry. 1730 Domino Designer Programming Guide.out.elementAt(i)).TYPE_PERSON ACLEntry. i++) System.TYPE_UNSPECIFIED Usage For setUserType. i<roles.println(entry.getName() + " has the following role(s):"). else { System.

out.println("Is a group"). case ACLEntry.ACLEntry class Example: UserType property This agent prints the user type of the ACL entry specified in the agent comment.isServer()) System. break. if (entry.getComment()). } } catch(Exception e) { e.getAgentContext(). // (Your code goes here) Agent agent = agentContext.getCurrentDatabase(). } } } Chapter 10: Java Classes A–Z 1731 .TYPE_PERSON : ut = "person". switch (entry.TYPE_MIXED_GROUP : ut = "mixed group".isPerson()) System. ACLEntry entry = acl. case ACLEntry. case ACLEntry.TYPE_UNSPECIFIED : ut = "unspecified". } System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ACL acl = db.domino. break. if (entry. and group. if (entry != null) { String ut = null.getEntry(agent. and prints whether the entry is for a person. case ACLEntry. server. Database db = agentContext. break.out.out.println("Is a person").getACL(). if (entry. AgentContext agentContext = session. case ACLEntry.TYPE_PERSON_GROUP : ut = "person group".println("User type is " + ut).TYPE_SERVER : ut = "server". break. break.out.getCurrentAgent().println("Is a server").TYPE_SERVER_GROUP : ut = "server group".*. break.isGroup()) System. import lotus.getUserType()) { case ACLEntry.printStackTrace().

acl.*. }} while ((entry = acl. for all ACL entries.getComment() + " is already disabled for " + entry. Example: disableRole method This agent disables. this method does nothing.println (agent. Database db = agentContext.getACL(). If the role exists. ACL acl = db. do { if (!entry.getCurrentDatabase(). else { entry.getAgentContext(). The role must exist in the ACL.getComment())) System. Usage You must call save on the ACL if you want the modified ACL to be saved to disk.getFirstEntry().out. System.getName()).getComment()). Defined in ACLEntry Syntax public void disableRole(String role) throws NotesException Parameter String role The name of the role to disable.getName()). the role specified in the agent comment.domino.getNextEntry(entry)) != null).println (agent.out. // (Your code goes here) Agent agent = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes . Do not specify the brackets. but is already disabled for the entry.getCurrentAgent().ACLEntry class disableRole method Disables a role for an entry. import lotus. ACLEntry entry = acl.getComment() + " disabled for " + entry. 1732 Domino Designer Programming Guide.disableRole(agent. AgentContext agentContext = session.isRoleEnabled(agent.save().

getName()). import lotus. If the role exists.printStackTrace().ACLEntry class } catch(Exception e) { e. Defined in ACLEntry Syntax public void enableRole(String role) throws NotesException Parameter String role The name of the role to enable. Chapter 10: Java Classes A–Z 1733 . but is already enabled for the entry. Usage You must call save on the ACL if you want the modified ACL to be saved to disk. Example: enableRole method This agent enables.getACL().getCurrentDatabase(). for all ACL entries. } } } enableRole method Enables a role for an entry.out. Do not specify the brackets.getComment())) System.getFirstEntry(). the role specified in the agent comment. // (Your code goes here) Agent agent = agentContext.getComment() + " is already enabled for " + entry. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). this method does nothing. Database db = agentContext.getAgentContext().isRoleEnabled(agent. do { if (entry.*. ACLEntry entry = acl. The role must exist in the ACL. ACL acl = db.getCurrentAgent().domino.println (agent. AgentContext agentContext = session.

AgentContext agentContext = session.*.printStackTrace(). Example: isRoleEnabled method This agent prints a message for each ACL entry saying whether the role specified as the agent comment is enabled.ACLEntry class else { entry. }} while ((entry = acl. import lotus.getAgentContext().out.domino. 1734 Domino Designer Programming Guide.getName()). } } } isRoleEnabled method Indicates if a role is enabled for an entry.getNextEntry(entry)) != null).enableRole(agent.save(). System. Return value boolean true if the role is enabled for this entry false if the role is not enabled for this entry Usage The role must exist in the ACL.getComment() + " enabled for " + entry. } catch(Exception e) { e. Defined in ACLEntry Syntax public boolean isRoleEnabled(String role) throws NotesException Parameter String role The name of the role.getComment()). acl. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println (agent. Volume 3: JavaScript Classes .

else { System. Database db = agentContext.getName()).println (agent. ACL acl = db.getCurrentAgent().ACLEntry class // (Your code goes here) Agent agent = agentContext. } catch(Exception e) { e.out.getComment() + " is disabled for " + entry.getName()).getComment() + " is enabled for " + entry.printStackTrace().getNextEntry(entry)) != null).getFirstEntry(). AgentContext agentContext = session.*. } } } remove method Removes an entry from an access control list.getAgentContext().getComment())) System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ACLEntry entry = acl. do { if (entry.isRoleEnabled(agent. // (Your code goes here) Chapter 10: Java Classes A–Z 1735 . Example: remove method This agent removes the ACL entry specified as the agent comment.out.getCurrentDatabase().domino. Defined in ACLEntry Syntax public void remove() throws NotesException Usage You must call save on the ACL if you want the modified ACL to be saved to disk.println (agent.getACL(). import lotus. }} while ((entry = acl.

Volume 3: JavaScript Classes .printStackTrace().getComment()). } catch(Exception e) { e.remove(). Syntax public class Agent extends Base Containment Contained by: AgentContext and Database Contains: Database and DateTime Properties Comment through getComment CommonOwner through getCommonOwner IsEnabled through isEnabled and setEnabled IsNotesAgent through isNotesAgent IsPublic through isPublic IsWebAgent through isWebAgent LastRun through getLastRun Name through getName Owner through getOwner Parent through getParent Query through getQuery ServerName through getServerName and setServerName Target through getTarget Trigger through getTrigger 1736 Domino Designer Programming Guide. if (entry != null) entry. acl.save().getCurrentDatabase(). ACLEntry entry = acl.getEntry(agent. ACL acl = db. Database db = agentContext. } } } Agent class Represents an agent.Agent class Agent agent = agentContext.getCurrentAgent().getACL().

AgentContext agentContext = session. import java. This agent prints the name of the current agent.getAgentContext().println ("Current agent is \"" + agent. System.Agent class Method remove run runOnServer save Access There are two ways to access an agent. import lotus. This agent prints the names of all agents in the current databaset. Examples: Agent class 1. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Agent agent = agentContext. Vector agents = db. use getAgents in Database. AgentContext agentContext = session.printStackTrace(). To access all the agents in a database.out.getCurrentAgent().println("Agents in database:").getAgentContext(). use getCurrentAgent in AgentContext.*. Chapter 10: Java Classes A–Z 1737 . // (Your code goes here) Database db = agentContext.out.util.domino.Vector. } } } 2.getName() + "\""). To access the agent that’s currently running.getAgents().domino. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.getCurrentDatabase().*. import lotus.

out.*. AgentContext agentContext = session. System.getName()).getCurrentAgent(). } } catch(Exception e) { e. System.domino. Volume 3: JavaScript Classes . // (Your code goes here) Agent agent = agentContext.println ("Current agent is \"" + agent.size().printStackTrace(). } } } Comment property Read-only. } catch(Exception e) { e. Defined in Agent Data type String Syntax public String getComment() throws NotesException Example: Comment property This agent prints the name and comment of the current agent.elementAt(i). i<agents.getName() + "\"").getComment()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The comment that describes an agent. i++) { Agent agent = (Agent)agents.Agent class for (int i=0.out. as entered by the agent’s designer.printStackTrace().out. } } } 1738 Domino Designer Programming Guide. import lotus.getAgentContext().println ("Comment: " + agent.println(" " + agent. System.

getCommonOwner()).*. System. Example: CommonOwner property This agent prints the common owner name of the current agent.domino. Defined in Agent Data type String Syntax public String getCommonOwner() throws NotesException Usage If the owner’s name is flat (non-hierarchical).printStackTrace().out.getCurrentAgent(). AgentContext agentContext = session. import lotus. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). the CommonOwner name is the same as the Owner name.getName() + "\"").Agent class CommonOwner property Read-only. } catch(Exception e) { e. } } } Chapter 10: Java Classes A–Z 1739 . The common name of the person who last modified and saved an agent.getAgentContext().out.println ("Current agent is \"" + agent. // (Your code goes here) Agent agent = agentContext.println ("Common owner: " + agent.

a change is not immediately reflected. Vector agents = db.elements(). // (Your code goes here) Database db = agentContext.domino.Agent class IsEnabled property Read-write. which can be enabled and disabled. The agent must be closed and reopened. This agent prints the status for each agent in the current database: enabled or disabled. Volume 3: JavaScript Classes . Defined in Agent Data type boolean Syntax public boolean isEnabled() throws NotesException public void setEnabled(boolean value) throws NotesException Legal values true if the agent can be run false if the agent is disabled Usage This property is intended for use with scheduled agents. System. Examples: IsEnabled property 1. AgentContext agentContext = session.getAgentContext(). This property always returns true for hidden agents and agents that are run from a menu. import java.out. import lotus.getAgents().*. Indicates if an agent is able to run or not.getAgents(). If the agent is open in the UI. while (e.println("Agents in database:").util.getCurrentDatabase().hasMoreElements()) { 1740 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Enumeration e = db. You must call Save to make any change effective.*.

} } } Chapter 10: Java Classes A–Z 1741 . String an = agent.printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().compareTo("Agent To Enable") == 0){ agent.getAgentContext(). This agent enables the agent named “Agent To Enable” if it exists in the current database. agent.getName(). break.out.getCurrentDatabase(). } } catch(Exception e) { e.printStackTrace(). if (agent.nextElement(). } } System.println(an + " is enabled"). Vector agents = db.*. String name = agent. else System.out.getName().isEnabled()) System.save(). if (name.Agent class Agent agent = (Agent)e.println(msg). AgentContext agentContext = session.elements().domino. Enumeration e = db. } } } 2.getAgents(). import java. String msg = "Agent not found".setEnabled(true).hasMoreElements()) { Agent agent = (Agent)e.out.util. import lotus.nextElement(). } catch(Exception e) { e. // (Your code goes here) Database db = agentContext.*. msg = "Agent found and enabled". while (e.println(an + " is disabled").getAgents().

nextElement().util.getAgents().println(" is a Web agent"). else System. // (Your code goes here) Database db = agentContext.elements(). else System. if (agent. if (agent.Agent class IsNotesAgent property Read-only.isNotesAgent()) System.*.out.domino. System.out. import java. import lotus.println("Agents in database:"). System.isWebAgent()) System.getAgentContext(). Vector agents = db.println(agent.getName()). AgentContext agentContext = session.println(" is a Notes agent"). } 1742 Domino Designer Programming Guide. Volume 3: JavaScript Classes .getCurrentDatabase().out. Enumeration e = db.*. Defined in Agent Data type boolean Syntax public boolean isNotesAgent() throws NotesException Legal values true if the agent can run in the Notes client environment false if the agent cannot run in the Notes client environment Example: IsNotesAgent and IsWebAgent properties This agent prints whether each agent in a database is a Notes agent and a Web agent. Indicates if an agent can run in the Notes client environment. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println(" is not a Web agent").out. while (e.out.out.hasMoreElements()) { Agent agent = (Agent)e.println(" is not a Notes agent").getAgents().

Agent class } catch(Exception e) { e.getCurrentDatabase(). AgentContext agentContext = session. // (Your code goes here) Database db = agentContext. Vector agents = db. } } } IsPublic property Read-only.printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). while (e. import java.*.elements(). personalAgents = 0. import lotus. A public agent is accessible to all users of a database and is stored in the database.hasMoreElements()) { Chapter 10: Java Classes A–Z 1743 .domino. int publicAgents = 0. Indicates if an agent is public or personal. A personal agent is accessible only to its owner and is stored in the owner’s desktop file.getAgents().util.getAgents(). Enumeration e = db.getAgentContext(). Defined in Agent Data type boolean Syntax public boolean isPublic() throws NotesException Legal values true if the agent is public false if the agent is personal Example: IsPublic property This agent counts the number of public and personal agents in the current database.*.

Defined in Agent Data type DateTime 1744 Domino Designer Programming Guide. } catch(Exception e) { e. } } } IsWebAgent property Read-only.isPublic()) publicAgents++.out. Volume 3: JavaScript Classes .Agent class Agent agent = (Agent)e. else personalAgents++.printStackTrace().nextElement(). Defined in Agent Data type boolean Syntax public boolean isWebAgent() throws NotesException Legal values true if the agent can run in a Web browser environment false if the agent cannot run in a Web browser environment LastRun property Read-only. } System. Indicates if an agent can run in a Web browser environment. System. if (agent.out. The date that an agent last ran. String an = agent.println(personalAgents + " agents are public").getName().println(publicAgents + " agents are public").

if (date. import java. this agent prints its name and the last time it ran. } } } Chapter 10: Java Classes A–Z 1745 .println("Agent " + agent.out.getName() + " last ran on " + date.getName() + " hasn't run yet"). // (Your code goes here) Database db = agentContext.getCurrentDatabase().println("Agent " + agent.util.printStackTrace(). AgentContext agentContext = session. else System. Vector agents = db.getAgents().getTimeOnly()).getLastRun(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getDateOnly() + " at " + date.Vector. DateTime date = agent. this property returns null.elementAt(i). i++) { Agent agent = (Agent)agents.*. for (int i=0.Agent class Syntax public DateTime getLastRun() throws NotesException Usage If the script has never been run before. import lotus. Example: LastRun property For each agent in the current database.out.getDateOnly() != null) System. } } catch(Exception e) { e.domino.size(). i<agents.getAgentContext().

Within a database. the name of an agent may not be unique. However.*. import lotus. Saving the agent changes the owner immediately.Agent class Name property Read-only. public class JavaAgent extends AgentBase { public void NotesMain() { try { 1746 Domino Designer Programming Guide. Volume 3: JavaScript Classes . The name of the person who last modified and saved an agent. if you subsequently call Agent. The ownership change is not reflected in properties until the next time a Session is obtained. the previous owner’s name will be returned. this property returns the fully distinguished name. The name of an agent. Example: Owner property This agent prints the name and common owner of all the agents in the current database.domino. Defined in Agent Data type String Syntax public String getName() throws NotesException Owner property Read-only. Defined in Agent Data type Name Syntax public String getOwner() throws NotesException Usage If the owner’s name is hierarchical.owner within the same Session.

System.println ("Database on which this agent is running is '" + db.printStackTrace().getAgentContext().getOwner()).getCurrentAgent().getName() + "\""). import lotus.getAgentContext().*. // (Your code goes here) Agent agent = agentContext.getTitle() + "'"). AgentContext agentContext = session. System. } } } Parent property Read-only. System.getCurrentAgent(). } catch(Exception e) { e. The database that contains an agent.out.out.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session.out.getParent().println ("Current agent is \"" + agent. Chapter 10: Java Classes A–Z 1747 .Agent class Session session = getSession(). Database db = agent. Defined in Agent Data type Database Syntax public Database getParent() throws NotesException Example: Parent property This agent prints the name of the database on which the agent is running. // (Your code goes here) Agent agent = agentContext.println ("Common owner: " + agent.

” Query returns: ("tulip") If an agent searches for documents that contain the word tulip and were created on September 19.printStackTrace(). The text of the query used by an agent to select documents.Agent class } catch(Exception e) { e. } } } Query property Read-only. If no query is defined with the Add Search button. Query returns: (([Form]="Response")) If an agent searches for documents that use the Response form and contain the phrase “mustard greens” in the Subject field. Query returns: (([Form]="Response")) AND ([Subject] CONTAINS (mustard greens)) 1748 Domino Designer Programming Guide. In the Agent Builder. the Query property returns an empty string. even if the agent runs a formula that has its own SELECT statement or a script that selects specific documents. Volume 3: JavaScript Classes . a query is defined by the searches added to the agent using the Add Search button. 1996. Defined in Agent Data type String Syntax public String getQuery() throws NotesException Usage Some sample results: If an agent searches for documents that contain the word “tulip. Query returns: ("tulip") AND ([_CreationDate] = 09/19/96) If an agent searches for documents that use the Response form.

System. if (aq.domino.getAgents(). while (e.elements().util.println(an + " . The name of the server on which an agent runs. AgentContext agentContext = session. Defined in Agent Data type String Syntax public String getServerName() throws NotesException public void setServerName(String serverName) throws NotesException Chapter 10: Java Classes A–Z 1749 . // (Your code goes here) Database db = agentContext. } } } ServerName property Read-write.*. Vector agents = db. import java.equals("")) aq = "None". String aq = agent. Enumeration e = db.hasMoreElements()) { Agent agent = (Agent)e.getQuery().out.nextElement().getAgents().getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). String an = agent." + aq).getName(). } } catch(Exception e) { e.getAgentContext().Agent class Example: Query property This agent prints the name and query of every agent in the current database. import lotus.printStackTrace().*.

Since scheduled agents can only run on a single replica of a database. If the agent is not scheduled. // (Your code goes here) String u = session. or it may represent a replica’s server.util.getAgentContext(). the property returns the name of the server that the scheduled agent runs on. indicating that the agent can run on any server.println("Server name = " + u). System. this property returns the name of the parent database’s server.printStackTrace(). AgentContext agentContext = session. you designate a server name for the agent under Schedule in the Agent Builder. } } } 2. If the parent database is on a workstation. AgentContext agentContext = session. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*. this property returns an empty string. 1750 Domino Designer Programming Guide. Therefore.getServerName().domino. This agent prints the name and server name of the current agent.getAgentContext().domino. import java. You must call Save to make any change effective. Examples: ServerName property 1. This agent sets the server name of the agent named “Agent To Run” to the asterisk (*).out.*. the ServerName property may represent the parent database’s server. import lotus. A null ServerName means the local workstation.*. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes . You can set ServerName to the asterisk (*) to indicate that the agent can run on any server.Agent class Usage The value returned by getServerName depends upon whether the agent is scheduled: If the agent is scheduled.

TARGET_ALL_DOCS_IN_VIEW Agent.getName().println(msg). break.elements().TARGET_ALL_DOCS Agent. while (e.Agent class // (Your code goes here) Database db = agentContext. Defined in Agent Data type boolean Syntax public int getTarget() throws NotesException Legal values Agent.getAgents().save().out.TARGET_SELECTED_DOCS Agent. } catch(Exception e) { e.compareTo("Agent To Run") == 0) { agent. } } System. if (name. String msg = "Agent not found". Enumeration e = db. String name = agent. msg = "Agent server name set to *".getAgents(). } } } Target property Read-only.getCurrentDatabase(). Indicates which documents this agent acts on.setServerName("*").printStackTrace().nextElement(). Vector agents = db.hasMoreElements()) { Agent agent = (Agent)e.TARGET_NEW_DOCS Agent.TARGET_NEW_OR_MODIFIED_DOCS Agent.TARGET_NONE Agent.TARGET_UNREAD_DOCS_IN_VIEW Chapter 10: Java Classes A–Z 1751 . agent.

import java. case Agent. case Agent. } switch (agent.TARGET_ALL_DOCS_IN_VIEW: target = "all documents in view".getTrigger()) { case Agent. trigger="".TARGET_NEW_OR_MODIFIED_DOCS: target = "all new or modified documents".TRIGGER_DOC_PASTED: trigger = "document pasted". public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().TARGET_UNREAD_DOCS_IN_VIEW: target = "unread documents in view".TARGET_NEW_DOCS: target = "all new documents".TRIGGER_NONE: trigger = "none".getTarget()) { case Agent.Agent class Example: Target and Trigger properties This agent prints the target and trigger of each agent in the current database.getCurrentDatabase(). Enumeration agents = db. case Agent.TRIGGER_AFTER_MAIL_DELIVERY: trigger = "after mail delivery".TARGET_SELECTED_DOCS: target = "selected documents". } 1752 Domino Designer Programming Guide. case Agent.domino.*. case Agent.getAgents().TARGET_NONE: target = "none". import lotus. case Agent.nextElement(). AgentContext agentContext = session.*.TRIGGER_SCHEDULED: trigger = "scheduled".getAgentContext(). String target="".TRIGGER_BEFORE_MAIL_DELIVERY: trigger = "before new mail". case Agent. // (Your code goes here) Database db = agentContext. case Agent.elements(). Volume 3: JavaScript Classes .TRIGGER_DOC_UPDATE: trigger = "document updated". while (agents.TARGET_ALL_DOCS: target = "all documents".util.TRIGGER_MANUAL: trigger = "manual". case Agent. switch (agent. case Agent.hasMoreElements()) { Agent agent = (Agent)agents. case Agent. case Agent.

TRIGGER_BEFORE_MAIL_DELIVERY Agent. } } catch(Exception e) { e.TRIGGER_AFTER_MAIL_DELIVERY Agent.TRIGGER_DOC_PASTED Agent.out.TRIGGER_MANUAL Agent. trigger is " + trigger).printStackTrace(). } } } Trigger property Read-only.Agent class System.TRIGGER_SCHEDULED remove method Permanently deletes an agent from a database. Defined in Agent Syntax public void remove() throws NotesException Chapter 10: Java Classes A–Z 1753 .println(agent.getName() + ": target is " + target + ".TRIGGER_NONE Agent.TRIGGER_DOC_UPDATE Agent. Indicates when this agent runs. Defined in Agent Data type boolean Syntax public int getTrigger() throws NotesException Legal values Agent.

nextElement(). } catch(Exception e) { e. Volume 3: JavaScript Classes .elements().domino. import java.getCurrentDatabase(). String msg = "Agent not found". break. Vector agents = db.*. } } System. Example: remove method This agent removes the agent in the current database named “Agent To Delete.util. while (e. Use this feature with care.println(msg). String name = agent.out.hasMoreElements()) { Agent agent = (Agent)e.remove(). } } } 1754 Domino Designer Programming Guide. // (Your code goes here) Database db = agentContext. You must refresh the Agents view in the user interface to see that the agent has been removed.” import lotus.getAgentContext().getAgents().getName().Agent class Usage Once you call this method.*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). if (name. Enumeration e = db. It is possible to use this method to delete the agent that’s currently running. AgentContext agentContext = session.printStackTrace().compareTo("Agent To Delete") == 0){ agent. msg = "Agent found and deleted". the Agent object is null and you can no longer use its methods or properties.getAgents().

Defined in Agent Syntax public void run() throws NotesException Usage You cannot run an agent recursively (cannot call it from itself). AgentContext agentContext = session. // (Your code goes here) Database db = agentContext. import java. break.elements(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println(msg). Example: run method This agent runs the agent in the current database named “Agent To Run.Agent class run method Runs the agent. User output goes to the Domino log. See runOnServer to do otherwise. Enumeration e = db. The user cannot interact directly with a called agent. Chapter 10: Java Classes A–Z 1755 . msg = "Agent has been run".domino. if (name. For local operations. the agent runs on the server handling the remote calls.getName().” import lotus. while (e. Vector agents = db.getAgentContext(). String name = agent.*.run().getAgents(). String msg = "Agent not found".getCurrentDatabase(). For remote (IIOP) operations.*.compareTo("Agent To Run") == 0){ agent.util. } } System.hasMoreElements()) { Agent agent = (Agent)e.out. the agent runs the computer running the current program.getAgents().nextElement().

Usage The server cannot be on the computer on which the program is running. AgentContext agentContext = session.runOnServer() == 0) System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.getAgentContext().getDatabase("NotesUA1".println("Agent did not run OK").printStackTrace().domino. Volume 3: JavaScript Classes . For remote (IIOP) operations. Agent agent = db.out.Agent class } catch(Exception e) { e. 1756 Domino Designer Programming Guide. // (Your code goes here) Database db = session. else System.out. the agent runs the server handling the remote calls the same as run and the return value is always 0. Example: runOnServer method This example runs an agent on a specified server.getAgent("SendMailTest"). import lotus. } } } runOnServer method Runs an agent that is in a server database on the computer containing the database. "DbExamples"). Defined in Agent Syntax public int runOnServer() throws NotesException Return value int Status of the operation where 0 indicates success.println("Agent ran OK"). if (agent. Use run to run agents that reside on the current computer.

DocumentCollection. Defined in Agent Syntax public void save() throws NotesException Usage Saving the agent changes the owner immediately.AgentContext class } catch(Exception e) { e. Name Properties CurrentAgent through getCurrentAgent CurrentDatabase through getCurrentDatabase DocumentContext through getDocumentContext Chapter 10: Java Classes A–Z 1757 . Database. if you subsequently call Agent. The ownership change is not reflected in properties until the next time a Session is obtained. You must call Save after setServerName and setEnabled. DateTime. } } } save method Saves changes made to the agent. Syntax public class AgentContext extends Base Containment Contained by: Session Contains: Agent. or the new value is lost.owner within the same Session. However. the previous owner’s name will be returned.printStackTrace(). Document. AgentContext class Represents the agent environment of the current program. if an agent is running it.

Domino Designer provides template code that creates a Session object named session and an AgentContext object named agentContext.*. } } } Example: AgentContext class This agent gets the context for the current agent. import lotus.AgentContext class EffectiveUserName through getEffectiveUserName LastExitStatus through getLastExitStatus LastRun through getLastRun SavedData through getSavedData UnprocessedDocuments through getUnprocessedDocuments Methods unprocessedFTSearch unprocessedSearch updateProcessedDoc Creation and access Use getAgentContext in Session to get the AgentContext object for the current agent.*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. The complete template code appears as follows: import lotus. // (Your code goes here) } catch(Exception e) { e. AgentContext agentContext = session.printStackTrace(). 1758 Domino Designer Programming Guide. In the latter case. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). then gets the agent itself and prints the agent name and comment.getAgentContext().domino. Volume 3: JavaScript Classes . Usage You can create a Java agent by importing files or by writing and compiling the code in Domino Designer.

*.getComment(). Chapter 10: Java Classes A–Z 1759 . } } } CurrentAgent property Read-only. String name = agent.AgentContext class AgentContext agentContext = session.getCurrentAgent(). Defined in AgentContext Data type Agent Syntax public Agent getCurrentAgent() throws NotesException Example: CurrentAgent property This agent prints the name of the current agent. // (Your code goes here) Agent agent = agentContext. } catch(Exception e) { e. AgentContext agentContext = session. if (comment == "") comment = "No comment".getAgentContext().getCurrentAgent().printStackTrace().println ("Comment: \"" + comment + "\""). System.getName().getAgentContext(). import lotus.out. // (Your code goes here) Agent agent = agentContext. String comment = agent. String name = agent. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The agent that’s currently running. System.domino.println ("Current agent is \"" + name + "\"").println ("Current agent: \"" + name + "\"").out.out. System.getName().

AgentContext agentContext = session. import lotus. } catch(Exception e) { e. Example: CurrentDatabase property This agent example prints the title of the current database. // (Your code goes here) Database db = agentContext.printStackTrace().getTitle().getCurrentDatabase(). Using getCurrentDatabase can make programs more portable from one database to another.AgentContext class } catch(Exception e) { e. } } } 1760 Domino Designer Programming Guide.out.printStackTrace(). Defined in AgentContext Data type Database Syntax public Database getCurrentDatabase() throws NotesException Usage This property allows you to access a database without having to specify its server and file name. Volume 3: JavaScript Classes .*.println ("Current database is \"" + title + "\""). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). String title = db. System.domino. } } } CurrentDatabase property Read-only.getAgentContext(). The database in which the current agent resides.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getItemValue("Subject"). then run an agent. // (Your code goes here) Document doc = agentContext.domino.util. } } } Chapter 10: Java Classes A–Z 1761 .getAgentContext(). import java. Defined in AgentContext Data type Document Syntax public Document getDocumentContext() throws NotesException Usage Through the C or C++ API. System.AgentContext class DocumentContext property Read-only. Example: DocumentContext property This agent prints the value of the Subject field of the in-memory document. AgentContext agentContext = session.printStackTrace(). } } catch(Exception e) { e.out.getDocumentContext().Vector. the in-memory document is the document highlighted in the view.*. import lotus. For an agent activated in a view through the UI. an external program can create an in-memory document.println ("Value of 'Subject' in document is " + v. if (doc != null) { Vector v = doc.toString()). The in-memory document when an agent starts. The agent can use this property to access the in-memory document.

} } } 1762 Domino Designer Programming Guide.println ("Effective user name is " + name). // (Your code goes here) String name = agentContext. } catch(Exception e) { e. If the user name is hierarchical. this is the name of the current user. getEffectiveUserName and getUserName return the same value for a given program.domino. Example: EffectiveUserName property This example prints the current effective user name. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out. For an agent running on a server.*. this is the name of the agent’s owner (the person who last saved the agent). Defined in AgentContext Data type Name Syntax public String getEffectiveUserName() throws NotesException Usage In general. AgentContext agentContext = session.printStackTrace(). The user name that is in effect for the current agent.getAgentContext().AgentContext class EffectiveUserName property Read-only. Volume 3: JavaScript Classes . where getEffectiveUserName is the name of the script’s owner and getUserName is the name of the server on which the script is running. import lotus. System. The exceptions are agents that run on a server. this property returns the fully distinguished name.getEffectiveUserName(). For an agent running on a workstation.

// (Your code goes here) int status = agentContext.getLastExitStatus(). } catch(Exception e) { e. Example: LastExitStatus property This agent prints the last exit status of the current agent. } } } Chapter 10: Java Classes A–Z 1763 .AgentContext class LastExitStatus property Read-only. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Defined in AgentContext Data type int Syntax public int getLastExitStatus() throws NotesException Usage This property returns 0 if the agent ran without errors. System. The exit status code returned by the Agent Manager the last time the current agent ran.*. import lotus.out.println( "Last exit status was " + status).getAgentContext(). AgentContext agentContext = session.printStackTrace().domino.

println("Agent was not run before").AgentContext class LastRun property Read-only. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The date and time when the current agent was last executed. if (date.getAgentContext(). else System. Volume 3: JavaScript Classes .out.getDateOnly() == "") System. this property returns null. Defined in AgentContext Data type DateTime Syntax public DateTime getLastRun() throws NotesException Usage If the agent never ran before.println ("Agent was last run on " + date. import lotus. // (Your code goes here) DateTime date = agentContext.*.getLastRun().domino. } catch(Exception e) { e.out.getDateOnly() + " at " + date. } } } 1764 Domino Designer Programming Guide.getTimeOnly()). AgentContext agentContext = session.printStackTrace(). Example: LastRun property This agent prints the date and time that the agent last ran.

The data record fields replace the agent record fields whenever Weekly_Sales is greater than MaxSales. The document replicates. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). but is not displayed in views. Chapter 10: Java Classes A–Z 1765 .The data records have Weeky_Sales and Name fields.lang.AgentContext class SavedData property Read-only. The agent can use the information in this document the next time the agent runs.replaceItemValue("MaxSales". import java. Each time you edit and re-save an agent.hasItem("MaxSales")) { agentDoc. The saved data record has MaxSales and MaxSales_Salesperson fields.util.domino. if (!agentDoc. its getSavedData document is deleted. A document that an agent uses to store information between invocations. Database db = agentContext. its getSavedData document is deleted and a new. "0").getFirstDocument(). // (Your code goes here) Document agentDoc = agentContext.getAgentContext().Float. import java.getView("Weekly Sales"). View view = db.getCurrentDatabase(). When you delete an agent. AgentContext agentContext = session.getSavedData().*. import lotus. Example: SavedData property This agent uses the save data record to find the maximum weekly sales. Document doc = view.Vector. and it is stored in the same database as the agent. Defined in AgentContext Data type Document Syntax public Document getSavedData() throws NotesException Usage The getSavedData document is created when you save an agent. blank one is created.

} } } UnprocessedDocuments property Read-only.floatValue() > maxSales. agentDoc = agentContext.getItemValue("MaxSales").getItemValue("MaxSales_Salesperson") + " who sold $" + agentDoc.firstElement()). true). true).firstElement()). The documents in a database that the current agent considers to be “unprocessed.AgentContext class agentDoc. } } catch(Exception e) { e.printStackTrace().println("Best salesperson to date is " + agentDoc.replaceItemValue ("MaxSales". Float maxSales = new Float((String)mvalue. Defined in AgentContext Data type DocumentCollection Syntax public DocumentCollection getUnprocessedDocuments() throws NotesException 1766 Domino Designer Programming Guide. } while (doc != null) { Vector mvalue = agentDoc.getItemValue("MaxSales")).out. Float weeklySales = new Float((String)wvalue. } agentDoc. Vector wvalue = doc.getItemValue("Weekly_Sales")).save(true.getItemValue("Weekly_Sales").replaceItemValue ("MaxSales_Salesperson". Volume 3: JavaScript Classes .” The type of agent determines which documents are considered unprocessed. agentDoc. if (weeklySales. System. doc.getItemValue("Name")).save(true. doc.floatValue()) { agentDoc.getSavedData().

getAgentContext(). Using updateProcessedDoc in one agent has no effect on the documents that another agent processes.domino. import lotus. Chapter 10: Java Classes A–Z 1767 . The updateProcessedDoc method marks a document as processed only for the particular agent from which it is called. the agent processes the same documents the next time it runs.” which ensures that a document gets processed by the agent only once (unless it’s modified again). AgentContext agentContext = session. getUnprocessedDocuments returns the selected documents. you must use updateProcessedDoc in Session to mark each document as “processed. What documents are returned? The following table describes the documents that are returned by getUnprocessedDocuments.AgentContext class Usage This method is valid only for agents. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If you do not call this method for each document. Example: UnprocessedDocuments property If this agent runs on selected documents.*. Agent runs on: All documents in database All new and modified documents since last run UnprocessedDocuments returns documents that meet all of these requirements: Meet the search criteria specified in Agent Builder Not processed by this agent with updateProcessedDoc Just created or modified Meet the search criteria specified in Agent Builder All unread documents in view All documents in view Selected documents Run once Are unread and in the view Meet the search criteria specified in Agent Builder Are in the view Meet the search criteria specified in Agent Builder Are selected in the view Meet the search criteria specified in Agent Builder Is the current document Using UpdateProcessedDoc For agents that run on new and modified documents.

} } } unprocessedFTSearch method Given a full-text query. doc = dc. int maxdocs) throws NotesException public DocumentCollection unprocessedFTSearch(String query. int maxdocs The maximum number of documents you want returned. Document doc = dc.getCount()). System. 0 means all matching documents. Volume 3: JavaScript Classes .getNextDocument().getFirstDocument(). int otheropt) throws NotesException Parameters String query The full-text query.println( doc. int maxdocs. while (doc != null) { System.getUnprocessedDocuments(). int sortopt. returns documents in a database that: The current agent considers to be unprocessed And match the query Defined in AgentContext Syntax public DocumentCollection unprocessedFTSearch(String query.out.println("Count = " + dc.getItemValueString("Subject")). } } catch(Exception e) { e.out. 1768 Domino Designer Programming Guide.AgentContext class // (Your code goes here) DocumentCollection dc = agentContext.printStackTrace().

FT_FILESYSTEM includes files other than Domino databases in the search scope. Second. To specify more than one option.FT_SCORES (default) sorts by relevance score with highest relevance first.FT_DATE_DES sorts by document creation date in descending order. Database. it conducts a full-text search on the unprocessed documents and returns a collection of those documents that match the query. in an agent that runs on all selected documents in a view. Chapter 10: Java Classes A–Z 1769 . Database.” The type of agent determines which documents are considered to be unprocessed.FT_STEMS uses stem words as the basis of the search. How does it work? This method works in two parts: First. it finds a collection of documents that the agent considers to be “unprocessed. For example. This document collection is identical to that returned by getUnprocessedDocuments. Usage This method is valid only for agents. Database. getUnprocessedFTSearch searches only the selected documents and returns those that match the query.FT_FUZZY specifies a fuzzy search. Return Value DocumentCollection A sorted collection of documents that are not yet processed and match the query. Database. use a logical or operation. Database. and returns those that match the query.AgentContext class int sortopt Use one of these to specify a sorting option: Database. In an agent that runs on all new and modified documents since the last run. getUnprocessedFTSearch searches only the documents that were not marked by updateProcessedDoc. Database. otheropt Integer.FT_DATE_ASC sorts by document creation date in ascending order.FT_DATABASE includes Domino databases in the search scope. Use the following constants to specify additional search options.

AgentContext class What documents are returned? The following table describes the documents that are returned by unprocessedFTSearch. 1770 Domino Designer Programming Guide. use updateFTIndex. To create an index on a local database. Agent runs on: All documents in database unprocessedFTSearch returns documents that meet all of these requirements: Meet the search criteria specified in Agent Builder Meet the full-text search critieria specified in this method All new and modified Not processed by this agent with updateProcessedDoc documents since last run Just created or modified Meet the search criteria specified in Agent Builder Meet the full-text search critieria specified in this method All unread documents in view Are unread and in the view Meet the search criteria specified in Agent Builder Meet the full-text search criteria specified in this method All documents in view Are in the view Meet the search criteria specified in Agent Builder Meet the full-text search criteria specified in this method Selected documents Are selected in the view Meet the search criteria specified in Agent Builder Meet the full-text search criteria specified in this method Run once Is the current document Using updateProcessedDoc For agents that run on new and modified documents. To test for an index. you must use updateProcessedDoc to mark each document as “processed. use isFTIndexed. the agent processes the same documents the next time it runs. Volume 3: JavaScript Classes .” which ensures that a document gets processed by the agent only once (unless it’s modified again). The updateProcessedDoc method marks a document as processed only for the particular agent from which it is called. Using updateProcessedDoc in one agent has no effect on the documents that another agent processes. but less efficiently. this method works. Full-text indexes If the database is not full-text indexed. If you do not call this method for each document.

getNextDocument(). 0. Example: unprocessedFTSearch method This agent runs on all or selected documents. } } } Chapter 10: Java Classes A–Z 1771 . AgentContext agentContext = session.*.putInFolder("Botanist's Delight"). enter the word or phrase as is. while (doc != null) { doc. operators. Database.printStackTrace().getCount()). and other syntax are permitted. Document doc = dc. Remember to escape quotes if you are inside a literal.domino. // (Your code goes here) DocumentCollection dc = agentContext.println("Count = " + dc. It puts all documents that contain the word “botany” in the folder “Botanist’s Delight.getFirstDocument().out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext().AgentContext class Query syntax To search for a word or phrase. Wildcards.FT_SCORES. see search operators in client help. For the complete syntax rules.println( doc.FT_STEMS). except that search keywords must be enclosed in quotes. System. Database.getItemValueString("Subject")).out. System. } } catch(Exception e) { e. doc = dc.” import lotus.unprocessedFTSearch ("botany".

DateTime limit. it finds a collection of documents that the agent considers to be “unprocessed. Volume 3: JavaScript Classes . it conducts a search on the unprocessed documents. and returns a collection of those documents that match the selection criteria and were created or modified since the cutoff date. Second. Usage This method is valid only for agents. How does it work? This method works in two parts: First. int maxdocs The maximum number of documents you want returned. This document collection is identical to that returned by getUnprocessedDocuments.AgentContext class unprocessedSearch method Given selection criteria. 1772 Domino Designer Programming Guide.” The type of agent determines which documents are considered to be unprocessed. The collection is sorted by relevance with highest relevance first. match the selection criteria. and were created or modified after the cutoff date. 0 means all matching documents. returns documents in a database that: The current agent considers to be unprocessed Meet the selection criteria Were created or modified since the cutoff date Defined in AgentContext Syntax public DocumentCollection unprocessedSearch(String formula. int maxdocs) throws NotesException Parameters String formula A Domino formula that defines the selection criteria. DateTime limit A cutoff date. Return value DocumentCollection A collection of documents that are not yet processed.

AgentContext class For example. unprocessedSearch searches only the documents that were not marked by updateProcessedDoc. What documents are returned? The following table describes the documents that are returned by unprocessedSearch. and returns those that match the selection criteria. unprocessedSearch searches only the selected documents and returns those that match the selection criteria. in an agent that runs on all selected documents in the view. Agent runs on: All documents in database unprocessedSearch returns documents that meet all of these requirements: Meet the search criteria specified in Agent Builder Meet the formula search critieria specified in this method Meet the cutoff date specified in this method All new and modified documents since last run Not processed by this agent with updateProcessedDoc Just created or modified Meet the search criteria specified in Agent Builder Meet the formula search critieria specified in this method Meet the cutoff date specified in this method All unread documents in view Are unread and in the view Meet the search criteria specified in Agent Builder Meet the formula search criteria specified in this method Meet the cutoff date specified in this method All documents in view Are in the view Meet the search criteria specified in Agent Builder Meet the formula search criteria specified in this method Meet the cutoff date specified in this method Selected documents Are selected in the view Meet the search criteria specified in Agent Builder Meet the formula search criteria specified in this method Meet the cutoff date specified in this method Run once Is the current document Chapter 10: Java Classes A–Z 1773 . In an agent that runs on all new and modified documents since the last run.

// (Your code goes here) DateTime date = session.out. } } catch(Exception e) { e. agentContext.createDateTime("01/01/99").AgentContext class Using updateProcessedDoc For agents that run on new and modified documents.printStackTrace().domino. Document doc = dc. and places them in the “Botanist’s Delight” folder.getItemValueString("Subject")). Volume 3: JavaScript Classes . System. \"botany\")". import lotus. Using updateProcessedDoc in one agent has no effect on the documents that another agent processes. If you do not call this method for each document.getFirstDocument(). you must use updateProcessedDoc to mark each document as “processed. The updateProcessedDoc method marks a document as processed only for the particular agent from which it is called.unprocessedSearch ("@Contains(Subject. doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } } 1774 Domino Designer Programming Guide.” which ensures that a document gets processed by the agent only once (unless it’s modified again).getAgentContext(). DocumentCollection dc = agentContext.updateProcessedDoc(doc). AgentContext agentContext = session. 1999 that contain “botany” in the Subject field. 0). date. the agent processes the same documents the next time it runs.getNextDocument().putInFolder("Botanist's Delight"). Example: unprocessedSearch method This agent searches all or selected documents for documents created after January 1.*.println( doc. while (doc != null) { doc.

This method is intended for agents that run on all new and modified documents since the last run. Usage Use this method in conjunction with getUnprocessedDocuments. Cannot be null. prints each Subject item. The first time the agent runs.AgentContext class updateProcessedDoc method Marks a document as processed by an agent. Thereafter. unprocessedFTSearch. getUnprocessedDocuments returns those documents that updateProcessedDoc has not touched. Without updateProcessedDoc. Defined in AgentContext Syntax public void updateProcessedDoc(Document doc) throws NotesException Parameter Document doc The document to be marked as processed. unprocessedFTSearch. Chapter 10: Java Classes A–Z 1775 . and unprocessedSearch. or unprocessedSearch to get the newly created and newly modified documents. Example: updateProcessedDoc method This program is for an agent that runs on newly created and modified documents since the last run. and unprocessedFTSearch and unprocessedSearch return all the documents in the database that meet their respective criteria. the program can use getUnprocessedDocuments. getUnprocessedDocuments returns all of the documents in the database. regardless of whether the documents have already been searched in a previous invocation of the agent. This method marks a document as processed only for the particular agent from which it is called. What does it do? This method ensures that a document gets processed by an agent only once. getUnprocessedDocuments returns all the documents in the database. this method has no effect. and marks each document as processed. In other programs. but must use updateProcessedDoc to mark the documents that it processes. Using UpdateProcessedDoc in one agent has no effect on the documents that another agent processes. The program gets the unprocessed documents. When an agent runs a program to process all new and modified documents since the last run.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println( doc.getItemValueString("Subject")). } } } Database class Represents a Notes database. Agent. agentContext. Replication. Form. doc = dc.getAgentContext(). Document doc = dc.printStackTrace().getUnprocessedDocuments(). } } catch(Exception e) { e. View Properties ACL through getACL Agents through getAgents AllDocuments through getAllDocuments Categories through getCategories and setCategories Created through getCreated CurrentAccessLevel through getCurrentAccessLevel 1776 Domino Designer Programming Guide. Document. DbDirectory. Syntax public class Database extends Base Containment Contained by: AgentContext. while (doc != null) { System.getNextDocument().domino.getFirstDocument().*. Volume 3: JavaScript Classes .updateProcessedDoc(doc). AgentContext agentContext = session. and Session Can contain: ACL.Database class import lotus. // (Your code goes here) DocumentCollection dc = agentContext. DocumentCollection.out. DateTime.

Database class DesignTemplateName through getDesignTemplateName FileName through getFileName FilePath through getFilePath FolderReferencesEnabled through getFolderReferences and setFolderReferences Forms through getForms IsDelayUpdates through isDelayUpdates and setDelayUpdates IsFTIndexed through isFTIndexed IsMultiDbSearch through isMultiDbSearch IsOpen through isOpen IsPrivateAddressBook through isPrivateAddressBook IsPublicAddressBook through isPublicAddressBook LastFTIndexed through getLastFTIndexed LastModified through getLastModified Managers through getManagers MaxSize through getMaxSize Parent through getParent PercentUsed through getPercentUsed ReplicaID through getReplicaID ReplicationInfo through getReplicationInfo Server through getServer Size through getSize SizeQuota through getSizeQuota and setSizeQuota TemplateName through getTemplateName Title through getTitle and setTitle Views through getViews Methods compact createCopy createDocument Chapter 10: Java Classes A–Z 1777 .

To access an existing database when you know its server and file name. Volume 3: JavaScript Classes . use getDatabase in Session. use getCurrentDatabase in AgentContext. 1778 Domino Designer Programming Guide.Database class createFromTemplate createOutline createReplica enableFolder FTDomainSearch FTSearch getAgent getDocumentByID getDocumentByUNID getDocumentByURL getForm getOutline getProfileDocCollection getProfileDocument getURLHeaderInfo getView grantAccess open queryAccess remove replicate revokeAccess search updateFTIndex Creation and access There are several ways you can use the Database class to access existing databases and to create new ones. To access the current database if you are running as an agent.

Usage A database must be open before you can use all the properties and methods in the corresponding Database object. modify the ACL. In most cases. use openURLDatabase in Session. To test for the existence of a database with a specific server and file name before accessing it. remove documents from it. the class library automatically opens a database for you. To access the current user’s mail database.Database class To access an existing database when you know its server and replica ID. as determined by the Server document in the Domino Directory. createFromTemplate. use the appropriate Parent (or ParentDatabase) property. The user’s access level to the server on which the database resides. Chapter 10: Java Classes A–Z 1779 . use createCopy. To create a new database from scratch. But see isOpen for the exceptions. To access a database when you have a contained object such as View. and so on. use getAddressBooks in Session. use createDatabase in DbDirectory. use openByReplicaID in DbDirectory. Document. Access levels Notes throws an exception when you attempt to perform an operation for which the user does not have appropriate access. or Agent. To locate an existing database when you know its server but not its file name. as determined by the database access control list. use the DbDirectory class. The properties and methods that you can successfully use on a Database object are determined by these factors: The user’s access level to the database. The ACL determines if the user can open a database. use openDatabase or openDatabaseIfModified in DbDirectory. DocumentCollection. add documents to it. or createReplica. To open the default Web Navigator database. ACL. use openMail in DbDirectory. To create a new database from an existing database. To access the available Domino Directories and Personal Address Books.

Volume 3: JavaScript Classes . true).println(db.out. This agent creates a Database object called db and assigns a database to it.createFromTemplate (null.. } } } 2.").getTitle()).Database class Examples: Database class 1.getDatabase(null.*.isOpen()) { db = template. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). db = session. template = session.getDatabase(null.*.setTitle("Ducks of North America"). // (Your code goes here) Database db.ntf"). if (db. getDatabase automatically opens it.isOpen()) System.getAgentContext(). If the database exists. } else System.. If not.out.println("Creating new database . "discsw50. } catch(Exception e) { e. "quack". // (Your code goes here) Database db = session.nsf located at the top level of the data directory on server doc. AgentContext agentContext = session. "quack"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getDatabase("doc".out.getAgentContext().println(db. "names"). System.nsf exists locally. The database is names.out. if (template. db. import lotus. System. import lotus. template. System.out.printStackTrace().domino.println(db.out. This agent uses isOpen to test if the database quack.println("Database does not exist").getTitle()).println 1780 Domino Designer Programming Guide. the agent uses the create method to create a new database on disk.domino. AgentContext agentContext = session. else { System.getTitle()).

getTitle()).isOpen()) System.println(db. System. Notice that two backslashes must be used because the backslash is an escape character in Java.printStackTrace(). db. import lotus.ntf").println( "Database does not exist"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.ntf does not exist").println( "Creating new database . public class JavaAgent extends AgentBase { Chapter 10: Java Classes A–Z 1781 .setTitle("Ducks of North America").ntf does not exist"). } } catch(Exception e) { e. if (db. System. } } } 4. } } catch(Exception e) { e.getDatabase(null. true). This agent gives Brian Flokka Editor access to the current database. This agent is the same as the last except that the database is in a subdirectory of the data directory.domino.*. Using the CurrentDatabase property avoids having to use file names in agents and makes agents easily portable from one database to another.").getAgentContext().Database class ("Template discsw50.out.isOpen()) { db = template.getTitle()). // (Your code goes here) Database db. "quack"). AgentContext agentContext = session.println ("Template discsw50.printStackTrace(). import lotus. template. "discsw50.. template = session. else { System. if (template.createFromTemplate (null.*.out.getDatabase(null.out. } else System.println(db. db = session. } } } 3. "birds\\quack".domino..out.

domino.compact(). // (Your code goes here) DbDirectory dir = session.createDateTime("").println( "Database not modified in past day"). if (db != null) { System. dt. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). Volume 3: JavaScript Classes .openDatabaseIfModified ("quack". The agent checks if quack. dt).adjustDay(-1). if so.println("Compacting database").getCurrentDatabase(). AgentContext agentContext = session.setNow(). import lotus. DateTime dt = session. db. } catch(Exception e) { e. AgentContext agentContext = session.out. ACL. } catch(Exception e) { e. } else System. db.getDbDirectory(null). Database db = dir.out.grantAccess("Brian Flokka". } } } 1782 Domino Designer Programming Guide. // (Your code goes here) Database db = agentContext.printStackTrace().LEVEL_EDITOR).printStackTrace(). the agent opens the database and compacts it. } } } 5.Database class public void NotesMain() { try { Session session = getSession().nsf on the current server was modified since yesterday. dt. This agent shows how you can use the openIfModified method to open a database only if it’s been modified after a certain date.getAgentContext().*.

*.printStackTrace(). Defined in Database Data type ACL Syntax public ACL getACL() throws NotesException Example: ACL property This agent prints the name of every entry in the ACL of the current database. AgentContext agentContext = session.out. ACLEntry acle = acl.getName()).Database class ACL property Read-only. } while ((acle = acl.domino. // (Your code goes here) Database db = agentContext. do { System.getCurrentDatabase().getAgentContext(). } } } Chapter 10: Java Classes A–Z 1783 . The access control list for a database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getNextEntry(acle)) != null). ACL acl = db.println(acle.getFirstEntry(). } catch(Exception e) { e.getACL(). import lotus.

} } catch(Exception e) { e.util.out.println("Agents in database:").getAgents(). System. // (Your code goes here) Database db = agentContext.domino. All of the agents in a database. for (int i=0.*. i<agents. import lotus. Defined in Database Data type java.util. import java.Database class Agents property Read-only.out.util. the return vector includes public agents and personal agents that belong to the current user. If the program runs on a server.getAgentContext().getCurrentDatabase(). } } } 1784 Domino Designer Programming Guide. Volume 3: JavaScript Classes .getName()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println(" " + agent. the return vector includes only public agents. elements are Agent Syntax public java. i++) { Agent agent = (Agent)agents.printStackTrace().Vector. Example: Agents property This agent prints the name of each agent in the current database.Vector getAgents() throws NotesException Usage If the program runs on a workstation or is remote (IIOP).elementAt(i). AgentContext agentContext = session. Vector agents = db.size().Vector. System.

An unsorted collection containing all the documents in a database. Defined in Database Data type DocumentCollection Syntax public DocumentCollection getAllDocuments() throws NotesException Usage The FTSearch and search methods return smaller collections of documents that meet specific criteria. System. String title = db. AgentContext agentContext = session. import java. Using the AllDocuments property is more efficient than using the search method with an @All formula.getCurrentDatabase(). import lotus. Chapter 10: Java Classes A–Z 1785 .getCount() + " documents").println("Database \"" + title + "\" has " + dc.out.getAllDocuments(). then prints the value of the Subject item for each document. DocumentCollection dc = db.Vector.util.Database class AllDocuments property Read-only.getAgentContext().*. Document doc. // (Your code goes here) Database db = agentContext. Example: AllDocuments property This agent prints the number of documents in the current database.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getTitle().

Database class for (int i=1. Examples: Categories property 1. // (Your code goes here) Database db = agentContext. Otherwise. String title = db. AgentContext agentContext = session.getCount(). System. import lotus.getCurrentDatabase(). This agent prints the categories of the current database. the database must be open.getNthDocument(i).println ("Document #" + (i+1) + ": " + doc.getTitle().*. Multiple categories are separated by a comma or semicolon. 1786 Domino Designer Programming Guide. } } } Categories property Read-write.getItemValue("Subject")).domino. i++) { doc = dc.printStackTrace().out. Defined in Database Data type String Syntax public String getCategories() throws NotesException public void setCategories(String categories) throws NotesException Usage A database retrieved through getFirstDatabase or getNextDatabase in DbDirectory does not have to be open for getCategories. The categories under which a database appears in the Database Library. Volume 3: JavaScript Classes . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). i<=dc.getAgentContext(). } } catch(Exception e) { e.

getCurrentDatabase(). if (cat != "") System.Database class String cat = db.” import lotus. The date a database was created.domino.setCategories("Examples database").printStackTrace().*. else System.getAgentContext().out. AgentContext agentContext = session. db. } } } Created property Read-only.println("Database \"" + title + "\" has the categories: " + cat). This agent sets the Categories property of the current database to “Examples database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace(). } catch(Exception e) { e.println("Database \"" + title + "\" has no categories"). } catch(Exception e) { e. } } } 2.out.getCategories(). // (Your code goes here) Database db = agentContext. Defined in Database Data type DateTime Syntax public DateTime getCreated() throws NotesException Chapter 10: Java Classes A–Z 1787 .

LEVEL_READER 1788 Domino Designer Programming Guide. System.LEVEL_NOACCESS ACL. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session.printStackTrace().out.println("Database \"" + title + "\" was created on " + created).getCurrentDatabase().getTitle().*.LEVEL_MANAGER ACL.LEVEL_EDITOR ACL.Database class Example: Created property This agent prints the creation date of the current database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().LEVEL_AUTHOR ACL. Volume 3: JavaScript Classes .LEVEL_DESIGNER ACL. import lotus.LEVEL_DEPOSITOR ACL. The current user’s access level to a database. } } } CurrentAccessLevel property Read-only. } catch(Exception e) { e.getLocalTime(). String created = db.getAgentContext().domino. Defined in Database Data type int Syntax public int getCurrentAccessLevel throws NotesException Legal values ACL.getCreated(). String title = db.

break.getTitle().getAgentContext(). case(ACL.print("Reader access").LEVEL_DESIGNER) : System.*. CurrentAccessLevel is determined by the access level of the person who last saved the program (the owner). } catch(Exception e) { e. case(ACL.printStackTrace().out. break. default: System.LEVEL_AUTHOR) : System.LEVEL_EDITOR) : System. } } } Chapter 10: Java Classes A–Z 1789 .getCurrentDatabase().out. break. break. break.print("Author access").out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().print("\n").print("Designer access"). break. Example: CurrentAccessLevel property This example prints a message indicating the current user’s access level to the current database. int level = db. case(ACL. String title = db.out.print("No access").print("Unknown access"). import lotus.print("Editor access"). case(ACL. case(ACL. break.LEVEL_READER) : System.LEVEL_NOACCESS) : System.out.domino. switch(level) { case(ACL.LEVEL_MANAGER) : System.out. break.LEVEL_DEPOSITOR) : System.out. AgentContext agentContext = session. } System. case(ACL.getCurrentAccessLevel(). // (Your code goes here) Database db = agentContext. System.print("Manager access"). CurrentAccessLevel is determined by the access level of the current user.print("For database \"" + title + "\" you have ").print("Depositor access").Database class Usage If a program runs on a workstation or is remote (IIOP).out.out.out. If a program runs on a server.

getAgentContext(). Defined in Database Data type String Syntax public String getDesignTemplateName() throws NotesException Usage If a database inherits a specific design element (such as a form) but not its entire design from a template. returns an empty string.out.printStackTrace().domino.println("Database \"" + title + "\" did not inherit its design from a template"). else System. if (template != "") System.out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). this property returns an empty string.Database class DesignTemplateName property Read-only. AgentContext agentContext = session. import lotus.getDesignTemplateName().getCurrentDatabase(). } } } 1790 Domino Designer Programming Guide. String title = db. If the database does not inherit its design from a design template. Volume 3: JavaScript Classes .println("Database \"" + title + "\" inherits its design from " + template). // (Your code goes here) Database db = agentContext. String template = db. } catch(Exception e) { e.getTitle(). Example: DesignTemplateName property This agent prints the design template name for the current database if one exists. The name of the design template from which a database inherits its design.*.

Defined in Database Data type String Chapter 10: Java Classes A–Z 1791 . excluding the path. } } } FilePath property Read-only.out.println("Database \"" + title + "\" has the file name " + name). import lotus.getAgentContext(). } catch(Exception e) { e. String name = db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The path and file name of a database.printStackTrace(). Defined in Database Data type String Syntax public String getFileName() throws NotesException Example: FileName property This agent prints the title and name of the current database. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session.getTitle(). System.domino. The file name of a database.*.Database class FileName property Read-only.getFileName(). String title = db.getCurrentDatabase().

Defined in Database Data type boolean 1792 Domino Designer Programming Guide. If the database is on a Domino server. import lotus. C:\Notes\data\sub\db. String path = db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.getTitle(). AgentContext agentContext = session.getFilePath().out.getCurrentDatabase(). // (Your code goes here) Database db = agentContext.*. FilePath returns the complete path (for example.nsf).println("Database \"" + title + "\" has the file path " + path).Database class Syntax public String getFilePath() throws NotesException Usage If the database is on a Notes workstation.nsf). } } } FolderReferencesEnabled property Read-write. FilePath returns the path relative to the data directory (for example.printStackTrace(). String title = db. Example: FilePath property This agent prints the title and path of the current database. Volume 3: JavaScript Classes . } catch(Exception e) { e.getAgentContext().domino. Indicates whether this database maintains folder references for documents. sub\db.

*. msg = "Folder references disabled".getAgentContext().setFolderReferencesEnabled(false). } System.Database class Syntax public boolean getFolderReferencesEnabled() throws NotesException public void setFolderReferencesEnabled(boolean bEnable) throws NotesException Legal Values true maintains folder references false (default) does not maintain folder references Usage Maintaining folder references impacts performance. Example: FolderReferencesEnabled property This agent toggles the FolderReferencesEnabled property.println(msg). } } } Chapter 10: Java Classes A–Z 1793 .getCurrentDatabase().out. AgentContext agentContext = session.getFolderReferencesEnabled()) { db.domino. // (Your code goes here) Database db = agentContext.printStackTrace(). import lotus. } else { db.setFolderReferencesEnabled(true). msg = "Folder references enabled". public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } catch(Exception e) { e. String msg. if (db.

All the forms in a database. String title = db.util. import java.Vector.println("Form #" + (i+1) + ": " + name). Defined in Database Data type boolean 1794 Domino Designer Programming Guide.println("Agents in database:").getName().*.Vector. Indicates whether updates to a server are delayed (batched) for better performance. Vector forms = db. } } catch(Exception e) { e.printStackTrace().util.util.domino. i++) { String name = ((Form)forms.getForms().Vector getForms() throws NotesException Example: Forms property This example displays the names of all the forms in the current database import lotus. elements are Form Syntax public java.out.elementAt(i)). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.getTitle(). for (int i=0. Database Data type java.getCurrentDatabase(). System. // (Your code goes here) Database db = agentContext. } } } IsDelayUpdates property Read-write. System.Database class Forms property Read-only. i<forms.size(). Volume 3: JavaScript Classes .getAgentContext(). AgentContext agentContext = session.

System. This makes for better performance but risks losing the cached updates in the event of a crash. else db.” import lotus. Example: IsDelayUpdates property This agent enables delayed updates for the current database if the comment for the current agent is “DelayUpdates. } catch(Exception e) { e. if (agent. This method applies to save and remove operations on documents. } } } Chapter 10: Java Classes A–Z 1795 . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If you set DelayUpdates to true.Database class Syntax public boolean isDelayUpdates() throws NotesException public void setDelayUpdates(boolean delay) throws NotesException Legal Values true delays server updates false posts server updates immediately Usage If DelayUpdates is false.println ("Delay updates is " + db. the cached updates are posted.out.*. Database db = agentContext.getCurrentDatabase().getCurrentAgent().isDelayUpdates()).getComment() == "DelayUpdates") db. The property is not saved.setDelayUpdates(true).setDelayUpdates(false).domino. server updates are cached and the program proceeds immediately. the program waits for updates to the server to be posted. AgentContext agentContext = session. Set this property each time you open a database. // (Your code goes here) Agent agent = agentContext. At a convenient time.printStackTrace().getAgentContext().

getCurrentDatabase().println("Database \"" + title + "\" is not full-text indexed"). Volume 3: JavaScript Classes . Indicates whether or not a database has a full-text index.isFTIndexed()) System.getAgentContext(). } catch(Exception e) { e.out. if (db.*. } } } 1796 Domino Designer Programming Guide.println("Database \"" + title + "\" is full-text indexed"). else System. Defined in Database Data type boolean Syntax public boolean isFTIndexed() throws NotesException Legal values true if the database has a full-text index false if the database does not have a full-text index Example: IsFTIndexed property This agent prints a message saying whether the current database has a full-text index.getTitle().printStackTrace().domino. AgentContext agentContext = session. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext.out. String title = db.Database class IsFTIndexed property Read-only.

Indicates whether a database represents a multi-database search index. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Defined in Database Data type boolean Syntax public boolean isMultiDbSearch() throws NotesException Legal values true if the database represents a multi-database search index false if the database does not represent a multi-database search index Example: IsMultiDbSearch property This agent prints whether the current database represents a multi-database search index.*.domino.getAgentContext().out. } catch(Exception e) { e.Database class IsMultiDbSearch property Read-only. String title = db.getTitle().isMultiDbSearch()) System. if (db. } } } Chapter 10: Java Classes A–Z 1797 .println("Database \"" + title + "\" is a multi-database search index").printStackTrace(). // (Your code goes here) Database db = agentContext. AgentContext agentContext = session. import lotus.getCurrentDatabase().println("Database \"" + title + "\" is not a multi-database search index").out. else System.

getNextDatabase. DbDirectory. Example: IsOpen property This agent prints the result of isOpen before and after opening a database. The following methods do not open a database: DbDirectory. getFilePath. You must explicitly call Database. getDelayUpdates. isOpen.open. Defined in Database Data type boolean Syntax public boolean isOpen() throws NotesException Legal values true if the database is open false if the database is not open Usage A database must be open to use the Database methods except: getCategories.println("\"" + db.*. getDesignTemplateName. getParent. Indicates whether a database is open.println("\"" + db. AgentContext agentContext = session. getTemplateName.getAddressBooks. isPublicAddressBook. getServer.out.getFirstDatabase. // (Your code goes here) DbDirectory Dir = session. and getTitle. 1798 Domino Designer Programming Guide. } public void NotesMain() { try { Session session = getSession().isOpen()) System. Volume 3: JavaScript Classes . else System. isPrivateAddressBook.domino. getReplicaID. getFileName. import lotus.getDbDirectory(null). public class JavaAgent extends AgentBase { public void isitopen(Database db) throws NotesException { if (db.getTitle() + "\" is not open").getAgentContext().Database class IsOpen property Read-only.out.getTitle() + "\" is open"). and Session. getSizeQuota.

} } } IsPrivateAddressBook property Read-only.*.util.printStackTrace(). Chapter 10: Java Classes A–Z 1799 . and prints a message for each one that is a Personal Address Book.Database class Database db = Dir.open().domino.getAgentContext(). AgentContext agentContext = session.*. } catch(Exception e) { e. isitopen(db). Defined in Database Data type boolean Syntax public boolean isPrivateAddressBook() throws NotesException Legal values true if the database is a Personal Address Book false if the database is not a Personal Address Book Usage This property is available for Database objects retrieved by getAddressBooks in Session. Example: IsPrivateAddressBook property This agent uses getAddressBooks in Session to retrieve the user Domino Directories and Personal Address Books. Indicates if a database is a Personal Address Book.DATABASE).getFirstDatabase(DbDirectory. import java. import lotus. this property has no value and evaluates to false. db. isitopen(db). For other Database objects. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

Defined in Database Data type boolean Syntax public boolean isPublicAddressBook() throws NotesException Legal values true if the database is a Domino Directory false if the database is not a Domino Directory Usage This property is available for Database objects retrieved from getAddressBooks in Session.elements().getFilePath().getServer().printStackTrace(). For other Database objects.Database class // (Your code goes here) System.isPrivateAddressBook()) { String msg = " " + db. Enumeration e = books.getAddressBooks(). }} } catch(Exception e) { e. Database db. while (e.out.println("Personal address books:\n"). this property has no value and evaluates to false. Volume 3: JavaScript Classes . Indicates if a database is a Domino Directory.println(msg).hasMoreElements()) { db = (Database)e.out. Vector books = session. 1800 Domino Designer Programming Guide. } } } IsPublicAddressBook property Read-only.nextElement(). System. if (db. if (db.getServer() != "") msg = msg + " on " + db.

// (Your code goes here) System.out.getAddressBooks(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace(). import lotus.isPublicAddressBook()) { String msg = " " + db. AgentContext agentContext = session.getFilePath(). Database db. The date that a database’s full-text index was last updated. while (e. and prints a message for each one that is a Domino Directory. Vector books = session. } } } LastFTIndexed property Read-only.hasMoreElements()) { db = (Database)e.Database class Example: IsPublicAddressBook property This agent retrieves the current user Domino Directories and Personal Address Books. System.domino. if (db. Defined in Database Data type DateTime Syntax public DateTime getLastFTIndexed() throws NotesException Chapter 10: Java Classes A–Z 1801 .getAgentContext().out. }} } catch(Exception e) { e. import java.println(msg).elements().nextElement().getServer() != "") msg = msg + " on " + db. if (db.*. Enumeration e = books.getServer().*.util.println("Domino Directories:\n").

println("Database \"" + title + "\" is not full-text indexed").out. } } } LastModified property Read-only.Database class Usage If the database does not have a full-text index.getDateOnly()).getTitle().domino.printStackTrace(). String title = db.isFTIndexed()) { DateTime dt = db. Defined in Database Data type DateTime Syntax public DateTime getLastModified() throws NotesException 1802 Domino Designer Programming Guide. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext. Example: LastFTIndexed property This agent prints the last update date of the full-text index for the current database if it has an index.getCurrentDatabase(). import lotus.*.out. } catch(Exception e) { e.getLastFTIndexed(). this property returns null.getAgentContext(). Volume 3: JavaScript Classes . AgentContext agentContext = session. The date that a database was last modified. } else System.println("Database \"" + title + "\" last full-text indexed on " + dt. if (db.

Vector getManagers() throws NotesException Usage Each element in the vector is the name of a person. server. servers.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getTitle().getAgentContext().util.println("Database \"" + title + "\" was last modified on " + lastMod).*.Database class Example: LastModified property This agent prints the date and time that the current database was last modified. Defined in Database Data type java. import lotus.getLocalTime().getCurrentDatabase().util. Chapter 10: Java Classes A–Z 1803 . or group with Manager access to the database. String title = db. } catch(Exception e) { e. People.getLastModified(). } } } Managers property Read-only. AgentContext agentContext = session. elements are String Syntax public java.printStackTrace(). // (Your code goes here) Database db = agentContext. System.Vector. and groups that have Manager access to a database. String lastMod = db.out.

} for (int i=0. System.getManagers(). Volume 3: JavaScript Classes .out. AgentContext agentContext = session.Vector. int size = managers.out. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext().getTitle(). Defined in Database Data type long Syntax public long getMaxSize() throws NotesException 1804 Domino Designer Programming Guide. if (size == 1) { System. // (Your code goes here) Database db = agentContext. i<size. The maximum size of a database in kilobytes.*.getCurrentDatabase().println("Database \"" + title + "\" has 1 manager"). i++) { String name = (String)managers.domino. } } catch(Exception e) { e.size().out.println("Database \"" + title + "\" has " + size + " managers"). Vector managers = db.Database class Example: Managers property This agent displays the number of managers in the current database and the name of each. import java.println ("Manager # " + (i+1) + ": " + name). String title = db.util. } else { System. } } } MaxSize property Read-only.printStackTrace().elementAt(i).

Defined in Database Data type double Chapter 10: Java Classes A–Z 1805 .out.println(session. "names").getParent().printStackTrace(). Defined in Database Data type Session Syntax public Session getParent() Example: Parent property This agent prints the user name of the parent session for the current database. AgentContext agentContext = session.getUserName()).getAgentContext(). The Notes session that contains a database.domino. } catch(Exception e) { e. The percent of a database’s total size that is occupied by real data (and not empty space).Database class Parent property Read-only. } } } PercentUsed property Read-only.*. // (Your code goes here) Database db = session. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). session = db.getDatabase("doc". System.

getPercentUsed(). // (Your code goes here) Database db = agentContext.out.getTitle().getCurrentDatabase(). String title = db.getAgentContext().*. Defined in Database Data type String Syntax public String getReplicaID() throws NotesException 1806 Domino Designer Programming Guide. Example: PercentUsed property This agent prints the percentage of the current database that contains data. System. } catch(Exception e) { e. Volume 3: JavaScript Classes .printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Database \"" + title + "\" is " + percent + " percent used. import lotus. double percent = db.domino. Databases with the same replica ID are replicas of one another. A 16-digit hexadecimal number that represents the replica ID of a Notes database. } } } ReplicaID property Read-only. AgentContext agentContext = session.").Database class Syntax public double getPercentUsed() throws NotesException Usage Compacting a database removes empty space in the database file.

System.out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Chapter 10: Java Classes A–Z 1807 . } } } ReplicationInfo property Read-only. import lotus. } catch(Exception e) { e. String title = db.getCurrentDatabase(). AgentContext agentContext = session.*.getTitle().println("Database \"" + title + "\" has the replica ID " + repid). // (Your code goes here) Database db = agentContext.Database class Example: ReplicaID property This agent prints the replica ID of the current database.getAgentContext().printStackTrace().domino. The replication object associated with this database. Defined in Database Data type Replication Syntax public Replication getReplicationInfo() throws NotesException Usage See the Replication class for information and examples.getReplicaID(). String repid = db.

println("Database \"" + title + "\" is local"). AgentContext agentContext = session. if (server != "") System.*.getServer().getCurrentDatabase(). The name of the server where a database resides. String server = db. } } } 1808 Domino Designer Programming Guide. } catch(Exception e) { e.Database class Server property Read-only.println("Database \"" + title + "\" resides on server " + server). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). else System.getTitle(). Example: Server property This agent prints the name of the server for the current database. // (Your code goes here) Database db = agentContext.out. Defined in Database Data type String Syntax public String getServer() throws NotesException Usage If the database is on a workstation.domino. the property returns an empty string. Volume 3: JavaScript Classes . String title = db.out.printStackTrace(). import lotus.getAgentContext().

getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace().getSize().println ("The maximum size of database \"" + title + "\" is" + maxsize + " kilobytes"). long maxsize = db.getMaxSize().domino.*. String title = db. System. Defined in Database Data type double Syntax public double getSize() throws NotesException Example: MaxSize and Size properties This agent prints the size of the current database.getTitle(). } } } Chapter 10: Java Classes A–Z 1809 . The size of a database.println ("The size of database \"" + title + "\" is" + (int)size + " bytes"). double size = db. import lotus. } catch(Exception e) { e.out. System.Database class Size property Read-only. // (Your code goes here) Database db = agentContext.getCurrentDatabase().out. in bytes. AgentContext agentContext = session.

and prints the old and new size quotas.Database class SizeQuota property Read-write.out.getCurrentDatabase(). The size quota is not the same as the size limit that a user specifies when creating a new database. String title = db. // (Your code goes here) Database db = agentContext. Example: SizeQuota property This agent changes the size quota of the current database.getSizeQuota().getTitle(). Therefore. Defined in Database Data type int Syntax public int getSizeQuota() throws NotesException public void setSizeQuota(int quota) throws NotesException Usage The size quota for a database specifies the amount of disk space that the server administrator is willing to provide for the database. db.println ("The size quota of database \"" + title + "\" is changed from " + oldq + " to 5000KB"). If the database has no size quota. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setSizeQuota(5000).getAgentContext().*.domino. Volume 3: JavaScript Classes . int oldq = db. this property returns 0. in kilobytes. System. 1810 Domino Designer Programming Guide. The size quota of a database. the SizeQuota property can only be set by a program that has administrator access to the server on which the database resides. import lotus.

if (template != "") System. } catch(Exception e) { e.*.domino. else System. returns an empty string.ntf in the local Notes directory.Database class } catch(Exception e) { e.out. Defined in Database Data type String Syntax public String getTemplateName() throws NotesException Example: TemplateName property This agent gets the template name of discuss4.getAgentContext().getCurrentDatabase().getTemplateName().printStackTrace(). // (Your code goes here) Database db = agentContext. String template = db.getTitle().println("Database \"" + title + "\" has the template name " + template). The template name of a database. } } } TemplateName property Read-only.out. If the database is not a template. } } } Chapter 10: Java Classes A–Z 1811 .println("Database \"" + title + "\" is not a template"). import lotus. AgentContext agentContext = session. if the database is a template.printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). String title = db.

else { title = title + " (Marketing)".getTitle(). Defined in Database Data type String Syntax public String getTitle() throws NotesException public void setTitle(String title) throws NotesException Usage A program cannot change the title of the database in which the program is currently running.*. Example: Title property This agent appends “(Marketing)” to the title of the current database.getAgentContext().endsWith("(Marketing)")). AgentContext agentContext = session.Database class Title property Read-write. } } } 1812 Domino Designer Programming Guide.getCurrentDatabase(). The title of a database. Volume 3: JavaScript Classes .printStackTrace(). // (Your code goes here) Database db = agentContext. } } catch(Exception e) { e. if (title. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). String title = db.setTitle(title). import lotus. db.domino.

Vector. elements are View Syntax public java.Database class Views property Read-only.getTitle().println ("View #" + (i+1) + ": " + name). i++) { String name = ((View)views. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Database \"" + title + "\" has " + size + " views"). // (Your code goes here) Database db = agentContext.printStackTrace(). AgentContext agentContext = session. personal folders are also included.getCurrentDatabase().out.elementAt(i)). } } catch(Exception e) { e.Vector getViews() throws NotesException Usage Each element of the vector represents a public view or folder in the database.util.out. System. import java. for (int i = 0. Defined in Database Data type java. If the database is local.domino. System.getViews(). import lotus. String title = db.getAgentContext().util.Vector. Vector views = db.size(). The views and folders in a database. Example: Views property This agent displays the names of all the views and folders in the current database.*. i<size. } } } Chapter 10: Java Classes A–Z 1813 .util. int size = views.getName().

compact().println("Compacting database \"" + title + "\""). System. Database db = session. if (percentUsed < 75) { int saved = db. The user supplies the database name as the agent’s comment. double percentUsed = db. // (Your code goes here) Agent agent = agentContext.println ("Database \"" + title + "\" is " + (int)percentUsed + " percent used"). String dbName = agent. Defined in Database Syntax public int compact() throws NotesException Return value int The difference in bytes between the size of the database before and after compacting. dbName).getCurrentAgent().*.out.getAgentContext().getTitle(). Volume 3: JavaScript Classes .domino. } catch(Exception e) { 1814 Domino Designer Programming Guide. import lotus.Database class compact method Compacts a local database.getPercentUsed(). Usage This method throws an exception if the database is not local.getComment(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getDatabase(null. Example: compact method This agent compacts a database if less than 75% of its disk space is occupied by real data. AgentContext agentContext = session. String title = db. } System.out.

an exception is thrown. and an identical title. In these cases. Specify null or an empty string (“”) to create a local copy. Chapter 10: Java Classes A–Z 1815 . This is the safer method. Return value Database The new copy. an identical access control list. String dbfile) throws NotesException Parameters String server The name of the server where the new database resides.Database class e. Make sure the name of the server that the program runs on matches the name of server. the server parameter must correspond to the server the program is running on.printStackTrace(). } } } createCopy method Creates an empty copy of the current database. String dbfile The file name of the new copy. The copy contains the design elements of the current database. Defined in Database Syntax public Database createCopy(String server. The copy does not contain any documents and is not a replica. There are two ways to do this: Use null or an empty string (“”) to indicate the current computer. Programs running on a server or using remote (IIOP) calls to a server can’t create or access databases on other servers. Usage If a database with the specified file name already exists.

String title = db.getDatabase(null. AgentContext agentContext = session.nsf.createCopy(null. Example: createCopy method This agent makes a local copy of the local database names.Database class Programs running on a workstation can access several different servers in a single program. "names2"). The ACL of the original database gets copied to the new database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). you may want Manager access to the copy for yourself even if you’re not a manager of the original. } catch(Exception e) { e.domino. // (Your code goes here) Database db = session. } } } createDocument method Creates a document in a database and returns a Document object that represents the new document. Defined in Database Syntax public Document createDocument() throws NotesException Return value Document The new document.out. System.getTitle(). 1816 Domino Designer Programming Guide. import lotus.printStackTrace(). Volume 3: JavaScript Classes . Use the methods grantAccess and revokeAccess to modify the copy’s ACL. db2.println ("Database \"" + title + "\" copied locally"). "names").getAgentContext().*. Database db2 = db. For example.setTitle("Copy of names"). but you may want to modify the copy’s ACL.

import lotus.save()) System.*.println("Document has been saved"). else System. } } } createFromTemplate method If the current database is a template.appendItemValue("Subject".out. The new database has the design features and documents of the template.createDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Example: createDocument method This agent creates a new document in the current database. and saves it.getCurrentDatabase(). doc. sets values for its Form. if (doc.getAgentContext().appendItemValue("Categories".domino. boolean inherit) throws NotesException Chapter 10: Java Classes A–Z 1817 . creates a new database from the template. } catch(Exception e) { e. Document doc = db.appendItemValue("Form". and Body items. rti."). Categories.printStackTrace().out. RichTextItem rti = doc. // (Your code goes here) Database db = agentContext. "Main Topic").println("Unable to save document")."). doc. "Test Documents"). Subject.appendText("This is the first sentence of text.createRichTextItem("Body").appendText(" This is the second sentence of text. rti. Defined in Database Syntax public Database createFromTemplate(String server. "Test Document").Database class Usage You must call save if you want the new document to be saved. String dbfile. doc. AgentContext agentContext = session.

Return value Database The new database. Programs running on a workstation can access several different servers in a single program. boolean inherit Specify true if you want the new database to inherit future design changes from the template. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). the createFromTemplate method creates a new.domino. import lotus. Specify null or an empty string (“”) to create a database on the current computer. Example: createFromTemplate method This agent creates a new database from the discussion template. Programs running on a server or making remote (IIOP) calls to a server can’t create or access databases on other servers. This is the safer method. If the current database is not a template. an exception is thrown. the server parameter must correspond to the server the program is running on. agents.*. AgentContext agentContext = session. blank database without any forms or views (equivalent to the create method). In these cases. String dbfile The file name of the new database.Database class Parameters String server The name of the server where the new database resides. otherwise. navigators. Make sure the name of the server that the program runs on matches the name of the server parameter. There are two ways to do this: Use null or an empty string (“”) to indicate the current computer. and documents of the template. specify false. 1818 Domino Designer Programming Guide. subforms. fields. folders. views. Volume 3: JavaScript Classes .getAgentContext(). Usage If a database with the specified file name already exists. which contains the forms.

Defined in Database Syntax public Outline createOutline(String name) throws NotesException public Outline createOutline(String name. true).out.getDatabase(null. Return value Outline The new outline. } } } createOutline method Creates an outline. boolean defaultOutline) throws NotesException Parameters String outline A name for the outline. Database newdb = template. "suggest".ntf"). "discsw50. Chapter 10: Java Classes A–Z 1819 . System. } catch(Exception e) { e. boolean defaultOutline True to generate a default outline.setTitle("Suggestions for Giving Campaign"). newdb.createFromTemplate (null.println("\"Suggestions for Giving Campagn\" created").printStackTrace().Database class // (Your code goes here) Database template = session. Default is to create an empty outline.

Database class createReplica method Creates a replica of the current database at a new location. Programs running on a workstation can access several different servers in a single program. Make sure the name of the server that the program runs on matches the name of the server parameter. Programs running on a server or making remote (IIOP) calls to a server can’t create or access databases on other servers. an exception is thrown. 1820 Domino Designer Programming Guide. In these cases. the server parameter must correspond to the server the program is running on. Usage If a database with the specified file name already exists. There are two ways to do this: Use null or an empty string (“”) to indicate the current computer. String dbfile The file name of the replica. Specify null or an empty string (“”) to create a replica on the current computer. This is the safer method. The new replica has an identical access control list. Return value Database The new replica. Defined in Database Syntax public Database createReplica(String server. Volume 3: JavaScript Classes . String dbfile) throws NotesException Parameters String server The name of the server where the replica will reside.

printStackTrace().nsf from notesua1 on the current computer. // (Your code goes here) Database db = session. System. this method does nothing.createReplica(null. "Domlog"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If the folder does not exist. Defined in Database Syntax public void enableFolder(String folder) throws NotesException Parameters String folder The name of the folder.getTitle().Database class Example: createReplica method This agent creates a replica of the Domlog. Usage If the folder exists. "Domlog"). Chapter 10: Java Classes A–Z 1821 .*. creating it if necessary. Database replica = db. } catch(Exception e) { e. this method creates it.out. } } } enableFolder method Ensures that a folder exists.getAgentContext().domino. String title = db. import lotus.println ("Database \"" + title + "\" has a new local replica"). AgentContext agentContext = session.getDatabase("notesua1".

use the FTSearchScore property in Document. Use the following constants to specify additional search options. a full-text search of all databases listed in a Domain Catalog and marked as included for multi-database indexing. int max.FT_FILESYSTEM includes files other than Domino databases in the search scope.FT_DATE_ASC sorts by document creation date in ascending order. Database. Database. See below for the syntax. Database. Defined in Database Syntax public Document FTDomainSearch(String query. To specify more than one option. Use one of the following constants to specify a sorting option: Database. Set this parameter to 0 to receive all matching documents. Database. 1822 Domino Designer Programming Guide. When the collection is sorted by relevance. Database. int sortopt Integer.FT_DATE_DES sorts by document creation date in descending order. String entryForm) throws NotesException Parameters String query The full-text query. int start.FT_FUZZY specifies a fuzzy search. that is.Database class FTDomainSearch method Conducts a Domain Search. the highest relevance appears first. otheropt Integer.FT_STEMS uses stem words as the basis of the search. To access the relevance score of each document in the collection. int count. int max The maximum number of documents you want returned from the query. Volume 3: JavaScript Classes .FT_DATABASE includes Domino databases in the search scope. use a logical or operation. int otheropt. Database.FT_SCORES (default) sorts by relevance score. int sortopt.

Usage The current Database object must represent a Domain Catalog. enter the word or phrase as is. Wildcards. “Domain Search.” Return value Document A document that contains the results of the full-text query. and other syntax are permitted. Remember to escape quotes if you are inside a literal. see “To use operators to refine a search” in Notes 5 Help. int max. If you ask for a sort by date. int count The number of pages to return. FTSearch method Conducts a full-text search of all the documents in a database. you get the documents sorted by relevance score. Defined in Database Syntax public DocumentCollection FTSearch(String query) throws NotesException public DocumentCollection FTSearch(String query. except that search keywords must be enclosed in quotes. String entryForm The name of the search form in the domain catalog. int sortopt. Query syntax To search for a word or phrase.Database class int start The starting page to return. for example. For the complete syntax rules. int otheropt) throws NotesException Chapter 10: Java Classes A–Z 1823 . If you don’t specify any sort options. operators. you don’t get relevance scores. int max) throws NotesException public DocumentCollection FTSearch(String query.

use the FTSearch method in View. use the FTSearchScore property in Document. To specify more than one option. Database. If no matches are found.FT_DATE_ASC sorts by document creation date in ascending order. the collection has a count of 0. 1824 Domino Designer Programming Guide. When the collection is sorted by relevance.FT_FILESYSTEM includes files other than Domino databases in the search scope. Database.FT_STEMS uses stem words as the basis of the search. Database. use a logical or operation. Database. To test for an index. the highest relevance appears first. To search only documents found in a particular document collection. Database. Database. but less efficiently. Usage If the database is not full-text indexed. int max The maximum number of documents you want returned from the query. To create an index on a local database.FT_FUZZY specifies a fuzzy search. Return value DocumentCollection A collection of documents that match the full-text query. sorted by the selected option. To access the relevance score of each document in the collection. use the IsFTIndexed property. Set this parameter to 0 to receive all matching documents. use the FTSearch method in DocumentCollection. sortopt Integer. See below for the syntax. Use the following constants to specify additional search options. Volume 3: JavaScript Classes .Database class Parameters String query The full-text query. use the updateFTIndex method.FT_DATE_DES sorts by document creation date in descending order.FT_DATABASE includes Domino databases in the search scope. To search only documents found in a particular view.FT_SCORES (default) sorts by relevance score. otheropt Integer. this method works. This method searches all documents in a database. Use one of the following constants to specify a sorting option: Database.

Examples: FTSearch method 1.getCount(). int matches = dc.out. operators.getComment()). up to a maximum 100 documents. except that search keywords must be enclosed in quotes. } else System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. If you ask for a sort by date. A Newsletter object formats its doclink report with either the document creation date or the relevance score.getAgentContext(). see “To use operators to refine a search” in Notes 5 Help.isFTIndexed()) { DocumentCollection dc = db.out. if (db. String title = db. you get a multi-database search.getCurrentDatabase(). System.getCurrentAgent(). Query syntax To search for a word or phrase.*.println ("Database \"" + title + "\" is not full-text indexed"). import lotus.getComment(). // (Your code goes here) Agent agent = agentContext. For the complete syntax rules. Wildcards.FTSearch (agent.println ("FTSearch of \"" + title + "\" found " + matches + " document(s) with " + agent. Every document.Database class If you don’t specify any sort options. but you can create a newsletter from the collection.getTitle(). Chapter 10: Java Classes A–Z 1825 . you get the documents sorted by relevance score. and other syntax are permitted. Remember to escape quotes if you are inside a literal. If the database has a multi-database index. depending on the sort options you use in the document collection. enter the word or phrase as is. containing the phrase is placed into a document collection.domino. Database db = agentContext. you don’t get relevance scores. Navigation through the resulting document collection may be slow. This agent searches the current database for the phrase specified in the agent’s comment if the database is full-text indexed. 100).

DocumentCollection dc = db.printStackTrace().FTSearch("red | blue".Database. This code fragment collects all documents containing either the word “red” or “blue” in descending order by creation date. Usage The return value is null if the current user (as obtained by Session. given the agent name.FTSearch("not (red | blue)". Volume 3: JavaScript Classes . 4.FTSearch("red & blue".Database class } catch(Exception e) { e. 3.FT_DATE_DES. DocumentCollection dc = db. 100.” DocumentCollection dc = db. 100. 100). This code fragment collects all documents that do not contain the word “red” or “blue” in descending order by creation date. } } } 2. 0). 1826 Domino Designer Programming Guide. Defined in Database Syntax public Agent getAgent(String name) throws NotesException Parameter String name The name of the agent. Database. Return value Agent The agent whose name matches the parameter.getUserName) is not the owner of the private agent. This code fragment collects all documents containing both the words “red” and “blue. 0). getAgent method Finds an agent in a database.FT_DATE_DES.

println("Owner:\t" + agent.out. } } } getDocumentByID method Finds a document in a database. System. and query for the agent named “Update Thread Maps. // (Your code goes here) Database db = agentContext. System. last run date. System. AgentContext agentContext = session.out. Return value Document The document whose note ID matches the parameter. given the document note ID.getName()).println( "Last run:\t" + agent.getAgentContext().getAgent("My Agent"). } catch(Exception e) { e.println("Agent:\t" + agent.out.” import lotus.getCurrentDatabase().getLastRun()). Agent agent = db.Database class Example: getAgent method This agent prints the owner.out.getQuery()).printStackTrace().println("Query:\t" + agent. Defined in Database Syntax public Document getDocumentByID(String noteid) throws NotesException Parameters String noteid The note ID of a document. System.domino.*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Chapter 10: Java Classes A–Z 1827 .getOwner()).

domino. Example: getDocumentByID method This agent gets the document in the current database whose note ID is the agent comment. // (Your code goes here) } catch(Exception e) { e.*. Agent agent = agentContext. and prints the value of the Subject item.getDocumentByID (agent.getCurrentDatabase().printStackTrace(). Database db = agentContext. If you get a note ID from @NoteID. Volume 3: JavaScript Classes .println ("Document " + agent.getAgentContext(). import lotus. } } } getDocumentByUNID method Finds a document in a database. if such a document exists.getComment() + " has the subject: " + doc. given the document universal ID (UNID).getComment()). see the NoteID property in Document.getItemValueString("Subject")). Document doc = db.getCurrentAgent(). 1828 Domino Designer Programming Guide. delete the “NT” prefix. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Database class Usage For an explanation of note IDs.out. AgentContext agentContext = session. System. Defined in Database Syntax public Document getDocumentByUNID(String unid) throws NotesException Parameters String unid The universal ID of a document.

pdocSubj = pdoc. pdocSubj.printStackTrace().getAllDocuments(). Example: getDocumentByUNID method This agent gets the parents of all the response documents in the current database.isResponse()) { pdoc = db. You can obtain the universal ID from the UniversalID property or ParentDocumentUNID property of a document.*.getItemValueString("Subject").getDocumentByUNID (doc.out.getItemValueString("Subject"). i<dc.domino. if (doc. see the UniversalID property in Document.Database class Return Values Document The document whose universal ID matches the parameter. System. }} } catch(Exception e) { e. AgentContext agentContext = session. pdoc. Document doc. import lotus.getCount(). String docSubj. DocumentCollection dc = db.getCurrentDatabase().getNthDocument(i+1).getAgentContext(). // (Your code goes here) Database db = agentContext. docSubj = doc.println("\"" + pdocSubj + "\" has the response \"" + docSubj + "\""). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). i++) { doc = dc.getParentDocumentUNID()). Usage For an explanation of universal IDs. for (int i=0. } } } Chapter 10: Java Classes A–Z 1829 .

False to load the page from the Internet only if it is not already in the Web Navigator database. For example. String webpasswd. http://www.) True to reload the page only if it has been modified on its Internet server.acme.Database class getDocumentByURL method Finds a document in the Web Navigator database.) Web pages can contain URL links to other Web pages. You can specify whether to save the URLs in a field called URLLinksn in the Notes document. boolean relifmod. the first URLLinks field is URLLinks1. boolean reload. String charset. boolean urllist (Defaults to false. String webuser. String proxypasswd. You can enter a maximum string length of 15K. boolean urllist. the second is URLLinks2. boolean nowait) throws NotesException Parameters String url The desired uniform resource locator (URL). boolean relifmod (Defaults to the specification for the second parameter. String proxyuser. Specify the entire URL starting with http.) 1830 Domino Designer Programming Guide. Volume 3: JavaScript Classes . boolean reload True to reload the page from its Internet server.com. False to load the page from the Internet only if it is not already in the Web Navigator database. for example. Defined in Database Syntax public Document getDocumentByURL(String url. (The Web Navigator creates a new URLLinksn field each time the field size reaches 64K. boolean reload) throws NotesException public Document getDocumentByURL(String url. You can use this method for either the Server Web Navigator or Personal Web Navigator database. and so on.

For example. in this case. Specify false if you do not want to save the URLs in the URLLinksn field(s). If you save the URLs. This parameter allows you to enter the username for the proxy server. This parameter allows you to enter the password that you previously obtained from the Internet server. ISO-2022-JP for Japanese or ISO-8859-1 for United States) that you want the Web Navigator to use when processing the Web page. This parameter allows you to enter the password for the proxy server.) Some Internet servers require you to obtain a username before you can access their pages. getDocumentByURL does not return the Document object representing the URL document. See your administrator for the username required by the proxy. This parameter is useful for offline storage purposes. Caution Saving URLs in the URLLinksn field(s) may affect performance. If you specify true.) Enter the MIME character set (for example. String proxypasswd (Defaults to null. boolean nowait (Defaults to false. This parameter allows you to enter the username that you previously obtained from the Full-text server.Database class Specify true if you want to save the URLs in the URLLinksn field(s). String charset (Defaults to null. String webpasswd (Defaults to null. Chapter 10: Java Classes A–Z 1831 .) Specify true to return immediately and not wait for completion of the retrieval.) Some proxy servers require that you specify a password in order to connect through them.) Some proxy servers require that you specify a username in order to connect through them. String proxyuser (Defaults to null. you can use them in agents. you can create an agent that opens Web pages in the Web Navigator database and then loads all the Web pages saved in each of the URLLinksn field(s). See your administrator for the password required by the proxy.) Some Full-text servers require you to obtain a password before you can access their pages. you do not need the Document object and do not have to wait for completion of the operation. String webuser (Defaults to null.

*.out.printStackTrace(). Document doc = db.com".lotus.getDocumentByURL ("http://www. // (Your code goes here) Database db = agentContext. Defined in Database Syntax public Form getForm(String name) throws NotesException Parameters String name The name or an alias of the form. import lotus. AgentContext agentContext = session.println( doc. Example: getDocumentByURL method This agent prints the value of the Subject item for the Lotus home page. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). given the form name. Return value Form The form whose name or alias matches the parameter. false).domino.getItemValueString("Subject")).getAgentContext().getCurrentDatabase().Database class Return value Document The Notes document that represents the URL document you specified. Volume 3: JavaScript Classes . System. } } } getForm method Finds a form in a database. 1832 Domino Designer Programming Guide.

*. for (int i=0.” import lotus.getCurrentDatabase().getName()).out.util.elementAt(i). Vector aliases = form. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import java. Chapter 10: Java Classes A–Z 1833 .getAliases(). Defined in Database Syntax public Outline getOutline(String name) throws NotesException Parameters String outline The name of the outline. Form form = db. System.Database class Example: getForm method This agent prints the names and aliases of the form named “Author Profile.Vector.domino.println(form. Return value Outline The outline. AgentContext agentContext = session.out.getForm("Author Profile"). System.printStackTrace(). // (Your code goes here) Database db = agentContext. } } } getOutline method Creates an outline.size().println ("Alias #" + (i+1) + ": " + alias). } } catch(Exception e) { e. i<aliases. i++) { String alias = (String)aliases.getAgentContext().

No profile documents results in an empty collection. while (doc != null) { System.println(doc. Example: getProfileDocCollection method This agent gets all the profile documents for the form “Author Profile. // (Your code goes here) Database db = agentContext. } } catch(Exception e) { e. } } } 1834 Domino Designer Programming Guide.getFirstDocument(). Defined in Database Syntax public DocumentCollection getProfileDocCollection(String profileName) throws NotesException Parameters String profileName The name or an alias of the profile form.*. AgentContext agentContext = session. DocumentCollection dc = db. Return value DocumentCollection The profile documents.getProfileDocCollection("Author Profile"). Volume 3: JavaScript Classes . Document doc = dc.domino.getItemValueString("Who")). doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext().getNextDocument().” import lotus.out.getCurrentDatabase().printStackTrace().Database class getProfileDocCollection Retrieves the profile documents associated with a profile form.

Return value Document The profile document for the specified key. session. Chapter 10: Java Classes A–Z 1835 . import lotus.println("Who: " + who). System. // (Your code goes here) Database db = agentContext. String phone = doc.getProfileDocument ("Author Profile".getItemValueString("Who").out. String who = doc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getItemValueString("Email"). or a new profile document if the document with the key does not exist.Database class getProfileDocument method Retrieves or creates a profile document.getCurrentDatabase().println("Email: " + email). Example: getProfileDocument method This agent gets the profile document for the current user based on the “Author Profile” form. Defined in Database Syntax public Document getProfileDocument(String profile. String profileuser) throws NotesException Parameters String profile The name or an alias of the profile form. AgentContext agentContext = session.domino. String profileuser The user name (key) attached to the profile document.*. System.out.getItemValueString("Phone"). Document doc = db.getUserName()). String email = doc.getAgentContext().

} catch(Exception e) { e. 1836 Domino Designer Programming Guide. The acceptable header strings are documented in the HTTP specification (available at various locations on the Internet.printStackTrace().acme. String webpasswd. webuser String. } } } getURLHeaderInfo method Gets the specific Hypertext Transfer Protocol (HTTP) header information from the Uniform Resource Locator (URL).Database class System. such as http://www. Defined in Database Syntax public String getURLHeaderInfo(String url. String header. Volume 3: JavaScript Classes .com/. This parameter allows you to enter the username that you previously obtained from the Internet server. A URL is a text string used for identifying and addressing a Web resource. String webuser. You can enter a maximum string length of 15K. Specify null if you don’t need this parameter.w3. String proxypasswd) throws NotesException Parameters String url The URL for the Web page you want information on.println("Phone: " + phone). String header Enter a header string of the URL header value you want returned.out. String proxyuser.org/) and are subject to change based on updated versions of the specification. for example. http://www. Specify the entire URL starting with http. Some Internet servers require you to obtain a username before you can access their pages.

AgentContext agentContext = session.domino. import lotus. null.getURLHeaderInfo ("http://www. Any dashes are converted to underscores. Return value String The requested header.com".out. Some Internet servers require you to obtain a password before you can access their pages. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println ("www. This parameter allows you to enter the password that you previously obtained from the Internet server. proxyuser String. See your administrator for the password required by the proxy.Database class webpasswd String. "Last-modified".com was last modified on " + hinfo). null).getAgentContext().printStackTrace(). Example: getURLHeaderInfo method This agent gets the “Last-modified” header string for the URL specified in the agent comment.*.lotus. See your administrator for the username required by the proxy. } } } Chapter 10: Java Classes A–Z 1837 .getCurrentDatabase(). Specify null if you don’t need this parameter. System. This parameter allows you to enter the password for the proxy server. Some proxy servers require that you specify a username in order to connect through them. null. // (Your code goes here) Database db = agentContext. } catch(Exception e) { e.lotus. This parameter allows you to enter the username for the proxy server. Some proxy servers require that you specify a password in order to connect through them. Specify null if you don’t need this parameter. or null if the URL or the requested header value is not found. proxypasswd String. null. Specify null if you don’t need this parameter. String hinfo = db.

however. import lotus. given the name or alias of the view or folder. Usage If the database is local. getView returns both public and personal views and folders. AgentContext agentContext = session. When the view or folder name contains underscores to indicate menu accelerators.getAgentContext(). Use either the view name (“By Author”) or its alias (“AuthorView”). Use either the entire name of the view or folder (including backslashes for cascading views and folders).*. getView returns only public views and folders. Volume 3: JavaScript Classes . 1838 Domino Designer Programming Guide. If the database is on a server. Example: getView method This agent gets the view named “(Default View)” in the current database and prints the number of columns in the view. For example. if you include the underscores. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). specifying “By Author|AuthorView” does not work.Database class getView method Finds a view or folder in a database. When specifying the parameter. Defined in Database Syntax public View getView(String name) throws NotesException Parameter String name The case-insensitive name of a view or folder in a database. The method works more efficiently. or an alias. you have the option of including or excluding the underscores. Return Values View The view or folder whose name or synonym matches the parameter.domino. do not combine the view name and an alias.

} } } grantAccess method Modifies a database access control list to provide a specified level of access to a person.LEVEL_READER Chapter 10: Java Classes A–Z 1839 . } catch(Exception e) { e. int level) throws NotesException Parameters String name The name of the person. For a hierarchical name. Specify one of the following constants: ACL. System.LEVEL_NOACCESS ACL. group. or server whose access level you want to provide or change.LEVEL_MANAGER ACL.getColumns().LEVEL_DEPOSITOR ACL.Database class // (Your code goes here) Database db = agentContext.printStackTrace(). View view = db. the full name must be specified but can be in abbreviated format. group. int level The level of access you’re granting.LEVEL_EDITOR ACL.LEVEL_DESIGNER ACL.size() + " columns").getCurrentDatabase().out.getView("($All)"). or server. Note Using this method at the same time an ACL object is in use may produce inconsistent results.LEVEL_AUTHOR ACL.println("($All) has " + view. Defined in Database Syntax public void grantAccess(String name.

Defined in Database Syntax public boolean open() throws NotesException 1840 Domino Designer Programming Guide. this method updates it with the access.printStackTrace(). AgentContext agentContext = session.getComment() + " has been granted manager access").grantAccess(agent. } } } open method Opens a database. // (Your code goes here) Agent agent = agentContext. the name is added to the ACL with the level. Otherwise. Volume 3: JavaScript Classes . } catch(Exception e) { e. This method sets ACL roles to their default values.println(agent.*.Database class Usage If the name already exists in the ACL.out. db.LEVEL_MANAGER). group.getCurrentDatabase(). You can also use this method to deny access to a person.domino.getAgentContext(). or server by assigning LEVEL_NOACCESS. Database db = agentContext. import lotus. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ACL.getCurrentAgent().getComment(). Example: grantAccess method This agent grants manager access to the user specified in the agent comment.

LEVEL_AUTHOR ACL. group’s.LEVEL_EDITOR Chapter 10: Java Classes A–Z 1841 .LEVEL_DEPOSITOR ACL.Database class Return value boolean true if the database exists and is opened false if no database with this name exists Usage A database must be open to use the Database properties and methods with some exceptions. or server. which is one of the following: ACL. but some do not. Note Using this method at the same time an ACL object is in use may produce inconsistent results.LEVEL_DESIGNER ACL. Errors An error is returned if the user does not have access rights to the database or server. Defined in Database Syntax public int queryAccess(String name) throws NotesException Parameters String name The name of the person. Return Value int The current access level. For a hierarchical name. See isOpen for details. Most methods that access a database open it. queryAccess method Returns a person’s. the full name must be specified but can be in abbreviated format. group. or server’s current access level to a database.

Database class ACL. Volume 3: JavaScript Classes . queryAccess checks the Domino Directory on that server.*. Example: queryAccess method This agent prints the access level for the current user.getAgentContext(). queryAccess uses the Domino Directories and Personal Address Books known to the computer on which the program is running.domino. import lotus. queryAccess returns the highest access level granted to any of the groups.getTitle(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase(). System. If the name is a member of several groups listed in the ACL. queryAccess checks the Personal Address Book on the local computer. queryAccess returns the access level of the group name. String title = db. switch (accLevel) { case(ACL. // (Your code goes here) Database db = agentContext.LEVEL_NOACCESS ACL. queryAccess returns the default access level. queryAccess does the following: If the name is a member of a group defined in the Domino Directory and that group name is listed in the ACL. If the program is running on a server. If the program is running on a workstation.LEVEL_NOACCESS) : 1842 Domino Designer Programming Guide. To see if a name is a member of a group. AgentContext agentContext = session. If the name is not a member of any group.LEVEL_MANAGER ACL.print ("For database \"" + title + "\" you have "). If the name you specify is listed explicitly in the ACL and is also a member of one or more groups listed in the ACL.out.getUserName()). queryAccess returns whichever access level is higher.LEVEL_READER Usage If the name you specify is not listed explicitly in the ACL. int accLevel = db.queryAccess(session.

break.Database class System. default: System.println("depositor access"). } } } remove method Permanently deletes a database.out.println("no access").println("author access"). break. case(ACL. break.println("reader access").LEVEL_MANAGER) : System. case(ACL.out. } } catch(Exception e) { e. break.LEVEL_DESIGNER) : System.LEVEL_READER) : System.LEVEL_EDITOR) : System. case(ACL. case(ACL.out. break.LEVEL_DEPOSITOR) : System.LEVEL_AUTHOR) : System.printStackTrace(). break.println("manager access").println("editor access").out. break.println("unknown access").out.out.println("designer access"). case(ACL. break.out.out. Defined in Database Syntax public void remove() throws NotesException Chapter 10: Java Classes A–Z 1843 . case(ACL.

Database db = session. db.printStackTrace().getAgentContext(). AgentContext agentContext = session.domino. import lotus. Any replica of the source database that exists on the server will replicate. agent. System.*. // (Your code goes here) Agent agent = agentContext.getCurrentAgent(). Return value boolean true if the database replicates without errors false if replication errors occur 1844 Domino Designer Programming Guide.out.remove().Database class Example: remove method This agent removes the local database whose name is in the agent’s comment. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Database " + agent.getComment() + " has been removed"). } } } replicate method Replicates a local database with its replica(s) on a server. } catch(Exception e) { e. Defined in Database Syntax public boolean replicate(String server) throws NotesException Parameter String server The name of the server with which you want to replicate.getComment()).getDatabase(null. Volume 3: JavaScript Classes .

} } } revokeAccess method Removes a person.out. "dbexamples"). import lotus. Defined in Database Chapter 10: Java Classes A–Z 1845 .out.isOpen()) { String title = db. Note Using this method at the same time an ACL object is in use may produce inconsistent results.nsf with its replica on notesua1. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). or server from a database access control list.getDatabase(null.printStackTrace(). if (db.replicate("notesua1")) System. AgentContext agentContext = session.println("No such database"). This resets the access level for that person. or server to the Default setting for the database. if (db.*.println ("Error replicating \"" + title + "\""). } else System.domino. // (Your code goes here) Database db = session.println ("\"" + title + "\" has replicated"). else System.getTitle(). group.out. Example: replicate method This agent replicates the local database dbexamples.getAgentContext(). group. } catch(Exception e) { e.Database class Usage The source database must be local or an exception is thrown.

domino. Usage Revoking access is different than assigning No Access (which you can do with the grantAccess method).getCurrentAgent(). but the person.revokeAccess(agent. db.*. group. When you revoke access. // (Your code goes here) Agent agent = agentContext. the full name must be specified but can be in abbreviated format.Database class Syntax public void revokeAccess(String name) throws NotesException Parameter String name The name of the person. or server whose access you want to revoke. group. } } } 1846 Domino Designer Programming Guide. Volume 3: JavaScript Classes . System. group. AgentContext agentContext = session. even if the name is a member of a group that is listed in the ACL. Example: revokeAccess method This agent revokes access to the current database for the user whose name is the agent comment. Errors The name must be explicitly listed in the database ACL.println (agent.out. import lotus.getComment()). regardless of the Default setting.getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). For a hierarchical name.getCurrentDatabase(). Database db = agentContext. If it isn’t. or server can still access the database at the level specified for Default. When you use the grantAccess method to assign No Access. or server cannot access the database. the name remains in the ACL. and the person. revokeAccess throws an exception.printStackTrace(). } catch(Exception e) { e.getComment() + "'s access is revoked"). you remove the name from the ACL.

DateTime dt A cutoff date. Defined in Database Syntax public DocumentCollection search(String formula) throws NotesException public DocumentCollection search(String formula. returns all documents in a database that meet the criteria. The method searches only documents created or modified since the cutoff date. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. import lotus. DateTime dt. Example: search method This agent searches the current database for all documents whose Subject field equals the value of the agent’s comment. // (Your code goes here) Agent agent = agentContext. Return value DocumentCollection An unsorted collection of documents that match the selection criteria. int max The maximum number of documents you want returned. Chapter 10: Java Classes A–Z 1847 . Specify 0 to receive all matching documents. Can be null to indicate no cutoff date.Database class search method Given selection criteria for a document.getAgentContext().domino.getCurrentAgent().*. DateTime dt) throws NotesException public DocumentCollection search(String formula. int max) throws NotesException Parameters String formula A Notes @function formula that specifies the selection criteria.

getCount().println ("Search of \"" + title + "\" found " + matches + " document(s) with Subject = \"" + agent. Defined in Database Syntax public void updateFTIndex(boolean create) throws NotesException Parameter boolean create Specify true if you want to create an index if none exists (valid only for local databases). DocumentCollection dc = db.printStackTrace(). } catch(Exception e) { e.out. Otherwise. Volume 3: JavaScript Classes . import lotus.getComment() + "\""). Usage An exception is thrown if you attempt to create a full-text index on a database that is not local.domino.getAgentContext().getTitle(). specify false.*. String title = db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System. int matches = dc. AgentContext agentContext = session. } } } updateFTIndex method Updates the full-text index of a database.search ("Subject = \"" + agent.getComment() + "\"").getCurrentDatabase().Database class Database db = agentContext. 1848 Domino Designer Programming Guide. Example: updateFTIndex method This agent updates the full-text index of the current database if the index has not been updated in the last two days.

int daysSince = nowDT.out.println("Database \"" + title + "\" was last full-text indexed " + daysSince + " days ago").setNow().getLastFTIndexed().println("Database \"" + title + "\" was full-text indexed less than two days ago"). } } } DateRange class Represents a range of dates and times.getCurrentDatabase(). if (daysSince > 2) { System. nowDT. DateTime lastDT = db. String title = db. db.out.updateFTIndex(true).createDateTime(""). Syntax public class DateRange extends Base Containment Contained by: Session Contains: DateTime Properties EndDateTime through getEndDateTime and setEndDateTime Parent through getParent StartDateTime through getStartDateTime and setStartDateTime Text through getText and setText Chapter 10: Java Classes A–Z 1849 .getTitle().printStackTrace(). } else System. DateTime nowDT = session.DateRange class // (Your code goes here) Database db = agentContext.out. } catch(Exception e) { e.println("Updating"). System.timeDifference(lastDT) / 86400.

DateRange dr = session. System. AgentContext agentContext = session. 1850 Domino Designer Programming Guide.01/02/97”).*.DateRange class Creation To create a new DateRange object. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). its value replaces the corresponding value in Text. Usage When you assign StartDateTime or EndDateTime. This example sets the StartDateTime and EndDateTime properties of a DateRange object through the property methods. DateTime dtnow = session. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. import lotus. and vice versa. DateTime dtdb = db. To initialize the object.now:"). Volume 3: JavaScript Classes .createDateTime("Today"). import lotus. use createDateRange in Session. “01/01/97 . dtnow. then displays the value of the Text property.out.getAgentContext(). then displays the value of the Text property.println("Creation date . This consists of two string representations of Domino-formatted date-time values separated by a hyphen (for example. Examples: DateRange class 1.*.createDateRange(dtdb.getCreated(). } } } 2.setNow(). Assign to Text a string value that represents a date range.out.printStackTrace().getText()). Assign to StartDateTime and EndDateTime DateTime values. This example sets the StartDateTime and EndDateTime properties of a DateRange object through the createDateRange parameters. } catch(Exception e) { e.println(" " + dr.getCurrentDatabase().domino. // (Your code goes here) Database db = agentContext. dtnow). you can do one of the following: Assign values to the createDateRange parameters.

println("Creation date .getEndDateTime().getText()).println("Start date = " + dr. System.DateRange class AgentContext agentContext = session. AgentContext agentContext = session.now:").out.setText (dtdb.getLocalTime()). dtnow. This example writes a value to the Text property.printStackTrace().createDateRange(). DateTime dtnow = session." + dtnow.setNow(). import lotus. } catch(Exception e) { e.createDateTime("Today").setNow().getAgentContext().getLocalTime()). dr.println("End date = " + dr.createDateRange(). DateTime dtdb = db. dr. dtnow.out. System.getCreated(). DateRange dr = session. System.out.getCreated(). DateTime dtnow = session. // (Your code goes here) Database db = agentContext. DateTime dtdb = db. DateRange dr = session.getCurrentDatabase().println(" " + dr.getStartDateTime().out.*.setEndDateTime(dtnow). // (Your code goes here) Database db = agentContext.getLocalTime() + " . } } } 3.printStackTrace(). then displays the LocalTime property of the StartDateTime and EndDateTime properties (which are DateTime objects).getAgentContext(). } } } Chapter 10: Java Classes A–Z 1851 .domino. dr.getCurrentDatabase().getLocalTime()).setStartDateTime(dtdb). System. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().createDateTime("Today").

AgentContext agentContext = session.adjustMonth(2). import lotus. Defined in DateRange Data type DateTime Syntax public DateTime getEndDateTime() public void setEndDateTime(DateTime end) 1852 Domino Designer Programming Guide.out.createDateRange(dtdb. DateRange dr = session.domino.*.getAgentContext(). // (Your code goes here) Database db = agentContext. dtplus). dtplus.getCurrentDatabase(). This example sets a value for a DateRange object.2 months from now:"). This implicitly changes the EndDateTime property.createDateTime("Today"). The ending date-time of a range.setNow().getCreated().out. dtplus. DateTime dtplus = session.printStackTrace().getText()). System. Volume 3: JavaScript Classes . } catch(Exception e) { e. DateTime dtdb = db.DateRange class 4. then changes the DateTime object that the EndDateTime property is based on. } } } EndDateTime property Read-write.println (" " + dr.println ("Creation date . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.

Date object.Date object. Parent property Read-only. Chapter 10: Java Classes A–Z 1853 . The DateTime object in setStartDateTime cannot be null. The DateTime object in setEndDateTime cannot be null. This does not apply if StartDateTime is based on a java. Defined in DateRange Data type DateTime Syntax public DateTime getStartDateTime() public setStartDateTime(DateTime start) Usage Modifying the DateTime object that StartDateTime is based on implicitly modifies StartDateTime. This does not apply if EndDateTime is based on a java. The session that contains a DateRange object.util. Defined in DateRange Data type Session Syntax public Session getParent() StartDateTime property Read-write.DateRange class Usage Modifying the DateTime object that EndDateTime is based on implicitly modifies EndDateTime.util. The starting date-time of a range.

String Syntax public String getText() throws NotesException public void setText(String text) throws NotesException DateTime class Represents a date and time.lang. setLocalTime. Volume 3: JavaScript Classes . Defined in DateRange Data type Object of type java. Session. and setLocalDate Parent through getParent TimeOnly through getTimeOnly TimeZone through getTimeZone ZoneTime through getZoneTime 1854 Domino Designer Programming Guide. DateTime. DateRange. and View Properties DateOnly through getDateOnly GMTTime through getGMTTime IsDST through isDST LocalTime through getLocalTime. The text associated with a range formatted as Domino date-time text. Database. Document.DateTime class Text property Read-write. Syntax public class DateTime extends Base Containment Contained by: AgentContext.

MM/DD/YYYY For example. where “/” represents the operating system date separator: MM/DD/YY For example. One form of setLocalTime takes a String parameter. Use this format to specify a year in any century. The createDateTime method takes a String or java. 1997 and “04/16/2097” represents April 16. The String form of the date parameter is a date. The date component of a String parameter can be in any of the following formats. Use this format to specify a year in the 20th century (MM is 50 or greater) or the 21st century (MM is less than 50). 1997. followed by a time. followed by a space. Other forms of setLocalTime and setLocalDate take multiple int parameters. and a time without a date. “04/16/1997” represents April 16. you can reset the date and time with setLocalTime and setLocalDate. Usage After creating a DateTime object with createDateTime. use createDateTime in Session. You can specify a date without a time.Date parameter.DateTime class Methods adjustDay adjustHour adjustMinute adjustMonth adjustSecond adjustYear convertToZone setAnyDate setAnyTime setNow timeDifference toJavaDate Creation To create a new DateTime object.util.util. “04/16/97” represents April 16. Chapter 10: Java Classes A–Z 1855 . another form takes a java.Date parameter. 2097.

” the value of the date is determined using the current date setting in Domino. 1996. if 1996 is the current year. therefore “09:12:33” is stored as 09:12:33 AM. “08-96” represents August 1. “09:12:33 PM.” HH:MM:SS AM. If you do not specify a time zone in the date String. “08/18” represents August 18. For example. Volume 3: JavaScript Classes . MM/YY For example. When you use this format. where “:” represents the operating system time separator. while “21:12:33” is stored as 09:12:33 PM. Today and Yesterday When you create a new DateTime object using an expression such as “Today” or “Yesterday. You can get the operating system date and time separators. Time zones When you create a new DateTime object. if the program runs on a computer whose time zone is set to US Eastern Standard Time. 1996. Domino stores it as the first day of the month.DateTime class MM/DD For example. For example.” If you do not specify AM or PM. “09:12:33 AM. use setNow. Domino stores it as the first day of the month. is optional. the time is treated as 24-hour time. 2096. “09:12:33. These expressions have no effect on the time component of a DateTime object. and time zone settings through the International class. “AM” and “PM” are ignored if you are using 24-hour time. 1856 Domino Designer Programming Guide. MM/YYYY or MM-YYYY For example. The seconds component. To access a date-time value stored in an item in a Domino document. When you use this format. its TimeZone property is determined by the time zone setting in the operating system. Use this format to specify a year in the 20th century (MM is 50 or greater) or the 21st century (MM is less than 50). HH:MM:SS PM.” HH:MM:SS. “Today” or “Yesterday” The time component of a String parameter can be in any of the following formats. To set a DateTime to the current date and time. Domino appends the current year. use getDateTimeValue in Item. Use this format to specify a year in any century. “08-2096” represents August 1. When you use this format. the time zone setting in the operating system is used to calculate the GMTime property. SS. the TimeZone property of any new DateTime object is automatically set to 5. For example. For example.

AgentContext agentContext = session.out.domino.printStackTrace(). import lotus.out.domino. import lotus. The first represents January 15. AgentContext agentContext = Chapter 10: Java Classes A–Z 1857 .getLocalTime()).*. System. AgentContext agentContext = session. This script creates two new DateTime objects.out.println(dt. System.getAgentContext().*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). The time component of the DateTime object is not set. } } } 2.*. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). 1900.domino. // (Your code goes here) DateTime dt = session.getGMTTime()). This agent creates a new DateTime object and prints it in local time and GMT.createDateTime("12/12/97 04:30:00 PM").createDateTime("Today"). 2000.DateTime class Examples: DateTime class 1. // (Your code goes here) DateTime dt = session. This script creates a new DateTime object that represents today’s date and then prints it in local time.println(dt.println(dt.printStackTrace().getLocalTime()). import lotus. System. } } } 3. } catch(Exception e) { e. the second represents January 15.

println ("Database \"" + db. } } } DateOnly property Read-only. Defined in DateTime Data type String Syntax public String getDateOnly() throws NotesException Example: DateOnly property This agent prints the creation date of the current database.createDateTime("01/15/1900").printStackTrace().getTitle() + "\" was created on " + sCreatedDate + ". import lotus.out.getAgentContext().println(dt2. A string representation of the date part of the time-date.getAgentContext().out. } catch(Exception e) { e.getDateOnly(). // (Your code goes here) Database db = agentContext. String sCreatedDate = createdDateTime. // (Your code goes here) DateTime dt1 = session. System. DateTime createdDateTime = db.DateTime class session. DateTime dt2 = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.getCurrentDatabase(). System.createDateTime("01/15/00").getCreated(). } catch(Exception e) { e. Volume 3: JavaScript Classes .getLocalTime()).domino.println(dt1.printStackTrace(). } } } 1858 Domino Designer Programming Guide. System.getLocalTime()).out. AgentContext agentContext = session.").

out. Example: GMTTime property This agent prints the creation date and time of the current database in GMT."). AgentContext agentContext = session.*. unless the date string specifies a time zone. System.getAgentContext().getTitle() + "\" was created on " + sGMTTime + ".DateTime class GMTTime property Read-only. DateTime createdDateTime = db.println ("Database \"" + db. String sGMTTime = createdDateTime. } catch(Exception e) { e. Defined in DateTime Data type String Syntax public String getGMTTime() throws NotesException Usage The GMT time for a date created from a string is determined using the operating system time zone setting.printStackTrace(). import lotus. // (Your code goes here) Database db = agentContext. converted to Greenwich Mean Time (timezone 0).domino. A string representing a date-time. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCreated().getGMTTime(). } } } Chapter 10: Java Classes A–Z 1859 .getCurrentDatabase().

getAgentContext(). else 1860 Domino Designer Programming Guide.isDST()) System. the current computer is the Domino server. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). but daylight-saving time is not currently in effect (for example. Indicates if the time reflects daylight savings time. the current computer is the computer on which the program is running. dt. the DateTime object has no date component. or the DateTime object has no time component Usage For remote (IIOP) operations. Defined in DateTime Data type boolean Syntax public boolean isDST() throws NotesException Legal values true if the current computer is set to observe daylight-saving time. from mid-April to mid-October) false if the current computer is set to observe daylight-saving time. the current computer is not set to observe daylight-saving time. Volume 3: JavaScript Classes . The convertToZone method may modify the value of this property. import lotus. if (dt.println("Enjoy the long days").setNow(). // (Your code goes here) DateTime dt = session. AgentContext agentContext = session. Example: IsDST property This agent prints one message or another depending on whether daylight-saving time is in effect. and daylight savings time is currently in effect (for example.createDateTime("Today"). from mid-October to mid-April).DateTime class IsDST property Read-only.out. For local operations.domino.*.

minute. Specify true Chapter 10: Java Classes A–Z 1861 . int month.util. The preserveLocalTime parameter affects adjustments from the existing date that cross a daylight savings boundary. int minute. hour. and hundredth parameters specify the new time.println("Endure the darkness"). therefore. affects the GMTTime property. year. Defined in DateTime Data type String Syntax public String getLocalTime() throws NotesException public void setLocalTime(String dt) throws NotesException public void setLocalTime(java. second. and. month. int month. } catch(Exception e) { e.Date dt) throws NotesException public void setLocalDate(int year. integer. and Boolean values. The dt.DateTime class System. day. } } } LocalTime property Read-write. boolean preserveLocalTime) throws NotesException public void setLocalTime(int hour.printStackTrace(). int hundredth) throws NotesException Usage When you set this property. A string representing a date-time in the local time zone. int second.out. Additional methods let you set the local time with Date. it changes the value of the date-time that the object represents. int day. int day) throws NotesException public void setLocalDate(int year.

setLocalTime("12/12/97 04:30:00 PM"). } } } 2. } } } 1862 Domino Designer Programming Guide.getTitle() + "\" was created on " + sLocalTime + ". then prints the date and time in local time and GMT."). AgentContext agentContext = session. This agent prints the creation date and time of the current database in local time.out.getLocalTime()).out. System. Volume 3: JavaScript Classes . import lotus. GMT time remains as adjusted and local time gains or loses an hour.println(dt.*. AgentContext agentContext = session.getGMTTime()). Examples: LocalTime property 1. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.createDateTime("Today").printStackTrace(). This agent sets the local date and time. } catch(Exception e) { e. System.domino.getAgentContext(). // (Your code goes here) Database db = agentContext.DateTime class to increment or decrement the GMT time by one hour so that a 24-hour adjustment yields the same local time in the new day. DateTime createdDateTime = db. System.domino. import lotus.getCurrentDatabase().printStackTrace().getLocalTime().*.println(dt. String sLocalTime = createdDateTime.getCreated(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). dt.println ("Database \"" + db. If this parameter is false or omitted. // (Your code goes here) DateTime dt = session. } catch(Exception e) { e.getAgentContext().

println(dt. 0. 12.domino. System. Defined in DateTime Data type String Chapter 10: Java Classes A–Z 1863 . dt.getGMTTime()). 0). A string representation of the time part of the date-time.DateTime class 3. The Notes session that contains a DateTime object.setLocalDate(1997.out. // (Your code goes here) DateTime dt = session.getLocalTime()).out.createDateTime("Today").printStackTrace(). dt.getAgentContext(). AgentContext agentContext = session. System. true). 30. import lotus.println(dt. This agent is the same as above but passes the date and time as integer values to setLocalDate and setLocalTime rather than as a string to setLocalTime.setLocalTime(1. } catch(Exception e) { e. Defined in DateTime Data type Session Syntax public Session getParent() throws NotesException TimeOnly property Read-only. } } } Parent property Read-only.*. 12. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

domino.getTimeOnly(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes . May be positive or negative. AgentContext agentContext = session.getCreated(). String sCreatedTime = createdDateTime. DateTime createdDateTime = db. // (Your code goes here) Database db = agentContext.").getCurrentDatabase().getTitle() + "\" was created at " + sCreatedTime + ".println ("Database \"" + db. An integer representing the time zone of a date-time. This integer indicates the number of hours that must be added to the time to get Greenwich Mean Time when daylight-saving time is not in effect. } catch(Exception e) { e. System.out. import lotus.*.printStackTrace(). } } } TimeZone property Read-only.getAgentContext().DateTime class Syntax public String getTimeOnly() throws NotesException Example: TimeOnly property This agent prints the creation time of the current database. Defined in DateTime Data type Integer Syntax public int getTimeZone() throws NotesException 1864 Domino Designer Programming Guide.

getCount(). DateTime cds = (DateTime)dtv. for remote (IIOP) operations.util.getAgentContext().getItemValue("Subject") + " was created in time zone " + zone). } } catch(Exception e) { e. DocumentCollection dc = db. j<dc. this property is set according to the time zone stored in the item. import lotus.Vector.getAllDocuments(). Example: TimeZone property This agent prints the time zone in the CreationDateSaved item of each document in the current database.DateTime class Usage When you create a new DateTime object.getCurrentDatabase(). this property is set according to the time zone setting of the computer on which the program runs or.getNthDocument(j+1). // (Your code goes here) Database db = agentContext. import java. The convertToZone method may modify the value of this property. Document doc. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System. } } } Chapter 10: Java Classes A–Z 1865 . Vector dtv = doc. int zone = cds.out. for (int j=0.printStackTrace().domino.println (doc.getItemValue("CreationDateSaved"). the Domino server.getTimeZone(). When you access a date-time value from an item in a document using the DateTimeValue property in Item. j++) { doc = dc.firstElement().*.

If you use the convertToZone method. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. adjustDay method Increments a date-time by the number of days you specify.DateTime class ZoneTime property Read-only. If this parameter is false or omitted. boolean preserveLocalTime) throws NotesException Parameter int n The number of days by which to increment the date-time. A string representation of the time adjusted for the TimeZone and IsDST properties. but LocalTime stays the same. Defined in DateTime Syntax public void adjustDay(int n) throws NotesException public void adjustDay(int n. 1866 Domino Designer Programming Guide. Defined in DateTime Data type String Syntax public String getZoneTime() throws NotesException Usage Initially ZoneTime is the same as LocalTime. GMT time remains as adjusted and local time gains or loses an hour. Can be positive or negative. boolean preserveLocalTime Affects adjustments that cross a daylight savings boundary. Volume 3: JavaScript Classes . changes to TimeZone and IsDST are reflected in ZoneTime.

this method has no effect. boolean preservelocaltime) throws NotesException Chapter 10: Java Classes A–Z 1867 . Defined in DateTime Syntax public void adjustHour(int n) throws NotesException public void adjustHour(int n.*. true). dt.printStackTrace(). System. // (Your code goes here) DateTime dt = session.adjustDay(-10. System. } catch(Exception e) { e.DateTime class Usage If the DateTime object consists of only a time component.createDateTime("Today").getLocalTime()). import lotus.out.domino. } } } adjustHour method Increments a date-time by the number of hours you specify.getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session.println("Ten days ago: " + dt.setNow().getLocalTime()).out.println("Today: " + dt. Example: adjustDay method This agent decrements the date by 10 days. dt. The number of days by which you increment a DateTime object can cause the month to be incremented.

.getAgentContext(). System. the date component changes to the next calendar day. true).printStackTrace(). Volume 3: JavaScript Classes . dt. Can be positive or negative.println("Now: " + dt.println("Ten hours ago: " + dt. import lotus.getLocalTime()).*.out.out.domino.getLocalTime()). Usage If the DateTime object consists of only a date component. Example: adjustHour method This agent decrements the time by 10 hours. this method has no effect.createDateTime("Today"). boolean preservelocaltime Affects adjustments that cross a daylight savings boundary.setNow().adjustHour(-10. GMT time remains as adjusted and local time gains or loses an hour. // (Your code goes here) DateTime dt = session. If this parameter is false or omitted. } } } 1868 Domino Designer Programming Guide. For example.DateTime class Parameter int n The number of hours by which to increment the date-time. AgentContext agentContext = session. dt. } catch(Exception e) { e. too. if the adjustment is +24. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The number of hours by which you increment a DateTime object can cause the date component to be adjusted. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. System.

*. GMT time remains as adjusted and local time gains or loses an hour.DateTime class adjustMinute method Increments a date-time by the number of minutes you specify. dt.getLocalTime()). Defined in DateTime Syntax public void adjustMinute(int n) throws NotesException public void adjustMinute(int n. Example: adjustMinute method This agent decrements the time by 10 minutes. dt. Chapter 10: Java Classes A–Z 1869 .createDateTime("Today"). this method has no effect. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). boolean preservelocaltime) throws NotesException Parameter int n The number of minutes by which to increment the date-time. the date component changes to the next calendar day. If this parameter is false or omitted.println("Now: " + dt. Can be positive or negative. System.getAgentContext(). The number of minutes by which you increment a DateTime object can cause the date component to be adjusted. if the adjustment is +1440.out. For example. boolean preservelocaltime Affects adjustments that cross a daylight-saving time boundary. AgentContext agentContext = session. // (Your code goes here) DateTime dt = session. import lotus. Usage If the DateTime object consists of only a date component. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day.domino.adjustMinute(-10. too.setNow(). true).

Defined in DateTime Syntax public void adjustMonth(int n) throws NotesException public void adjustMonth(int n. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. boolean preservelocaltime) throws NotesException Parameter int n The number of months by which to increment the date-time. } catch(Exception e) { e.println("Ten minutes ago: " + dt. The number of months by which you increment a DateTime object can cause the year to be incremented. } } } adjustMonth method Increments a date-time by the number of months you specify. boolean preservelocaltime Affects adjustments that cross a daylight-saving time boundary. GMT time remains as adjusted and local time gains or loses an hour. Volume 3: JavaScript Classes . For example. Can be positive or negative. if the adjustment is +12. this method has no effect.getLocalTime()).DateTime class System.printStackTrace(). 1870 Domino Designer Programming Guide. Usage If the DateTime object consists of only a time component. the date component changes to the next calendar year. If this parameter is false or omitted.out.

} catch(Exception e) { e. Can be positive or negative.getLocalTime()).createDateTime("Today").adjustMonth(-10. } } } adjustSecond method Increments a date-time by the number of seconds you specify.println("Ten months ago: " + dt. boolean preservelocaltime) throws NotesException Parameter int n The number of seconds by which to increment the date-time.getAgentContext().printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().DateTime class Example: adjustMonth method This agent decrements the date by 10 months. AgentContext agentContext = session. boolean preservelocaltime Affects adjustments that cross a daylight savings boundary. import lotus.println("Today: " + dt. Chapter 10: Java Classes A–Z 1871 . Defined in DateTime Syntax public void adjustSecond(int n) throws NotesException public void adjustSecond(int n. // (Your code goes here) DateTime dt = session.out.out. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. System. If this parameter is false or omitted. dt. System.domino.*. dt.getLocalTime()).setNow(). true). GMT time remains as adjusted and local time gains or loses an hour.

getLocalTime()). System. boolean preservelocaltime) throws NotesException Parameter int n The number of years by which to increment the date-time.printStackTrace().adjustSecond(-10.println("Ten seconds ago: " + dt. Volume 3: JavaScript Classes .*.out. 1872 Domino Designer Programming Guide. Example: adjustSecond method This agent decrements the time by 10 seconds.setNow(). import lotus. System. // (Your code goes here) DateTime dt = session. dt. } } } adjustYear method Increments a date-time by the number of years you specify. dt. AgentContext agentContext = session.DateTime class Usage If the DateTime object consists of only a date component.println("Now: " + dt.getAgentContext(). Defined in DateTime Syntax public void adjustYear(int n) throws NotesException public void adjustYear(int n.getLocalTime()). } catch(Exception e) { e.out. Can be positive or negative. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. this method has no effect. true).createDateTime("Today").

getLocalTime()). the year is represented as a string with four digits instead of two. // (Your code goes here) DateTime dt = session.setNow(). GMT time remains as adjusted and local time gains or loses an hour.getLocalTime()).out.out. If this parameter is false or omitted. true).println("Today: " + dt. AgentContext agentContext = session. such as 08/18/2001. System. Usage If the DateTime object consists of only a time component.DateTime class boolean preservelocaltime Affects adjustments that cross a daylight savings boundary.domino.println("Ten years ago: " + dt. } } } Chapter 10: Java Classes A–Z 1873 .createDateTime("Today"). Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. dt. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). dt.adjustYear(-10. System. Example: adjustYear method This agent decrements the date by 10 years.*. } catch(Exception e) { e.printStackTrace(). import lotus. The number of years by which you increment a DateTime object can cause the century to change. this method has no effect.getAgentContext(). If this happens.

// (Your code goes here) DateTime dt = session.DateTime class convertToZone method Changes the TimeZone and IsDST properties as specified.domino.println("ZoneTime: " + dt.createDateTime("Today"). These changes do not affect the GMTTime and the LocalTime properties. true). System. AgentContext agentContext = session. boolean isDST) throws NotesException Parameters int zone A time zone -12 through 12.*.println("Here and now: " + dt. System. Example: convertToZone method and ZoneTime property This agent converts the current time to zone 15 time. } } } 1874 Domino Designer Programming Guide. Usage These changes also affect the ZoneTime property. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().isDST()). System.out.setNow().convertToZone(8. boolean isDST Indicates whether daylight savings is in effect (true) or not (false).println("TimeZone: " + dt.out.println("IsDST: " + dt. dt. dt.out.getTimeZone()). Volume 3: JavaScript Classes .printStackTrace().getZoneTime()).getAgentContext(). import lotus. System.out.getZoneTime()). } catch(Exception e) { e. Defined in DateTime Syntax public void convertToZone(int zone.

println("Date = " + dt. import lotus.setNow().DateTime class setAnyDate method Sets the date component to a wildcard value. AgentContext agentContext = session.setNow().createDateTime("Today"). dt.println("Time = " + dt. // Set date part to any date System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getLocalTime()). dt. The time component is unaffected. dt. Example: setAnyDate and setAnyTime methods This agent sets the date component to any date.printStackTrace().getLocalTime()). // (Your code goes here) DateTime dt = session. } catch(Exception e) { e.getAgentContext().domino.setAnyTime(). A DateTime object for which you have invoked this method may not be convertible to string format.out. } } } Chapter 10: Java Classes A–Z 1875 . // Sets time part to any time System. dt.*. then the time component to any time. which means it matches any date. Defined in DateTime Syntax public void setAnyDate() throws NotesException Usage This method is useful when passing the object as an argument to other methods.out.setAnyDate().

DateTime class setAnyTime method Sets the time component to a wildcard value. the value of the DateTime object does not update itself to always reflect the current date-time. setNow method Sets the value of a date-time to now (today’s date and current time). Volume 3: JavaScript Classes . For local operations. Defined in DateTime Syntax public void setAnyTime() throws NotesException Usage This method is useful when passing the object as an argument to other methods. the date-time value is based on the computer on which the program is running. Its value only changes if you change it explicitly. A date-time object for which you have invoked this method may not be convertible to string format. 1876 Domino Designer Programming Guide. The date component is unaffected. the date-time value is based on the Domino server. Defined in DateTime Syntax public void setNow() throws NotesException Usage For remote (IIOP) operations. which means it matches any time. After the method executes. This method works by taking a snapshot of the current date-time at the moment that the method is executed.

printStackTrace(). true).adjustMonth(2.appendItemValue("Form".createDateTime("Today").*.getCurrentDatabase(). doc.appendItemValue("Subject". } } } timeDifference method Finds the difference in seconds between one date-time and another. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). doc. dt. true). import lotus. "2-month document"). doc.setNow(). // (Your code goes here) Database db = agentContext. dt).DateTime class Example: setNow method This agent increments the current time by 2 months and appends this value to the PurgeDate item. AgentContext agentContext = session. } catch(Exception e) { e.getAgentContext(). doc.createDocument().save(true.domino. Chapter 10: Java Classes A–Z 1877 . Document doc = db. DateTime dt = session. "Main Topic"). dt. Defined in DateTime Syntax public int timeDifference(DateTime dt) throws NotesException public double timeDifferenceDouble(DateTime dt) throws NotesException Parameter DateTime dt Any date-time value.appendItemValue("PurgeDate".

getAgentContext().*.util.println ("Database \"" + db. } catch(Exception e) { e.domino. AgentContext agentContext = session. Example: timeDifference method This agent calculates the number of days since a document was created.setNow().").util.DateTime class Return value int The date-time of the object minus the date-time of the parameter. Volume 3: JavaScript Classes .Date toJavaDate() throws NotesException Return value java. DateTime createdDateTime = db.util. double The date-time of the object minus the date-time of the parameter. nowDateTime.printStackTrace(). import lotus.getCurrentDatabase(). System.timeDifference(createdDateTime) / 86400. 1878 Domino Designer Programming Guide.out. } } } toJavaDate method Converts a Notes date and time into a java. // (Your code goes here) Database db = agentContext.createDateTime("Today"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). int daysSinceCreated = nowDateTime.Date The date-time of the object in Java format. Defined in DateTime Syntax public java. DateTime nowDateTime = session.getTitle() + "\" was created " + daysSinceCreated + " days ago. in seconds.Date object.getCreated(). in seconds.

AgentContext agentContext = session. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getDbDirectory(null).out. // (Your code goes here) DbDirectory dir = session. String server = dir.*.domino. import lotus.getName(). if (server == null) server = "Local". Syntax public class DbDirectory extends Base Containment Contained by: Session Contains: Database and DateTime Properties Name through getName Parent through getParent Methods createDatabase getFirstDatabase getNextDatabase openDatabase openDatabaseByReplicaID openDatabaseIfModified openMailDatabase Creation You create a new DbDirectory object with getDbDirectory in Session.println ("Database directory list on server " + server + "\n").getAgentContext(). Example: DbDirectory class This agent prints the file name and title of every database in the local directory. Chapter 10: Java Classes A–Z 1879 .DbDirectory class DbDirectory class Represents the Domino databases on a server or the local computer.

getDbDirectory (agent. import lotus.out.getFileName(). } } } Name property Read-only. The name of the server whose database directory you are searching.getTitle().DATABASE). String server = dir.getComment()).DbDirectory class Database db = dir.getAgentContext().*. Volume 3: JavaScript Classes .printStackTrace().getFirstDatabase(DbDirectory.getName(). 1880 Domino Designer Programming Guide. AgentContext agentContext = session." + title).getCurrentAgent(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } catch(Exception e) { e. Example: Name property This agent prints the file name and title of every template (. db = dir. // (Your code goes here) Agent agent = agentContext.println(fn. String title = db.toUpperCase() + " . System.domino. Defined in DbDirectory Data type String Syntax public String getName() throws NotesException Usage This property returns null for DbDirectory objects that represent the local directory. while (db != null) { String fn = db. DbDirectory dir = session.getNextDatabase().nsf file) on the server specified in the agent comment.

getLastModified().getLocalTime()).out.getNextDatabase(). The Domino session that contains a DbDirectory object. it is blank and does not contain any forms or views. System.printStackTrace(). while (db != null) { System.DbDirectory class if (server == null) server = "Local".out.out. boolean open) throws NotesException Chapter 10: Java Classes A–Z 1881 . db.open(). Defined in DbDirectory Syntax public Database createDatabase(String dbfile) throws NotesException public Database createDatabase(String dbfile.println(db. System. Defined in DateTime Data type Session Syntax public Session getParent() createDatabase method Creates a new database. } } catch(Exception e) { e. Database db = dir.getFirstDatabase (DbDirectory. using the server and file name that you specify.getTemplateName()).TEMPLATE). db = dir.println("Templates on " + server + "\n"). } } } Parent property Read only.println("Last modified: " + db. Because the new database is not based on a template.

getAgentContext(). only a subset of its methods are available. // (Your code goes here) DbDirectory dir = session. boolean found = false. if (fn. AgentContext agentContext = session.getFirstDatabase(DbDirectory. Database db = dir. } else System.equalsIgnoreCase("newdb.nsf unless a database by that name already exists. boolean open Indicates if you want to open the database.domino.nsf")) found = true.getNextDatabase().nsf").DATABASE).out. } catch(Exception e) { e.DbDirectory class Parameters String dbfile The file name of the new database.createDatabase("newdb. Specify true if you want to open the database and false if you do not Usage If you do not open the database. } } } 1882 Domino Designer Programming Guide. creating newdb.println("Not found. See isOpen in Database.nsf"). import lotus.nsf"). not creating newdb.println("found.getDbDirectory(null). Example: createDatabase method This agent creates a local database named newdb. } if (!found) { System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.out. dir. db = dir. while (db != null) { String fn = db.getFileName().printStackTrace(). Volume 3: JavaScript Classes .

the database directory is reset and a new search is conducted. only a subset of its methods are available. .domino.REPLICA_CANDIDATE means any database or template not disabled for replication DbDirectory. Each time you call this method. Example: getFirstDatabase and getNextDatabase methods This agent prints the last modified date for each template in the local directory. or . See isOpen in Database.TEMPLATE_CANDIDATE means any database or template Return value Database The first database of the specified file type located in the directory. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().TEMPLATE means any template (. Usage The returned database is closed. using the file type you specify. Defined in DbDirectory Syntax public Database getFirstDatabase(int type) throws NotesException Parameter int type Indicates the kind of database file you want to retrieve: DbDirectory. for example. or null if the directory contains no databases of the specified type.nsf.DATABASE means any database (. a new call to getFirstDatabase with the parameter DATABASE starts searching the directory from the beginning. this time for database files. import lotus.DbDirectory class getFirstDatabase method Returns the first database from a server or the local directory. If you are searching for template files. If you do not open the database.*. Chapter 10: Java Classes A–Z 1883 .nsg.ntf file) DbDirectory.nsh file) DbDirectory.

out.printStackTrace().DbDirectory class AgentContext agentContext = session. This method must be preceded in the code by getFirstDatabase.getDbDirectory(null). System.out. or null if there are no more.getLocalTime()). // (Your code goes here) DbDirectory dir = session. See isOpen in Database. using the file type specified in the preceding getFirstDatabase method.getLastModified(). Database db = dir. Usage The returned database is closed. db.getNextDatabase().TEMPLATE). Defined in DbDirectory Syntax public Database getNextDatabase() throws NotesException Return value Database The next database located in the directory.getTemplateName()).getAgentContext(). } } } getNextDatabase method Returns the next database from a server or the local directory.println("Last modified: " + db. Volume 3: JavaScript Classes . 1884 Domino Designer Programming Guide. only a subset of its methods are available. while (db != null) { System.open(). db = dir.println("Local templates\n"). System.println(db.getFirstDatabase (DbDirectory. If you do not open the database. } } catch(Exception e) { e.out.

getDbDirectory(null).DbDirectory class openDatabase method Opens a database. Defined in DbDirectory Syntax public Database openDatabase(String dbfile) throws NotesException public Database openDatabase(String dbfile.domino. boolean failover If true and the database cannot be opened on the current server. import lotus.getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().openDatabase("names"). or null if the database is not opened. an attempt is made to open it on another server in the cluster (if there is a cluster). System.println(db.nsf in the local directory and prints its title. } catch(Exception e) { e.printStackTrace(). For remote (IIOP) access. The object’s Server and FilePath properties reflect the server that the database is opened on. boolean failover) throws NotesException Parameters String dbfile The file name of the database to open. Database db = dir. // (Your code goes here) DbDirectory dir = session.getTitle()). } } } Chapter 10: Java Classes A–Z 1885 .out. AgentContext agentContext = session. Return value Database The opened database.*. Example: openDatabase method This agent opens names. failover is always false.

domino. String rid = "852565D2000B5144".println("help located and opened"). Return value Database The opened database. import lotus.*.getAgentContext().printStackTrace().out. Database db = dir. if (db != null) System.getDbDirectory(null). Volume 3: JavaScript Classes . or null if the database is not opened.println("help not found").out. else System. Defined in DbDirectory Syntax public Database openDatabaseByReplicaID(String rid) throws NotesException Parameters String rid The replica ID of the database that you want to open.openDatabaseByReplicaID(rid). Example: openDatabaseByReplicaID method This agent attempts to open the help database. AgentContext agentContext = session. // (Your code goes here) DbDirectory dir = session. which is know to have the specified replica ID. } catch(Exception e) { e. } } } 1886 Domino Designer Programming Guide.DbDirectory class openDatabaseByReplicaID method Opens the database with a specified replica ID. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

nsf in the local directory if the database was modified in the past three hours. or null if the database is not opened. if not. Example: openDatabaseIfModified method This agent opens name. else Chapter 10: Java Classes A–Z 1887 .adjustHour(-3). the database is opened. it is not opened. dt. DateTime date A cutoff date.setNow().domino. If one or more documents in the database were modified since this date. dt).openDatabaseIfModified("names".createDateTime("Today"). Database db = dir. // (Your code goes here) DbDirectory dir = session. if (db != null) System. AgentContext agentContext = session. Return value Database The opened database.getDbDirectory(null). Defined in DbDirectory Syntax public Database openDatabaseIfModified(String dbfile.*. dt. Cannot be null.out.println("Database opened"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). DateTime dt = session. import lotus.DbDirectory class openDatabaseIfModified method Opens a database if it has been modified since a specified date. DateTime date) throws NotesException Parameters String dbfile The file name of the database.getAgentContext().

If the program runs on a workstation. } } } openMailDatabase method Opens the current user’s mail database.DbDirectory class System. If the program runs on a server. public class JavaAgent extends AgentBase { public void NotesMain() { try { 1888 Domino Designer Programming Guide. Defined in DbDirectory Syntax public Database openMailDatabase() throws NotesException Return value Database The opened database.out. and openMailDatabase finds the user’s mail server and database in the Domino Directory on the server. import lotus. it must run either on a workstation or on the agent owner’s mail server. and number of documents. openMailDatabase finds the user’s mail server and database in the Domino Directory on the server.ini file. If the program is making remote (IIOP) calls to a server. an error occurs since programs running on servers cannot access databases on other servers. Usage For a program to use this method. Example: openMailDatabase method This agent opens the current user’s mail database and prints its title. } catch(Exception e) { e. Volume 3: JavaScript Classes .*.domino. size. the current user is considered to be the last person who modified the agent (the agent’s owner). Otherwise. the current user is the user who created the session. or null if the database is not opened.printStackTrace().println( "Database not modified in past 3 hours"). openMailDatabase finds the current user’s mail server and database in the notes.

View Contains: DateTime. } catch(Exception e) { e. DocumentCollection. System.printStackTrace().getAgentContext(). DocumentCollection dc = db.getDbDirectory(null). EmbeddedObject.getAllDocuments().getTitle() + " is " + ((int)(db.openMailDatabase(). AgentContext agentContext = session.getSize()/1024)) + "KB long and has " + dc. Newsletter.Document class Session session = getSession(). } } } Document class Represents a document in a database. RichTextItem Properties Authors through getAuthors ColumnValues through getColumnValues Created through getCreated EmbeddedObjects through getEmbeddedObjects EncryptionKeys through getEncryptionKeys and setEncryptionKeys FolderReferences through getFolderRefs FTSearchScore through getFTSearchScore HasEmbedded through hasEmbedded IsDeleted through isDeleted IsEncryptOnSend through isEncryptOnSend and setEncryptOnSend IsNewNote through isNewNote Chapter 10: Java Classes A–Z 1889 .println("Mail database : " + db. Database db = dir. Syntax public class Document extends Base Containment Contained by: Database. Item.getCount() + " documents").out. // (Your code goes here) DbDirectory dir = session.

Document class IsProfile through isProfile IsResponse through isResponse IsSaveMessageOnSend through isSaveMessageOnSend and setSaveMessageOnSend IsSentByAgent through isSentByAgent IsSigned through isSigned IsSignOnSend through isSignOnSend and setSignOnSend IsValid through isValid Items through getItems Key through getKey LastAccessed through getLastAccessed LastModified through getLastModified NameOfProfile through getNameOfProfile NoteID through getNoteID ParentDatabase through getParentDatabase ParentDocumentUNID through getParentDocumentUNID ParentView through getParentView Responses through getResponses Signer through getSigner Size through getSize UniversalID through getUniversalID and setUniversalID Verifier through getVerifier Methods appendItemValue computeWithForm copyAllItems copyItem copyToDatabase createReplyMessage createRichTextItem 1890 Domino Designer Programming Guide. Volume 3: JavaScript Classes .

To get a document based on its position in a response hierarchy. To get all documents that are responses to a particular document. use FTSearch in Database or FTSearch in View. To get a response document’s parent document.Document class encrypt getAttachment getFirstItem getItemValue getItemValueDouble getItemValueInteger getItemValueString hasItem makeResponse putInFolder remove removeFromFolder removeItem renderToRTItem replaceItemValue save send sign Creation To create a new Document object. To get a document based on its position in a view. use getParentDocumentUNID in Document followed by getDocumentByUNID in Database. use createDocument in Database. use a View object. Chapter 10: Java Classes A–Z 1891 . use a View object. use getResponses in Document. use getAllDocuments in Database. Access To access existing documents: To get all the documents in a database. To get all the documents that match a full text search query.

createDocument(). where the criteria are defined using the formula language. else 1892 Domino Designer Programming Guide. you can navigate to a specific document using methods in the DocumentCollection class. or delete a document. AgentContext agentContext = session. all of your changes to a Document are lost. // (Your code goes here) Database db = agentContext. Saving changes After you create. but do not add any items to it.getCurrentDatabase(). If you don’t call save before the program finishes. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Document doc = db. unprocessedFTSearch.out. To get documents in a database not yet processed by the current agent. you must save the changes by calling the Save method. use getDocumentByID or getDocumentByUNID in Database. if (doc. "Main Topic"). the document is not saved.getAgentContext(). import lotus. an exception is thrown. This agent creates a document and saves it in the current database.Document class To get all the documents in a database that meet search criteria. you can navigate to a specific document using methods in the View class. doc.println("Document created and saved"). use getUnprocessedDocuments. If decryption fails.replaceItemValue("Form".save()) System. Volume 3: JavaScript Classes . Once you have a collection of documents. and unprocessedSearch in AgentContext. To get a document based on its Note ID or UNID. even if you invoke the save method. Once you have a view. Encryption A program attempts to decrypt an encrypted document the first time the program accesses one of the Document properties or methods. If you create a new document. modify.replaceItemValue("Subject".*. doc. "New building"). use FTSearch in Database. Examples: Document class 1.domino.

} } } Authors property Read-only. "Memo").send("Robert Smith"). AgentContext agentContext = session.replaceItemValue("Form".replaceItemValue("Subject". elements are String Syntax public java. The document is not saved. } catch(Exception e) { e. doc. Document doc = db. // (Your code goes here) Database db = agentContext.println("Something went wrong").getCurrentDatabase()."). doc. "A document awaits your approval in " + db. "Reminder"). import lotus.getAgentContext().createDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setEncryptOnSend(true).Vector. doc. } } } 2.printStackTrace().getTitle() + ". Defined in Document Data type java. doc.util.out. doc.util. The names of the people who have saved a document.*.Document class System.replaceItemValue("Body". This agent creates a document and sends it.printStackTrace().domino.Vector getAuthors() throws NotesException Chapter 10: Java Classes A–Z 1893 . } catch(Exception e) { e.

out.domino. } catch(Exception e) { e. } } } 1894 Domino Designer Programming Guide.getDatabase( "FrenchFry". import lotus. Example: Authors and IsResponse properties This agent counts the number of response douments of which the current user is an author.getFirstDocument().getUserName() + " is author on " + count + " main documents"). Therefore. "notesua\\progwork"). Document doc = dc.getAgentContext().isResponse()) { authors = doc.Document class Usage If a name is hierarchical.getAuthors(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). DocumentCollection dc = db. int count = 0.util.getAllDocuments().println(session. if (authors. } doc = dc. Vector authors. } System. AgentContext agentContext = session.printStackTrace().getUserName())) count++. import java.contains(session. this property returns the fully distinguished name.Vector. the people returned by the Authors property and the people listed in an Authors item may differ. Volume 3: JavaScript Classes . This property does not return the names of people who have permission to edit a document (as found in an item of type Authors). // (Your code goes here) Database db = session. while (doc != null) { if (!doc.getNextDocument(doc).*.

util. if the third column in a view is responses-only. taking care to determine the data type of each value. this property has no value.Vector getColumnValues() throws NotesException Usage If you do not access the document through a view. An array of values.Vector. If a document contains an item that’s visible in a view. the second value is the one that appears in the second column.util. each element of which corresponds to a column value in the document’s parent view.Vector.Document class ColumnValues property Read-only. the ColumnValues property provides efficient access to its value. The value of each element of the array is the result of the corresponding column’s formula and the items on the current document. elements are Object Syntax public java.getCurrentDatabase(). // (Your code goes here) Database db = agentContext.” For example. import java. Example: ColumnValues property This agent gets the column values of all documents in a database. Accessing the item value directly is less efficient. This property returns a value for each column in the parent view.domino. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). and so on. AgentContext agentContext = session. whether the document is a response or not.getAgentContext(). Some elements in the array might have no value. The first value in the array is the value that appears in the view’s first column for the document. Chapter 10: Java Classes A–Z 1895 . regardless of whether the column is considered “Responses-only. doc. Defined in Document Data type java.GetColumnValues( 2 ) evaluates the column formula for the document and returns a result.util.*.

s = dt. System.length() == 0) s = "*no value*".getClass().endsWith("String")) s = (String)v.getLocalTime().elementAt(i). tabs = tabs + "\t". } } catch(Exception e) { e.getView("All Documents"). Defined in Document Data type DateTime 1896 Domino Designer Programming Guide. Volume 3: JavaScript Classes . } doc = view. Vector v. i++) { if (v.printStackTrace(). Document doc = view. for (int i=0. The date a document was created.elementAt(i). tabs.Document class View view = db.size().elementAt(i).getName().println(tabs + s).elementAt(i).elementAt(i).getFirstDocument().elementAt(i).endsWith("DateTime")) { dt = (DateTime)v. DateTime dt.getColumnValues().toString(). } } } Created property Read-only. String s.endsWith("Double")) { d = (Double)v. else if (v. } else if (v.getNextDocument(doc). while (doc != null) { v = doc. if (s. } else s = "not String.out.getClass(). tabs = "". i<v.getName(). s = d. Double d. DateTime. or Double".getClass().getName().

AgentContext agentContext = session. elements are EmbeddedObject Chapter 10: Java Classes A–Z 1897 . Defined in Document Data type java.Document class Syntax public DateTime getCreated() throws NotesException Example: Created. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().util.getLocalTime()).getLocalTime()).getAllDocuments(). Document doc = dc. // (Your code goes here) Database db = agentContext.getItemValueString("Subject")). last accessed.out. and last modified dates for all documents in a database. } } catch(Exception e) { e. DocumentCollection dc = db. on UNIX.printStackTrace(). System. and LastModified properties This agent gets the creation.Vector.util.getLastModified().out.out. LastAccessed.println("\tCreated on " + doc.println(doc. System. System. and on the Macintosh.println("\tLast accessed on " + doc. import lotus. Note EmbeddedObjects is not supported on OS/2. import java.println("\tLast modified on " + doc.getCreated().out.getLocalTime()).*.Vector.domino. } } } EmbeddedObjects property Read-only. while (doc != null) { System.getAgentContext().getFirstDocument().getCurrentDatabase().getNextDocument(doc). The OLE/2 and OLE/1 embedded objects in a document. doc = dc.getLastAccessed().

out.getEmbeddedObjects().elementAt(i). 1898 Domino Designer Programming Guide. this property does not include file attachments or OLE/1 objects created in Notes Release 3. // Beta bug: Attachment throws null pointer exception // Catch exception and set vector to null // In final product."). else for (int i=0.Vector.util. } catch (Exception e) { v = null. Document doc = dc.getAgentContext(). DocumentCollection dc = db.size().getAllDocuments(). Such objects must have been activated. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().hasEmbedded()) { System. Example: EmbeddedObjects and HasEmbedded properties This agent finds documents with embedded objects and prints the names of the objects.println("\"" + doc. // (Your code goes here) Database db = agentContext."). not the document). i<v. while (doc != null) { if (doc. i++) { EmbeddedObject eo = (EmbeddedObject)v. It also includes objects in the document that were originally embedded in the document’s form. AgentContext agentContext = session.println( "\tEmbedded object is an attachment.domino. Volume 3: JavaScript Classes .Vector getEmbeddedObjects() throws NotesException Usage Unlike the EmbeddedObjects property in RichTextItem. This property does include OLE/2 and OLE/1 objects created in Release 4 and higher.getItemValueString("Subject") + "\" has embedded objects.util.getFirstDocument(). Vector v = null. import lotus.getCurrentDatabase(). and re-saved in order to be returned by this property (otherwise they remain a part of the form.*. } if (v == null) System. modified.out. The vector is empty if the document contains no embedded objects.Document class Syntax public java. v should be empty try { v = doc. import java.

Since encryption works differently when a document is mailed. The encrypt method uses these keys when it encrypts the document.Vector getEncryptionKeys() throws NotesException public void setEncryptionKeys(java. Chapter 10: Java Classes A–Z 1899 . elements are String Syntax public java.util. The key(s) used to encrypt a document.Vector.out. } } catch(Exception e) { e. This property returns the contents of the item.Vector keys) throws NotesException Usage Each element in EncryptionKeys contains the name of an encryption key you want to use to encrypt the document.getName() + " of " + eo.println ("\t" + eo. the document is encrypted with the current user’s public key and can only be decrypted by that user.Document class System. The document can be decrypted by any user who posesses one of the keys.util. You must call the encrypt and save methods to actually encrypt the document. the EncryptionKeys property has no effect when a document is encrypted when mailed. } } } EncryptionKeys property Read-write.getClassName()). If there are no encryption keys specified for a document.util. The name of each encryption key in a document is stored in a text item called SecretEncryptionKeys. Defined in Document Data type java.printStackTrace().getNextDocument(doc). } } doc = dc.

the term weights assigned to the target words. Defined in Document Data type java. elements are String Syntax public java. Defined in Document Data type int Syntax public int getFTSearchScore() throws NotesException Usage The score is determined by the number of target words that are found in the document. The score is correct unless you get the score from the current object after retrieving the same document from another collection. and any proximity operators in the search query.Document class FolderReferences property Read-only. If a document is in more than one DocumentCollection or ViewEntryCollection. returns an unpredictable number. The universal IDs for the folders containing a document. Volume 3: JavaScript Classes . if it was retrieved as part of a full-text search.util. The full-text search score of a document. If the document is not retrieved as part of a full-text search. its score is that of the last collection it was retrieved from.Vector getFolderReferences() throws NotesException Usage Folder references must be enabled for the database. See the FolderReferencesEnabled property of Database. FTSearchScore property Read-only.util. returns 0. If the document is retrieved using an FTSearch method on a database without a full-text index.Vector. 1900 Domino Designer Programming Guide.

Defined in Document Chapter 10: Java Classes A–Z 1901 . or file attachments. } } } catch(Exception e) { e. AgentContext agentContext = session. doc = dc.Vector.getItemValueString("Subject")).getCurrentDatabase(). on UNIX. import lotus.getAgentContext().getFirstDocument(). // (Your code goes here) Database db = agentContext.out. DocumentCollection dc = db. Note HasEmbedded is not supported on OS/2.printStackTrace(). 0).getFTSearchScore() + "\t" + doc.FTSearch("blue".println("No \"blue\""). else { System.out.println(doc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). object links. if (dc. Documents deleted from a view have a search score of 0. import java.util.println("\"blue\" hits"). Example: FTSearchScore property This agent gets the search score for each document returned by a full-text search. and on the Macintosh. Indicates if a document contains one or more embedded objects.Document class Documents added to a collection have a search score of 0.domino.getNextDocument(doc).out. } } } HasEmbedded property Read-only.getCount() == 0) System. while (doc != null) { System. Document doc = dc.*.

Document class Data type boolean Syntax public boolean hasEmbedded() throws NotesException Legal values True if the document contains one or more embedded objects. This property has no effect on whether a document is encrypted when saved to a database. or file attachments. object links. Defined in Document Data type boolean Syntax public boolean isEncryptOnSend() throws NotesException public void setEncryptOnSend(boolean flag) throws NotesException Legal values True if the document is encrypted when mailed. False if the document is not encrypted when mailed. Indicates if a document is encrypted when mailed. 1902 Domino Designer Programming Guide. All other recipients receive an encrypted copy of the document. the method sends an unencrypted copy of the document to that recipient. If it cannot find a recipient’s public key. or file attachments. Usage To encrypt a document when mailed. IsEncryptOnSend property Read-write. object links. this method looks for the public key of each recipient in the Domino Directory. False if the document does not contain any embedded objects. Volume 3: JavaScript Classes .

doc. Document doc = db. AgentContext agentContext = session. doc.domino. but has not been saved.Vector. doc.save().createDocument().. saving . doc.println(". "New documents"). Indicates if a document is new. } catch(Exception e) { e.Document class IsNewNote property Read-only.").getCurrentDatabase(). // (Your code goes here) Database db = agentContext.. "Main Topic").util.*. False if the document has been saved. System.getAgentContext(). import lotus. } } Chapter 10: Java Classes A–Z 1903 .out.appendItemValue("Categories"..printStackTrace(). Example: IsNewNote property This agent shows the effect of IsNewNote before and after saving a newly created document.. import java. isitnew(doc). A document is new if it has not been saved. Defined in Document Data type boolean Syntax public boolean isNewNote() throws NotesException Legal values True if the document was created. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().appendItemValue("Subject". isitnew(doc).appendItemValue("Form". "New document 1").

import java.println("\"" + doc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus.printStackTrace(). // (Your code goes here) Database db = agentContext.out. } } } IsProfile property Read-only.util.getItemValueString("Subject") + "\" has not been saved yet"). } catch(Exception e) { e.*. else System.domino.Document class public void isitnew(Document doc) { try { if (doc. Example: IsProfile property This agent gets the name and key for the “Author Profile” document of the current user. 1904 Domino Designer Programming Guide.out. Volume 3: JavaScript Classes .getItemValueString("Subject") + "\" has been saved"). Indicates if a Document object is a profile document.isNewNote()) System.Vector.getCurrentDatabase(). AgentContext agentContext = session. False if the document is not a profile document.getAgentContext().println("\"" + doc. Defined in Document Data type boolean Syntax public boolean isProfile() throws NotesException Legal values True if the document is a profile document.

System. } } catch(Exception e) { e.getItemValueString("Who").println( "Profile name: " + doc. if (doc != null && doc.getProfileDocument ("Author Profile".isProfile()) { System. Defined in Document Data type boolean Chapter 10: Java Classes A–Z 1905 .getNameOfProfile()).out.Document class Document doc = db. String email = doc. False if the document is not a response to another document. Indicates if a document is saved to a database when mailed. IsSaveMessageOnSend property Read-write. } } } IsResponse property Read-only.getItemValueString("email").getUserName()). session. Indicates if a document is a response to another document. Applies only to new documents that have not yet been saved. String who = doc.printStackTrace(). Defined in Document Data type boolean Syntax public boolean isResponse() throws NotesException Legal values True if the document is a response to another document.println("Key: " + doc.out.getKey()).

sends a reply except to memos sent by programs. Usage When SaveMessageOnSend is true. import java. the document is saved just after being mailed. Indicates if a document was mailed by a Domino program.Document class Syntax public boolean isSaveMessageOnSend() throws NotesException public void setSaveMessageOnSend(boolean flag) throws NotesException Legal values True if the document is saved when mailed.domino. you can use this property to make sure that the agent is not responding to mail that was sent by a program. Usage In agents that respond to mail messages.*. Defined in Document Data type boolean Syntax public boolean isSentByAgent() throws NotesException Legal values True if the document was mailed by a program. IsSentByAgent property Read-only.util. public class JavaAgent extends AgentBase { 1906 Domino Designer Programming Guide.Vector. Documents sent by a program contain an item called $AssistMail whose value is set to 1. import lotus. which is activated after new mail arrives. False if the document was mailed by a person. Example: IsSentByAgent property This agent. Volume 3: JavaScript Classes . False if the document is not saved when mailed.

"On vacation until 8/15\n"). Defined in Document Data type boolean Syntax public boolean isSigned() throws NotesException Chapter 10: Java Classes A–Z 1907 .replaceItemValue ("Subject".getCurrentDatabase(). DocumentCollection dc = agentContext. Indicates if a document contains a signature.Document class public void NotesMain() { try { Session session = getSession(). } doc = dc.printStackTrace(). while (doc != null) { sendTo = doc. // (Your code goes here) Database db = agentContext. } } } IsSigned property Read-only. AgentContext agentContext = session. } } catch(Exception e) { e. if (!doc.getUnprocessedDocuments().getItemValueString("Subject")).getFirstDocument(). "Re: " + doc.getAuthors().createReplyMessage(false).getNextDocument(doc). reply.replaceItemValue( "Body". Document doc = dc. reply.send(sendTo). Document reply. Vector sendTo. reply.getAgentContext().isSentByAgent()) { reply = doc.

Example: IsSigned. and Verifier properties This agent gets the signer and verifier for documents that are signed.println("\tNot signed").Document class Legal values True if the document contains one or more signatures.domino. View view = db. you must find the item of type SIGNATURE in the document.println("\tVerified by " + doc.out. } } } IsSignOnSend property Read-write. False if the document does not contain signatures.getView("($Inbox)"). AgentContext agentContext = session.printStackTrace(). Defined in Document 1908 Domino Designer Programming Guide. doc = view. Database db = dir.isSigned()) { System. Document doc = view. // (Your code goes here) DbDirectory dir = session. if (doc. import lotus. Indicates if a document is signed when mailed. Usage You can get the Signer and Verifier for a signed document. while (doc != null) { System.getDbDirectory(null). Volume 3: JavaScript Classes .println("\tSigned by " + doc.out.out.getNextDocument(doc). System.*. Signer.getVerifier()). } else System.out. } } catch(Exception e) { e.println("[ " + doc.getFirstDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().openMailDatabase().getItemValueString("Subject") + " ]"). To access the signature itself.getAgentContext().getSigner()).

False if the document is a deletion stub.Vector. DocumentCollection dc = db. Example: IsValid property This agent checks on whether a document on a server is still valid. // (Your code goes here) Database db = session.util. open db on another computer and delete a Chapter 10: Java Classes A–Z 1909 . IsValid property Read-only.Document class Data type boolean Syntax public boolean isSignOnSend() throws NotesException public void setSignOnSend(boolean flag) throws NotesException Legal values True if the document is signed when mailed.getDatabase( "NotesUA1". public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAllDocuments().domino. import java. // For testing. Indicates if a Document object represents an existing document (not a deletion stub). Defined in Document Data type boolean Syntax public boolean isValid() throws NotesException Legal values True if the document represents an existing document. AgentContext agentContext = session.getAgentContext(). "dbexamples"). import lotus. False if the document is not signed when mailed.*.

getAllDocuments().getAgentContext(). } } catch(Exception e) { e.println("[Deletion stub]").Vector getItems() throws NotesException Example: Items property This agent gets the NoteID for each document in a database. import java.out. elements are Item Syntax public java. import lotus.isValid()) System. Volume 3: JavaScript Classes . DocumentCollection dc = db. else System. and the name and value string of each item in the document.*.Vector. Defined in Document Data type java. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().print( doc.getCurrentDatabase(). } } } Items property Read-only. doc = dc.getFirstDocument().util.Document class // document while this program is sleeping sleep(12000). while (doc != null) { if (doc. while (doc != null) { 1910 Domino Designer Programming Guide. Document doc = dc. Document doc = dc.util. // (Your code goes here) Database db = agentContext.domino.getItemValueString("Subject")).util. AgentContext agentContext = session. An item is any piece of data stored in a document.Vector.out. All the items in a document.printStackTrace().getNextDocument(doc).getFirstDocument().

for (int j=0. System.getItems(). If a profile document. Defined in Document Data type String Syntax public String getKey() throws NotesException LastAccessed property Read-only.getName() + " = \"" + item.getNextDocument().println("\t" + item.out. j<items. Defined in Document Data type DateTime Syntax public DateTime getLastAccessed() throws NotesException Chapter 10: Java Classes A–Z 1911 . } } catch(Exception e) { e.printStackTrace().getValueString() + "\""). } doc = dc.out.elementAt(j). The date a document was last modified or read. j++) { Item item = (Item)items. } } } Key property Read-only. the user name (key) of the profile.Document class System.size().println("Document " + doc. Vector items = doc.getNoteID() + ":").

The NoteID of a document. Volume 3: JavaScript Classes . Defined in Document Data type DateTime Syntax public DateTime getLastModified() throws NotesException NameOfProfile property Read-only. Defined in Document Data type String Syntax public String getNameOfProfile() throws NotesException NoteID property Read-only. The date a document was last modified. which is a hexadecimal value of up to 8 characters that uniquely identifies a document within a particular database. Defined in Document Data type String 1912 Domino Designer Programming Guide. the name of the profile. If a profile document.Document class LastModified property Read-only.

getAgentContext().Vector.getAllDocuments(). so documents that are replicas of one another generally have different NoteIDs. import java.Document class Syntax public String getNoteID() throws NotesException Usage A typical Note ID looks like this: 20FA. import lotus. } catch(Exception e) { e. unless the document is deleted. parentdb(doc). ParentDatabase property Read-only.getFirstDocument(). A NoteID does not change. Document doc = dc. Defined in Document Data type Database Syntax public Database getParentDatabase() throws NotesException Example: ParentDatabase property This agent demonstrates a function that gets the parent database given a Document object.printStackTrace().*. DocumentCollection dc = db.domino. } } Chapter 10: Java Classes A–Z 1913 . "dbexamples"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().util.getDatabase( "NotesUA1". // (Your code goes here) Database db = session. A NoteID represents the location of a document within a specific database file. AgentContext agentContext = session. The database that contains a document.

domino.getFirstDocument().Document class public void parentdb(Document d) { try { Database db = d.*. Document parentDoc = null. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). import lotus. 1914 Domino Designer Programming Guide.getAllDocuments().getCurrentDatabase(). Example: ParentDocumentUNID property This agent gets the parent documents of response documents in a database through their UNIDs. For more information on universal IDs. } } } ParentDocumentUNID property Read-only.getTitle() + "\" (" + db. this property allows you to get the parent document for any document.out. The universal ID of a document’s parent. Document doc = dc. } catch (Exception e) { e. DocumentCollection dc = db. Volume 3: JavaScript Classes .getFileName() + ")"). Defined in Document Data type String Syntax public String getParentDocumentUNID() throws NotesException Usage When used in conjunction with getDocumentByUNID in Database. AgentContext agentContext = session. if the document is a response. String parentUNID = null. see the UniversalID property.println("Parent database is \"" + db. System.printStackTrace(). Returns a null if a document doesn’t have a parent. // (Your code goes here) Database db = agentContext.getParentDatabase().

parentDoc = db.getView("By Category").getFirstDocument().*. if any.getAgentContext(). // (Your code goes here) Database db = agentContext. } } catch(Exception e) { e.println( doc. import lotus. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("\tParent is \"" + parentDoc. parentUNID = doc.getAllDocuments().out. The view from which a document was retrieved.getDocumentByUNID(parentUNID).getItemValueString("Subject") + "\"").getCurrentDatabase(). } doc = dc. } } } ParentView property Read-only. Document doc2 = dc.getItemValueString("Subject")). View view = db.getFirstDocument(). printViewName(doc).isResponse()) { System. returns null.printStackTrace().domino. System.getParentDocumentUNID().Document class while (doc != null) { if (doc. Defined in Document Data type View Syntax public View getParentView() throws NotesException Example: ParentView property This agent demonstrates a function that gets the parent view given a Document object.getNextDocument(doc).out. Document doc = view. Chapter 10: Java Classes A–Z 1915 . If the document was retrieved directly from the database or a document collection. DocumentCollection dc = db.

1916 Domino Designer Programming Guide.")."). else System. Responses-to-responses are not included. } } } Responses property Read-only. the same way that a non-recursive sub calls any other sub or function. the vector contains zero documents. } catch(Exception e) { e. Responses-to-Responses This property returns only immediate responses to a document.out.println( "Document did not come from a view. } catch(Exception e) { e.out. A recursive sub calls itself. Volume 3: JavaScript Classes . but you can write a recursive sub or function to access all the descendants of a particular document. } } public void printViewName(Document d) { try { View view = d. if (view == null) System.printStackTrace().getName() + "\" view. If the current document has no responses.println("Document came from \"" + view. The immediate responses to a document.getParentView().Document class printViewName(doc2).printStackTrace(). Defined in Document Data type DocumentCollection Syntax public DocumentCollection getResponses() throws NotesException Usage Each document returned is an immediate response to the first document.

if (responses. } } catch(Exception e) { e. // (Your code goes here) Database db = agentContext.printStackTrace().getResponses(). doc = view.Document class Example: Responses property This agent gets all the main documents in a view.getItemValueString("Subject")).getAgentContext().getView("All Documents").out. } } } Chapter 10: Java Classes A–Z 1917 . } } public void printResponses(DocumentCollection dc. then gets their responses by calling a function recursively. while (doc != null) { System.getCount() > 0) printResponses(responses. doc = dc. if (dc2.getCurrentDatabase(). String tabs) { try { Document doc = dc. } } catch(Exception e) { e. while (doc != null) { System.printStackTrace().getCount() > 0) printResponses(dc2. View view = db.getFirstDocument(). AgentContext agentContext = session. "\t").domino.println(tabs + doc. DocumentCollection responses = doc.getFirstDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). tabs + "\t").println( doc.getNextDocument(doc).getNextSibling(doc). DocumentCollection dc2 = doc.out. import lotus.getResponses().*. Document doc = view.getItemValueString("Subject")).

if a document is signed.domino.Document class Signer property Read-only. import lotus. which includes the size of any file attachments to the document.*. 1918 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext().getFirstDocument(). // (Your code goes here) Database db = agentContext. The name of the person who created the signature. Defined in Document Data type int Syntax public int getSize() throws NotesException Example: Size property This agent gets the size of every document in a database.getCurrentDatabase(). AgentContext agentContext = session. The size of a document in bytes. Document doc = view. View view = db. Defined in Document Data type String Syntax public String getSigner() throws NotesException Usage If a document is not signed. Size property Read-only.getView("All Documents"). Volume 3: JavaScript Classes . returns null.

getSize() + " bytes.printStackTrace(). The universal ID of a document.out. it becomes a new document. Chapter 10: Java Classes A–Z 1919 . you get run-time error 4000 when you attempt to save the document."). If two documents in replica databases share the same universal ID. If you set the UNID of a document the same as another document. Defined in Document Data type String Syntax public String getUniversalID() throws NotesException public void setUniversalID(String unid) throws NotesException Usage If you modify the UNID of an existing document. The universal ID is also known as the unique ID or UNID. doc = view. the documents are replicas.getItemValueString("Subject") + "\" consumes " + doc.println("\"" + doc. } } } UniversalID property Read-write. A-F) that uniquely identifies a document across all replicas of a database.Document class while (doc != null) { System. } } catch(Exception e) { e.getNextSibling(doc). which is a 32-character combination of hexadecimal digits (0-9.

System. doc. doc. Volume 3: JavaScript Classes . else e. "Topic # " + topicID).getCurrentAgent(). doc.appendItemValue( "Categories". } } } Verifier property Read-only. Defined in Document Data type String 1920 Domino Designer Programming Guide. "Numbered topics"). if (topicID != null && topicID.domino. String topicID = agent.out. // (Your code goes here) Database db = agentContext. The name of the certificate that verified a signature. "Main Topic"). } catch(NotesException e) { if (e. AgentContext agentContext = session.id == 4000) System. doc.*. } else System. Agent agent = agentContext. import lotus.appendItemValue( "Subject". if a document is signed. doc.save().getComment().println("Universal ID for new topic is " + doc.printStackTrace().appendItemValue("Form". public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setUniversalID( "AAAABBBBCCCCDDDDEEEEFFFF" + topicID).out.println("TopicID must be 8 characters").getCurrentDatabase().length() == 8) { Document doc = db.Document class Example: UniversalID property This agent constructs a universal ID for a new document from the agent comment.getUniversalID()).getAgentContext().createDocument().println("TopicID is not unique").out.

appendItemValue is safe. Note In general. double value) throws NotesException public Item appendItemValue(String name. Chapter 10: Java Classes A–Z 1921 . int value The value of the new item. appendItemValue creates a second item of the same name. Object value) throws NotesException Parameters String name The name of the new item. double value The value of the new item. If you are creating a new document. If an item of the same name already exists in a document. replaceItemValue is favored over appendItemValue. int value) throws NotesException public Item appendItemValue(String name. Defined in Document Syntax public Item appendItemValue(String name) throws NotesException public Item appendItemValue(String name. and the duplicate items are not accessible through most methods. appendItemValue method Creates a new item in a document and optionally sets the item value.Document class Syntax public String getVerifier() throws NotesException Usage This property is null if the document is not signed.

it creates another item of the same name and gives it the value you specify.Document class Object value The value of the new item.appendItemValue("Subject". import java. Usage To keep the new item. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session.Vector. The data type of the new item depends upon the data type of the value that you place in it. 1922 Domino Designer Programming Guide. Document doc = db.util. // (Your code goes here) Database db = agentContext. number.appendItemValue("Form". Data type of value String Integer Double DateTime java. "Main Topic"). // Create text item with one String value doc. Integer.getAgentContext().Vector with String.util. Volume 3: JavaScript Classes . multi-value numeric (from Vector of Integer values). numeric (from double). appendItemValue does not replace it. "Test appendItemValue"). import lotus. doc. multi-value text. you call save after calling appendItemValue.*.getCurrentDatabase(). // Create text item with multiple String values Vector stringMultiple = new Vector(). numeric (from int).createDocument(). or date-time item Same data type as the Item Return value Item The new item. Example: appendItemValue method This agent creates text.domino. Instead. or DateTime elements Item Resulting Item Text Number Number Date-time item Multi-value text. If the document already has an item called name. Double. and date-time items.

println("Document created and saved"). // Create numeric item with one double value doc. } catch(Exception e) { e. Integer two = new Integer(2). // Create numeric item with one int value doc. stringMultiple. 101). // Create time item with one DateTime value DateTime timenow = session. stringMultiple). doc.addElement(two).addElement("String two").printStackTrace(). stringMultiple. boolean raiseerror) throws NotesException Chapter 10: Java Classes A–Z 1923 .Document class stringMultiple. integerMultiple. // Create numeric item with multiple Integer values Vector integerMultiple = new Vector().out. Integer one = new Integer(1). } } } computeWithForm method Validates a document by executing the default value. doc.out. timenow. Integer three = new Integer(3). doc.createDateTime("").01). Defined in Document Syntax public boolean computeWithForm(boolean dodatatypes. integerMultiple.addElement(one).addElement("String three").println("Something went wrong").appendItemValue("stringMultiple".addElement("String one").appendItemValue("double".appendItemValue("dateTime". if any are defined in the document form. else System. timenow). if (doc.setNow(). translation.addElement(three).appendItemValue("integerMultiple". integerMultiple). and validation formulas.appendItemValue("integer".save()) System. integerMultiple. 1.

Specify either true or false. Document doc = db. Programatically you can create a document without a form. Usage The form is as follows: 1. 1924 Domino Designer Programming Guide. the method returns false if validation fails. @Failure( "You must enter a Subject" ). False if there are errors in the document. Return value True if there are no errors in the document. // (Your code goes here) Database db = agentContext.getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. you must use a form to create a document. The form stored in the document. boolean raiseerror If true. 2. instead. if no form is stored in the document. Volume 3: JavaScript Classes .Document class Parameters boolean dodatatypes The method ignores this parameter. 3. an error is raised if the validation fails. if any.*. the agent saves the document. no error is raised. The value of the Form item. if the document does not have a Form item. Example: computeWithForm method Assume that the Subject field on the “Main Topic” form contains the following validation formula: @If( Subject = "". The document must meet the form requirements for input validation. import lotus. The computeWithForm method provides a means of checking that the data you placed in a document meets a form’s requirements. If the replaceItemValue line for Subject is uncommented. @Success ) The following agent as it stands does not save the document. If false.domino.getAgentContext(). although (unlike in the user interface) you can still save a document if computeWithForm returns false or throws an exception. The database default form. and the user interface informs you if the document does not meet these requirements. In the user interface.createDocument().

The item names are unchanged.")..Document class doc.printStackTrace(). boolean replace) throws NotesException Parameters Document The destination document. if (doc. } } } copyAllItems method Copies all items in the current document into the destination document. If false. no subject").save(true. the items in the destination document are appended.computeWithForm(false. "Text of document. true). boolean replace If true. } else System.println("Saving document . the items in the destination document are replaced..replaceItemValue("Body"..println("Document not saved .replaceItemValue("Form". doc.."). "Subject of document"). } catch(Exception e) { e.out. Defined in Document Syntax public void copyAllItems(Document doc.replaceItemValue("Subject". doc. false)) { System. "Main Topic"). See appendItemValue for a note about appending items to existing documents. Chapter 10: Java Classes A–Z 1925 .out. you should probably specify true for the second parameter. // doc. Usage If you are not copying to a newly created document.

replaceItemValue("Subject".getCurrentDatabase().domino. if (dc.createDocument().save()) System.println("Something went wrong"). "Copy of test appendItemValue").out. docCopy.Document class Example: copyAllItems method This agent copies all items from an existing document into a newly created one.*. } } } copyItem method Copies an item into the current document and optionally assigns the copied item a new name. } } catch(Exception e) { e.println("Document saved").getFirstDocument(). Document docCopy = db. if (docCopy.getCount() == 1) { Document doc = dc. import lotus.out. else System. AgentContext agentContext = session.search("Subject = \"Test appendItemValue\""). Volume 3: JavaScript Classes . // (Your code goes here) Database db = agentContext. Defined in Document Syntax public Item copyItem(Item item) throws NotesException public Item copyItem(Item item. doc. DocumentCollection dc = db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). String newname) throws NotesException 1926 Domino Designer Programming Guide.printStackTrace(). false).copyAllItems(docCopy.

getCurrentDatabase().*. Return value Item A copy of the specified item parameter.Document class Parameters Item item The item.getCount() == 1) { Document doc = dc. docCopy.id + " " + e.domino.copyItem(bodyItem.save()) System. AgentContext agentContext = session.getFirstDocument(). } } } Chapter 10: Java Classes A–Z 1927 .println("Something went wrong").replaceItemValue("Subject".out. e. else System. DocumentCollection dc = db. "Copy of test appendItemValue").println("Document saved").createDocument().printStackTrace(). "").search("Subject = \"Test appendItemValue\""). identical except for its newname. // (Your code goes here) Database db = agentContext.out. Example: copyItem method This agent copies an item from an existing document to a newly created document. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out. that you want to copy. String newname The name to assign to the copied item. Cannot be null.text). usually from another document. import lotus.println(e. Specify null to retain the item’s existing name. } } catch(NotesException e) { System. if (docCopy. docCopy. if (dc. Document docCopy = db.getAgentContext().

// (Your code goes here) Database db = agentContext. while (doc != null) { doc. System.getCurrentDatabase(). int count = 0. Database newdb = db.out. doc = view.copyToDatabase(newdb).getAgentContext(). View view = db. } catch(Exception e) { e. import lotus. Volume 3: JavaScript Classes . count++. AgentContext agentContext = session. Cannot be null.out.*. Document doc = view.Document class copyToDatabase method Copies a document to a specified database. } System.getFirstDocument(). "archive"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Defined in Document Syntax public Document copyToDatabase(Database db) throws NotesException Parameter Database db The database to which you want to copy the document.println("Archive created").getNextDocument(doc).println(count + " documents copied to archive").printStackTrace().domino. Return value Document The new document in the specified database.createCopy(null. } } } 1928 Domino Designer Programming Guide.getView("By Category"). Example: copyToDatabase method This agent copies the documents in a view of one database to a newly created database.

Document class createReplyMessage method Creates a new document that is formatted as a reply to the current document. Database db = dir. import lotus.*. If you want one. Example: createReplyMessage method This agent sends a reply message for all documents in a view. Chapter 10: Java Classes A–Z 1929 .getView("Filed but not forgotten"). Document doc = view. If you want to mail it. the program must explicitly add it to the document. while (doc != null) { Document reply = doc. Return value Document A reply to the current document.getDbDirectory(null). Defined in Document Syntax public Document createReplyMessage(boolean toall) throws NotesException Parameter boolean toall If true. AgentContext agentContext = session.openMailDatabase(). Usage The new document does not contain a Subject item. If false.createReplyMessage(false). The new document does not automatically get mailed. the program must explicitly call the send method. "Can't work on this now").getFirstDocument(). the new document recipient list contains only the sender of the original.domino. View view = db.replaceItemValue("Subject".getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) DbDirectory dir = session. the new document recipient list contains all the recipients of the original. reply.

getCurrentDatabase(). Usage For more information.replaceItemValue("Body". AgentContext agentContext = session.id + " " + e.Document class reply.println(e. } } } createRichTextItem method Creates a new rich text item in a document.out.getNextDocument(doc). 1930 Domino Designer Programming Guide.createDocument().printStackTrace().domino.*. doc = view.send(doc. Defined in Document Syntax public RichTextItem createRichTextItem(String name) throws NotesException Parameter String name The name of the new rich text item.text).getItemValueString("From")). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). see the RichTextItem class. Example: createRichTextItem method This agent creates a rich text item. } } catch(NotesException e) { System.getAgentContext(). e."). Document doc = db. Return value RichTextItem The newly created item. import lotus. "This has been filed for future consideration. Volume 3: JavaScript Classes . // (Your code goes here) Database db = agentContext. reply.

it must have permission to use Encrypt. RichTextItem rtitem = doc. Chapter 10: Java Classes A–Z 1931 .bmp". } } } encrypt method Encrypts a document.replaceItemValue("Form".createRichTextItem("Body").printStackTrace(). "Forest icon"). Since mail encryption works differently. If there are no encryption keys specified. the document is encrypted with the user’s public key. those keys are used to encrypt the document. Any user who has one of the encryption keys can decrypt the document. "C:\\Windows\\forest. } catch(Exception e) { e. and use the send method. If the program is running on a server. If the EncryptionKeys property is set with one or more named keys. Instead.save(). "Forest icon"). rtitem. null. set the EncryptOnSend property to true. Defined in Document Syntax public void encrypt() throws NotesException Usage The encrypted document is not saved until you call save.replaceItemValue("Subject".embedObject(EmbeddedObject. Items for which isEncrypted is false remain visible to any user.Document class doc.EMBED_ATTACHMENT. do not use this method if you want to mail an encrypted document. even if the user does not have the proper encryption key. "Main Topic"). Only the items for which isEncrypted is true are encrypted. doc. in which case only the user who encrypted the document can decrypt it. doc.

println(e.getEncryptionKeys().encrypt().setEncrypted(true). import lotus. } } if (!found) { v. if (item != null) { // Make sure the item can be encrypted if (!item. import java. } } doc. // Add "Top Secret" to the encryption keys // if not there boolean found = false. AgentContext agentContext = session.Vector. i++) { String k = (String)v. Volume 3: JavaScript Classes . break. } } catch(Exception e) { e.getView("By Category").*.save().size(). View view = db.domino.text). if (k. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } // Encrypt the document try { doc.getFirstDocument(). Vector v = doc.compareTo("Top Secret") == 0) { found = true.addElement("Top Secret"). } catch (NotesException e) { System.id + " " + e.getNextDocument(doc). for (int i=0.Document class Example: encrypt method and EncryptionKeys property This agent encrypts a document after making sure “Top Secret” is one of the encryption keys.out. i<v. Document doc = view.printStackTrace(). break.setEncryptionKeys(v). } } } 1932 Domino Designer Programming Guide. // (Your code goes here) Database db = agentContext.getFirstItem("Body").elementAt(i). doc.getCurrentDatabase(). doc = view.getAgentContext(). while (doc != null) { Item item = doc.isEncrypted()) item.util.

DocumentCollection dc = db. since it was not accessed through a RichTextItem. Returns null if an attachment by the specified name is not found.getAllDocuments(). import lotus.getAttachment("forest.getCurrentDatabase(). AgentContext agentContext = session. The file name of the file attachment. if (obj != null) { System.*. Example: getAttachment method This agent looks for the file attachment forest. Usage The Parent property for the returned EmbeddedObject returns null. Document doc = dc.out.getAgentContext().getFirstDocument().bmp in all the documents in a database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. You can use this method to find file attachments that are not contained in a rich text item (such as an attachment in a Release 2 database) as well as file attachments that are contained in a rich text item.getName() + " in \"" + doc.bmp").println("Found " + obj.getItemValueString( Chapter 10: Java Classes A–Z 1933 . Define in Document Syntax public EmbeddedObject getAttachment(String filename) throws NotesException Parameter String filename String. // (Your code goes here) Database db = agentContext.Document class getAttachment method Returns a representation of a file attachment. while (doc != null) { EmbeddedObject obj = doc. Return value EmbeddedObject A representation of the file attachment.

use getCreated.printStackTrace(). Usage A document may contain more than one item of the same name. } } catch(Exception e) { e. Returns null if the document does not contain an item with name.getNextDocument(). if a document has a DateComposed field computed for display with the formula @Created. Defined in Document Syntax public Item getFirstItem(String name) throws NotesException Parameter String name The name of the item you want to find. To access other than the first item. the value is not stored as an item and is inaccessible from a Document object. } doc = dc. you can access the field value another way.Document class "Subject") + "\""). In some cases. use the Items property. 1934 Domino Designer Programming Guide. Return value Item The first item with name. } } } getFirstItem method Returns the first item of a specified name in a document. If the value of a field is computed for display. break. For example. Volume 3: JavaScript Classes .

out.out. else System. doc = dc. else System.getFirstItem("Body").println("[ No subject ]").getFirstItem("Subject").out.*. Document doc = dc. RichTextItem body = (RichTextItem)doc.getNextDocument().getFirstItem("Body"). 0. // (Your code goes here) Database db = agentContext..println("No body").getCurrentDatabase(). if (subject == null) System. //. 0)).getFormattedText(true. while (doc != null) { Item subject = doc.println("[ " + subject. } } } Chapter 10: Java Classes A–Z 1935 . RichTextItem rtitem = (RichTextItem)doc.println( body.Document class Using this method to get rich text items To get a rich text item...getText() + " ]").set value of doc. DocumentCollection dc = db. import lotus.printStackTrace().out. Example: getFirstItem method This agent gets an item and a rich text item for all documents in a database. Document doc.domino. if (body == null) System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session.getFirstDocument().. } } catch(Exception e) { e.getAgentContext(). explicitly cast the return value from getFirstItem to RichTextItem.getAllDocuments().

Notes item type Rich text Text (includes Names.util. If the item contains a single value. getItemValueInteger.util. rich text. numeric integer. getItemValueDouble. Use the Items property to get all the items. public class JavaAgent extends AgentBase { 1936 Domino Designer Programming Guide.util. and date-time item values. multi-value text.util. multi-value numeric.util.Vector The value or values contained in the item. this method returns the value of the first item. and Readers item types) or text list Number or number list Date-time or range of date-time values Value return type java.Vector with DateTime elements Each element corresponds to a value in the item.*. Example: getItemValue method.util. The data type of the value depends on the data type of the item.Vector with String elements java. Defined in Document Syntax public java. Return value java.domino.util.Vector with one String element rendered into plain text java. import lotus.Document class getItemValue method Returns the value of an item.Vector with Double elements java. and getItemValueString This agent gets text. If the item has no value.Vector. Volume 3: JavaScript Classes . Authors. Usage If multiple items have the same name. numeric double. import java. this method returns an empty vector.Vector getItemValue(String name) throws NotesException Parameter String name The name of an item. the vector has just one element.

getItemValue("dateTime").println((i+1) + ": " + d. Document doc = dc.must convert from double Vector iM = doc.size() > 0) { DateTime dt = (DateTime)dM. // Get numeric item with one decimal value System. // (Your code goes here) Database db = agentContext.getAgentContext(). } } } Chapter 10: Java Classes A–Z 1937 .size().getItemValueString("Body")).getLocalTime()).getItemValueDouble("double")).elementAt(i)). } // Get date-time item Vector dM = doc. // Get rich text item rendered to plain text System.out. DocumentCollection dc = db. AgentContext agentContext = session.getNextDocument(). System.out.intValue()).getAllDocuments(). if (dM.out.println((i+1) + ": " + sM.elementAt(i).printStackTrace().getItemValue("integerMultiple"). for (int i=0.println("[ " + doc.Document class public void NotesMain() { try { Session session = getSession(). while (doc != null) { // Get text item with one value System.size(). System.println(dt. // Get text item with multiple values Vector sM = doc.elementAt(0). i<sM.getItemValue("stringMultiple").out. // Get numeric item with one integer value System. for (int i=0.getFirstDocument().println(doc. i++) System.getCurrentDatabase().out.println(doc.getItemValueString("Subject") + " ]").getItemValueInteger("integer")). } doc = dc.println(doc. } } catch(Exception e) { e. Double d.out. i++) { d = (Double)iM. // Get numeric item with multiple integer values // .out. i<iM.

Use the Items property to get all the items. Volume 3: JavaScript Classes . Defined in Document Syntax public double getItemValueDouble(String name) throws NotesException Parameter String name The name of the item. Usage If multiple items have the same name. this method returns the first value.Document class getItemValueDouble method Returns the value of an item with a single numeric value. this method returns 0. or empty. If the item has multiple values. getItemValueInteger method Returns the value of an item with a single numeric value. Defined in Document Syntax public int getItemValueInteger(String name) throws NotesException Parameter String name The name of the item. date-time.0. this method returns the value of the first item. If the item has no value or the value is text. 1938 Domino Designer Programming Guide. Return value double The value of the item.

this method returns 0. this method returns the value of the first item. Usage If multiple items have the same name. This method returns a rich text item rendered to plain text. Use the Items property to get all the items. or empty.Document class Return value int The value of the item. Chapter 10: Java Classes A–Z 1939 . If the item has multiple values. If the item has no value or the value is numeric or date-time. this method returns the first value. Defined in Document Syntax public String getItemValueString(String name) throws NotesException Parameter String name The name of the item. Return value String The value of the item. Formatting and embedded objects are lost. Use the Items property to get all the items. Usage If multiple items have the same name. this method returns the value of the first item. If the item has multiple values. getItemValueString method Returns the value of an item with a single text value. If the item has no value or the value is text. this method returns an empty string. date-time. this method returns the first value.

False if no item with name exists in the document. Return value True if an item with name exists in the document. Volume 3: JavaScript Classes .Document class hasItem method Indicates if an item exists in the document. 1940 Domino Designer Programming Guide. Usage You must call save after this method if you want to save the change you have made. The two documents must be in the same database. Defined in Document Syntax public boolean hasItem(String name) throws NotesException Parameter String name The name of an item. makeResponse method Makes one document a response to another. Defined in Document Syntax public void makeResponse(Document doc) throws NotesException Parameter Document doc The document to which the current document becomes a response. Cannot be null.

println("Something went wrong"). } } catch(Exception e) { e. "Response"). rdoc. Document rdoc = db.getCurrentDatabase(). boolean createonfail) throws NotesException Chapter 10: Java Classes A–Z 1941 .printStackTrace().*. } } } putInFolder method Adds a document to a folder. if (rdoc.Document class Example: makeResponse method This agent makes a newly created document a response document to an existing document. import lotus. rdoc. If the folder does not exist.search("Subject = \"Test appendItemValue\"").getCount() == 1) { Document doc = dc.println("Document saved"). DocumentCollection dc = db.getFirstDocument().appendItemValue("Subject". if (dc. Defined in Document Syntax public void putInFolder(String name) throws NotesException public void putInFolder(String name.out. it is created.out.appendItemValue("Form".domino. rdoc.save()) System.createDocument().getAgentContext(). "Response to Test appendItemValue"). else System. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session.makeResponse(doc). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

getItemValueString("Category"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().” Example: putInFolder method This agent puts documents in folders that have names the same as the values of their Category items.save(). putInFolder creates both. For example: doc. specify a path to it. If you specify a path to a folder. for example: "Vehicles\\Bikes" boolean createonfail If true (default).Document class Parameter String name The name of the folder in which to place the document. doc. the method creates all of them for you.*. putInFolder does nothing. Document doc = dc. This method cannot add the first document to a folder that is “Shared. // (Your code goes here) DocumentCollection dc = agentContext.getFirstDocument(). separating folder names with backslashes. } agentContext. If the folder is within another folder. Usage If the document is already inside the folder you specify. and none of the folders exists. Database db = agentContext. AgentContext agentContext = session. doc = dc. creates the folder if it does not exist.putInFolder( "Vehicles\\Bikes" ). placing the Bikes folder inside the Vehicles folder. if (category != null) { doc.getAgentContext(). The folder may be personal if the program is running on a workstation.domino.getCurrentDatabase(). Personal on first use. } 1942 Domino Designer Programming Guide. If neither Vehicles nor Bikes exists. Volume 3: JavaScript Classes . import lotus.getNextDocument(doc).getUnprocessedDocuments().updateProcessedDoc(doc). while (doc != null) { String category = doc.putInFolder(category).

getFirstDocument(). the document is removed even if another user modifies the document after your program opens it. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If false. } } } remove method Permanently removes a document from a database.println("\"" + subject + "\" removed"). Document doc = view.getItemValueString("Subject"). View view = db.printStackTrace(). the document is not removed if another user modifies it. import lotus.domino. Chapter 10: Java Classes A–Z 1943 .getAgentContext().getCurrentDatabase().getView("Folder1").*. AgentContext agentContext = session. // (Your code goes here) Database db = agentContext. String subject. while (doc != null) { subject = doc. Example: remove method This agent removes all the documents in a folder. System.remove(true).Document class } catch(Exception e) { e. Return value True if the document is successfully removed. Defined in Document Syntax public boolean remove(boolean force) throws NotesException Parameter boolean force If true. doc.out. False if the document is not deleted because another user modified it and the force parameter is set to false.

If the folder is within another folder. AgentContext agentContext = session.getItemValueString("Category").domino.printStackTrace(). 1944 Domino Designer Programming Guide.getFirstDocument().getAllDocuments().getCurrentDatabase(). Document doc = dc. } } catch(Exception e) { e. Example: removeFromFolder method This agent removes documents from folders that have names the same as the values of their Category items. specify a path to it. or if the folder you specify does not exist.getFirstDocument(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). DocumentCollection dc = db.getAgentContext(). while (doc != null) { String category = doc.*.Document class doc = view. The folder may be personal if the program is running on a workstation. for example: "Vehicles\\Bikes" Usage The method does nothing if the document is not in the folder you specify. Defined in Document Syntax public void removeFromFolder(String name) throws NotesException Parameter String name The name of the folder from which to remove the document. separating folder names with backslashes. import lotus. // (Your code goes here) Database db = agentContext. } } } removeFromFolder method Removes a document from a folder. Volume 3: JavaScript Classes .

getAgentContext(). } } catch(Exception e) { e. AgentContext agentContext = session. import java. true). DocumentCollection dc = db. Usage You can achieve the same result with remove in Item.Document class if (category != null) { doc.domino. you must call save after removing the item. } doc.removeFromFolder(category. If there is no item with name. import lotus. doc = dc.getNextDocument(doc).util. If more than one item has name. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace().getCurrentDatabase(). To keep the changes to the document. // (Your code goes here) Database db = agentContext.*. Defined in Document Syntax public void removeItem(String name) throws NotesException Parameter String name The name of the item to remove from the document.save(). Example: removeItem method This agent removes an item first putting in its value into another item (effectively changing the name of the item). } } } removeItem method Removes an item from a document.getAllDocuments().Vector. Chapter 10: Java Classes A–Z 1945 . all items with this name are removed. the method does nothing.

Document class Document doc = dc. 1946 Domino Designer Programming Guide. the method is successful.save().getFirstDocument(). Return value boolean If true.printStackTrace(). Therefore. Defined in Document Syntax public boolean renderToRTItem(RichTextItem rtitem) throws NotesException Parameter RichTextItem rtitem The destination for the picture. the method is not successful and the rich text item remains unchanged. the form’s input translation and validation formulas are executed. If false. while (doc != null) { if (doc.removeItem("OldItem").replaceItemValue("NewItem". } } } renderToRTItem method Creates a picture of a document and places it into a rich text item you specify. Cannot be null.getItemValue("OldItem")). This can happen if an input validation formula fails on the document’s form. Usage The picture is created using both the document and its form. } doc = dc.getNextDocument(doc).hasItem("OldName")) { doc. } } catch(Exception e) { e. doc. Volume 3: JavaScript Classes . doc. doc.

out.send(session. "Picture of Test appendItemValue").getCount() == 1) { Document doc = dc. RichTextItem rti = memo.getAgentContext(). AgentContext agentContext = session. If the document does not contain an item with the specified name. Document memo = db. memo.getUserName()).id + " " + e. Defined in Document Syntax public Item replaceItemValue(String name.appendItemValue("Subject".renderToRTItem(rti). // (Your code goes here) Database db = agentContext. import lotus.getCurrentDatabase().appendItemValue("Form". e.Document class Example: renderToRTItem method This agent puts a picture of a document in another document and sends it. memo.search("Subject = \"Test appendItemValue\""). if (dc. } } } replaceItemValue method Replaces all items of the specified name with one new item.println(e.text). } } catch(NotesException e) { System. DocumentCollection dc = db. doc.domino.getFirstDocument().printStackTrace().createRichTextItem("Body").createDocument(). memo.*. "Memo"). which is assigned the specified value. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). this method creates a new item and adds it to the document. Object value) throws NotesException Chapter 10: Java Classes A–Z 1947 .

multi-value numeric. The data type of the item depends upon the data type of value.getFirstDocument().util. Example: replaceItemValue method This agent replaces text. and date-time item values. Volume 3: JavaScript Classes . if (dc. Object value The value of the new item. import lotus.search("Subject = \"Test appendItemValue\"").getAgentContext().replaceItemValue("Subject". which replaces all previous items with the same name. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.Vector. numeric integer. 1948 Domino Designer Programming Guide. and does not need to match the data type of the old item. Data type of value String Integer Double DateTime java. number. Double. numeric double.getCurrentDatabase(). multi-value text. or DateTime elements Item Resulting Item Text Number Number Date-time item Multi-value text.util. Integer.Vector with String. Usage To keep the changes. // Replace text item with one String value doc. The name of the item or items you want to replace. you must call save after calling replaceItemValue. // (Your code goes here) Database db = agentContext.*. AgentContext agentContext = session.Document class Parameters String name String. DocumentCollection dc = db. import java. "Test replaceItemValue"). or date-time item Same data type as the Item Return value Item The new item.getCount() == 1) { Document doc = dc.

doc.addElement("String six").addElement(two). Integer one = new Integer(3). doc.replaceItemValue("dateTime".setNow(). } } } Chapter 10: Java Classes A–Z 1949 . doc.replaceItemValue( "stringMultiple".Document class // Replace text item with multiple String values Vector stringMultiple = new Vector(). integerMultiple. // Create numeric item with multiple Integer values Vector integerMultiple = new Vector().replaceItemValue("integer". Integer three = new Integer(5). else System.println("Something went wrong"). stringMultiple.out.printStackTrace(). timenow. // Replace numeric item with one double value Double doubleObj = new Double(2. if (doc. stringMultiple). timenow). // Replace time item with one DateTime value DateTime timenow = session. // Replace numeric item with one int value Integer intObj = new Integer(202). } } catch(Exception e) { e.replaceItemValue( "integerMultiple". Integer two = new Integer(4). integerMultiple). doubleObj).addElement("String four"). intObj). integerMultiple.addElement(one).println("Document saved").out.replaceItemValue("double". doc. stringMultiple. stringMultiple.02).save()) System.addElement("String five").addElement(three).createDateTime(""). integerMultiple. doc.

Return Value True if the document is successfully saved. boolean makeresponse) throws NotesException public boolean save(boolean force. boolean markread) throws NotesException Parameters boolean force If true. the save is canceled. the document is not marked as unread. Volume 3: JavaScript Classes . If false. If false. If false (default). the earlier version is discarded. Defined in Document Syntax public boolean save() throws NotesException public boolean save(boolean force) throws NotesException public boolean save(boolean force. the document is saved even if someone else edits and saves the document while the program is running. If the force parameter is true. boolean makeresponse If true. boolean markread If true. the makeresponse argument determines what happens. the document is marked as read. 1950 Domino Designer Programming Guide. The last version of the document that was saved wins. boolean makeresponse. the makeresponse parameter has no effect. False if the document is not saved.Document class save method Saves any changes you have made to a document. and someone else edits the document while the program is running. the current document becomes a response to the original document (this is what the replicator does when there’s a replication conflict).

util. Defined in Document Syntax public void send(String recipient) throws NotesException public void send(java. true)).out.domino. DocumentCollection dc = db. do {} while (!doc.Document class Example: save method This agent saves a document. String recipient) throws NotesException public void send(boolean attachform.util. The agent keeps trying if the document is not saved because someone else modified it while the program was running. e.*. intObj).text). java. doc.getAgentContext().save(false.Vector recipients) throws NotesException Chapter 10: Java Classes A–Z 1951 . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). false. } } } send method Mails a document to the recipients you specify. Integer intObj = new Integer(303). } } catch(NotesException e) { System. AgentContext agentContext = session.getCurrentDatabase().Vector recipients) throws NotesException public void send(boolean attachform.id + " " + e.getFirstDocument().search("Subject = \"Test appendItemValue\""). if (dc.getCount() == 1) { Document doc = dc. import lotus.printStackTrace(). // (Your code goes here) Database db = agentContext.println(e.replaceItemValue("integer".

Required if the document does not contain a SendTo item.util. it isn’t. such as CopyTo or BlindCopyTo. the form is stored and sent along with the document. they are used when sending the document. boolean attachform If true. The recipients of the document. The SentByAgent property uses this item to determine if a document was mailed by an agent. If the document contains items to control the routing of mail. or mail-in databases. the mailed document contains the server’s name in the From item. java. Volume 3: JavaScript Classes . the form is saved with the document. but insures that the recipient can see all of the items on the document. If a program runs as an agent on a server.Document class Parameters String recipient The recipient of the document. or ReturnReceipt.Vector recipients Vector of String elements. Ignored if the document contains a SendTo item. If a program runs on a workstation. in which case the document is mailed to recipients listed in SendTo. The SaveMessageOnSend property controls whether the sent document is saved in the database. groups. If SaveMessageOnSend is true and you attach the form to the document. 1952 Domino Designer Programming Guide. If false. DeliveryReport. Sending the form increases the size of the document. the documents mailed to those recipients. The send method automatically creates an item called $AssistMail on the sent document. See below. the mailed document contains the current user’s name in the From item. such as DeliveryPriority. which may include people. Usage Two kinds of items can affect the mailing of the document when you use send: If the document contains additional recipient items.

util.addElement("Lakshmi Annavajhala").addElement("Evelyn McKay"). v. memo.getFirstDocument(). // (Your code goes here) Database db = agentContext. RichTextItem rti = memo.addElement(session. memo. DocumentCollection dc = db. and SignerVerifier properties This agent sends an encrypted. v.setSaveMessageOnSend(true). } } } Chapter 10: Java Classes A–Z 1953 .appendItemValue("Form". } } catch(Exception e) { e. import java.getCurrentDatabase(). import lotus. "Test .printStackTrace().setEncryptOnSend(true). v).createRichTextItem("Body"). AgentContext agentContext = session. and signed message. saved.Document class Example: send method and IsSaveMessageOnSend.sign(). memo. Document memo = db.getCount() == 1) { Document doc = dc. memo. "Memo").setSignOnSend(true).createDocument(). memo. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.appendItemValue ("Subject".please reply if you get this"). Vector v = new Vector(). v.Vector.getAgentContext().send(true.*. if (dc. v.addElement("Kyla Town").getUserName()). doc.renderToRTItem(rti). IsSigned. memo. memo.search("Subject = \"Test appendItemValue\"").

DocumentCollection class sign method Signs a document. this method has no effect. Volume 3: JavaScript Classes . selected according to specific criteria. Defined in Document Syntax public void sign() throws NotesException Usage If you want the signature to be saved. If the program is running on a server. View Contains: Document Properties Count through getCount IsSorted through isSorted Parent through getParent Query through getQuery Methods addDocument deleteDocument FTSearch getDocument getFirstDocument 1954 Domino Designer Programming Guide. you must call the Save method after signing the document. DocumentCollection class Represents a collection of documents from a database. Database. Syntax public class DocumentCollection extends NotesBase Containment Contained by: AgentContext.

You do not need to navigate the documents’ response hierarchies. ViewEntryCollection. and ViewNavigator objects provide access to documents in a database. which can be any of the following: getAllDocuments in Database FTSearch in Database search in Database getProfileDocCollection in Database getAllDocumentsByKey in View getUnprocessedDocuments in AgentContext unprocessedFTSearch in AgentContext unprocessedSearch in AgentContext getResponses property in Document Usage DocumentCollection. The documents in the subset are determined by the method or property you use to search the database. Use a DocumentCollection object if: You want to act on a specific set of documents that meet certain criteria.DocumentCollection class getLastDocument getNextDocument getNthDocument getPrevDocument putAllInFolder removeAll removeAllFromFolder stampAll updateAll Access A DocumentCollection represents a subset of all the documents in a database. There is no view in the database that contains every document you need to search. Chapter 10: Java Classes A–Z 1955 .

Use isValid in Document to check whether a document is real (true) or a deletion stub (false). Document doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). ViewNavigator provides access to categories and totals as well as documents.*. All navigation methods set the current pointer to the retrieved document with the following exceptions.out.println(doc.getItemValueString("Subject")). removeAll (remote IIOP only). By contrast.getAgentContext(). } } } 1956 Domino Designer Programming Guide. Example: DocumentCollection class This agent gets all the documents in a database. Add and delete methods do not move the current pointer.getAllDocuments(). ViewEntryCollection and ViewNavigator provide access to view entries. Deletion stubs A deletion stub is returned for a document deleted after creation of the collection or for a document to which you do not have read access. Volume 3: JavaScript Classes . putAllInFolder. The following methods set the current pointer to the first document: FTSearch.getNextDocument(). import lotus. } } catch(Exception e) { e. Sorted collections The documents in a collection are not sorted unless the collection results from a search. AgentContext agentContext = session.printStackTrace(). and stampAll. Current pointer A current pointer is maintained for document collections.getFirstDocument(). they do not necessarily provide access to the documents that you want.domino. However. while (doc != null) { System. doc = dc.DocumentCollection class Views are a more efficient means of accessing documents because they are already indexed by the database itself. removeAllFromFolder. documents accessed through ViewEntryCollection and ViewNavigator are in view order. DocumentCollection dc = db.getCurrentDatabase(). // (Your code goes here) Database db = agentContext. which contain ViewEntry as well as Document information.

} } } IsSorted property Read-only. System.getAgentContext().getCount() + " documents."). DocumentCollection dc = db. } catch(Exception e) { e.getAllDocuments().*. Defined in DocumentCollection Data type boolean Chapter 10: Java Classes A–Z 1957 . Indicates if the documents in a collection are sorted.println ("Database contains " + dc.printStackTrace().domino. // (Your code goes here) Database db = agentContext.out. The number of documents in a collection. import lotus. AgentContext agentContext = session.DocumentCollection class Count property Read-only. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Defined in DocumentCollection Data type int Syntax public int getCount() throws NotesException Example: Count property This agent gets the number of documents in a database.getCurrentDatabase(). A collection is sorted only when it results from a full-text search.

out.DocumentCollection class Syntax public boolean isSorted() throws NotesException Legal values true if the collection is sorted false if the collection is not sorted Usage When a collection is sorted.printStackTrace().*.printStackTrace().println("Is not sorted"). else System.isSorted()) System. printIsSorted(dc). } catch(Exception e) { e.println("Is sorted"). the documents are sorted by relevance score with the most relevant document appearing first. } catch(Exception e) { e. A relevance score is a number assigned to each document that matches a particular full-text search query.getCurrentDatabase().getAllDocuments(). DocumentCollection dc = db. // (Your code goes here) Database db = agentContext. The number is related to the number of matches that were found in the document.out.getAgentContext(). AgentContext agentContext = session. } } void printIsSorted(DocumentCollection dc) { try { if (dc. printIsSorted(dc). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes . import lotus.FTSearch("blue"). dc. Example: IsSorted property This agent demonstrates a function that determines whether a document collection is sorted. } } } 1958 Domino Designer Programming Guide.domino.

import lotus.getAllDocuments().getCurrentDatabase().getParent().*. Defined in DocumentCollection Data type Database Syntax public Database getParent() throws NotesException Usage This method throws an exception if the parent database is not accessible.printStackTrace(). } } public void parentdb(DocumentCollection d) { try { Database db = d. DocumentCollection dc = db. Example: Parent property This agent demonstrates a function that gets the parent database of a document collection. // (Your code goes here) Database db = agentContext. parentdb(dc).DocumentCollection class Parent property Read-only.out.getAgentContext().domino. AgentContext agentContext = session. } catch(Exception e) { e. } } } Chapter 10: Java Classes A–Z 1959 .getFileName() + ")").println("Parent database is \"" + db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } catch (Exception e) { e.printStackTrace(). The database that contains a document collection. System.getTitle() + "\" (" + db.

out.getCurrentDatabase(). The text of the query that produced a document collection if the collection results from a full-text or other search. else 1960 Domino Designer Programming Guide. DocumentCollection dc = db. dc.getQuery() + " ]").*. } catch(Exception e) { e.domino. printquery(dc).out.FTSearch("blue").println("\t[ " + d. if (d. this property returns an empty string. AgentContext agentContext = session.length() != 0) System. Volume 3: JavaScript Classes . import lotus.println("Search query:"). // (Your code goes here) Database db = agentContext. Defined in DocumentCollection Data type String Syntax public String getQuery() throws NotesException Usage For collections produced without a search.getAllDocuments(). } } public void printquery(DocumentCollection d) { try { System.getQuery().getAgentContext(). Example: Query property This agent demonstrates a formula that gets the query for a document collection.DocumentCollection class Query property Read-only. printquery(dc).printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

printStackTrace(). import lotus.*.println("\tNo search query"). } catch (Exception e) { e. boolean checkDups If true. Has no effect on local calls. } } } addDocument method Adds a document to a collection. Chapter 10: Java Classes A–Z 1961 .out.DocumentCollection class System. Defined in DocumentCollection Syntax public void addDocument(Document doc) throws NotesException public void addDocument(Document doc. forces a remote (IIOP) add to be made immediately rather than on the next navigation or other method (such as stampAll) that calls the server. boolean checkDups) throws NotesException Parameters Document doc The document to be added. The document collection is the result of a multi-database full-text search. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino. Usage This method throws an exception if: The document is a duplicate of one already in the collection. Cannot be null. Example: addDocument method This agent combines two document collections putting the result in the first collection. so that a duplicate exception can be thrown immediately.

Defined in DocumentCollection Syntax public void deleteDocument(Document doc) throws NotesException Parameters Document doc The document to be deleted. while (doc != null) { // Make sure it's not already there before adding if (dc1.out. Volume 3: JavaScript Classes . } doc = dc1. while (doc != null) { System. e.println(e.FTSearch("red").println(doc.printStackTrace().getAgentContext(). else db.isFTIndexed()) db.getFirstDocument().getAllDocuments().getCurrentDatabase(). Cannot be null. Document doc = dc2.updateFTIndex(false).getItemValueString("Subject")).addDocument(doc). dc1. dc2. DocumentCollection dc2 = db.updateFTIndex(true).out.FTSearch("blue"). DocumentCollection dc1 = db. } } } deleteDocument method Deletes a document from a collection.getNextDocument(). 1962 Domino Designer Programming Guide.id + " " + e.getDocument(doc) == null) dc1.getNextDocument(). doc = dc2. } } catch(NotesException e) { System. doc = dc1.DocumentCollection class AgentContext agentContext = session. if (db.text).getAllDocuments().getFirstDocument(). // (Your code goes here) Database db = agentContext.

DocumentCollection class

Usage This method throws an exception if: The document is already deleted. The document cannot be retrieved from this collection. The document collection is the result of a multi-database full-text search. Example: deleteDocument method This agent subtracts a second document collection from a first collection.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc1 = db.getAllDocuments(); DocumentCollection dc2 = db.getAllDocuments(); dc1.FTSearch("blue"); dc2.FTSearch("red"); Document doc = dc2.getFirstDocument(); while (doc != null) { // Make sure it's there before deleting if (dc1.getDocument(doc) != null) dc1.deleteDocument(doc); doc = dc2.getNextDocument(); } doc = dc1.getFirstDocument(); while (doc != null) { System.out.println(doc.getItemValueString("Subject")); doc = dc1.getNextDocument(); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

Chapter 10: Java Classes A–Z 1963

DocumentCollection class

FTSearch method
Conducts a full-text search of all the documents in a database collection, and reduces the collection to a sorted collection of those documents that match. Defined in DocumentCollection Syntax
public void FTSearch(String query) throws NotesException public void FTSearch(String query, int maxdocs) throws NotesException

Parameters
String query

The full-text query. See below for the syntax.
int maxdocs

The maximum number of documents you want returned from the query. Set this parameter to 0 to receive all matching documents. Usage This method moves the current pointer to the first document in the collection. The collection of documents that match the full-text query are sorted by relevance with highest relevance first. You can access the relevance score of each document in the collection using getFTSearchScore Document. If the database is not full-text indexed, this method works, but less efficiently. To test for an index, use isFTIndexed. To create an index on a local database, use updateFTIndex. This method searches all documents in a document collection. To search all documents in a database, use FTSearch in Database. To search only documents found in a particular view, use FTSearch in View or FTSearch in ViewEntryCollection. Query syntax To search for a word or phrase, enter the word or phrase as is, except that search keywords must be enclosed in quotes. Remember to escape quotes if you are inside a literal. Wildcards, operators, and other syntax are permitted. For the complete syntax rules, see “To use operators to refine a search” in Notes 5 help.
1964 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

Example: FTSearch method This agent locates up 10 documents containing the word “vaccine,” and prints their subjects and relevance scores.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc = db.getAllDocuments(); dc.FTSearch("vaccine", 10); Document doc = dc.getFirstDocument(); while (doc != null) { System.out.println(doc.getItemValueString("Subject")); System.out.println("\tRelevance score: " + doc.getFTSearchScore()); doc = dc.getNextDocument(); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

getDocument method
Gets a specified document in a collection. Defined in DocumentCollection Syntax
public Document getDocument(Document doc) throws NotesException

Parameters
Document doc

The document to be retrieved. Cannot be null.

Chapter 10: Java Classes A–Z 1965

DocumentCollection class

Return value
Document

The specified document. If the specified document is not in the collection, returns null. Usage This method gets a document in a document collection that is the same as a reference document that does not necessarily come from the collection (for example, a document retrieved from another collection). If the reference document is not in the collection, you get a null return. This method throws an exception if the document collection is the result of a multi-database full-text search. Example: getDocument method This agent gets all the documents in one collection noting which ones are also in another collection.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc1 = db.getAllDocuments(); DocumentCollection dc2 = db.getAllDocuments(); dc2.FTSearch("blue"); String izz = ""; Document doc = dc1.getFirstDocument(); while (doc != null) { // Make sure dc2 is not empty before doing getDocument if (dc2.getCount() != 0 && dc2.getDocument(doc) != null) izz = " is blue"; else izz = " is not blue"; System.out.println (doc.getItemValueString("Subject") + izz); doc = dc1.getNextDocument(); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } } 1966 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

getFirstDocument method
Gets the first document in a collection. Defined in DocumentCollection Syntax
public Document getFirstDocument() throws NotesException

Return value
Document

The first document in the collection. If there are no documents in the collection, returns null.

getLastDocument method
Gets the last document in a collection. Defined in DocumentCollection Syntax
public Document getLastDocument() throws NotesException

Return value
Document

The last document in the collection. If there are no documents in the collection, returns null.

getNextDocument method
Gets the document immediately following the current document or a specified document in a collection. Defined in DocumentCollection

Chapter 10: Java Classes A–Z 1967

DocumentCollection class

Syntax
public Document getNextDocument() throws NotesException public Document getNextDocument(Document doc) throws NotesException

Parameter
Document doc

Any document in the collection. Cannot be null. Return value
Document

If no parameter, the document following the current document. If a parameter, the document following the specified document. If there is no next document, returns null. Usage In remote (IIOP) operations, getNextDocument(Document doc) invalidates the cache and is therefore discouraged. The preferred loop structure is getFirstDocument() followed by getNextDocument() until it returns null. For performance reasons, you should avoid using getNthDocument(int n) and getNextDocument(Document doc) in a loop. Examples: getFirstDocument and getNextDocument methods 1. This agent gets all the documents in a database, demonstrating the preferred loop structure.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); Document doc = dc.getFirstDocument(); while (doc != null) { System.out.println(doc.getItemValueString ("Subject")); doc = dc.getNextDocument(); } } catch(Exception e) { e.printStackTrace(); } } } 1968 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

2. This agent gets the second document in a document collection by using the first document as a parameter to getNextDocument.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); if (dc.getCount() > 1) { Document doc = dc.getNextDocument(dc.getFirstDocument()); System.out.println("Doc # 2: " + doc.getItemValueString("Subject")); } } catch(Exception e) { e.printStackTrace(); } } }

getNthDocument method
Given a position number, returns the document at that position in a collection. Defined in DocumentCollection Syntax
public Document getNthDocument(int n) throws NotesException

Parameter
int n

Integer. A number indicating the document to return. Use 1 to indicate the first document in the collection, 2 to indicate the second document, and so on. Return value
Document

The document in the nth position in the collection. If there is no document at the specified position, returns null.
Chapter 10: Java Classes A–Z 1969

DocumentCollection class

Usage Collections are renumbered when deletions occur so that the positions of documents after the deleted document change. Using getNthDocument in conjunction with getCount to iterate through a loop is strongly discouraged for performance reasons. See getNextDocument and getPrevDocument for the preferred loop structures. Example: GetNthDocument method This agent demonstrates a function that gets a document in a document collection specified by number.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); int N = 3; printDocument(dc, N); } catch(Exception e) { e.printStackTrace(); } } void printDocument(DocumentCollection dc, int n) { try { if (n < 0 || n > dc.getCount()) System.out.println("N out of range"); else System.out.println("Doc #" + n + ": " + dc.getNthDocument(n).getItemValueString("Subject")); } catch(Exception e) { e.printStackTrace(); } } }

1970 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

getPrevDocument method
Gets the document immediately preceding the current document or a specified document in a collection. Defined in DocumentCollection Syntax
public Document getPrevDocument() throws NotesException public Document getPrevDocument(Document doc) throws NotesException

Parameter
Document doc

Any document in the collection. Cannot be null. Return value
Document

If no parameter, the document preceding the current document. If a parameter, the document preceding the specified document. If there is no previous document, returns null. Usage In remote (IIOP) operations, getPrevDocument(Document doc) invalidates the cache and is therefore discouraged. The preferred loop structure is getLastDocument() followed by getPrevDocument() until it returns null. For performance reasons, you should avoid using getNthDocument(int n) and getPrevDocument(Document doc) in a loop. Examples: getLastDocument and getPrevDocument methods 1. This agent gets all the documents in a document collection in reverse order, demonstrating the preferred loop structure.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); Chapter 10: Java Classes A–Z 1971

DocumentCollection class Document doc = dc.getLastDocument(); while (doc != null) { System.out.println(doc.getItemValueString ("Subject")); doc = dc.getPrevDocument(); } } catch(Exception e) { e.printStackTrace(); } } }

2. This agent gets the next to the last document in a document collection by using the last document as a parameter to getPrevDocument.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); if (dc.getCount() > 1) { Document doc = dc.getPrevDocument(dc.getLastDocument()); System.out.println("Doc # n-1: " + doc.getItemValueString("Subject")); } } catch(Exception e) { e.printStackTrace(); } } }

putAllInFolder method
Adds all the documents in the collection to the specified folder. If the folder does not exist in the document’s database, it is created. Defined in DocumentCollection

1972 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

Syntax
public void putAllInFolder(String folderName) throws NotesException public void putAllInFolder(String folderName, boolean createonfail) throws NotesException

Parameter
String folderName

The name of the folder in which to place the documents. The folder may be personal if the script is running on the workstation. If the folder is within another folder, specify a path to it, separating folder names with backward slashes, for example, “Vehicles\\Bikes”.
boolean createonfail

If true (default), creates the folder if it does not exist. If false, throws an exception if the folder does not exist. Usage For remote (IIOP) operations only, this method moves the current pointer to the first document in the collection. If a document is already inside the folder you specify, putAllInFolder does nothing for that document. Example: putAllInFolder method This agent puts all the documents returned by a full-text search in a folder.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc = db.getAllDocuments(); dc.FTSearch("blue"); dc.putAllInFolder("Blue", false); } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

Chapter 10: Java Classes A–Z 1973

DocumentCollection class

removeAll method
Permanently removes the documents in a collection from a database. Defined in DocumentCollection Syntax
public void removeAll(boolean force) throws NotesException

Parameters
boolean force

If true, a document is removed even if another user modifies the document after it is retrieved. If false, a document is not removed if another user modifies it first. Usage This method moves the current pointer to the first document in the collection. All documents removed from the database as a result of this operation are also removed from the collection. Example: removeAll method This agent removes all the documents returned by a full-text search in a folder.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc = db.getAllDocuments(); dc.FTSearch("blue"); if (dc.getCount() > 0) { System.out.println(dc.getCount() + " \"blue\" documents being removed from database ..."); dc.removeAll(true); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } } 1974 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class

removeAllFromFolder method
Removes all documents in the collection from the specified folder. Defined in DocumentCollection Syntax
public void removeAllFromFolder(String foldername) throws NotesException

Parameters
String foldername

The name of the folder from which to remove the document. The folder may be personal if the script is running on a workstation. If the folder is within another folder, specify a path to it, separating folder names with backward slashes, for example, “Vehicles\\Bikes”. Usage This method moves the current pointer to the first document in the collection. The method does nothing for documents not in the folder you specify. This method does nothing if the folder you specify does not exist. Example: removeAllFromFolder method This agent removes from a folder all the documents returned by a full-text search in a folder.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc = db.getAllDocuments(); dc.FTSearch("blue"); dc.removeAllFromFolder("Blue"); } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

stampAll method
Replaces the value of a specified item in all documents in a collection.
Chapter 10: Java Classes A–Z 1975

DocumentCollection class

Defined in DocumentCollection Syntax
public void stampAll(String itemname, Object value) throws NotesException

Parameters
String itemname

The name of the item.
Object value

A value appropriate for the item type. See replaceItemValue. Usage This method moves the current pointer to the first document in the collection. If the item does not exist, it is created. The item values are immediately written to the server documents. You do not have to use the save method of Document after stampAll. However, any documents modified by your script must be saved before calling stampAll. This method does not modify existing Document objects. Documents must be retrieved again to see the changes. Example: StampAll method This agent replaces the value of an item in documents found through a full-text search.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); if (db.isFTIndexed()) db.updateFTIndex(false); else db.updateFTIndex(true); DocumentCollection dc = db.getAllDocuments(); dc.FTSearch("red"); if (dc.getCount() > 0) {

1976 Domino Designer Programming Guide, Volume 3: JavaScript Classes

DocumentCollection class System.out.println(dc.getCount() + " \"red\" documents being stamped ..."); dc.stampAll("Color", "red"); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

updateAll method
Marks all documents in a collection as processed by an agent. Note Does not apply to remote calls. Defined in DocumentCollection Syntax
public void updateAll() throws NotesException

Usage See updateProcessedDoc in AgentContext for a description of the update process. Example: updateAll method This is an example of an agent that runs on, “All new and modified documents since last run.” The agent processes the documents returned by getUnprocessedDocuments and marks them as updated.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) DocumentCollection dc = agentContext.getUnprocessedDocuments(); Document doc = dc.getFirstDocument(); while (doc != null) { System.out.println(doc.getItemValueString("Subject")); doc = dc.getNextDocument(); } dc.updateAll();

Chapter 10: Java Classes A–Z 1977

DocumentCollection class } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }

EmbeddedObject class
Represents any one of the following: An embedded object An object link A file attachment Note EmbeddedObject is not supported under OS/2, under UNIX, and on the Macintosh. Syntax
public class EmbeddedObject extends Base

Containment Contained by: Document and RichTextItem Properties ClassName through getClassName FileSize through getFileSize Name through getName Object through getObject Parent through getParent Source through getSource Type through getType Verbs through getVerbs Methods activate doVerb extractFile remove

1978 Domino Designer Programming Guide, Volume 3: JavaScript Classes

EmbeddedObject class

Creation To create a new object, object link, or file attachment, use embedObject in RichTextItem. Access To access an existing object, object link, or file attachment: To access an object, object link, or attachment when you know its name and the rich text item that contains it, use getEmbeddedObject in RichTextItem. To access all the objects, object links, and attachments in a particular rich text item, use getEmbeddedObjects in RichTextItem. To access the objects and object links in a particular document, including those that are not contained within a particular rich text item, use getEmbeddedObjects in Document. This property does not return file attachments or objects and object links created in Notes Release 3. Example: EmbeddedObject class and ClassName, FileSize, Name, Object, Parent, Source, Type, and Verbs properties The agent gets the properties for all the embedded objects in all the “Body” items.
import lotus.domino.*; import java.util.Vector; import java.util.Enumeration; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); Document doc = dc.getFirstDocument(); while (doc != null) { RichTextItem body = (RichTextItem) doc.getFirstItem("Body"); System.out.println(doc.getItemValueString("Subject")); Vector v = body.getEmbeddedObjects(); Enumeration e = v.elements(); while (e.hasMoreElements()) { EmbeddedObject eo = (EmbeddedObject)e.nextElement(); System.out.println("\t" + eo.getName()); String type = null; switch (eo.getType()) { case EmbeddedObject.EMBED_ATTACHMENT : type = "file attachment"; break; Chapter 10: Java Classes A–Z 1979

println("\t\tType: " + type).id + " " + e.equals("embedded object")) System.EMBED_OBJECTLINK : type = "object link". break. Defined in EmbeddedObject Data type String Syntax public String getClassName() throws NotesException Usage For file attachments.printStackTrace().getItemValueString( "Subject")).println("\t\tClass name: " + eo.println("\t\tVerbs: " + eo.getVerbs()).println(e.out. System.out. this property returns null. } System.getFileSize() + " bytes"). case EmbeddedObject. The name of the application that created an object.getNextDocument().println("\t\tParent doc: " + eo.println("\t\tSize: " + eo. System.println("\t\tSource: " + eo.getClassName()).EmbeddedObject class case EmbeddedObject.text).equals("file attachment")) System. Volume 3: JavaScript Classes . if (!type.getSource()). if (type.equals("file attachment")) System. } } catch(NotesException e) { System.out. } } } ClassName property Read-only.EMBED_OBJECT : type = "embedded object".out.out.out. if (type.getParent(). 1980 Domino Designer Programming Guide. e.getParent().out. } doc = dc.

object link. this property returns the name parameter that was used with getEmbedObject. Defined in EmbeddedObject Data type Object of type java. The size of a file attachment. in bytes. this property returns null. Chapter 10: Java Classes A–Z 1981 .String Syntax public String getName() throws NotesException Usage If an object or object link does not have a name. Name property Read-only.lang. If the embedded object or object link was created using the user interface. Defined in EmbeddedObject Data type int Syntax public int getFileSize() throws NotesException Usage Returns 0 for embedded objects and links. this property returns the name of the object as it appears in the user interface. If an object or object link was created using the embedObject in RichTextItem. or file attachment. The name used to reference an object.EmbeddedObject class FileSize property Read-only.

The rich text item that holds an object. For an object or object link. Parent property Read-only. For a file attachment. Defined in EmbeddedObject Data type int Syntax public int getObject() throws NotesException Usage This property may or may not return a valid OLE handle for object links. returns the OLE handle (IUnknown or IDispatch handle).EmbeddedObject class Object property Read-only. depending upon the application used to create the object link. returns the internal name for the source document. Defined in EmbeddedObject 1982 Domino Designer Programming Guide. Defined in EmbeddedObject Data type RichTextItem Syntax public RichTextItem getParent() throws NotesException Source property Read-only. If an embedded object has been loaded into memory. returns the file name of the original file. Volume 3: JavaScript Classes . If the OLE object supports OLE Automation. you can invoke the methods and properties of the object using the handle.

EmbeddedObject class Data type Object of type java.EMBED_ATTACHMENT EmbeddedObject.String Syntax public String getSource() throws NotesException Type property Read-only.lang.util.Vector getVerbs() throws NotesException Usage Throws an exception if not invoked from an OLE/2 embedded object. Defined in EmbeddedObject Data type java.Vector. elements are String Syntax public java. if the object is an OLE/2 embedded object. or a file attachment. an object link. The verbs that an object supports.util.EMBED_OBJECT EmbeddedObject. Defined in EmbeddedObject Data type int Syntax public int getType() throws NotesException Return Values EmbeddedObject. Indicates whether an embedded object is an object.EMBED_OBJECTLINK Verbs property Read-only. Chapter 10: Java Classes A–Z 1983 .

1984 Domino Designer Programming Guide. the server application hides its user interface. doVerb method Executes a verb in an embedded object. Defined in EmbeddedObject Syntax public void doVerb(String verb) throws NotesException Parameter String verb The name of one of the object’s verbs. This method throws an exception if you invoke it on a EmbeddedObject that is a file attachment. This method may or may not return a valid OLE handle for object links. Returns null if the embedded object or object link does not support OLE automation. Usage Agents running on a server must set the show parameter to false.EmbeddedObject class activate method Causes an embedded object or object link to be loaded by OLE. depending upon the application used to create the object link. the OLE server application displays its user interface. Volume 3: JavaScript Classes . Defined in EmbeddedObject Syntax public int activate(boolean show) throws NotesException Parameter boolean show If true. If false. Return value int The OLE handle to the object.

getCurrentDatabase(). Chapter 10: Java Classes A–Z 1985 . import lotus.getType() == EmbeddedObject. System.util. eo. then removes the attachments.getEmbeddedObjects(). import java.getSource()).getAllDocuments().domino. this method throws an exception.EMBED_ATTACHMENT) { eo.util.*.getAgentContext().getFirstDocument(). DocumentCollection dc = db. Defined in EmbeddedObject Syntax public void extractFile(String path) throws NotesException Parameter String path The path and file name where you want to store the extracted file.nextElement(). Vector v = body. Enumeration e = v. AgentContext agentContext = session. Usage For embedded objects and object links.Enumeration.getFirstItem("Body"). // (Your code goes here) Database db = agentContext.out. while (doc != null) { RichTextItem body = (RichTextItem)doc. import java.EmbeddedObject class extractFile method Writes a file attachment to storage.println(doc.remove().getItemValueString("Subject")).elements(). Example: extractFile and remove methods This agent extracts all the file attachments in all the “Body” items of a database. while (e.hasMoreElements()) { EmbeddedObject eo = (EmbeddedObject)e. Document doc = dc. boolean saveFlag = false.Vector. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). if (eo.extractFile("c:\\extracts\\" + eo.

id + " " + e. true). object link. } } } remove method Removes an object.printStackTrace(). Defined in EmbeddedObject Syntax public void remove() throws NotesException Usage After calling remove. } } if (saveFlag) { doc.save(true.text). } } catch(NotesException e) { System.println(e. } doc = dc. saveFlag = false. e.getNextDocument(). Syntax public class Form extends Base Containment Contained by: Database Properties Aliases through getAliases Fields through getFields FormUsers through getFormUsers and setFormUsers 1986 Domino Designer Programming Guide. or file attachment. you must call save in Document to keep the change. Form class Represents a form in a database.out.Form class saveFlag = true. Volume 3: JavaScript Classes .

out. AgentContext agentContext = session.println ("\t \" \"\t: " + alias.getCurrentDatabase().out.Form class IsProtectReaders through isProtectReaders and setProtectReaders IsProtectUsers through isProtectUsers and setProtectUsers IsSubForm through isSubForm Name through getName Parent through getParent Readers through getReaders and setReaders Methods remove Access There are two ways to access a form: To get all the forms in a database.elementAt(0)).getTitle() + "\":"). use getForm in Database. j < alias. i < forms. for (int j = 1. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import java.isProtectReaders()).Vector.getAliases(). import lotus. // (Your code goes here) Database db = agentContext. System.println ("Forms in \"" + db.out.getForms(). use Forms in Database.domino.elementAt(i).elementAt(j)). Chapter 10: Java Classes A–Z 1987 .size(). System. } System.out.size().getName()). i++) { Form form = (Form)forms.println ("\tAlias\t: " + alias.size() != 0) { System.println ("\tProtect Readers\t: " + form. Vector forms = db. Example: Form class This agent prints the properties of all the forms in the current database.getAgentContext(). You can’t get access to private forms belonging to other people.println ("\nForm name : " + form. for (int i = 0.*.out. To get a form by its name. Vector alias = form. j++) System. if (alias.util.

Vector getAliases() throws NotesException 1988 Domino Designer Programming Guide. The aliases of a form.out.elementAt(0)). if (fields.j++) System.out.isSubForm()).out. for (int j = 1.println ("\t \"\" \t: " + fields. for (int j = 1.println ("\tSub Form \t: " + form. Vector users = form.out.size().elementAt(j)).size().printStackTrace(). for (int j = 1.println ("\tFields \t: " + fields.println ("\tForm Readers\t: " + readers. j < fields.size() != 0) { System. elements are String Syntax public java.elementAt(0)).out.getReaders().size(). Defined in Form Data type Vector. System.getFormUsers(). j < users.elementAt(0)). j < readers.util.Form class System.getFields().isProtectUsers()). j++) System. if (readers.size() != 0) { System. } Vector readers = form.println ("\t \" \" \t: " + users. j++) System.out.println ("\t \" \" \t: " + readers.elementAt(j)).size() != 0) { System. } } } catch(Exception e) { e.out. } Vector fields = form.println ("\tProtect Users\t: " + form.elementAt(j)). Volume 3: JavaScript Classes . if (users. } } } Aliases property Read-only.println ("\tForm users\t: " + users.out.

import java.getAgentContext(). } catch(Exception e) { e.*. } } } Fields property Read-only.size(). Form form = db. The Name property returns the first name in the list.elementAt(j)).getComment()).Vector.getForm(agent.out.util. j++) System.out. import lotus. AgentContext agentContext = session.getCurrentAgent().printStackTrace().Form class Usage This property returns all but the first in the list of all the form’s names.println (" " + alias.out.getComment()). Database db = agentContext. Vector alias = form. if (alias.getComment()).size() != 0) { System. for (int j=0.println ("No aliases for " + agent. j<alias. Defined in Form Data type Vector. elements are String Chapter 10: Java Classes A–Z 1989 .println ("Aliases for " + agent. } else System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Agent agent = agentContext.domino.getAliases().getCurrentDatabase(). The names of all the fields of a form. Example: Aliases property This agent prints all the aliases for the form specified as the agent comment.

} } } FormUsers property Read-write.getCurrentAgent().elementAt(j)). elements are String 1990 Domino Designer Programming Guide. Vector fields = form. } catch(Exception e) { e. j++) System. for (int j=0.domino.getCurrentDatabase().getFields().println ("Fields for " + agent. import lotus.Vector getFields() throws NotesException Example: Fields property This agent prints the names of all the fields in the form specified as the agent comment.getForm(agent.out.getAgentContext().getComment()).println ("No fields for " + agent.Form class Syntax public java.*.Vector.out. Volume 3: JavaScript Classes .out. Form form = db. Database db = agentContext. if (fields.getComment()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().util.util. AgentContext agentContext = session.println (" " + fields.getComment()).printStackTrace(). The contents of the $FormUsers field. Defined in Form Data type Vector. // (Your code goes here) Agent agent = agentContext.size(). } else System. j<fields.size() != 0) { System. import java.

setFormUsers(users).println ("No $FormUsers for " + form.util. form. for (int j=0. // (Your code goes here) Agent agent = agentContext.domino.util.getUserName()).util.out.out.getName()). import java. j<users. if (users.printStackTrace().getName()). Form form = db.getForm(agent.getUserName() + " added"). Database db = agentContext. } catch(Exception e) { e.Vector getFormUsers() throws NotesException public void setFormUsers(java.addElement(session.println (session.println ("$FormUsers for " + form.Vector users) throws NotesException Example: FormUsers property This agent prints the contents of $FormUsers for the form specified as the agent comment. then adds the current user’s name. AgentContext agentContext = session.*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Form class Syntax public java.size() != 0) { System.size().getCurrentDatabase(). System. } } } Chapter 10: Java Classes A–Z 1991 .getAgentContext().out.getComment()).elementAt(j)).out.getCurrentAgent(). users. j++) System. import lotus.println (" " + users. } else System.getFormUsers(). Vector users = form.Vector.

getCurrentDatabase().getForm(agent. } } catch(Exception e) { e.domino. Protects $Readers items from being overwritten by replication. Defined in Form Data type boolean Syntax public boolean isProtectReaders() throws NotesException public void setProtectReaders(boolean flag) throws NotesException Legal values true to protect $Readers false to not protect $Readers Example: IsProtectReaders property This agent toggles protection for $Readers in the form specified as the agent comment. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Form class IsProtectReaders property Read-write.printStackTrace(). Volume 3: JavaScript Classes .isProtectReaders()) { form.setProtectReaders(true). Form form = db.println ("Protect readers set for " + form. // (Your code goes here) Agent agent = agentContext.getComment()).getCurrentAgent(). if (form.out.setProtectReaders(false). import lotus. AgentContext agentContext = session. } else { form.getName()).getName()). System. System. Database db = agentContext.println ("Protect readers cleared for " + form.*.getAgentContext(). } } } 1992 Domino Designer Programming Guide.out.

System.getCurrentDatabase(). Defined in Form Data type boolean Syntax public boolean isProtectUsers() throws NotesException public void setProtectUsers(boolean flag) throws NotesException Legal values true to protect $FormUsers false to not protect $FormUsers Example: IsProtectUsers property This agent toggles protection for $FormUsers in the form specified as the agent comment. if (form.printStackTrace().setProtectUsers(false). Database db = agentContext.domino.getForm(agent. System. } } catch(Exception e) { e.*.Form class IsProtectUsers property Read-write.out.println ("Protect users cleared for " + form.isProtectUsers()) { form.out.println ("Protect users set for " + form.getCurrentAgent().setProtectUsers(true). import lotus.getName()).getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Protects $FormUsers items from being overwritten by replication.getComment()).getName()). } else { form. Form form = db. AgentContext agentContext = session. // (Your code goes here) Agent agent = agentContext. } } } Chapter 10: Java Classes A–Z 1993 .

out.size().out. i<forms.getAgentContext().getTitle() + "\":"). boolean gotOne = false.isSubForm()) { System. Defined in Form Data type boolean Syntax public boolean isSubForm() throws NotesException Legal values true if the form is a subform false if the form is not a subform Example: IsSubForm property This agent prints the names of all the subforms in the current database.util.Vector. i++) { Form form = (Form)forms. import java.out.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace(). System. Volume 3: JavaScript Classes .*. Vector forms = db. Indicates if a form is a subform. for (int i=0. if (form.getName()). AgentContext agentContext = session. } catch(Exception e) { e.Form class IsSubForm property Read-only.println ("Subforms in \"" + db.getForms(). }} if (!gotOne) System. if (!gotOne) gotOne = true.println(" No subforms"). } } } 1994 Domino Designer Programming Guide.elementAt(i). // (Your code goes here) Database db = agentContext.println (" " + form. import lotus.getCurrentDatabase().

out. System. Use the Aliases property to return any additional names.printStackTrace().util. System.*. Vector forms = db. import lotus.getTitle() + "\" has " + forms.size().getCurrentDatabase().getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext. i++) { Form form = (Form)forms.Form class Name property Read-only. } } } Chapter 10: Java Classes A–Z 1995 . AgentContext agentContext = session. } } catch(Exception e) { e.out.elementAt(i).size() + " forms:"). The name of a form.Vector. i<forms. import java.domino. Example: Name property This agent prints the names of all the forms in the current database. for (int i=0.getName()). Defined in Form Data type String Syntax public String getName() throws NotesException Usage This property returns the first name associated with a form.println ("\"" + db.getForms().println (" " + form.

AgentContext agentContext = session.out.util.getAgentContext().util.getComment()). Volume 3: JavaScript Classes .Form class Parent property Read-write.size() != 0) { System. Defined in Form Data type Database Syntax public Database getParent() throws NotesException Readers property Read-write.println 1996 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getForm(agent. Defined in Form Data type java. // (Your code goes here) Agent agent = agentContext.domino. then adds the current user’s name. The contents of the $Readers field.getCurrentAgent().getCurrentDatabase(). import java.util.Vector. Vector readers = form. The database that contains a form.Vector readers) throws NotesException Example: Readers property This agent prints the contents of $Readers for the form specified as the agent comment. import lotus.*.Vector getReaders() throws NotesException public void setReaders(java.util. Database db = agentContext.Vector.getReaders(). if (readers. Form form = db. elements are String Syntax public java.

} catch(Exception e) { e. } else System. } } } Chapter 10: Java Classes A–Z 1997 . System.getUserName() + " added"). } } } remove method Permanently deletes a form from a database. if (agent.out. Defined in Form Syntax public void remove() throws NotesException Example: remove method This agent removes the form specified by agent comment from the current database.getForm(agent. form.elementAt(j)). // (Your code goes here) Agent agent = agentContext.getName()).getCurrentAgent().*.println (session. form. readers. AgentContext agentContext = session.size().out.getCurrentDatabase().println (agent.println ("No $Readers for " + form. System.println (" " + readers. j++) System.getName()).printStackTrace().out.domino.getComment() != null) { Form form = db.getComment()).printStackTrace().Form class ("$Readers for " + form.getUserName()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out. for (int j=0.addElement(session. import lotus. Database db = agentContext.getAgentContext().setReaders(readers).remove().getComment() + " removed from database"). } } catch(Exception e) { e. j<readers.

Syntax public class International extends Base Containment Contained by: Session Properties AMString through getAMString CurrencyDigits through getCurrencyDigits CurrencySymbol through getCurrencySymbol DateSep through getDateSep DecimalSep through getDecimalSep IsCurrencySpace through isCurrencySpace IsCurrencySuffix through isCurrencySuffix IsCurrencyZero through isCurrencyZero IsDateDMY through isDateDMY IsDateMDY through isDateMDY IsDateYMD through isDateYMD IsDST through isDST IsTime24Hour through isTime24Hour Parent through getParent PMString through getPMString ThousandsSep through getThousandsSep TimeSep through getTimeSep 1998 Domino Designer Programming Guide. these settings represent the session’s server. When settings change in the operating environment.International class International class Represents the international settings in the operating environment. For remote (IIOP) operations. Notes recognizes the new settings immediately. for example. the Regional Settings in the Windows Control Panel. Volume 3: JavaScript Classes .

println("No exceptions").println("Decimal separator is " + inat.International class TimeZone through getTimeZone Today through getToday Tomorrow through getTomorrow Yesterday through getYesterday Access Access an International object for the current session through getInternational in Session. } if (inat.getCurrencySymbol()).out. if (!inat. except = true.println("Time is 24-hour").getDecimalSep().equals("$")) { System.getCurrencySymbol().equals(".println("Currency symbol is " + inat. // (Your code goes here) boolean except = false. International inat = session.out.out.getDecimalSep()). } } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). except = true. except = true. AgentContext agentContext = session.")) { System. } } } Chapter 10: Java Classes A–Z 1999 . Example: International class This agent examines three international settings and displays a setting’s value if it deviates from what the agent considers standard.*. } if (!inat.isTime24Hour()) { System.domino.out.getAgentContext().getInternational(). } if (!except) { System.printStackTrace(). import lotus.

else { System. The string that denotes AM time.println("Time format is 12-hour").domino. System.International class AMString property Read-only. isDST. System.getAgentContext().*. System.println("Time zone is " + inat.out.println("Time format is 24-hour"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). and TimeZone properties This agent displays international time settings: 24-hour or 12-hour.getPMString() + "\""). if (inat.out. if (inat.isDST()) System.getTimeSep() + "\""). import lotus.out.out.out. for example.println("Time reflects daylight-saving"). and the time zone.getInternational(). isTime24Hour. “AM” in English. // (Your code goes here) International inat = session. TimeSep. AgentContext agentContext = session. } System.println("Time separator is \"" + inat.getTimeZone()). Defined in International Data type String Syntax public String getAMString() throws NotesException Example: AMString. the hour-minute-second separator.isTime24Hour()) System.out. Volume 3: JavaScript Classes . PMString.out. the AM and PM strings. for 12-hour.getAMString() + "\""). 2000 Domino Designer Programming Guide.println("PM notation is \"" + inat.println("AM notation is \"" + inat.

for example.International class else System.println( "Time does not reflect daylight-saving"). Indicates the number of decimal digits for number format. The symbol that indicates a number is currency.printStackTrace().String Syntax public String getCurrencySymbol() throws NotesException Chapter 10: Java Classes A–Z 2001 . } } } CurrencyDigits property Read-only. Defined in International Data type Object of type java.out. the dollar sign.lang. } catch(Exception e) { e. Defined in International Data type int Syntax public int getCurrencyDigits() throws NotesException CurrencySymbol property Read-only.

printStackTrace(). Volume 3: JavaScript Classes .out.out. IsCurrencySpace. AgentContext agentContext = session.println ("Currency symbol does not follow number").println("Currency symbol is \"" + inat.*. whether a space is between the currency symbol and the number.println ("No space between currency symbol and number").getCurrencySymbol() + "\"").International class Example: CurrencySymbol. else System. days. Defined in International Data type String 2002 Domino Designer Programming Guide. for example. if (inat.println ("Currency symbol follows number").out. The character used to separate months.isCurrencySpace()) System. else System. } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } } DateSep property Read-only. whether the currency symbol follows the number. and IsCurrencySuffix properties The following agent displays the currency international settings: the currency symbol. and years. // (Your code goes here) International inat = session.isCurrencySuffix()) System.out.println ("Space between currency symbol and number").getAgentContext(). System. the slash.out.domino. if (inat.getInternational(). import lotus.

isDateMDY. or YMD.out. } } } Chapter 10: Java Classes A–Z 2003 . the month-day-year separator.out.getInternational().domino.out. if (inat. Tomorrow.println ("Format of date is \"DMY\""). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). the keywords for yesterday.getAgentContext(). System.println ("Date separator is \"" + inat. " + inat. " + inat. System.isDateDMY()) System. if (inat.out.printStackTrace(). today.International class Syntax public String getDateSep() throws NotesException Example: DateSep.println ("Text of date keywords: " + inat.getToday() + ". if (inat. Today. } catch(Exception e) { e. isDateYMD.out.getYesterday() + ". isDateDMY. and Yesterday properties This agent displays the date international settings: whether the date format is DMY. MDY.*.println ("Format of date is \"YMD\"").isDateMDY()) System. AgentContext agentContext = session. and tomorrow. import lotus. // (Your code goes here) International inat = session.println ("Format of date is \"MDY\"").isDateYMD()) System.getDateSep() + "\"").getTomorrow()).

The decimal separator for number format. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.out. Defined in International Data type String Syntax public String getDecimalSep() throws NotesException Example: DecimalSep.getCurrencyDigits()). if (inat.getDecimalSep() + "\""). the 1000s separator.println ("1000s separator: \"" + inat.out. System. // (Your code goes here) International inat = session.println("Leading zero").println ("Decimal separator: \"" + inat. the decimal separator (between the whole and fraction parts).getAgentContext().out.println("No leading zero").getInternational().out. import lotus.printStackTrace(). AgentContext agentContext = session. for example. } } } 2004 Domino Designer Programming Guide.domino. else System. System. the decimal point.*. and whether a zero precedes the decimal point if the number is a fraction (no whole part). isCurrencyZero.International class DecimalSep property Read-only. Volume 3: JavaScript Classes . and ThousandsSep properties This agent displays the decimal international settings: the number of decimal (fraction) digits.getThousandsSep() + "\"").isCurrencyZero()) System. System. } catch(Exception e) { e. CurrencyDigits.println ("Number of decimal digits: " + inat.

Indicates if the currency format has a space between the currency symbol and the number. Defined in International Data type boolean Syntax public boolean isCurrencySuffix() throws NotesException Legal values true if the currency symbol follows the number false if the currency symbol precedes the number Chapter 10: Java Classes A–Z 2005 .International class IsCurrencySpace property Read-only. Indicates if the currency symbol follows the number in the currency format. IsCurrencySuffix property Read-only. Defined in International Data type boolean Syntax public boolean isCurrencySpace() throws NotesException Legal values true if the currency format has a space between the currency symbol and the number false if the currency format does not have a space between the currency symbol and the number Usage Under UNIX. this property is derived from the language installed on the machine as indicated by the LANG environment variable.

Defined in International Data type boolean Syntax public boolean isCurrencyZero() throws NotesException Legal values true if fractions have a zero before the decimal point false if fractions do not have a zero before the decimal point Usage Under UNIX. Volume 3: JavaScript Classes . IsDateDMY property Read-only. Defined in International Data type boolean Syntax public boolean isDateDMY() throws NotesException Legal values true if the order of the date format is day-month-year false if the order of the date format is not day-month-year 2006 Domino Designer Programming Guide. Indicates if fractions have a zero before the decimal point in number format. this property is meaningless.International class IsCurrencyZero property Read-only. Indicates if the order of the date format is day-month-year.

Indicates if the order of the date format is year-month-day. Defined in International Data type boolean Syntax public boolean isDateMDY() throws NotesException Legal values true if the order of the date format is month-day-year false if the order of the date format is not month-day-year IsDateYMD property Read-only. Indicates if the order of the date format is month-day-year. Defined in International Data type boolean Syntax public boolean isDateYMD() throws NotesException Legal values true if the order of the date format is year-month-day false if the order of the date format is not year-month-day Chapter 10: Java Classes A–Z 2007 .International class IsDateMDY property Read-only.

Indicates if the time format is 24-hour. Defined in International Data type boolean Syntax public boolean isDST() throws NotesException Legal values true if the time format reflects daylight savings time false if the time format does not reflect daylight savings time IsTime24Hour property Read-only. Indicates if the time format reflects daylight savings time. Defined in International Data type boolean Syntax public boolean isTime24Hour() throws NotesException Legal values true if the time format is 24-hour false if the time format is 12-hour 2008 Domino Designer Programming Guide. Volume 3: JavaScript Classes .International class IsDST property Read-only.

printStackTrace(). for example.getUserName()). } } } PMString property Read-only. AgentContext agentContext = session.International class Parent property Read-only.*. “PM” in English.out. } catch(Exception e) { e.println("Parent user name = " + inat. The Notes session that contains an International object. import lotus. System. The string that denotes PM time. // (Your code goes here) International inat = session.getInternational().domino.getParent().getAgentContext(). Defined in International Data type Session Syntax public Session getParent() throws NotesException Example: Parent property This agent displays the user name for the parent session. Defined in International Data type String Syntax public String getPMString() throws NotesException Chapter 10: Java Classes A–Z 2009 . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

Volume 3: JavaScript Classes . but not all. minutes. An integer representing the time zone. the comma. May be positive or negative.International class ThousandsSep property Read-only. for example. Defined in International Data type String Syntax public String getTimeSep() throws NotesException TimeZone property Read-only. The character used to separate hours. and seconds. Defined in International 2010 Domino Designer Programming Guide. Defined in International Data type String Syntax public String getThousandsSep() throws NotesException TimeSep property Read-only. The thousands separator in number format. for example. the colon. this integer indicates the number of hours that must be added to the time to get Greenwich Mean Time. In many cases.

The string that means tomorrow in a time-date specification. Defined in International Data type String Syntax public String getToday() throws NotesException Tomorrow property Read-only. “Tomorrow” in English. for example.International class Data type int Syntax public int getTimeZone() throws NotesException Today property Read-only. for example. “Today” in English. Defined in International Data type String Syntax public String getTomorrow() throws NotesException Chapter 10: Java Classes A–Z 2011 . The string that means today in a time-date specification.

Item class Yesterday property Read-only. “Yesterday” in English. Syntax public class Item extends Base Derived Classes RichTextItem inherits from Item class. Containment Contained by: Document Contains: DateTime Properties DateTimeValue through getDateTimeValue and setDateTimeValue IsAuthors through isAuthors and setAuthors IsEncrypted through isEncrypted and setEncrypted IsNames through isNames and setNames IsProtected through isProtected and setProtected 2012 Domino Designer Programming Guide. Volume 3: JavaScript Classes . Defined in International Data type String Syntax public String getYesterday() throws NotesException Item class Represents a discrete value or set of values in a document. the Subject field displays the Subject item). for example. regardless of what form is used to display the document in the user interface. When a field on a form and an item in a document have the same name. the field displays the item (for example. The client interface displays items in a document through fields on a form. All items in a document are accessible programmatically. The string that means yesterday in a time-date specification.

use copyItemToDocument. Chapter 10: Java Classes A–Z 2013 . Use replaceItemValue unless your intent is to create another item with the same name (not recommended). but creates another item of the same name if the specified item exists. or replaceItemValue in Document. To create a new Item object from one that already exists. use replaceItemValue in Document. copyItem.Item class IsReaders through isReaders and setReaders IsSaveToDisk through isSaveToDisk and setSaveToDisk IsSigned through isSigned and setSigned IsSummary through isSummary and setSummary LastModified through getLastModified Name through getName Parent through getParent Text through getText Type through getType ValueDouble through getValueDouble and setValueDouble ValueInteger through getValueInteger and setValueInteger ValueLength through getValueLength Values through getValues and setValues ValueString through getValueString and setValueInteger Methods abstractText appendToTextList containsValue copyItemToDocument remove Creation To create a new Item object: To create a new Item object from scratch. The method appendItemValue also creates an item.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The document won’t display the new item in the user interface unless there is a field of the same name on the form used to display the document. use getItems in Document. all of your changes to an Item object are lost. If you don’t call save before the program finishes. // (Your code goes here) Database db = agentContext.createDocument(). import lotus. import java. To create a new item or set an item’s value. To access all the items in a document. Explicitly call setSummary and specify true if you want the value to be displayed in a view or folder. Saving Changes After you create or modify an item. Document has methods to access items without creating an Item object.*. use getItemValue.getAgentContext(). use hasItem. To get an item’s value. Document doc = db. use getFirstItem in Document. To check for the existence of a particular item in a document. You need to know is the name of the item. use removeItem. Volume 3: JavaScript Classes . Example: Item class This agent creates a document with items of various types.getCurrentDatabase(). use replaceItemValue. AgentContext agentContext = session. you must save the changes by calling the parent document’s save method. To delete an item from a document.Item class You must call save on the document if you want the modified document to be saved to disk.Vector. Rich-text items RichTextItem inherits the properties and methods of Item and has additional properties and methods you can use to manipulate rich-text. 2014 Domino Designer Programming Guide.util. Access To access an existing Item object: To access an item when you know its name.domino.

replaceItemValue("Subject". authorsItem.. } } } Chapter 10: Java Classes A–Z 2015 . textListItem.addElement("Foot").setValueString("South America"). textListItem.").setSummary(true). dt. Item textListItem = doc.replaceItemValue("numberItem". v2.setSummary(true). null). authorsItem. } catch(Exception e) { e. v. // Save the document doc. numberItem. // Create multi-value text item explicitly specifying //data type Vector v = new Vector().replaceItemValue("authorsItem". textItem. // Create numeric item explicitly specifying data type Item numberItem = doc.. numberItem.replaceItemValue("textListItem". v.Item class // Create text item with implied data type doc.setValueDouble(98).setValues(v2).save(true. authorsItem.replaceItemValue("textItem". null). // Create date-time item explicitly specifying data type Item dateTimeItem = doc.setSummary(true). DateTime dt = session. dateTimeItem. true). v2. // Create authors item explicitly specifying data type Vector v2 = new Vector(). dateTimeItem. null).addElement("Pierre Singer"). v.addElement("Train"). textItem. null).setNow().createDateTime("").setDateTimeValue(dt).printStackTrace(). "Creating items .setValues(v).replaceItemValue("dateTimeItem".addElement("Mariko Nakamura"). null).addElement("Bicycle").setSummary(true). Item authorsItem = doc.setSummary(true). // Create text item explicitly specifying data type Item textItem = doc.setAuthors(true).

returns null. Volume 3: JavaScript Classes .Item class DateTimeValue property Read-write. 2016 Domino Designer Programming Guide. For a date-time item.TEXT for getType. returns a DateTime object representing the value of the item. Indicates whether an item is of type Authors. Defined in Item Data type DateTime Syntax public DateTime getDateTimeValue() throws NotesException public void setDateTimeValue(DateTime value) throws NotesException Usage Can be set to null. An Authors item returns Item. Defined in Item Data type boolean Syntax public boolean isAuthors() throws NotesException public void setAuthors(boolean flag) throws NotesException Legal values true if the item is of type Authors false if the item is not of type Authors Usage An Authors item contains a text list of user names indicating people who have Author access to a particular document. For items of other types. IsAuthors property Read-write.

isReaders()) readers.addElement(item).printStackTrace().hasMoreElements()) { Item item = (Item)e. and IsReaders properties This agent locates the items of type Authors. System. Vector names = new Vector(). while (e.Item class Example: IsAuthors.getAllDocuments(). Vector readers = new Vector().()) authors.println("\t\t" + item.elements(). if (doc != null) { Enumeration items = doc. } } catch(Exception e) { e.nextElement().elements(). printValues("Names". Names. System.Vector.getCurrentDatabase().println(name). printValues("Readers".getAgentContext().nextElement().println("\t" + item. } Chapter 10: Java Classes A–Z 2017 . Document doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Vector authors = new Vector(). } } void printValues(String name.getItems().domino. AgentContext agentContext = session. IsNames.Enumeration.getName()). import lotus.util. if (item. authors). import java. if (item. if (item.out.hasMoreElements()) { Item item = (Item)items. readers).getFirstDocument(). and Readers in a document.isNames()) names.addElement(item).*.addElement(item).util.getText()). DocumentCollection dc = db. // (Your code goes here) Database db = agentContext. } printValues("Authors". Vector v) { try { Enumeration e = v.out. names).out. while (items. System. import java.

} } } IsEncrypted property Read-write. and summary status of the items in a document.getAgentContext(). import lotus. Defined in Item Data type boolean Syntax public boolean isEncrypted() throws NotesException public void setEncrypted(boolean flag) throws NotesException Legal values true if the item is encrypted false if the item is not encrypted Usage If you set this property to true. This agent determines the encryption. save-to-disk.getCurrentDatabase(). Examples: IsEncrypted.*. IsSaveToDisk. AgentContext agentContext = session.domino.util. the item is not actually encrypted until you call encrypt on the parent Document. import java.Enumeration. IsProtected. // (Your code goes here) Database db = agentContext.Item class } catch(Exception e) { e. and IsSummary properties 1.util. Volume 3: JavaScript Classes . import java. protection. 2018 Domino Designer Programming Guide.printStackTrace(). Indicates whether an item is encrypted. IsSigned. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Vector.

out.out.isSummary()) System.getFirstDocument(). if (item.getAllDocuments().getFirstDocument().out. import lotus.out.isSigned()) System.hasMoreElements()) { Item item = (Item)items.getAllDocuments(). Document doc = dc.println(" * summarized").domino.print(" not encrypted").print(" * not signed").getName()).print(" * protected").print("* saved to disk"). if (item. if (item.println(" * not summarized"). Document doc = dc.nextElement().out. AgentContext agentContext = session. System.isProtected()) System. else System.print(" * not saved to disk"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out. // (Your code goes here) Database db = agentContext.out. if (item.print(" * signed"). else System. while (items.getItems().isSaveToDisk()) System.Item class DocumentCollection dc = db. while (doc != null) { Chapter 10: Java Classes A–Z 2019 .print(" encrypted"). else System. } } } catch(Exception e) { e. } } } 2.printStackTrace(). else System. This agent sets encryption on for an item and encrypts the document containing it.out.out. if (doc != null) { Enumeration items = doc.out.print(" * not protected").out.elements().println(item.*. DocumentCollection dc = db. else System.getCurrentDatabase().isEncrypted()) System. if (item.getAgentContext().

TEXT for getType. doc. A Names item returns Item. true). 2020 Domino Designer Programming Guide. } } catch(Exception e) { e.getFirstItem("Body"). Defined in Item Data type boolean Syntax public boolean isNames() throws NotesException public setNames(boolean flag) throws NotesException Legal values true if the item is a Names item false if the item is not a Names item Usage A Names item contains a list of user names. if (item != null) { item.setEncrypted(true).Item class Item item = doc. Volume 3: JavaScript Classes . doc.save(true. } } } IsNames property Read-write.printStackTrace().getNextDocument().encrypt(). Indicates whether an item is a Names item. } doc = dc.

Defined in Item Data type boolean Syntax public boolean isReaders() throws NotesException public void setReaders(boolean flag) throws NotesException Chapter 10: Java Classes A–Z 2021 . you can modify it as long as you have Author access or better IsReaders property Read-write. Indicates whether a user needs at least Editor access to modify an item. Defined in Item Data type boolean Syntax public boolean isProtected() throws NotesException public void setProtected(boolean flag) throws NotesException Legal values true if you need at least Editor access to modify the item false if you do not need Editor access to modify the item.Item class IsProtected property Read-write. Indicates whether an item is of type Readers.

Item class Legal values true if the item is of type Readers false if the item is not of type Readers Usage A Readers item contains a list of user names indicating people who have Reader access to a document. it disappears from storage the next time you save the document. A Readers item returns Item. Indicates whether an item is saved when the document is saved. Defined in Item class Data type boolean Syntax public boolean isSaveToDisk() throws NotesException public void setSaveToDisk(boolean flag) throws NotesException Legal values (default) true if the item is saved when the document is saved false if the item is not saved when the document is saved Usage If you mark an existing item as not to be saved. IsSigned property Read-write. IsSaveToDisk property Read-write. Volume 3: JavaScript Classes .TEXT for getType. Indicates if an item contains a signature. Defined in Item Data type boolean 2022 Domino Designer Programming Guide.

Item class Syntax public boolean isSigned() throws NotesException public void setSigned(boolean flag) throws NotesException Legal values true if the item is signed false if the item is not signed IsSummary property Read-write. Chapter 10: Java Classes A–Z 2023 . Indicates whether an item can appear in a view or folder. isSummary for a RichTextItem always returns false. Defined in Item Data type boolean Syntax public boolean isSummary() throws NotesException public void setSummary(boolean flag) throws NotesException Legal values true if the item is a summary item false if the item is not a summary item Usage Rich text cannot appear in a view.

Volume 3: JavaScript Classes . Defined in Item Data type String Syntax public String getName() throws NotesException Usage A document may have multiple items with the same name. The date that an item was last modified. The document that contains an item. Defined in Item Data type DateTime Syntax public DateTime getLastModified() throws NotesException Name property Read-only.Item class LastModified property Read-only. Parent property Read-only. Defined in Item Data type Document 2024 Domino Designer Programming Guide. The name of an item. All file attachments have the name $FILE.

printStackTrace(). else System. Document doc = dc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getFirstItem("Subject").out.println("Parent doc is a response document"). Item item = doc.getAgentContext().*. } catch(Exception e) { e. AgentContext agentContext = session.Item class Syntax public Document getParent() throws NotesException Example: Parent property This agent demonstrates a function that gets the parent document of an item. if (doc. } } } Chapter 10: Java Classes A–Z 2025 .isResponse()) System.println("Parent doc is a main document"). } } public void parentdoc(Item i) { try { Document doc = i.domino. // (Your code goes here) Database db = agentContext. if (doc != null) parentdoc(item).printStackTrace().getCurrentDatabase(). } catch (Exception e) { e.out. import lotus.getParent(). DocumentCollection dc = db.getAllDocuments().getFirstDocument().

Volume 3: JavaScript Classes . this property skips non-text data such as bitmaps and file attachments. Type property Read-only. Usage Multiple values in a list are separated by semicolons in the returned string.Item class Text property Read-only. the returned string may be truncated. this property returns null. For HTML items. Defined in Item Data type int Syntax public int getType() throws NotesException 2026 Domino Designer Programming Guide. A plain text representation of an item’s value. For rich-text items. The data type of an item. If an item’s value is large. Defined in Item Data type String Syntax public String getText() throws NotesException public String getText(int maxlen) throws NotesException Parameters int maxlen Maximum length of returned text.

domino. Name.AUTHORS Item. Text. import lotus.EMBEDDEDOBJECT Item.ICON Item.Enumeration.NOTELINKS (link to a database.UNAVAILABLE Item.FORMULA (Domino formula) Item.READERS Item.SIGNATURE Item.NOTEREFS (reference to the parent document) Item.ERRORITEM (error occurred while getting type) Item.HTML (HTML source text) Item.util. text value.RICHTEXT Item.NAMES Item. type. public class JavaAgent extends AgentBase { public void NotesMain() { Chapter 10: Java Classes A–Z 2027 . view.USERDATA Item.*. and Authors items with: IsNames IsReaders IsAuthors Example: LastModified.util. or document) Item.USERID Usage You can also test for Names. import java. length. Readers.ATTACHMENT (file attachment) Item.DATETIMES (date-time or range of date-time values) Item.UNKNOWN Item. import java. Type.TEXT (text or text list) Item.Item class Legal values Item. and last modification date of each item in a document. and ValueLength properties This agent gets the name.OTHEROBJECT Item.Vector.NUMBERS (number or number list) Item.

2028 Domino Designer Programming Guide.READERS : type = "Readers". if (doc != null) { Enumeration items = doc.ICON : type = "Icon". AgentContext agentContext = session. case Item.EMBEDDEDOBJECT : type = "Embedded object". case Item. case Item. switch (item. while (items. break.AUTHORS : type = "Authors". break.ATTACHMENT : type = "File attachment". break. case Item. case Item. break. break.HTML : type = "HTML source text". DocumentCollection dc = db.getAgentContext(). case Item.ERRORITEM : type = "Error while accessing type". case Item. break. case Item. break.NOTEREFS : type = "Reference to the parent document". case Item.SIGNATURE : type = "Signature".QUERYCD : type = "Query CD".getType()) { case Item. String type. break.DATETIMES : type = "Date-time or range of date-times". break.NUMBERS : type = "Number or number list". case Item. case Item.OTHEROBJECT : type = "Other object".FORMULA : type = "Formula".ASSISTANTINFO : type = "Assistant information". break. break. or document". case Item. break. case Item. break. case Item.nextElement().NOTELINKS : type = "Link to database. // (Your code goes here) Database db = agentContext.getItems(). break. break.getAllDocuments(). case Item. break. Document doc = dc.LSOBJECT : type = "LotusScript object".getFirstDocument().NAMES : type = "Names". case Item.elements(). break. break. view. case Item. case Item. break.RICHTEXT : type = "Rich text". Volume 3: JavaScript Classes .getCurrentDatabase(). case Item.Item class try { Session session = getSession(). break.ACTIONCD : type = "Action CD". break.COLLATION : type = "Collation". case Item.hasMoreElements()) { Item item = (Item)items.

out. default : type = "Other". case Item.Item class case Item. break. } } } ValueDouble property Read-write. break. else System. case Item.println(item.TEXT : type = "Text or text list".out. case Item.out.out. case Item. break.printStackTrace().out.VIEWMAPDATA : type = "View map data". case Item.getLocalTime()). } } } catch(Exception e) { e.VIEWMAPLAYOUT : type = "View map layout". break. System.getText().UNKNOWN : type = "Unknown typet". break. } System. Defined in Item Data type double Chapter 10: Java Classes A–Z 2029 .USERID : type = "User ID name".USERDATA : type = "User data".println(item.println("[no text]\n").getValueLength() + " bytes"). System.println(item.getLastModified().getText(80) + "\n").println(type).UNAVAILABLE : type = "Unavailable type".length() == 0) System. The value of an item with a single numeric value.out. System. if (item.getName()). break. case Item. break.println("Last modified " + item.

or empty. this method returns the first value. date-time. The value of an item with a single numeric value. ValueLength property Read-only. this method returns 0.0. this method returns the first value. this method returns 0.Item class Syntax public double getValueDouble() throws NotesException public setValueDouble(double value) throws NotesException Usage If the item has no value or the value is text. Defined in Item Data type int Syntax public int getValueInteger() throws NotesException public setValueInteger(int value) throws NotesException Usage If the item has no value or the value is text. The bytes of internal storage. If the item has mutiple values. date-time. required to store an item. If the item has mutiple values. Defined in Item 2030 Domino Designer Programming Guide. including overhead. or empty. ValueInteger property Read-write. Volume 3: JavaScript Classes .

Values. ValueInteger.*.util.domino.util.util.*.util.Vector with DateTime elements Syntax public java.util. Examples: DateTimeValue.Item class Data type int Syntax public int getValueLength() throws NotesException Values property Read-write. This agent gets item values of various types. public class JavaAgent extends AgentBase { public void NotesMain() { Chapter 10: Java Classes A–Z 2031 . The value of an item. Authors.Vector getValues() throws NotesException public void setValues(java. import java.Vector. Item type Rich text Text (includes Names.util.Vector values) throws NotesException Usage This property returns the same value(s) for an item as getItemValue in Document.Vector with Double elements java. import lotus.Vector with String elements java.Vector with one String element rendered into plain text java. ValueDouble.util. Defined in Item Data type java. and Readers item types) Number or number list Date-time or range of date-time values Valid return type java. The data type of the value depends upon the type of the item. and ValueString properties 1.util.

// Numeric item item = doc.out. } } } catch(Exception e) { e.getValueDouble()). System.*.nextElement()). Enumeration values = item.getName()). } } } 2.getDateTimeValue().println("\n" + item.getFirstItem("textItem").println((String)values.getValueInteger()).getName()). System. Volume 3: JavaScript Classes . AgentContext agentContext = session.getFirstDocument().println("Integer value: " + item.getLocalTime()). System.*.out.println("\n" + item. // (Your code goes here) Database db = agentContext.getFirstItem("dateTimeItem"). // Multi-value text item item = doc.getValues().domino.getAgentContext().out. This agent increments a numeric item and adds a value to a multi-value text item.util. DocumentCollection dc = db. while (values. System.printStackTrace().getName()).getName()).out.getValueString()). import java.getAllDocuments(). System.hasMoreElements()) { System. if (doc != null) { // Text item Item item = doc.println( item. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.out. System. AgentContext agentContext = 2032 Domino Designer Programming Guide.out.out.Item class try { Session session = getSession(). import lotus.getCurrentDatabase(). System.out.println("\n" + item.println(item.out.println("Double value: " + item.getFirstItem("textListItem").println(item. Document doc = dc. // Date-time item item = doc.elements().getFirstItem("numberItem").

getFirstItem("textListItem"). while (values.nextElement()).getAllDocuments().out.getAgentContext().printStackTrace(). item.println("Old value: " + item. // Multi-value text item item = doc.getValues().println(item. The value that an item holds.Item class session. item.out.getFirstDocument().addElement("New value").getValues().getName()).getName()). } doc.hasMoreElements()) { System.getValueInteger() + 1). Vector v = item. // (Your code goes here) Database db = agentContext.getValueInteger()). System.getValueInteger()). Enumeration values = item.setValues(v). Defined in Item Data type String Chapter 10: Java Classes A–Z 2033 . true).println((String)values.save(true. Document doc = dc. } } catch(Exception e) { e. } } } ValueString property Read-write. System.println("New value: " + item.setValueInteger(item.out.getFirstItem("numberItem"). v. System.elements(). if (doc != null) { // Numeric item Item item = doc.out. System.println("\n" + item.out. DocumentCollection dc = db.getCurrentDatabase().

This method returns a rich-text item rendered to plain text. specify false. specify false. boolean userdict) throws NotesException Parameters int maxlen The maximum length of the abbreviation. then truncated to fit to maxlen. Return value String The contents of the item. Otherwise. If the item has multiple values. Defined in Item Syntax public String abstractText(int maxlen. this method returns an empty string. boolean userdict Specify true if you want to use the table of abbreviations in noteabbr. this method returns the first value. boolean dropvowels. Otherwise. boolean dropvowels Specify true if you want to drop vowels from the words in the item. Formatting and embedded objects are lost. Volume 3: JavaScript Classes .Item class Syntax public String getValueString() throws NotesException public setValueString(String value) throws NotesException Usage If the item has no value or the value is numeric or date-time. abstractText method Abbreviates the contents of a text item. with vowels dropped and abbreviations substituted (if specified). 2034 Domino Designer Programming Guide.txt.

} } } appendToTextList method For an item that’s a text list. adds a new value to the item without erasing any existing values.Vector values) throws NotesException Chapter 10: Java Classes A–Z 2035 .getFirstDocument(). Document doc = dc.Item class Example: abstractText method This agent generates an abstract of an item. doc = dc.domino. DocumentCollection dc = db.util.getAllDocuments(). true)).getAgentContext(). Defined in Item Syntax public void appendToTextList(String value) throws NotesException public void appendToTextList(java.println(" Body summary: " + doc. // (Your code goes here) Database db = agentContext. import lotus.out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } catch(Exception e) { e.getNextDocument(). if (doc != null) { System.out. true.println(" Subject: " + doc.abstractText(80. System.getFirstItem("Body").getCurrentDatabase(). AgentContext agentContext = session.*.printStackTrace().getItemValueString("Subject")).

getAllDocuments(). This agent appends to two String values to a text list.domino. doc.getCurrentDatabase(). 2036 Domino Designer Programming Guide.util.*. // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext.save(). Document doc = dc. import lotus. DocumentCollection dc = db.getCurrentDatabase(). java. if (doc != null) { Item item = doc.getFirstItem("textListItem").getFirstItem("textListItem"). } } catch(Exception e) { e. AgentContext agentContext = session. DocumentCollection dc = db. Document doc = dc.appendToTextList("Motorcycle").Vector.Vector values The string(s) you want to add to the item. if (doc != null) { Item item = doc. item.util. import lotus. Volume 3: JavaScript Classes . item.getAllDocuments().getFirstDocument().getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Each vector element is an object of type String.*.getAgentContext().printStackTrace().getFirstDocument(). This agent appends a Vector of two String values to a text item.Item class Parameter String value The string you want to add to the item. AgentContext agentContext = session.domino. } } } 2. import java.appendToTextList("Airplane"). Examples: appendToTextList method 1.

the distinguished name matches the common version of the hierarchical name. If value is a distinguished name. number list. or DateTime value Return Values true if the value matches one of the values in the item false if the value matches no value in the item Usage This method does not search a text item to see if it contains a specific word. It is intended to search a text list. Defined in Item Syntax public boolean containsValue(Object value) throws NotesException Parameter Object value String. Chapter 10: Java Classes A–Z 2037 .save().printStackTrace(). v. } } } containsValue method Checks whether a value matches at least one of an item’s values.Item class Vector v = new Vector().addElement("Motorcycle").appendToTextList(v). Number. and if the item contains Domino user names. or date-time range to see if one of the values in the list or range matches value. doc. item. } } catch(Exception e) { e.addElement("Airplane"). v.

getAllDocuments().appendToTextList("Motorcycle"). } } catch(Exception e) { e.containsValue("Motorcycle")) item. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). if (!item. AgentContext agentContext = session.Item class Example: containsValue method This agent appends a value to a list if the list does not already contain the value. if (!item.getCurrentDatabase(). Defined in Item Syntax public Item copyItemToDocument(Document doc) throws NotesException public Item copyItemToDocument(Document doc.getAgentContext().printStackTrace(). Volume 3: JavaScript Classes .appendToTextList("Airplane"). // (Your code goes here) Database db = agentContext. String newname) throws NotesException 2038 Domino Designer Programming Guide. } } } copyItemToDocument method Copies an item to a specified document. import java. DocumentCollection dc = db. if (doc != null) { Item item = doc. import lotus.domino. Document doc = dc.util.containsValue("Airplane")) item.Vector.getFirstDocument().*.domino.save().getFirstItem("textListItem"). doc. import lotus.*.

getFirstDocument(). } } catch(Exception e) { e. import lotus. Item item = doc.getAllDocuments(). item. import java. import lotus. if (doc != null) { Document newdoc = db.printStackTrace(). true).copyItemToDocument(newdoc).copyItemToDocument(newdoc.Item class Parameters Document doc The document on which to create the item.util. and object links that are contained within the rich-text item are not copied to the destination document.Vector.*.*. item. DocumentCollection dc = db. Document doc = dc. item = doc. Specify an empty string (“”) if you want to keep the name of the original item. newdoc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. // (Your code goes here) Database db = agentContext.domino.getFirstItem("Body"). String newname The name of the new item. Usage When you call this method using a RichTextItem object. } } } Chapter 10: Java Classes A–Z 2039 .getCurrentDatabase(). AgentContext agentContext = session.createDocument().domino. embedded objects. Return value Item The new item. file attachments. Cannot be null.getAgentContext().getFirstItem("Subject").domino.save(true. "BodyPrototype").*. Example: copyItemToDocument method This agent copies two items from an existing document to a new document. renaming one of them.

true).getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*. Document doc = dc. you must call save in Document to save the change. AgentContext agentContext = session.getFirstDocument(). } } catch(Exception e) { e. while (doc != null) { if (doc. Defined in Item Syntax public void remove() throws NotesException Usage After calling remove. item.getAllDocuments().Item class remove method Permanently deletes an item from a document.getAgentContext().remove(). Volume 3: JavaScript Classes .printStackTrace(). } } } 2040 Domino Designer Programming Guide. DocumentCollection dc = db.hasItem("BodyPrototype")) { Item item = doc. } doc = dc.save(true. Example: remove method This agent removes an item from all documents in a database. // (Your code goes here) Database db = agentContext. import lotus. doc. You can achieve the same result with removeItem in Document.domino.getFirstItem("BodyPrototype").getNextDocument().

You can record actions and errors in: A Domino database A mail memo A file (for programs that run locally) An agent log (for agents) Syntax public class Log extends Base Containment Contained by: Session Properties IsLogActions through isLogActions and setLogActions IsLogErrors through isLogErrors and setLogErrors IsOverwriteFile through isOverwriteFile and setOverwriteFile NumActions through getNumActions NumErrors through getNumErrors Parent through getParent ProgramName through getProgramName and setProgramName Methods close logAction logError logEvent openAgentLog openFileLog openMailLog openNotesLog Chapter 10: Java Classes A–Z 2041 .Log class Log class Enables you to record actions and errors that take place during a program’s execution.

addElement(session. // (Your code goes here) Log log = session.domino. } catch(Exception e) { e. To log to a file (only available to programs running locally). use createLog in Session. To log to a mail memo.*.util. AgentContext agentContext = session.Vector. use openNotesLog.createLog("Checkup Agent"). use logAction. Vector v = new Vector(). } } } 2042 Domino Designer Programming Guide. use openMailLog. import java. This agent opens a mail log and sends it to the current user when the log closes. Usage Once you create a log. v. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().close().openMailLog(v. import lotus. "Log for checkup agent"). log. you use one of the following methods to open it before you begin logging: To log to a database.getUserName()). To log an error. You must explicitly log each action and error using the following methods: To log an action. Examples: Log class 1.printStackTrace(). log. To log to an agent log (only available to agents).getAgentContext().Log class Creation To create a new log. Volume 3: JavaScript Classes . Domino does not automatically log actions or errors for you. use openAgentLog. use openFileLog. use logError.

Log log = session.getCurrentDatabase().Log class 2.domino. log. Vector v = new Vector().getCurrentAgent().createLog("Cleansing Agent"). "Log for cleansing agent").openMailLog(v. AgentContext agentContext = session.printStackTrace(). } catch(Exception e) { e.getCurrentDatabase(). This agent opens a mail log. if (view==null) { log. } log. for (int j=0.getUserName()). Chapter 10: Java Classes A–Z 2043 . "Unable to find view foo"). import lotus. "agentlog. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). View view = db. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().logError(0.openNotesLog(null. // (Your code goes here) Agent agent = agentContext. j<dc.getAgentContext().getAllDocuments(). Database db = agentContext. Database db = agentContext. logs an action for each document in the current database.logAction("Processed document " + (j+1)).*. This example opens a Domino log and logs an error. The database agentlog.createLog( db.addElement(session.getTitle() + " on " + db.nsf"). and sends the log to the current user when the log closes. DocumentCollection dc = db. v.getView("foo"). } } } 3.close(). // (Your code goes here) Log log = session. import java.util. j++) { log.close().Vector. log. } log.*.getAgentContext().nsf must be based on the StdR4AgentLog template.getCount().domino. import lotus.getServer()).

Volume 3: JavaScript Classes . "Here's your log").addElement(session.*. log.createLog("Turning actions on and off"). } } } IsLogActions property Read-write. 2044 Domino Designer Programming Guide. // (Your code goes here) Log log = session. import java. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. Indicates if action logging is enabled or not. Vector v = new Vector(). Defined in Log Data type boolean Syntax public boolean isLogActions() throws NotesException public void setLogActions(boolean flag) throws NotesException Return Values true (default) enables action logging false disables action logging Usage The logAction method has no effect while the logActions property is false. Example: IsLogActions property This agent disables and enables the action logging.util.printStackTrace().getAgentContext().domino.getUserName()).openMailLog(v.Vector. v.Log class } catch(Exception e) { e.setLogActions(false). AgentContext agentContext = session. log.

createLog("Turning actions on and off"). Chapter 10: Java Classes A–Z 2045 . Defined in Log Data type boolean Syntax public boolean isLogErrors() throws NotesException public void setLogErrors(boolean flag) throws NotesException Return Values true (default) enables error logging false disables error logging Usage The logError method has no effect while the IsLogErrors property is false. import lotus.setLogActions(true).logAction("This action does not get logged").getAgentContext(). Example: IsLogErrors property This agent disables and enables error logging. } } } IsLogErrors property Read-write.printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Log log = session.Log class log.*. log.logAction("This action does get logged").domino. } catch(Exception e) { e.close(). Indicates if error logging is enabled or not.util. log. AgentContext agentContext = session.Vector. log. import java.

openMailLog(v. indicates if the log should write over the existing file or append to it. The existing contents of the file are removed before any actions or errors are logged. This property has no effect on logs that record to a mail message or database. import lotus. public class JavaAgent extends AgentBase { 2046 Domino Designer Programming Guide.logError(0. This agent opens the over. Defined in Log Data type boolean Syntax public boolean isOverwriteFile() throws NotesException public void setOverwriteFile(boolean flag) throws NotesException Legal values true writes over the existing log file false (default) appends to the existing log file Usage To write over an existing log file.close().Log class Vector v = new Vector(). Volume 3: JavaScript Classes . "This error does not get logged"). you must set this property to true before calling the openFileLog method. "Here's your log").addElement(session. } catch(Exception e) { e. "This error does get logged"). log. log. log.*. log. } } } IsOverwriteFile property Read-write. log.getUserName()).txt file for logging.printStackTrace().setLogErrors(false).setLogErrors(true). v. log. Examples: IsOverwriteFile property 1.logError(0.domino. For a log that records to a file.

DateTime nowDateTime = session.openFileLog("over. if (daysSinceRun > 7) log.Log class public void NotesMain() { try { Session session = getSession().setOverwriteFile(true). import lotus.timeDifference(lastRun) / 86400. log. // (Your code goes here) Log log = session. nowDateTime.createDateTime(""). int daysSinceRun = nowDateTime.domino.printStackTrace().setNow().logAction("Logged an action").setOverwriteFile(false). This agent sets the IsOverwriteFile property to true if the agent last ran over seven days ago.setOverwriteFile(true).*.printStackTrace(). AgentContext agentContext = session. } catch(Exception e) { e.logAction("Logged an action").getAgentContext(). it sets the IsOverwriteFile property to false. log. } } } 2.log"). else log. log.openFileLog("over.createLog("Overwrite file"). AgentContext agentContext = session. } catch(Exception e) { e.getLastRun(). DateTime lastRun = agentContext. // (Your code goes here) Log log = session.createLog("Overwrite file").log"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } } Chapter 10: Java Classes A–Z 2047 .getAgentContext(). log. log. If the agent last ran within the last seven days.

getUserName()).createLog("Counting actions").*.close().logAction("Action number " + log. "Here's your log"). v.getAgentContext().printStackTrace(). Volume 3: JavaScript Classes .logAction("Action number " + log.getNumActions()). Vector v = new Vector(). AgentContext agentContext = session. import lotus. log.Log class NumActions property Read-only. log. log.getNumActions()). import java.Vector. Defined in Log Data type int Syntax public int getNumActions() throws NotesException Example: NumActions property This agent prints the number of each action in the action message.util. The number of actions logged so far. log.getNumActions()).addElement(session. log. // (Your code goes here) Log log = session. } catch(Exception e) { e. } } } 2048 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().openMailLog(v.domino.logAction("Action number " + log.

getNumErrors()+1)). import lotus.close().getNumErrors()+1)).getUserName()). The number of errors logged so far. "Error number " + ( log. Vector v = new Vector(). increment getNumErrors by 1. v.logError(0.Log class NumErrors property Read-only. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace(). "Error number " + ( log. // (Your code goes here) Log log = session.util. Defined in Log Data type int Syntax public int getNumErrors() throws NotesException Usage The NumErrors property is not incremented until after logErrors is called.openMailLog(v.logError(0. log.domino. AgentContext agentContext = session. log.createLog("Counting errors"). log. } } } Chapter 10: Java Classes A–Z 2049 .logError(0. import java.getAgentContext(). "Here's your log").getNumErrors()+1)). log.*. Example: NumErrors property This agent prints the number of the error number in the log message. } catch(Exception e) { e. "Error number " + ( log.Vector.addElement(session. To get the correct count at the time of a call to logErrors. log.

println 2050 Domino Designer Programming Guide.openFileLog("progname. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). The name is the same as the name specified with createLog. AgentContext agentContext = session.String Syntax public String getProgramName() throws NotesException public void setProgramName(String name) throws NotesException Example: ProgramName property This agent prints the program name.domino.getAgentContext(). The Domino session that contains a Log object. import lotus.out. Defined in Log Data type Object of type java.createLog("Program name file").*. The name that identifies the agent whose actions and errors you’re logging. log. System. // (Your code goes here) Log log = session. Volume 3: JavaScript Classes .lang.Log class Parent property Read-only.log"). Defined in Log Data type Session Syntax public Session getParent() throws NotesException ProgramName property Read-write.

getProgramName() + "\""). } catch(Exception e) { e.Vector.createLog("Checkup Agent"). // log some errors and actions log. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). the log is mailed. import java.Log class ("Program name = \"" + log. When the close method is called.addElement(session. AgentContext agentContext = session.util. Vector v = new Vector(). import lotus.domino.close(). Defined in Log Syntax public void close() throws NotesException Usage If you are logging to a mail message. "Here's your log").close(). v. log. this method sends the mail message to its recipient(s). Example: close method This agent opens and then closes a mail log.printStackTrace().getUserName()).getAgentContext().printStackTrace(). } } } close method Closes a log.openMailLog(v. } } } Chapter 10: Java Classes A–Z 2051 . log.*. // (Your code goes here) Log log = session. } catch(Exception e) { e.

*. Document [Leaves] placed in folder. along with the current date and time. Defined in Log Syntax public void logAction(String action) throws NotesException Parameter String action A description of the action. this method creates a new document in the database. if FTSearch returns a collection of three documents. Example: logAction method This agent logs actions to a mail memo. It performs a full-text search on the current database. Document [Stems] placed in folder. and logs one action for each document that matches the full-text search query.Vector.domino. If you open a mail memo using openMailLog. it adds a new line to the Body item of the mail memo. If you open a file using openFileLog.util. along with the log’s ProgramName and the current date and time. If you open a Domino database using openNotesLog. Each time the logAction method is called. Volume 3: JavaScript Classes . import lotus. the body of the mail memo looks like this: 09/14/98 01:41:51 PM 09/14/98 01:41:52 PM 09/14/98 01:41:52 PM 09/14/98 01:41:52 PM Botany Agent starting Document [Petals] placed in folder. The A$ACTION item in the document contains the description. For example. Usage The behavior of this method depends upon the type of log you open. public class JavaAgent extends AgentBase { public void NotesMain() { try { 2052 Domino Designer Programming Guide.Log class logAction method Records an action in a log. this method adds the description to the Body item of the memo. as you want it to appear in the log. import java. this method adds the description to the next line of the file.

log. DocumentCollection dc = db.putInFolder("Botanist's Delight").getCurrentDatabase(). Defined in Log Syntax public void logError(int code.addElement(session.FTSearch("botany". } log.printStackTrace().getFirstDocument(). as you want it to appear in the log.Log class Session session = getSession(). v.openMailLog(v. AgentContext agentContext = session. } } } logError method Records an error in a log. // (Your code goes here) Log log = session.close(). } catch(Exception e) { e. String text A description of the error that occurred.getAgentContext(). Database db = agentContext.getNextDocument().getItemValue("Subject") + " placed in folder.createLog("Botany Agent"). Document doc = dc. Vector v = new Vector(). Chapter 10: Java Classes A–Z 2053 .logAction("Document " + doc."). String text) throws NotesException Parameters int code A number indicating which error occurred. log.getUserName()). 0). "Log for botany agent"). while (doc != null) { doc. doc = dc.

createNewsletter(dc). this method adds the code and the description to the next line of the file. } else { Newsletter news = session.send(false. } } } 2054 Domino Designer Programming Guide. Log log = session. along with the log’s ProgramName and the current date and time.formatMsgWithDoclinks(db).log in the current Domino directory if no occurrences are found.getCurrentDatabase().Log class Usage The behavior of this method depends upon the type of log you open. "Memo"). log.FTSearch("Rocks". 0). this method adds the code and the description to the Body item of the memo.openFileLog("logerror.log"). "The Rock Report"). Document doc = news. AgentContext agentContext = session.getAgentContext(). this method creates a new document in the database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext. } } catch(Exception e) { e. import lotus. doc.getCount() == 0) { log. If you open a Domino database using openNotesLog.getUserName()). Example: logError method This agent searches for “Rocks” in the documents in the current database and logs an error message to logerror. If you open a mail memo using openMailLog. Volume 3: JavaScript Classes . if (dc. doc. If you open a file using openFileLog. "No documents found").appendItemValue("Form". DocumentCollection dc = db. session.*.logError(0.createLog("Geology Agent").appendItemValue("Subject". doc.printStackTrace().setSubjectItemName("Subject"). along with the current date and time.domino. news. The A$ERRCODE item in the document contains the code and the A$ERRMSG item contains the description.

EV_COMM Log.EV_MAIL Log.EV_SERVER Log. Defined in Log Syntax public void logEvent(String text.EV_RESOURCE Log. Domino picks a queue if you send an empty string (“”). String queue. May be any of the following: Log. int event Indicates the kind of event being logged.EV_MISC Log. Only scripts running on a server can use this method.EV_REPLICA Log. int severity) throws NotesException Parameters String text The message to send to the network. int event.EV_UPDATE Chapter 10: Java Classes A–Z 2055 .EV_UNKNOWN Log.EV_SECURITY Log.Log class logEvent method Sends a Domino event out to the network. String queue The name of the queue.EV_ALARM Log.

To display an agent log. Using the logAction or logError method has no effect on event logging. Example: openAgentLog method This agent opens the agent log and writes an action message to it. The log also displays after you run an agent with Actions . openAgentLog method Opens the agent log for the current agent. Defined in Log Syntax public void openAgentLog() throws NotesException Usage This method stores output in the log for the current agent and fails if the program is not running as an agent. select the agent and choose Agent .*. Note This method does not work for remote (IIOP) operations.domino.SEV_FAILURE Log.Log class int severity Indicates the severity of the event being logged.SEV_NORMAL Log. or mail).Run. import lotus.SEV_FATAL Log.SEV_UNKNOWN Usage This method does not affect other open logs (database.SEV_WARNING2 Log. file. Volume 3: JavaScript Classes .Log. 2056 Domino Designer Programming Guide.SEV_WARNING1 Log. May be any of the following: Log. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

} catch(Exception e) { e. } } } openFileLog method Starts logging to a file. This method returns an error if you call it on a server. Usage To write over an existing log file.getAgentContext(). log.Log class AgentContext agentContext = session.printStackTrace().logAction("Action one"). see the logAction and logError methods. If the file does not exist. the method creates it for you.createLog("Agent Log"). Chapter 10: Java Classes A–Z 2057 . the method throws an exception. Logging actions and errors For information on how actions and errors get logged to a database log. // (Your code goes here) Log log = session. log. If a directory in the path does not exist.close(). log. you must set the IsOverwriteFile property to true before calling openFileLog.openAgentLog(). Defined in Log Syntax public void openFileLog(String filepath) throws NotesException Parameter String filepath The path and file name of the log file.

domino. AgentContext agentContext = session.setOverwriteFile(true). log.createLog("Overwrite file").txt in the Domino directory. import lotus. log. } } } 2. log.log").printStackTrace(). } } } 2058 Domino Designer Programming Guide. // (Your code goes here) Log log = session. This agent opens a file called over.openFileLog("over.*.createLog("Append to file"). log.domino.logAction("Logged an action").txt in the Domino directory. } catch(Exception e) { e. // (Your code goes here) Log log = session.log"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. This agent opens a file called append. Each action and error gets appended to the file on a separate line without writing over the existing contents of the file.*. } catch(Exception e) { e.printStackTrace(). Volume 3: JavaScript Classes .getAgentContext().getAgentContext(). Each action and error gets appended to the file on a separate line after first writing over the existing contents of the file. log.openFileLog("append. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus.logAction("Logged an action").Log class Examples: openFileLog method 1.

When the close method is called. Logging actions and errors For information on how actions and errors get logged to a mail log. Log log = session.*. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. String subject The subject of the mail memo. Example: openMailLog method This agent opens a mail log.Vector recipients. // (Your code goes here) Agent agent = agentContext. the mail memo is sent to the owner of the agent with the name of the agent and the title of the database in the Subject. Defined in Log Syntax public void openMailLog(java. Usage When you call this method. or when the object is deleted.util. Note This method works only in Domino agents. Domino uses the current user’s mail database to create and send the mail memo.getCurrentAgent().Log class openMailLog method Opens a new mail memo for logging.getName()). The memo is not saved to the database.util. import java.getAgentContext(). see the logAction and logError methods.util.Vector recipients The recipients of the mail memo. Chapter 10: Java Classes A–Z 2059 . The memo is mailed when the log’s close method is called.Vector.getCurrentDatabase(). Each element is an object of type String. Database db = agentContext. String subject) throws NotesException Parameters java.domino.createLog(agent.

printStackTrace().close().openMailLog(v. agent. log. String database) throws NotesException Parameters String server The server on which the database log resides.getName() + " in " + db. Each document contains the following items: Item Form A$PROGNAME A$LOGTIME A$USER Contents “Log Entry” The ProgramName property The date and time that the error or action is logged The user at the time the error or action is logged continued 2060 Domino Designer Programming Guide. Usage One document is created in the database for each error or action that you log. } catch(Exception e) { e. v.addElement(agent. Defined in Log Syntax public void openNotesLog(String server. } } } openNotesLog method Opens a specified Domino database for logging. a database on that server if the agent runs on a server. Volume 3: JavaScript Classes .Log class Vector v = new Vector().getTitle()).getOwner()). String database The path and file name of the database. Use null or an empty string (“”) to indicate the current computer: a local database if the agent runs on a workstation. log.

Log class Item A$LOGTYPE A$ACTION A$ERRCODE A$ERRMSG Contents “Error” or “Action” A description of the action (actions only) The error code (errors only) A description of the error (errors only) The StdR4AgentLog template The StdR4AgentLog template (alog4. Opening a database An agent that runs on a server cannot open a database on a different server. Each time an action or error is logged. import lotus. log. Several agents can log to the same server and database.util.Vector. An agent that attempts to open a database to which it does not have access returns an error. import java. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If the database you specify inherits its design from this template. Logging actions and errors For information on how actions and errors get logged to a database log. An error is returned if you attempt to do so. you can use the database main view to see each of the items listed above.createLog("Database log"). "agentlog. // (Your code goes here) Log log = session.ntf) is designed to display the action and error documents that Log creates. Example: openNotesLog method This agent opens agentlog.domino. You need at least Reader access to a database to open it. a new document gets created in agentlog.close(). log. Chapter 10: Java Classes A–Z 2061 .getAgentContext().nsf on the current computer. AgentContext agentContext = session.nsf").*.logAction("Logging an action"). see the logAction and logError methods. log. the database categorizes each action and error according to the A$PROGNAME item.nsf.openNotesLog(null.

printStackTrace(). Syntax public class Name extends Base Containment Contained by: AgentContext and Session Properties Abbreviated through getAbbreviated Addr821 through getAddr821 Addr822Comment1 through getAddr822Comment1 Addr822Comment2 through getAddr822Comment2 Addr822Comment3 through getAddr822Comment3 Addr822LocalPart through getAddr822LocalPart Addr822Phrase through getAddr822Phrase ADMD through getADMD Canonical through getCanonical Common through getCommon Country through getCountry Generation through getGeneration Given through getGiven Initials through getInitials IsHierarchical through isHierarchical Keyword through getKeyword Language through getLanguage Organization through getOrganization 2062 Domino Designer Programming Guide. } } } Name class Represents a user or server name. Volume 3: JavaScript Classes .Name class } catch(Exception e) { e.

println ("Abbreviated name = " + n.println ("Canonical name = " + n.getAbbreviated()). } Chapter 10: Java Classes A–Z 2063 .getUserNameObject(). Example: Name class This example displays properties of the current user name that are not null. Use getUserName and getCommonUserName in Session to get the full user name and common user name in String format.out.*. use createName in Session.getCanonical()).domino.out. public class name1 extends NotesThread { public static void main(String argv[]) { name1 t = new name1(). Usage The properties of this class can be interrogated to distinguish different elements of the name. import lotus.isHierarchical()) { System. t.start(). if (n. } public void runNotes() { try { Session s = NotesFactory. Name n = s.Name class OrgUnit1 through getOrgUnit1 OrgUnit2 through getOrgUnit2 OrgUnit3 through getOrgUnit3 OrgUnit4 through getOrgUnit4 PRMD through getPRMD Parent through getParent Surname through getSurname Creation To create a new Name object.createSession(). System. Use getUserNameList and getUserNameObject in Session to get the primary and alternate names for the current Domino user.

getGiven() != null) System.getLanguage()).println ("Organization = " + n.getPRMD()).getKeyword()). if (n.getGiven()).getOrganization() != null) System. } catch (Exception e) { e. if (n. if (n. } } } 2064 Domino Designer Programming Guide.out.println ("Generation = " + n. if (n.getOrganization()).out.println ("OrgUnit2 = " + n.println ("Surname = " + n.println ("Keyword = " + n.getInitials() != null) System. if (n. if (n.out.printStackTrace().out.getOrgUnit3() != null) System.println ("Common name = " + n.println ("OrgUnit1 = " + n.getCommon()). if (n.getKeyword() != null) System.getOrgUnit4()).getLanguage() != null) System.getADMD() != null) System.getSurname()).out.println ("OrgUnit3 = " + n.getOrgUnit3()).getGeneration()).println ("Given = " + n.out.getSurname() != null) System.getOrgUnit2() != null) System.out.println ("Initials = " + n. if (n.println ("ADMD = " + n.Name class System.out.out.out.getADMD()).out.out. if (n.println ("OrgUnit4 = " + n. if (n. if (n.getOrgUnit4() != null) System.getGeneration() != null) System.getInitials()).println ("Language = " + n. if (n.out.println ("PRMD = " + n.out.getOrgUnit2()).getOrgUnit1() != null) System. if (n.getPRMD() != null) System.getOrgUnit1()). Volume 3: JavaScript Classes .

Comment1 component of Internet address in the format based on RFC 822 Address Format Syntax.Name class Abbreviated property Read-only. Defined in Name Data type String Syntax public String getAbbreviated() throws NotesException Addr821 property Read-only. Defined in Name Data type String Syntax public String getAddr822Comment1() throws NotesException Chapter 10: Java Classes A–Z 2065 . A hierarchical name in abbreviated form. Internet address in the format based on RFC 821 Address Format Syntax. or null if the property is undefined. Defined in Name Data type String Syntax public String getAddr821() throws NotesException Addr822Comment1 property Read-only.

Defined in Name Data type String Syntax public String getAddr822LocalPart() throws NotesException 2066 Domino Designer Programming Guide. Comment3 component of Internet address in the format based on RFC 822 Address Format Syntax. Comment2 component of Internet address in the format based on RFC 822 Address Format Syntax. LocalPart component of Internet address in the format based on RFC 822 Address Format Syntax. Defined in Name Data type String Syntax public String getAddr822Comment2() throws NotesException Addr822Comment3 property Read-only.Name class Addr822Comment2 property Read-only. Defined in Name Data type String Syntax public String getAddr822Comment3() throws NotesException Addr822LocalPart property Read-only. Volume 3: JavaScript Classes .

or null if the property is undefined. A hierarchical name in canonical form. Defined in Name Data type String Syntax public String getADMD() throws NotesException Canonical property Read-only.Name class Addr822Phrase property Read-only. Defined in Name Data type String Syntax public String getCanonical() throws NotesException Chapter 10: Java Classes A–Z 2067 . or null if the property is undefined. Defined in Name Data type String Syntax public String getAddr822Phrase() throws NotesException ADMD property Read-only. Phrase component of Internet address in the format based on RFC 822 Address Format Syntax. The administration management domain name (ADMD) component of a hierarchical name (A=).

Defined in Name Data type String Syntax public String getCommon() throws NotesException Country property Read-only. “Jr. or the entire name if it is flat. or null if the property is undefined. Defined in Name Data type String Syntax public String getGeneration() throws NotesException 2068 Domino Designer Programming Guide.” or null if the property is undefined.Name class Common property Read-only. The common name component of a hierarchical name (CN=). The generation component of a hierarchical name (Q=). Volume 3: JavaScript Classes . The country component of a hierarchical name (C=). for example. Defined in Name Data type String Syntax public String getCountry() throws NotesException Generation property Read-only.

or null if the property is undefined. Indicates if a name is hierarchical. Defined in Name Data type boolean Chapter 10: Java Classes A–Z 2069 .Name class Given property Read-only. The given component of a hierarchical name (G=). or null if the property is undefined. Defined in Name Data type String Syntax public String getInitials() throws NotesException IsHierarchical property Read-only. Defined in Name Data type String Syntax public String getGiven() throws NotesException Initials property Read-only. The initials component of a hierarchical name (I=).

Returns null if the property is undefined. The following components of a hierarchical name in the order shown separated by backslashes: country\organization\organizational unit 1\organizational unit 2\organizational unit 3\organizational unit 4. Volume 3: JavaScript Classes .Name class Syntax public boolean isHierarchical() throws NotesException Legal values true if the name is hierarchical false if the name is not hierarchical Keyword property Read-only. Defined in Name Data type String Syntax public String getLanguage() throws NotesException 2070 Domino Designer Programming Guide. The language tag associated with a name. Returns null if the property is undefined. Defined in Name Data type String Syntax public String getKeyword() throws NotesException Language property Read-only.

Tunisia Arabic .Name class Usage The language tags are as follows: Tag ar ar-ae ar-bh ar-dz ar-iq ar-jo ar-kw ar-lb ar-ly ar-ma ar-om ar-qa ar-sa ar-sy ar-tn ar-ye be bg ca cs da de de-at de-ch de-li de-lu el en Language Arabic Arabic .Bahrain Arabic .Oman Arabic .Yemen Byelorussian Bulgarian Catalan Czech Danish German German .Qatar Arabic .Iraq Arabic .Saudi Arabia Arabic .Morocco Arabic .Liechtenstein German .United Arab Emirates Arabic .Jordan Arabic .Algeria Arabic .Libyan Arab Jamahiriya Arabic .Switzerland German .Austria German .Syrian Arab Republic Arabic .Lebanon Arabic .Kuwait Arabic .Luxembourg Greek English continued Chapter 10: Java Classes A–Z 2071 .

Argentina Spanish . Volume 3: JavaScript Classes .South Africa Spain (traditional collation) Spanish .Peru Spanish .Uruguay Spanish .Panama Spanish .Canada French .Guatemala Spanish .Chile Spanish .United States English .Belgium French .Name class Tag en-au en-ca en-gb en-ie en-jm en-nz en-us en-za es es-ar es-bo es-cl es-co es-cr es-do es-ec es-gt es-mx es-pa es-pe es-py es-uy es-ve et fi fr fr-be fr-ca fr-ch fr-lu Language English .Switzerland French .Venezuela Estonian Finnish French French .Mexico Spanish .Australia English .Canada English .New Zealand English .Costa Rica Spanish .Bolivia Spanish .Dominican Republic Spanish .United Kingdom English .Ecuador Spanish .Colombia Spanish .Jamaica English .Ireland English .Luxembourg continued 2072 Domino Designer Programming Guide.Paraguay Spanish .

Taiwan Chapter 10: Java Classes A–Z 2073 .Name class Tag he hr hu it it-ch ja ko lt lv mk nl no pl pl-pl pt pt-br ro ru sk sl sq sr sv th tr uk vi zh-cn zh-hk zh-sg zh-tw Language Hebrew Croatian Hungarian Italian Italian .Poland Portuguese Portuguese .Brazil Romanian Russian Slovak Slovenian Albanian Serbian Swedish Thai Turkish Ukranian Vietnamese Chinese .Singapore Chinese .China Chinese .Hong Kong Chinese .Switzerland Japanese Korean Lithuanian Latvian Macedonian Dutch Norwegian Polish Polish .

Defined in Name Data type String Syntax public String getOrgUnit1() throws NotesException OrgUnit2 property Read-only. or null if the property is undefined. The organization component of a hierarchical name (O=). Defined in Name Data type String Syntax public String getOrganization() throws NotesException OrgUnit1 property Read-only. or null if the property is undefined. The first organizational unit of a hierarchical name (OU=). The second organizational unit of a hierarchical name (OU=). or null if the property is undefined. Volume 3: JavaScript Classes .Name class Organization property Read-only. Defined in Name Data type String Syntax public String getOrgUnit2() throws NotesException 2074 Domino Designer Programming Guide.

Name class OrgUnit3 property Read-only. The Notes session that contains a Name object. or null if the property is undefined. The third organizational unit of a hierarchical name (OU=). Defined in Name Data type Session Syntax public Session getParent() throws NotesException Chapter 10: Java Classes A–Z 2075 . The fourth organizational unit of a hierarchical name (OU=). Defined in Name Data type String Syntax public String getOrgUnit4() throws NotesException Parent property Read-only. or null if the property is undefined. Defined in Name Data type String Syntax public String getOrgUnit3() throws NotesException OrgUnit4 property Read-only.

The private management domain name (PRMD) component of a hierarchical name (P=). Volume 3: JavaScript Classes . or links to. Defined in Name Data type String Syntax public String getPRMD() throws NotesException SurName property Read-only. Defined in Name Data type String Syntax public String getSurName() throws NotesException Newsletter class Document or set of documents that contains information from. The surname component of a hierarchical name (S=). Syntax public class Newsletter extends Base Containment Contained by: Session Contains: Document 2076 Domino Designer Programming Guide. several other documents.Newsletter class PRMD property Read-only. or null if the property is undefined. or null if the property is undefined.

"The Arachnid Report").getAgentContext(). doc.formatMsgWithDoclinks(db).appendItemValue("Subject". news. Use formatMsgWithDoclinks to create a new document with links to each of the documents in the collection. if (dc. Examples: Newsletter class 1. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.getCount() > 0) { Newsletter news = session. // (Your code goes here) Database db = agentContext. Usage Once you create a newsletter. Document doc = news. import lotus.updateFTIndex(true). 15).Newsletter class Properties IsDoScore through isDoScore and setDoScore IsDoSubject through isDoSubject and setDoSubject Parent through getParent SubjectItemName through getSubjectItemName and setSubjectItemName Methods formatDocument formatMsgWithDoclinks Creation To create a new Newsletter. "Memo").FTSearch("arachnid".getCurrentDatabase(). AgentContext agentContext = session.setDoSubject(true). This agent performs a full-text search on the current database and creates a newsletter.createNewsletter(dc). The agent formats a newsletter message containing a link to each matching document and sends it to the current user. db. you can: Use formatDocument to create a new document with a rendering of one of the documents in the collection. DocumentCollection dc = db. use a DocumentCollection object containing the documents you want with createNewsletter in Session.appendItemValue("Form".domino. doc. Chapter 10: Java Classes A–Z 2077 . news.setSubjectItemName("Subject").

} } } 2. doc.getCount(). The agent formats a newsletter document for each matching document and saves it in the database Reports. Database reports = session.FTSearch("arachnid". session. This agent performs a full-text search on the current database and creates a newsletter.formatDocument(reports. doc. session. "The Arachnid Report " + (j+1)). if (dc.nsf. } } } 2078 Domino Designer Programming Guide.appendItemValue("From". true).appendItemValue("Subject".printStackTrace().getAgentContext().getUserName()). AgentContext agentContext = session.getCurrentDatabase().getCount() > 0) { Newsletter news = session. "Reports"). db.Newsletter class doc.appendItemValue("Categories".getDatabase(null. doc. for (int j=0.send(false. doc.getCommonUserName()). Volume 3: JavaScript Classes . // (Your code goes here) Database db = agentContext. "reports"). } } catch(Exception e) { e. "Main Topic"). import lotus. 15). j++) { doc = news.appendItemValue("Form". j<dc.*. DocumentCollection dc = db.updateFTIndex(true).domino.createNewsletter(dc). }} } catch(Exception e) { e.save(true.printStackTrace(). Document doc. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). j+1). doc.

indicates if the newsletter includes a string describing the subject of each document. IsDoSubject property Read-write. Defined in Newsletter Data type boolean Chapter 10: Java Classes A–Z 2079 . For a newsletter document created using the formatMsgWithDoclinks method. Defined in Newsletter Data type boolean Syntax public boolean isDoScore() throws NotesException public void setDoScore(boolean flag) throws NotesException Legal values true if the newsletter includes the relevance score for each document. If a newsletter collection is unsorted. for example. This property applies only to newsletters with sorted collections. default false if the newsletter does not include relevance scores Usage This property has no effect for a newsletter document created using the formatDocument method. indicates if the newsletter includes the relevance score for each document. For a newsletter document created using the formatMsgWithDoclinks method. this property has no effect.Newsletter class IsDoScore property Read-write. a collection produced by a call to the FTSearch method in Database.

This property must be used in conjunction with the SubjectItemName property. Defined in Newsletter Data type Session Syntax public Session getParent() throws NotesException SubjectItemName property Read-write. indicates the name of the item on the documents of a newsletter that contains the text you want to use as a subject line. default false if the newsletter does not include subject lines Usage This property has no effect for a newsletter document created using the formatDocument method. Defined in Newsletter 2080 Domino Designer Programming Guide. the DoSubject property has no effect. The Domino session that contains a Newsletter object. You must set both SubjectItemName and DoSubject before calling FormatMsgWithDoclinks. For a newsletter document created using the formatMsgWithDoclinks method.Newsletter class Syntax public boolean isDoSubject() throws NotesException public void setDoSubject(boolean flag) throws NotesException Legal values true if the newsletter includes a subject line for each document. If you do not specify the SubjectItemName property. Volume 3: JavaScript Classes . Parent property Read-only.

Use 1 to indicate the first document in the collection. which displays a rendering of the forwarded document. and so on. the document is created in the user’s default mail database. formatDocument method Creates a document containing a rendering of a document in the newsletter collection. For example. if the DoSubject property is true and SubjectItemName is “Subject. int index) throws NotesException Parameters Database db The database in which to create the newsletter document. 2 to indicate the second document. the SubjectItemName property has no effect. This property must be used in conjunction with the DoSubject property. int index A number indicating the document to render. If the DoSubject property is false.Newsletter class Data type String Syntax public String getSubjectItemName() throws NotesException public void setSubjectItemName(String name) throws NotesException Usage This property has no effect for a newsletter document created using the FormatDocument method. Chapter 10: Java Classes A–Z 2081 .” then the newsletter contains the contents of each document Subject item next to the document link. If you specify this parameter as null. Defined in Newsletter Syntax public Document formatDocument(Database db. This is similar to forwarding a document. You must set both SubjectItemName and DoSubject before calling formatMsgWithDoclinks.

AgentContext agentContext = session. // (Your code goes here) Database db = agentContext. The agent formats a newsletter document for each document in the collection.createNewsletter(dc).” and makes a newsletter based on the document collection. doc.formatDocument(db.Newsletter class Return value Document A document in db. Volume 3: JavaScript Classes . doc.domino. "Memo").appendItemValue("Form". db. for (int j=0. }} } catch(Exception e) { e. you must explicitly call the save method of Document. j<dc. session. doc. Usage If you want to save the rendered document. } } } 2082 Domino Designer Programming Guide. if (dc.getCurrentDatabase(). The rendering is placed into the Body item.FTSearch("arachnid".printStackTrace(). If you want to mail the rendered document.send(false. DocumentCollection dc = db. and sends them to the current user.*.getUserName()).getCount().getAgentContext(). 15).appendItemValue("Subject". j++) { doc = news. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). j+1). Document doc. containing a rendering of the nth document in the collection. import lotus. "The Arachnid Report " + (j+1)). you must explicitly call the send method of Document.updateFTIndex(true). Example: FormatDocument method This agent makes a document collection of all the documents (up to 15) in the current database containing the word “arachnid.getCount() > 0) { Newsletter news = session.

Newsletter class

formatMsgWithDoclinks method
Creates a document that contains a link to each document in the newsletter collection. Defined in Newsletter Syntax
public Document formatMsgWithDoclinks(Database db) throws NotesException

Parameter
Database db

The database in which to create the newsletter document. If you specify this parameter as null, the document is created in the user’s default mail database. Return value
Document

A document that contains a link to each document in the newsletter collection. Usage The Body item of the returned document contains the following: The file name of the database that contains the documents in the newsletter collection. A link to each document in the newsletter collection. If the collection is sorted and the DoScore property is true, the relevance score of each document. You must set this property before calling the formatMsgWithDoclinks method. If the DoSubject property is true and the SubjectItemName property has a value, a title for each document. You must set this property before calling the formatMsgWithDoclinks method. The query that produced the newsletter collection. If you want to save the newsletter, you must explicitly call the save method of Document. If you want to mail the newsletter, you must explicitly call the send method of Document.

Chapter 10: Java Classes A–Z 2083

Newsletter class

Example: FormatMsgWithDoclinks method; IsDoScore, IsDoSubject, and SubjectItemName properties This agent makes a document collection of all documents in the current database containing the word “arachnid,” then makes a newsletter based on this document collection. The agent formats a message with links to the newsletter documents and mails it to the current user.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); db.updateFTIndex(true); DocumentCollection dc = db.FTSearch("arachnid", 0); if (dc.getCount() > 0) { Newsletter news = session.createNewsletter(dc); news.setSubjectItemName("Subject"); news.setDoSubject(true); news.setDoScore(true); Document doc = news.formatMsgWithDoclinks(db); doc.appendItemValue("Form", "Memo"); doc.appendItemValue("Subject", "The Arachnid Report"); doc.send(false, session.getUserName()); } } catch(Exception e) { e.printStackTrace(); } } }

2084 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

Outline class
Represents an outline in a database. Containment Contained by: Database Contains: OutlineEntry Properties Alias through getAlias Comment through getComment Name through getName Methods addEntry createEntry getFirst getLast getNext getNextSibling getParent getPrev getPrevSibling moveEntry removeEntry save Creation and access Create an outline with createOutline in Database. Get an existing outline object with getOutline in Database. Usage An outline supports a hierarchy of outline entries and provides methods for their navigation and manipulation.

Chapter 10: Java Classes A–Z 2085

Outline class

Examples: Outline class, Alias, Comment, and Name properties, getFirst and getNext methods, OutlineEntry class, Alias, EntryClass, IsInThisDB, IsPrivate, Label, Level, and Type properties 1. This agent gets the properties of every entry in an outline.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try Session session = getSession() AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); System.out.println("*** " + outline.getName() + " ***"); System.out.println("Alias: " + outline.getAlias()); System.out.println("Comment: " + outline.getComment()); OutlineEntry entry = outline.getFirst(); while (entry != null) { System.out.println(entry.getLabel()); if (entry.getAlias().length() > 0) System.out.println("\tAlias: " + entry.getAlias()); String type = null; switch (entry.getType()) { case OutlineEntry.OUTLINE_OTHER_FOLDERS_TYPE: type = "Other folders"; break; case OutlineEntry.OUTLINE_OTHER_VIEWS_TYPE: type = "Other views"; break; case OutlineEntry.OUTLINE_OTHER_UNKNOWN_TYPE: type = "Other unknown"; break; case OutlineEntry.OUTLINE_TYPE_ACTION: type = "Action"; break; case OutlineEntry.OUTLINE_TYPE_NAMEDELEMENT: type = "Named element"; break; case OutlineEntry.OUTLINE_TYPE_NOTELINK: type = "Note link"; break; case OutlineEntry.OUTLINE_TYPE_URL: type = "URL"; break; } System.out.println("\tType: " + type); String entryClass = null; switch (entry.getEntryClass()) { case OutlineEntry.OUTLINE_CLASS_DATABASE: entryClass = "Database"; break; 2086 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class case OutlineEntry.OUTLINE_CLASS_DOCUMENT: entryClass = "Document"; break; case OutlineEntry.OUTLINE_CLASS_FORM: entryClass = "Form"; break; case OutlineEntry.OUTLINE_CLASS_FOLDER: entryClass = "Folder"; break; case OutlineEntry.OUTLINE_CLASS_FRAMESET: entryClass = "Frame set"; break; case OutlineEntry.OUTLINE_CLASS_NAVIGATOR: entryClass = "Navigator"; break; case OutlineEntry.OUTLINE_CLASS_PAGE: entryClass = "Page"; break; case OutlineEntry.OUTLINE_CLASS_UNKNOWN: entryClass = "Unknown"; break; case OutlineEntry.OUTLINE_CLASS_VIEW: entryClass = "View"; break; } System.out.println("\tEntry class: " + entryClass); System.out.println("\tLevel: " + entry.getLevel()); if (entry.isInThisDB()) System.out.println("\tRefers to an element in this database"); else System.out.println ("\tDoes not refer to an element in this database"); if (entry.isPrivate()) System.out.println("\tEntry is private"); else System.out.println("\tEntry is public"); if (entry.getFrameText().length() > 0) System.out.println("\tFrame text: " + entry.getFrameText()); if (entry.getImagesText().length() > 0) System.out.println("\tImages text: " + entry.getImagesText()); entry = outline.getNext(entry); } } catch(Exception e) { e.printStackTrace(); } } }

Chapter 10: Java Classes A–Z 2087

Outline class

2. This agent creates an outline.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.createOutline("Some Documents"); outline.setAlias("SomeDocuments"); outline.setComment("Gives partial view of database"); outline.save(); } catch(Exception e) { e.printStackTrace(); } } }

Alias property
Read-write. Alias name of an outline for programmatic access. Defined in Outline Data type String Syntax
public String getAlias() throws NotesException public void setAlias(String value) throws NotesException

2088 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

Comment property
Read-write. An informational description of an outline. Defined in Outline Data type String Syntax
public String getComment() throws NotesException public void setComment(String value) throws NotesException

Name property
Read-write. Name of an outline. Defined in Outline Data type String Syntax
public String getName() throws NotesException public void setName(String value) throws NotesException

addEntry method
Adds an entry to an outline. Defined in Outline Syntax
public void addEntry(OutlineEntry entry, OutlineEntry referenceEntry) throws NotesException

Chapter 10: Java Classes A–Z 2089

Outline class public void addEntry(OutlineEntry entry, OutlineEntry referenceEntry, boolean after) throws NotesException public void addEntry(OutlineEntry entry, OutlineEntry referenceEntry, boolean after, boolean asChild) throws NotesException

Parameters
OutlineEntry entry

The entry being added.
OutlineEntry referenceEntry

The entry after or before which the entry being added is placed.
boolean after

True (default) to put the entry after the reference entry; false to put the entry before the reference entry.
boolean asChild

True (default) to make the entry a child of the preceding entry. If the after parameter is False and asChild parameter is True, an exception is raised. Usage You must save the outline or the effect of this method is lost when the program exits.

createEntry method
Creates an outline entry. Defined in Outline Syntax
public OutlineEntry createEntry(String entryName) throws NotesException

Parameters
String entryName

The name of the entry. Usage The new entry becomes a free entry. Use addEntry to position the new entry.
2090 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

You must save the outline or the effect of this method is lost when the program exits. Example: addEntry, createEntry, and save methods, OutlineEntry FrameText, ImagesText, and IsHidden properties, setNamedElement property This agent creates an entry as a subentry to the first entry in an outline.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.createOutline("Some Documents"); outline.setAlias("SomeDocuments"); outline.setComment("Gives partial view of database"); outline.save(); } catch(Exception e) { e.printStackTrace(); } } }

getFirst method
Gets the first entry of an outline. Defined in Outline Syntax
public OutlineEntry getFirst() throws NotesException

Return value
OutlineEntry

The first entry of the outline, or null if there are no entries.

Chapter 10: Java Classes A–Z 2091

Outline class

getLast method
Gets the last entry of an outline. Defined in Outline Syntax
public OutlineEntry getLast() throws NotesException

Return value
OutlineEntry

The last entry of the outline, or null if there are no entries. Example: getLast and getPrev methods This agent gets the entries in an outline last to first.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); System.out.println("*** " + outline.getName() + " ***"); System.out.println("ALL ENTRIES LAST TO FIRST"); OutlineEntry entry = outline.getLast(); while (entry != null) { System.out.println(entry.getLabel()); entry = outline.getPrev(entry); } } catch(Exception e) { e.printStackTrace(); } } }

2092 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

getNext method
Gets the entry immediately following a specified entry of an outline. Defined in Outline Syntax
public OutlineEntry getNext(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

An entry in the outline. Return value
OutlineEntry

The entry following the one specified as the parameter, or null if there is no next entry.

getNextSibling method
Gets the entry at the same level following a specified entry of an outline. Defined in Outline Syntax
public OutlineEntry getNextSibling(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

An entry in the outline. Return value
OutlineEntry

The entry at the same level following the one specified as the parameter, or null if there is no next sibling.

Chapter 10: Java Classes A–Z 2093

Outline class

Example: getNextSibling and getParent methods This agent gets the top-level entries in an outline.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); System.out.println("*** " + outline.getName() + " ***"); System.out.println("TOP-LEVEL ENTRIES"); OutlineEntry entry = outline.getFirst(); while (entry != null) { System.out.println(entry.getLabel()); entry = outline.getNextSibling(entry); } } catch(Exception e) { e.printStackTrace(); } } }

getParent method
Returns the parent of a specified entry. Defined in Outline Syntax
public OutlineEntry getParent(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

An entry in the outline. Return value
OutlineEntry

The parent entry of the one specified as the parameter, or null if there is no parent.

2094 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

getPrev method
Gets the entry immediately preceding a specified entry of an outline. Defined in Outline Syntax
public OutlineEntry getPrev(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

An entry in the outline. Return value
OutlineEntry

The entry preceding the one specified as the parameter, or null if there is no next entry.

getPrevSibling method
Gets the entry at the same level preceding a specified entry of an outline. Defined in Outline Syntax
public OutlineEntry getPrevSibling(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

An entry in the outline. Return value
OutlineEntry

The entry at the same level preceding the one specified as the parameter, or null if there is no next sibling.

Chapter 10: Java Classes A–Z 2095

Outline class

Example: getPrevSibling method This agent gets the top-level entries in an outline last to first.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); System.out.println("*** " + outline.getName() + " ***"); System.out.println("TOP-LEVEL ENTRIES LAST TO FIRST"); OutlineEntry entry = outline.getLast(); while (entry.getLevel() > 0) entry = outline.getParent(entry); while (entry != null) { System.out.println(entry.getLabel()); entry = outline.getPrevSibling(entry); } } catch(Exception e) { e.printStackTrace(); } } }

moveEntry method
Moves an outline entry from one location to another. Defined in Outline Syntax
public void moveEntry(OutlineEntry entry, OutlineEntry referenceEntry) throws NotesException public void moveEntry(OutlineEntry entry, OutlineEntry referenceEntry, boolean after) throws NotesException public void moveEntry(OutlineEntry entry, OutlineEntry referenceEntry, boolean after, boolean asChild) throws NotesException

2096 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Outline class

Parameters
OutlineEntry entry

The entry being moved.
OutlineEntry referenceEntry

The entry after or before which the entry being moved is placed.
boolean after

True (default) to move the entry after the reference entry; false to move the entry before the reference entry.
boolean asChild

True (default) to make the entry a child of the preceding entry. If after parameter is false, and asChild parameter is true, an exception is raised. Usage You must save the outline or the effect of this method is lost when the program exits. Moving an entry to the beginning of the outline makes it a top-level (level 0) entry. Example: moveEntry method This agent moves an entry to the beginning of the outline.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); OutlineEntry entry = outline.getFirst(); while (entry != null) { if (entry.getLabel().equals("Some Documents")) { System.out.println(entry.getLabel() + " ... is being moved"); outline.moveEntry(entry, outline.getFirst(), false); outline.save(); break; } entry = outline.getNext(entry); }

Chapter 10: Java Classes A–Z 2097

Outline class } catch(Exception e) { e.printStackTrace(); } } }

removeEntry method
Removes an entry or entries from an outline. Defined in Outline Syntax
public void removeEntry(OutlineEntry entry) throws NotesException

Parameters
OutlineEntry entry

The entry being removed. Cannot be null. Usage You must save the outline or the effect of this method is lost when the program exits. Example: removeEntry method This agent removes all entries that are not at the top level.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); int count = 0; OutlineEntry entry = outline.getFirst(); while (entry != null) { OutlineEntry thisEntry = entry; entry = outline.getNext(entry); if (thisEntry.getLevel() > 0) { System.out.println(thisEntry.getLabel() + " ... is being removed");

2098 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class outline.removeEntry(thisEntry, false); count++; } } outline.save(); System.out.println(count + " outline entries removed"); } catch(Exception e) { e.printStackTrace(); } } }

save method
Saves any changes made to the outline. Defined in Outline Syntax
public void save()

Usage You must save the outline before the program exits or the effect of a method that changes the outline is lost. These methods include addEntry, createEntry, and moveEntry.

OutlineEntry class
Represents an entry in an outline. Containment Contained by: Outline Properties Alias through getAlias and setAlias Database through getDatabase Document through getDocument EntryClass through getClass Formula through getFormula FrameText through getFrameText and setFrameText
Chapter 10: Java Classes A–Z 2099

use createEntry in Outline. Defined in OutlineEntry Data type String Syntax public String getAlias() throws NotesException public void setAlias(String value) throws NotesException 2100 Domino Designer Programming Guide. use the navigation methods in Outline. Alias property Read-write.OutlineEntry class HasChildren through hasChildren ImagesText through getImagesText and setImagesText IsHidden through isHidden and setHidden IsInThisDb through isInThisDB IsPrivate through isPrivate Label through getLabel and setLabel Level through getLevel NamedElement through getNamedElement Type through getType URL through getURL View through getView Methods setAction setNamedElement setNoteLink setURL Creation and access To create an outline entry. Name of an outline entry for programmatic access. Volume 3: JavaScript Classes . To access outline entries.

OutlineEntry class

Database property
Read-only. Database that is the resource link for an outline entry, or null. Defined in OutlineEntry Data type Database Syntax
public Database getDatabase() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_NOTELINK or OUTLINE_TYPE_NAMEDELEMENT and the entry class is OUTLINE_CLASS_DATABASE, OUTLINE_CLASS_DOCUMENT, or OUTLINE_CLASS_VIEW.

Document property
Read-only. Document that is the resource link for an outline entry, or null. Defined in OutlineEntry Data type Document Syntax
public Document getDocument() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_NOTELINK and the entry class is OUTLINE_CLASS_DOCUMENT.

Chapter 10: Java Classes A–Z 2101

OutlineEntry class

EntryClass property
Read-only. Class of outline entry. Defined in OutlineEntry Data type int Syntax
public int getEntryClass() throws NotesException

Legal values OutlineEntry.OUTLINE_CLASS_DATABASE OutlineEntry.OUTLINE_CLASS_DOCUMENT OutlineEntry.OUTLINE_CLASS_FORM OutlineEntry.OUTLINE_CLASS_FOLDER OutlineEntry.OUTLINE_CLASS_FRAMESET OutlineEntry.OUTLINE_CLASS_NAVIGATOR OutlineEntry.OUTLINE_CLASS_PAGE OutlineEntry.OUTLINE_CLASS_UNKNOWN OutlineEntry.OUTLINE_CLASS_VIEW

Formula property
Read-only. Formula of an action outline, or an empty string. Defined in OutlineEntry Data type String

2102 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class

Syntax
public String getFormula() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_ACTION.

FrameText property
Read-write. The name of the target frame for the entry’s OnClick event. Defined in OutlineEntry Data type String Syntax
public String getFrameText() throws NotesException public void setFrameText(String value) throws NotesException

HasChildren property
Read-only. Indicates whether an entry contains child entries. Defined in OutlineEntry Data type boolean Syntax
public boolean hasChildren() throws NotesException

Legal values true if the entry contains child entries false if the entry does not contain child entries

Chapter 10: Java Classes A–Z 2103

OutlineEntry class

Example: HasChildren property This agent gets all the entries in an outline. It separates the children by dropping levels through a recursive function.
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Database db = agentContext.getCurrentDatabase(); Outline outline = db.getOutline("DiscOutline"); System.out.println("*** " + outline.getName() + " ***"); OutlineEntry entry = outline.getFirst(); while (entry != null) { System.out.println(entry.getLabel()); if (entry.hasChildren()) printChild(outline, entry); entry = outline.getNextSibling(entry); } } catch(Exception e) { e.printStackTrace(); } } void printChild(Outline outline, OutlineEntry entry) { try { entry = outline.getNext(entry); String tabs = ""; for (int i=0; i<entry.getLevel(); i++) tabs = tabs + "\t"; while (entry != null) { System.out.println(tabs + entry.getLabel()); if (entry.hasChildren()) printChild(outline, entry); entry = outline.getNextSibling(entry); } } catch(Exception e) { e.printStackTrace(); } } }

2104 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class

ImagesText property
Read-write. The name of the image file used to add an icon to an entry. Defined in OutlineEntry Data type String Syntax
public String getImagesText() throws NotesException public void setImagesText(String value) throws NotesException

IsHidden property
Read-write. Indicates if an entry is hidden. Defined in OutlineEntry Data type boolean Syntax
public boolean isHidden() throws NotesException public void setHidden(boolean value) throws NotesException

Legal values true if the entry is hidden false if the entry displays in the UI

Chapter 10: Java Classes A–Z 2105

OutlineEntry class

IsInThisDB property
Read-only. Indicates if an entry refers to an element in the current database. Defined in OutlineEntry Data type boolean Syntax
public boolean isInThisDB() throws NotesException

Legal values true if the entry is in the current database false if the entry is not in the current database

IsPrivate property
Read-only. Indicates if an entry is specific to an individual. Defined in OutlineEntry Data type boolean Syntax
public boolean isPrivate() throws NotesException

Legal values true if the entry is private false if the entry is public

2106 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class

Label property
Read-write. Label (display text) for an entry. Defined in OutlineEntry Data type String Syntax
public String getLabel() throws NotesException public void setLabel(String value) throws NotesException

Level property
Read-only. The level of this entry. Defined in OutlineEntry Data type int Syntax
public int getLevel() throws NotesException

Usage Level 0 is the top level.

NamedElement property
Read-only. Named element referenced by an outline entry, or an empty string. Defined in OutlineEntry Data type String
Chapter 10: Java Classes A–Z 2107

OutlineEntry class

Syntax
public String getNamedElement() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_NAMEDELEMENT.

Type property
Read-only. Type of outline entry. Defined in OutlineEntry Data type int Syntax
public int getType() throws NotesException

Legal values OutlineEntry.OUTLINE_OTHER_FOLDERS_TYPE OutlineEntry.OUTLINE_OTHER_UNKNOWN_TYPE OutlineEntry.OUTLINE_OTHER_VIEWS_TYPE OutlineEntry.OUTLINE_TYPE_ACTION OutlineEntry.OUTLINE_TYPE_NAMEDELEMENT OutlineEntry.OUTLINE_TYPE_NOTELINK OutlineEntry.OUTLINE_TYPE_URL

URL property
Read-only. URL of an outline entry, or an empty string. Defined in OutlineEntry Data type String

2108 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class

Syntax
public String getURL() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_URL.

View property
Read-only. View that is the resource link for an outline entry, or null. Defined in OutlineEntry Data type View Syntax
public View getView() throws NotesException

Usage This property applies if the outline entry type is OUTLINE_TYPE_NOTELINK and the entry class is OUTLINE_CLASS_DOCUMENT or OUTLINE_CLASS_VIEW.

setAction method
Specifies a formula for an action outline entry. Defined in OutlineEntry Syntax
public boolean setAction(String formula) throws NotesException

Parameter
String formula

A Domino formula.

Chapter 10: Java Classes A–Z 2109

OutlineEntry class

Return value
boolean

True if the action is set successfully. Usage This method sets the outline entry type to OUTLINE_TYPE_ACTION.

setNamedElement method
Specifies a named element for an outline entry. Defined in OutlineEntry Syntax
public boolean setNamedElement(Database db, String elementName, int entryClass) throws NotesException

Parameters
Database db

The database containing the named element.
String elementName

The name of a database element.
int entryClass

The entry class to be assigned to the database element. See getEntryClass for the legal values. Return value
boolean

True if the named element is set successfully. Usage This method sets the outline entry type to OUTLINE_TYPE_NAMEDELEMENT and the entry class as specified.

2110 Domino Designer Programming Guide, Volume 3: JavaScript Classes

OutlineEntry class

setNoteLink method
Specifies a resource link for an outline entry. Defined in OutlineEntry Syntax
public boolean setNoteLink(Database db) throws NotesException public boolean setNoteLink(Document doc) throws NotesException public boolean setNoteLink(View view) throws NotesException

Parameters
Database db

A database that is the resource link.
Document doc

A document that is a resource link.
View view

A view that is a resource link. Return value
boolean

True if the link is set successfully. Usage This method sets the outline entry type to OUTLINE_TYPE_NOTELINK and the entry class to OUTLINE_CLASS_DATABASE, OUTLINE_CLASS_DOCUMENT, or OUTLINE_CLASS_VIEW depending on the particular method.

Chapter 10: Java Classes A–Z 2111

Registration class

setURL method
Specifies a URL as the resource link for an outline entry. Defined in OutlineEntry Syntax
public boolean setURL(String url) throws NotesException

Parameter
String url

A URL. Return value
boolean

True if the URL is set successfully. Usage This method sets the outline entry type to OUTLINE_TYPE_URL.

Registration class
Represents the creation or administration of an ID file. Syntax
public class Registration extends Base

Containment Contained by NotesSession class Properties CertifierIDFile property through getCertifierIDFile and setCertifierIDFile CreateMailDb property through getCreateMailDb and setCreateMailDb Expiration property through getExpiration and setExpiration IDType property through getIDType and setIDType IsNorthAmerican property through isNorthAmerican and setNorthAmerican MinPasswordLength property through getMinPasswordLength and setMinPasswordLength

2112 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Registration class

OrgUnit property through getOrgUnit and setOrgUnit RegistrationLog property through getRegistrationLog and setRegistrationLog RegistrationServer property through getRegistrationServer and setRegistrationServer StoreIDInAddressBook property through getStoreIDToAddressBook and setStoreIDToAddressBook UpdateAddressbook property through getUpdateAddressBook and setUpdateAddressBook Methods addCertifierToAddressbook method addServerToAddressbook method addUserProfile method addUserToAddressBook method crossCertify method deleteIDOnServer method getIDFromServer method getUserInfo method recertify method registerNewCertifier method registerNewServer method registerNewUser method switchToID method Creation To create a new Registration object, use the createRegistration method in Session.

Chapter 10: Java Classes A–Z 2113

Registration class

CertifierIDFile property
Read-write. The complete file specification of the certifier ID to use when creating IDs. Defined in Registration Data type String Syntax
public String getCertifierIDFile() throws NotesException public void setCertifierIDFile(String file) throws NotesException

Usage Specify the complete path, for example, c:\notes\data\cert.id.

CreateMailDb property
Read-write. Indicates whether a mail database is created with the ID file when calling registerNewUser. Defined in Registration Data type boolean Syntax
public boolean getCreateMailDb() throws NotesException public void setCreateMailDb(boolean flag) throws NotesException

Legal values True to create a mail database False to not create a mail database; it will be created during setup

2114 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Registration class

Expiration property
Read-write. The expiration date to use when creating ID files. Defined in Registration Data type DateTime Syntax
public DateTime getExpiration() throws NotesException public void setExpiration(DateTime date) throws NotesException

Usage Can be set to null.

IDType property
Read-write. The type of ID file to create when calling registerNewUser, registerNewServer, and registerNewCertifier. Defined in Registration Data type int Syntax
public int getIDType() throws NotesException public void setIDType(int type) throws NotesException

Legal Values ID_FLAT to create a flat ID ID_HIERARCHICAL to create a hierarchical ID ID_CERTIFIER to create an ID that depends on whether the certifier ID is flat or hierarchical

Chapter 10: Java Classes A–Z 2115

Registration class

IsNorthAmerican property
Read-write. indicates whether an ID file is North American. Useful when calling registerNewUser, registerNewServer, and registerNewCertifier. Defined in Registration Data type boolean Syntax
public boolean isNorthAmerican() throws NotesException public void setNorthAmerican(boolean flag) throws NotesException

Legal Values True if the ID is North American. False if the ID is not North American.

MinPasswordLength property
Read-write. The minimum number of characters required for a password in an ID file when calling registerNewUser, registerNewServer, and registerNewCertifier. Defined in Registration Data type int Syntax
public int getMinPasswordLength() throws NotesException public void setMinPasswordLength(int len) throws NotesException

Usage This property defines the minimum password length required for subsequent changes to the password by the user. The password used when the certifier is created is not restricted by the MinPasswordLength property.

2116 Domino Designer Programming Guide, Volume 3: JavaScript Classes

Registration class

OrgUnit property
Read-write. The organizational unit to use when creating ID files. Defined in Registration Data type String Syntax
public String getOrgUnit() throws NotesException public void setOrgUnit(String unit) throws NotesException

RegistrationLog property
Read-write. The log file to use when creating IDs. Defined in Registration class Data type String Syntax
public String getRegistrationLog() throws NotesException public void setRegistrationLog(String name) throws NotesException

RegistrationServer property
Read-write. The server to use when creating IDs. This property is used only when the created ID is stored in the server Domino Directory, or when a mail database is created for the new user. Defined in Registration Data type String
Chapter 10: Java Classes A–Z 2117

and registerNewCertifier. Volume 3: JavaScript Classes . Indicates whether the ID file is stored in the server’s Domino Directory. registerNewServer. Defined in Registration Data type boolean Syntax public boolean getStoreIDInAddressBook() throws NotesException public void setStoreIDInAddressBook(boolean flag) throws NotesException Legal Values True to store the ID in the Domino Directory False to not store the ID in the Domino Directory UpdateAddressbook property Read-write.Registration class Syntax public String getRegistrationServer() throws NotesException public void setRegistrationServer(String server) throws NotesException StoreIDInAddressBook property Read-write. Defined in Registration class Data type boolean 2118 Domino Designer Programming Guide. Indicates whether the server entry in the Domino Directory is updated when the ID file is created when calling registerNewUser.

addCertifierToAddressbook method Adds the certifier ID file to the Domino Directory. String password.Registration class Syntax public boolean getUpdateAddressBook() throws NotesException public void setUpdateAddressBook(boolean flag) throws NotesException Legal Values True to update the Domino Directory. for example. Return value boolean True if the operation is successful.id. Chapter 10: Java Classes A–Z 2119 . String comment The contents of the comment field in the Domino Directory record. String location The contents of the location field in the Domino Directory record. false otherwise. String comment) throws NotesException Parameters String idfile The certifer ID file to be added to the Domino Directory. False to not update the Doimino Directory. c:\notes\data\cert. String password The password for the certifier ID file. Specify the complete path. String location. Defined in Registration Syntax public boolean addCertifierToAddressBook(String idfile) throws NotesException public boolean addCertifierToAddressBook(String idfile.

Volume 3: JavaScript Classes . String network The notes named network (NNN) on which the server runs. String title. String domain The domain of the server to be added to the Domino Directory. Defined in NotesRegistration Syntax public boolean addServerToAddressBook(String idfile. String title The contents of the title field of the Domino Directory record. 2120 Domino Designer Programming Guide.id. String server The name of the server to be added to the Domino Directory. String comment The contents of the comment field of the Domino Directory record. String network. c:\notes\data\cert. String adminname The full name of the administrator of the server. String server.. for example. String userpw. String userpw The server password for the specified ID file. String comment) throws NotesException Parameters String idfile The ID file for the server to be added to the Domino Directory. String location The contents of the location field of the Domino Directory record. Specify the full path.Registration class addServerToAddressbook method Adds a server to the Domino Directory. String server. String domain. String location. String adminname. String domain) throws NotesException public boolean addServerToAddressBook(String idfile.

String fwdaddr. String lastn) throws NotesException public boolean addUserToAddressBook(String idfile. addUserToAddressbook method Adds a user to the Domino Directory. false otherwise. addUserProfile method Adds a user profile document to the ID file. Defined in Registration Syntax public void addUserProfile(String username. String fullname. String profile) throws NotesException Parameters String username The username to be added to the ID. String userpw. String firstn. String profile The name of the profile document to be added to the ID. String comment) throws NotesException Chapter 10: Java Classes A–Z 2121 . String fullname. String mailserv. String location.Registration class Return value boolean True if the operation is successful. Defined in Registration Syntax public boolean addUserToAddressBook(String idfile. String mailfilepath. String middle. String lastn.

String firstn The user’s first name. String location The contents of the location field in the Domino Directory record. String fwdaddr The user’s forwarding mail address. c:\notes\data\cert. String comment The contents of the comment field in the Domino Directory record. 2122 Domino Designer Programming Guide.id. String middle The user’s middle name. for example. String fullname The user’s full name. false otherwise. Return value boolean True if the operation is successful. String userpw The user password for the specified ID file. String mailserv The full name of the user’s mail server. Specify the full path.Registration class Parameters String idfile The ID file for the user to be added to the Domino Directory. String mailfilepath The full mail pathname for the specified ID file. Volume 3: JavaScript Classes . String lastn The user’s last name.

Defined in Registration Syntax public void deleteIDOnServer(String username. String certpw. Specify the full path.Registration class crossCertify method Cross-certifies an ID file. c:\notes\data\cert. String certpw The password for the certifier ID file. Defined in Registration Syntax public boolean crossCertify(String idfile) throws NotesException public boolean crossCertify(String idfile. deleteIDOnServer method Deletes an ID file from the server. Return value boolean True if the operation is successful. for example. String comment The contents of the comment field in the Domino Directory record. String comment) throws NotesException Parameters String idfile The ID file to be cross-certified. false otherwise.id. boolean isserverid) throws NotesException Chapter 10: Java Classes A–Z 2123 .

Defined in Registration Syntax public void getIDFromServer(String username. boolean isserverid) throws NotesException Parameters String username The username attached to the ID file. boolean isserverid True if the name you query represents a server ID.Registration class Parameters String username The username attached to the ID file. False if the name is that of a person. this argument helps you to choose a view to search. Volume 3: JavaScript Classes . getIDFromServer method Gets an ID file from the server. While the information always comes from the designated server Domino Directory. boolean isserverid True if the name you query represents a server ID. False if the name is that of a person. this argument helps you to choose a view to search. String filepath. Defined in NotesRegistration 2124 Domino Designer Programming Guide. String filepath The full path of the ID file. While the information always comes from the designated server Domino Directory. getUserInfo method Gets information about the user from the server.

String comment) throws NotesException Chapter 10: Java Classes A–Z 2125 . StringBuffer mailserver. Vector profile Returns the user’s profile document. StringBuffer mailsystem Returns the name of the user’s mail system. Defined in Registration Syntax public boolean recertify(String idfile) throws NotesException public boolean recertify(String idfile. StringBuffer mailsystem. StringBuffer maildomain Returns the name of the user’s mail domain. recertify method Recertifies an ID file.Registration class Syntax public void getUserInfo(String username. String certpw. Usage The parameters. are return values. StringBuffer mailfile. StringBuffer mailfile Returns the name of the user’s mail file. StringBuffer mailserver Returns the name of the user’s mail server. Vector profile) throws NotesException Parameters String username The username attached to the ID file. except for the first. StringBuffer maildomain.

Specify the full path. String country. String userpw) throws NotesException Parameters String org The organization to which the new certifier ID belongs.id.id. String comment The contents of the comment field in the Domino Directory record. Specify the full path. Volume 3: JavaScript Classes . String idfile. false otherwise. String country The contents of the country field in the Domino Directory record. String certpw The password for the certifier ID file. for example. String certpw The password for the certifier ID file. registerNewCertifier method Registers a new certfier ID file. String certpw.Registration class Parameters String idfile The ID file to be recertified. Return value boolean True if the operation is successful. String idfile. String userpw) throws NotesException public boolean registerNewCertifier(String org. 2126 Domino Designer Programming Guide. c:\notes\data\cert. for example. c:\notes\data\cert. String idfile The ID file to be registered. Defined in Registration Syntax public boolean registerNewCertifier(String org.

String certpw. String pw) throws NotesException public boolean registerNewServer(String server. String location. Defined in Registration Syntax public boolean registerNewServer(String server. for example. String serverpw The password for the server ID file. false otherwise. String domain The domain to which the server belongs. Chapter 10: Java Classes A–Z 2127 .Registration class String userpw The user’s password. String idfile. String comment. String domain. String serverpw. String domain.id. String certpw The password for the certifier ID file. c:\notes\data\server. String idfile The ID file to be registered. String idfile. String network. String adminname. registerNewServer method Registers a new server ID file. String location The contents of the location field in the Domino Directory record. Return value boolean True if the operation is successful. String title) throws NotesException Parameters String server The server name attached to the ID file. Specify the complete path.

String idfile. c:\notes\data\cert. String server. Defined in Registration Syntax public boolean registerNewUser(String lastn. 2128 Domino Designer Programming Guide. String maildbpath. String idfile. String middle. String certpw. for example. false otherwise. String adminname The full name of the server administartor. Return value boolean True if the operation is successful. String firstn. registerNewUser method Registers a new server ID file. String server The name of the server containing the user’s mail file. String network The Notes named network (NNN) on which the server runs. Volume 3: JavaScript Classes . String forward. String title The contents of the title field in the Domino Directory record. String comment. Specify the complete path.id. String userpw) throws NotesException Parameters String lastn The last name of the user to be registered.Registration class String comment The contents of the comment field in the Domino Directory record. String server) throws NotesException public boolean registerNewUser(String lastn. String idfile The ID file to be registered. String location.

Registration class String firstn Optional. Defined in Registration Syntax public String switchToID(String idfile. String certpw Optional. String maildbpath Optional. for example. String userpw) throws NotesException Chapter 10: Java Classes A–Z 2129 . The forwarding domain for the user’s mail file. switchToID method Switches to a different ID file. The path of the user’s mail file relative to the mail directory. The contents of the comment field in the Domino Directory record. false otherwise. String middle Optional. String userpw Optional.nsf. String location Optional. Return value boolean True if the operation is successful. The contents of the location field in the Domino Directory record. The user’s password. mail\jones. The user’s first name. The password for the certifier ID file. String comment Optional. The user’s middle initial. String forward Optional.

c:\notes\data\cert. Volume 3: JavaScript Classes . for example. String userpw The user’s password. Return Value String The username that corresponds to the ID file to which you have switched. Replication class Represents the replication settings of a database.Replication class Parameters String idfile The ID file to which you want to switch. Specify the complete path. Syntax public class Replication extends Base Containment Contained by: Database Properties CutoffDate through getCutoffDate CutoffInterval through getCutoffInterval and setCutoffInterval IsAbstract through isAbstract and setAbstract IsCutoffDelete through isCutoffDelete and setCutoffDelete IsDisabled through isDisabled and setDisabled IsDoNotBrowse through isDoNotBrowse and setDoNotBrowse IsDoNotCatalog through isDoNotCatalog and setDoNotCatalog IsHideDesign through isHideDesign and setHideDesign IsIgnoreDeletes through isIgnoreDeletes and setIgnoreDeletes IsIgnoreDestDeletes through isIgnoreDestDeletes and setIgnoreDestDeletes IsMultiDbIndex through isMultiDbIndex and setMultiDbIndex 2130 Domino Designer Programming Guide.id.

String p = null.domino.out. Replication replication = db.CNOTES_REPLCONST_PRIORITYMED : p = "medium". else System. case Replication. } if (replication. // (Your code goes here) Database db = agentContext.Replication class IsNeverReplicate through isNeverReplicate and setNeverReplicate IsNoChronos through isNoChronos and setNoChronos Priority through getPriority and setPriority Methods clearHistory reset save Creation Each Database object has exactly one associated Replication object. AgentContext agentContext = session. if (replication. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus.CNOTES_REPLCONST_PRIORITYNOTSET : p = "not set". Example: Replication class This agent prints the replication properties for the current database.getReplicationInfo().out.println("Background agents are disabled").out.isNeverReplicate()) System.CNOTES_REPLCONST_PRIORITYLOW : p = "low". case Replication.getAgentContext().println("Background agents are enabled").isDisabled() ^ replication.isNoChronos()) System.CNOTES_REPLCONST_PRIORITYHIGH : p = "high". if (replication. Use getReplicationInfo in Database to get the Replication object.isAbstract()) Chapter 10: Java Classes A–Z 2131 .println("Replication is disabled").getPriority()) { case Replication.println("Replication is enabled"). switch (replication.println("Priority is " + p).getCurrentDatabase().out. } System.out.*. case Replication. else { System.

isMultiDbIndex()) System. Volume 3: JavaScript Classes .getCutoffInterval()).println("Cutoff date is " + replication. else System. else System.out. if (replication.nsf"). else System.println ("Do not replicate destination deletions"). if (replication. if (replication.println("Do not show in \"Open Database\" box").println("Do not list in catalog.println ("Do not allow in multi-database indexing").out.isDoNotBrowse()) System.out.println("Do not hide design").println("Replicate destination deletions").out. } catch(Exception e) { e.out.isCutoffDelete()) { System.out.out.isDoNotCatalog()) System. if (replication.out.println("Do not replicate deletions").nsf").println("Replicate deletions").printStackTrace().out. if (replication.println("Allow in multi-database indexing"). else System.out.out. } else System. if (replication.out. else System.getCutoffDate()).isIgnoreDestDeletes()) System.println ("Do not truncate large documents and keep attachments"). else System.Replication class System.println("Show in \"Open Database\" box").out.println("Cutoff interval is " + replication.println("Cutoff delete not in effect").isHideDesign()) System. } } } 2132 Domino Designer Programming Guide. if (replication.out.out.println("Hide design").out.out.println("Truncate large documents and remove attachments").isIgnoreDeletes()) System. else System. System.println("List in catalog.

replication.getCurrentDatabase().domino.isAbstract()).Replication class IsAbstract property Read-write. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setAbstract(false).save(). AgentContext agentContext = session. Indicates if large documents should be truncated and attachments removed during replication. // (Your code goes here) Database db = agentContext.isAbstract()) replication.printStackTrace(). if (replication. System. } catch(Exception e) { e.getReplicationInfo(). else replication.out. Defined in Replication Data type boolean Syntax public boolean isAbstract() throws NotesException public void setAbstract(boolean bValue) throws NotesException Legal values True to truncate large documents and remove attachments False to replicate large documents in their entirety Example: IsAbstract property This agent toggles the IsAbstract property.println("Abstract = " + replication. Replication replication = db. import lotus.setAbstract(true).getAgentContext(). } } } Chapter 10: Java Classes A–Z 2133 .*.

IsCutoffDelete. System.printStackTrace().*.getCutoffDate()). } replication.setCutoffInterval(i.save(). Replication replication = db.Replication class CutoffDate property Read-only.setCutoffDelete(true). AgentContext agentContext = session. } } } 2134 Domino Designer Programming Guide.println("No cutoff date"). System. } catch(Exception e) { e.println("Cutoff date is " + replication. // (Your code goes here) Agent agent = agentContext. if (agent. Volume 3: JavaScript Classes . Defined in Replication Data type DateTime Syntax public DateTime getCutoffDate() throws NotesException Example: CutoffDate. replication.getComment() == null) { replication.setCutoffDelete(false).out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getReplicationInfo().domino.getComment()).getCurrentDatabase().getAgentContext().getCurrentAgent().out. } else { Integer i = new Integer(agent.longValue()). and CutoffInterval properties This agent sets a cutoff date based on the agent comment. Today’s date plus the cutoff interval. Database db = agentContext. import lotus. replication.

Defined in Replication Data type boolean Syntax public boolean isCutoffDelete() throws NotesException public void setCutoffDelete(boolean bValue) throws NotesException Legal values True to automatically delete documents that are older than the cutoff date False to not delete old documents Chapter 10: Java Classes A–Z 2135 . Number of days after which documents are automatically deleted if isCutoffDelete is in effect.Replication class CutoffInterval property Read-write. Defined in Replication Data type long Syntax public long getCutoffInterval() throws NotesException public void setCutoffInterval(long interval) throws NotesException IsCutoffDelete property Read-write. Indicates if documents that are older than the cutoff date should be automatically deleted.

if (agent. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). Defined in Replication Data type boolean Syntax public boolean isDisabled() throws NotesException public void setDisabled(boolean bValue) throws NotesException Legal values True to disable replication False to enable replication Usage You can disable replication with this property and isNeverReplicate.getComment(). Indicates if replication is disabled.getCurrentAgent(). Volume 3: JavaScript Classes . Database db = agentContext. Example: IsDisabled property.” replication is disabled so that it cannot be enabled through the UI.getCurrentDatabase(). replication.clearHistory().domino.setDisabled(true).getReplicationInfo(). save method This agent clears the replication history and disables replication.*. clearHistory method. IsNeverReplicate property. This property is accessible through the UI while isNeverReplicate is not. replication. import lotus. Replication replication = db. AgentContext agentContext = session.getComment() != null) if (agent. // (Your code goes here) Agent agent = agentContext.setNeverReplicate(true). 2136 Domino Designer Programming Guide.Replication class IsDisabled property Read-write.equalsIgnoreCase("NEVER")) replication. If the agent comment is “NEVER.

else replication. if (replication. Indicates if a database should not be shown in the “Open Database” dialog box.domino.getCurrentDatabase().save().save().setDoNotBrowse(true). // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. replication. } } } IsDoNotBrowse property Read-write. Defined in Replication Data type boolean Syntax public boolean isDoNotBrowse() throws NotesException public void setDoNotBrowse(boolean bValue) throws NotesException Legal values True to not show the database in the “Open Database” dialog box False to how the database in the “Open Database” dialog box Example: IsDoNotBrowse property This agent toggles the IsDoNotBrowse property. Replication replication = db. AgentContext agentContext = session.setDoNotBrowse(false). System.out.getReplicationInfo().isDoNotBrowse()) replication.Replication class replication.*.println("DoNotBrowse = " + Chapter 10: Java Classes A–Z 2137 .getAgentContext(). } catch(Exception e) { e.printStackTrace().

setDoNotCatalog(false). import lotus. System. if (replication. } catch(Exception e) { e.isDoNotCatalog()) replication.Replication class replication. else replication. // (Your code goes here) Database db = agentContext.domino.nsf).setDoNotCatalog(true). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase().out. } } } IsDoNotCatalog property Read-write.*. Volume 3: JavaScript Classes . Indicates if a database should not be listed in the database catalog (catalog.getAgentContext().println("DoNotCatalog = " + 2138 Domino Designer Programming Guide. replication. Replication replication = db.isDoNotBrowse()).save(). AgentContext agentContext = session.printStackTrace().getReplicationInfo(). Defined in Replication Data type boolean Syntax public boolean isDoNotCatalog() throws NotesException public void setDoNotCatalog(boolean bValue) throws NotesException Legal values True to not list the database in the database catalog False to list the database in the database catalog Example: IsDoNotCatalog property This agent toggles the IsDoNotCatalog property.

getCurrentDatabase().printStackTrace().save(). Chapter 10: Java Classes A–Z 2139 .setHideDesign(false). } catch(Exception e) { e. import lotus.*.getReplicationInfo(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setHideDesign(true). // (Your code goes here) Database db = agentContext.isHideDesign()) replication.getAgentContext().isHideDesign()). Indicates if a database design should be hidden. System.Replication class replication. if (replication.println("HideDesign = " + replication. else replication.domino. Replication replication = db. replication.isDoNotCatalog()).out. } } } IsHideDesign property Read-write. Defined in Replication Data type boolean Syntax public boolean isHideDesign() throws NotesException public void setHideDesign(boolean bValue) throws NotesException Legal values True to hide the database design False to not hide the database design Example: IsHideDesign property This agent toggles the IsHideDesign property. AgentContext agentContext = session.

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().setIgnoreDeletes(false). Indicates if deletions should not be replicated. Replication replication = db. else replication. import lotus.*. } } } IsIgnoreDeletes property Read-write.Replication class } catch(Exception e) { e. replication.domino. AgentContext agentContext = session. Volume 3: JavaScript Classes . System.getCurrentDatabase().setIgnoreDeletes(true).println("IgnoreDeletes = " + 2140 Domino Designer Programming Guide. Defined in Replication Data type boolean Syntax public boolean isIgnoreDeletes() throws NotesException public void setIgnoreDeletes(boolean bValue) throws NotesException Legal values True to not replicate deletions False to replicate deletions Example: IsIgnoreDeletes property This agent toggles the IsIgnoreDeletes property. // (Your code goes here) Database db = agentContext.getAgentContext().isIgnoreDeletes()) replication.out. if (replication.printStackTrace().getReplicationInfo().save().

System.println("IgnoreDestDeletes = " + Chapter 10: Java Classes A–Z 2141 .getAgentContext().getIsIgnoreDestDeletes()) replication.setIgnoreDestDeletes(true).*. Replication replication = db. replication. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus.save(). else replication.Replication class replication.setIgnoreDestDeletes(false). AgentContext agentContext = session.getReplicationInfo().out.getCurrentDatabase(). // (Your code goes here) Database db = agentContext.printStackTrace(). } } } IsIgnoreDestDeletes property Read-write.domino. Indicates if deletions should not be replicated to destination databases. } catch(Exception e) { e.isIgnoreDeletes()). if (replication. Defined in Replication Data type boolean Syntax public boolean isIgnoreDestDeletes() throws NotesException public void setIgnoreDestDeletes(boolean bValue) throws NotesException Legal values True to not replicate deletions to destination databases False to replicate deletions to destination databases Example: IsIgnoreDestDeletes property This agent toggles the IsIgnoreDestDeletes property.

*.isMultiDbIndex()) replication. AgentContext agentContext = session. if (replication.Replication class replication.isIgnoreDestDeletes()).setMultiDbIndex(false). System. } catch(Exception e) { e.getReplicationInfo().out. replication.printStackTrace(). Defined in Replication Data type boolean Syntax public boolean isMultiDbIndex() throws NotesException public void setMultiDbIndex(boolean bValue) throws NotesException Legal values True to include the database in multi-database indexing False to not include the database in multi-database indexing Example: IsMultiDbIndex property This agent toggles the IsMultiDbIndexing property. Volume 3: JavaScript Classes .getAgentContext(). Indicates if a database can be included in multi-database indexing. import lotus. // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase(). else replication.save().domino. } } } IsMultiDbIndex property Read-write.println("MultiDbIndex = " + 2142 Domino Designer Programming Guide. Replication replication = db.setMultiDbIndex(true).

} } } IsNeverReplicate property Read-write. Defined in Replication Data type boolean Chapter 10: Java Classes A–Z 2143 . } catch(Exception e) { e. IsNoChronos property Read-write.isMultiDbIndex()). Indicates if replication is disabled. Defined in Replication Data type boolean Syntax public boolean isNeverReplicate() throws NotesException public void setNeverReplicate(boolean bValue) throws NotesException Legal values True to disable replication False to enable replication Usage You can disable replication with this property and isDisabled.printStackTrace().Replication class replication. Indicates if background agents are disabled. This property is not accessible through the UI while isDisabled is.

setNoChronos(false).out. Replication replication = db. Replication priority.isNoChronos()). replication.save().println("NoChronos = " + replication. else replication. System.printStackTrace().Replication class Syntax public boolean isNoChronos() throws NotesException public void setNoChronos(boolean bValue) throws NotesException Legal values True to disable background agents False to enable background agents Example: IsNoChronos property This agent toggles the IsNoChronos property.*. import lotus.getCurrentDatabase().getAgentContext(). } catch(Exception e) { e.isNoChronos()) replication. if (replication. // (Your code goes here) Database db = agentContext.setNoChronos(true). Defined in Replication Data type int 2144 Domino Designer Programming Guide. Volume 3: JavaScript Classes . AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } } } Priority property Read-write.domino.getReplicationInfo().

*.DB_REPLICATION_PRIORITY_HIGH Replication.domino.CNOTES_REPLCONST_PRIORITYLOW).CNOTES_REPLCONST_PRIORITYHIGH). // (Your code goes here) Agent agent = agentContext.println("Priority is medium").println("Priority is low"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getComment().println("Priority is high"). System.Replication class Syntax public int getPriority() throws NotesException public void setPriority(int priority) throws NotesException Legal values Replication.setPriority (Replication. } else if (agent.out.out. AgentContext agentContext = session.DB_REPLICATION_PRIORITY_MED Replication.setPriority (Replication. Replication replication = db.CNOTES_REPLCONST_PRIORITYNOTSET).getAgentContext().getComment(). } else if (agent.equalsIgnoreCase("HIGH")) { replication.DB_REPLICATION_PRIORITY_LOW Replication.CNOTES_REPLCONST_PRIORITYMED). } else if (agent.getCurrentAgent(). System.equalsIgnoreCase("MEDIUM")) { replication.getReplicationInfo().out.out. if (agent.getCurrentDatabase().DB_REPLICATION_PRIORITY_NOTSET Example: Priority property This agent changes the replication priority depending on the agent comment.setPriority (Replication.setPriority (Replication. Database db = agentContext.println("Priority is not set"). System.equalsIgnoreCase("LOW")) { replication. System.getComment() == null) { replication.getComment(). } Chapter 10: Java Classes A–Z 2145 . import lotus.

printStackTrace(). } } } clearHistory method Clears the replication history. Defined in Replication Syntax public int clearHistory() throws NotesException reset method Resets the replication properties to their last saved values. Defined in Replication Syntax public int save() throws NotesException 2146 Domino Designer Programming Guide.Replication class } catch(Exception e) { e. any changes to the replication properties are lost. If you don’t call save before closing the database. Volume 3: JavaScript Classes . Defined in Replication Syntax public int reset() throws NotesException save method Saves the replication properties.

Chapter 10: Java Classes A–Z 2147 . use createRichTextItem in Document.RichTextItem class RichTextItem class Represents an item of type rich text. Syntax public class RichTextItem extends Item Base class Inherits from: Item Containment Contained by: Document Contains: EmbeddedObject and RichTextStyle Property EmbeddedObjects through getEmbeddedObjects Methods addNewLine addPageBreak addTab appendDocLink appendParagraphStyle appendRTItem appendStyle appendText embedObject getEmbeddedObject getFormattedText Creation To create a new RichTextItem object.

*.createRichTextItem("Body"). too.out. } } } 2. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). When you change the value of a RichTextItem object. // Save the document doc. Document doc = db.appendText("Cartoon book for children ages 9-12").domino. System.createDocument().replaceItemValue("Subject".getCurrentDatabase(). all of the Item properties and methods can be used on a RichTextItem. the change is not written to disk until you call save for the parent Document object. use getFirstItem in Document. // (Your code goes here) Database db = agentContext. } catch(Exception e) { e. This agent gets a rich-text item.util.println(subject. import java.Vector. "Project description"). Item subject = doc. You must explicitly cast the return value to RichTextItem.RichTextItem class Access To access an existing RichTextItem object. import java. This agent creates a rich text item and appends text to it. Examples: RichTextItem class 1. AgentContext agentContext = 2148 Domino Designer Programming Guide. Volume 3: JavaScript Classes . RichTextItem body = doc. Because RichTextItem inherits from Item. AgentContext agentContext = session.println(body.getText()).getAgentContext(). // Print text of subject and body System.out. import lotus.printStackTrace().*. true). body.getText()). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Vector.util. import lotus.save(true.domino.

System. RichTextItem body = (RichTextItem)doc. use the EmbeddedObjects property in Document.printStackTrace(). Item subject = doc.out.getText()). because the object was originally created on the document’s form). and file attachments contained in a rich-text item. } } } EmbeddedObjects property Read-only.getAgentContext(). DocumentCollection dc = db. and on the Macintosh.getFirstItem("Subject"). Chapter 10: Java Classes A–Z 2149 . // (Your code goes here) Database db = agentContext.println(subject. under UNIX.getFirstDocument(). object links.println(body. If you need access to OLE/2 embedded objects that exist on a document but are not part of a rich-text item (for example. elements are EmbeddedObject Syntax public java.getAllDocuments().RichTextItem class session. Document doc = dc.out.getText()).getFirstItem("Body"). All the embedded objects. Note EmbeddedObjects is not supported under OS/2.Vector.util.Vector getEmbeddedObjects() throws NotesException Usage This property includes OLE/1 and OLE/2 embedded objects and object links as well as file attachments. Defined in RichTextItem Data type java.getCurrentDatabase(). // Print text of subject and body System. } catch(Exception e) { e.util.

} } catch(NotesException e) { System.out.nextElement(). import java.getItemValueString("Subject")). System.getNextDocument().text).out. System.id + " " + e. import java. Defined in RichTextItem 2150 Domino Designer Programming Guide. } doc = dc.println(e.util. DocumentCollection dc = db.RichTextItem class Example: EmbeddedObjects property This agent import lotus. AgentContext agentContext = session.out.getName()). while (doc != null) { RichTextItem body = (RichTextItem)doc. e.println("\t" + eo.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Enumeration e = v.printStackTrace(). while (e.*.getCurrentDatabase().getFirstItem("Body").getFirstDocument().getEmbeddedObjects().hasMoreElements()) { EmbeddedObject eo = (EmbeddedObject)e.elements().getAgentContext().util.Enumeration. Vector v = body. } } } addNewLine method Appends one or more new lines (carriage returns) to the end of a rich-text item.println(doc. Volume 3: JavaScript Classes . Document doc = dc.Vector. // (Your code goes here) Database db = agentContext.getAllDocuments().

the new line is added.Vector. addPageBreak.createRichTextItem("Body").").").createDocument()."). body.appendText("Element B1"). body.addPageBreak().*. body. "Rich text item").replaceItemValue("Subject". boolean newparagraph If true (default). AgentContext agentContext = session. and appendText methods This agent creates a rich-text item.appendText("This is a new paragraph.addNewLine(). body.addTab().appendText("Column 2"). addTab. body. appends text.util. body. page breaks. body.RichTextItem class Syntax public void addNewLine() throws NotesException public void addNewLine(int count) throws NotesException public void addNewLine(int count. body. import java. but does not force a new paragragh. forces the new line to be a paragraph separator.addTab().getAgentContext(). body.addNewLine(2).appendText("Element A1"). body. Document doc = db. If false.getCurrentDatabase().domino.appendText("This is the first sentence. // (Your code goes here) Database db = agentContext. Item subject = doc. Example: addNewLine.appendText(" This is the second sentence. Chapter 10: Java Classes A–Z 2151 .appendText("Column 1"). body. and adds new lines. and tabs. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). RichTextItem body = doc. boolean newparagraph) throws NotesException Parameters int count The number of new lines to append. body. import lotus.

addTab(). // Save the document doc.appendText("Element B2"). addTab method Appends one or more tabs to the end of a rich-text item. Volume 3: JavaScript Classes . body. Defined in RichTextItem Syntax public void addTab() throws NotesException public void addTab(int count) throws NotesException 2152 Domino Designer Programming Guide. true). } catch(Exception e) { e.save(true.addNewLine(). body. } } } addPageBreak method Appends a page break to the end of a rich-text item.RichTextItem class body.appendText("Element A2"). Defined in RichTextItem Syntax public void addPageBreak() throws NotesException public void addPageBreak(RichTextParagraphStyle pstyle) throws NotesException Parameters RichTextParagraphStyle pstyle Starts the new page with the specified paragraph style.printStackTrace(). body.

String comment. String hotspottext) throws NotesException Parameters Document doc The document to which you want to link. String comment. String comment) throws NotesException public void appendDocLink(Database db. appendDocLink method Adds a doclink to the end of a rich-text item. String comment) throws NotesException public void appendDocLink(Document doc. Database db The database to which you want to link. String comment) throws NotesException public void appendDocLink(View vw. String comment.RichTextItem class Parameter int count The number of tabs to append. Defined in RichTextItem Syntax public void appendDocLink(Document doc) throws NotesException public void appendDocLink(Database db) throws NotesException public void appendDocLink(View vw) throws NotesException public void appendDocLink(Document doc. String hotspottext) throws NotesException public void appendDocLink(Database db. Chapter 10: Java Classes A–Z 2153 . String hotspottext) throws NotesException public void appendDocLink(View vw.

import lotus. body. "Memo"). // Send the document doc.getItemValueString("Subject"). Document doc = db. } catch(Exception e) { e.createRichTextItem("Body"). This text appears in place of a token.getCurrentDatabase().replaceItemValue("Subject".*.appendDocLink(db. body. "Document link").Vector.printStackTrace().addNewLine(2).getAgentContext().domino. doc. db.send("Pierre LaPierre"). body.util.appendDocLink(doc. "Database link").appendText("Here are the links:"). body. } } } 2154 Domino Designer Programming Guide. "Doc links").replaceItemValue("Form". Volume 3: JavaScript Classes . body.RichTextItem class Database vw The view to which you want to link. AgentContext agentContext = session. doc. import java. String hotspottext Boxed text that appears that the user clicks to follow the link.createDocument().addNewLine(). RichTextItem body = doc. doc. String comment The text that appears when a user presses and holds the mouse over the link. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext.getTitle(). Example: appendDocLink method This agent creates a rich text field and appends doc links.

Text following the paragraph style is rendered using the attributes of that paragraph style.getAgentContext(). Chapter 10: Java Classes A–Z 2155 .*.Vector. Defined in RichTextItem Syntax public void appendParagraphFile(RichTextParagraphStyle pstyle) throws NotesException Parameter RichTextParagraphStyle pstyle The paragraph style to be appended. Usage See RichTextParagraphStyle for details and examples.domino. appendRTItem method Appends the contents of one rich text item to the end of another rich text item. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. import lotus. Cannot be null.util. Example: appendRTItem method This agent creates a rich text item and appends the contents of another rich text item.RichTextItem class appendParagraphStyle method Appends a paragraph style to the end of a rich text item. import java. Defined in RichTextItem Syntax public void appendRTItem(RichTextItem item) throws NotesException Parameter RichTextItem item The item to be appended.

appendText("Here is the body of the first document:"). "Memo").getFirstDocument().println(e.replaceItemValue("Form".getCurrentDatabase(). doc. body. RichTextItem rti = (RichTextItem)doc1.getFirstItem("Body"). } } } appendStyle method Appends a style to the end of a rich text item. e. Text following the style is rendered using the attributes of that style until another style is appended. 2156 Domino Designer Programming Guide. Document doc1 = dc. body. "Copy of first document"). RichTextItem body = doc.createRichTextItem("Body").send("Robert Perron"). doc.RichTextItem class // (Your code goes here) Database db = agentContext.(rti). Volume 3: JavaScript Classes . Usage This method does not affect text appended by appendRTItem.id + " " + e. } catch(NotesException e) { System. Defined in RichTextItem Syntax public void appendStyle(RichTextStyle style) throws NotesException Parameter RichTextStyle style The style to be appended.createDocument(). See RichTextStyle for details and examples.printStackTrace().getAllDocuments(). DocumentCollection dc = db. body. // Send the document doc.text).out. Document doc = db.addNewLine(2).replaceItemValue("Subject".

Places an object link in a rich-text item. Defined in RichTextItem Syntax public EmbeddedObject embedObject(int type. Defined in RichTextItem Syntax public void appendText(String text) throws NotesException Parameter String text The text to append. String name) throws NotesException Parameters int type One of the following: EmbeddedObject.EMBED_OBJECT EmbeddedObject. under UNIX. does one of the following: Attaches the file you specify to a rich-text item.RichTextItem class appendText method Appends text to the end of a rich text item. Note EmbedObject is not supported under OS/2. The object is created using either the application or the file you specify. String source. or on the Macintosh.EMBED_ATTACHMENT EmbeddedObject. The text is rendered in the current style of the item. embedObject method Given the name of a file or an application. The link is created using the file you specify.EMBED_OBJECTLINK Chapter 10: Java Classes A–Z 2157 . String class. Embeds an object in a rich-text item.

import java. String name String. If you are using EMBED_ATTACHMENT or EMBED_OBJECTLINK.getCurrentDatabase(). use this parameter to specify the name of the file. use this parameter to specify the name of the file to attach or link.Vector. doc. Return value EmbeddedObject The newly attached file. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Example: embedObject method This agent creates a rich-text item and embeds an attachment.*. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session. specify an empty string (“”). Document doc = db.RichTextItem class String class If you are using EMBED_OBJECT and want to create an empty embedded object from an application.createDocument(). RichTextItem body = doc.domino. but they can be embedded as OLE/1 objects on any supported platform (if the file is of a supported type. String source If you are using EMBED_OBJECT and want to create an embedded object from a file. embedded object. such as a Lotus® application data file). Files can be embedded as OLE/2 objects only on platforms supporting OLE. and specify null for class. 2158 Domino Designer Programming Guide.replaceItemValue("Subject". Usage Files can be attached on any supported platform. If you are using EMBED_OBJECTLINK or EMBED_ATTACHMENT. "Attachment"). but objects and links can only be created on platforms supporting OLE. or linked object.getAgentContext(). use this parameter to specify the name of the application (for example.util. Volume 3: JavaScript Classes . Case sensitive. Can be null. import lotus. “123Worksheet”) and specify null for source.createRichTextItem("Body"). Name by which you can reference the EmbeddedObject later.

embedded object. returns null. if found. "c:\\notesr50\\notes. } catch(NotesException e) { System. Specify just the file name not the full path. body. To find a file attachment. true). Note getEmbeddedObject is not supported under OS/2.appendText("Here is the attachment:").ini". and on the Macintosh. null. } } } getEmbeddedObject method Given the name of a file attachment.addNewLine(2). "notesini"). under UNIX. body. specify its file name. use the name of the object or link as it appears in the InfoBox. the changes are saved but the rendering of the object in the Domino document is not updated until you manually activate the object.EMBED_ATTACHMENT.printStackTrace().RichTextItem class body. returns the corresponding EmbeddedObject.embedObject(EmbeddedObject. Return value EmbeddedObject The object.text). Defined in RichTextItem Syntax public EmbeddedObject getEmbeddedObject(String name) throws NotesException Parameter String name String.println(e. Otherwise. To find an embedded object or object link. // Save the document doc. Usage If you modify the object returned by getEmbeddedObject. or object link in a rich-text item. e.id + " " + e. or as designated in the embedObject method.out. The name of the object to find.save(true. Chapter 10: Java Classes A–Z 2159 .

printStackTrace().getAllDocuments(). import lotus.getFirstDocument(). 2160 Domino Designer Programming Guide. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getItemValueString("Subject")).println("Found notes.domino.out.util. tabs are not stripped out.getAgentContext(). tabs are stripped out.out. Defined in RichTextItem Syntax public String getFormattedText(boolean tabstrip.getNextDocument().Vector.ini") != null) System.id + " " + e.getCurrentDatabase(). int linelen. e.text). Volume 3: JavaScript Classes .RichTextItem class Example: getEmbeddedObject method This agent examines the documents in a database to see which ones contain a specified embedded object.*. import java. AgentContext agentContext = session. If false.println(e.getEmbeddedObject("notes. int maxlen) throws NotesException Parameters boolean tabstrip If true.ini in " + doc. doc = dc. if (body.getFirstItem("Body"). } } catch(NotesException e) { System. // (Your code goes here) Database db = agentContext. DocumentCollection dc = db. } } } getFormattedText method Returns the contents of a rich-text item as plain text. while (doc != null) { RichTextItem body = (RichTextItem)doc. Document doc = dc.

while (doc != null) { RichTextItem body = (RichTextItem)doc.domino.getAgentContext(). as plain text.getFirstItem("Body"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().text). Example: GetFormattedText method This agent gets the formatted text from a rich-text item. Return value String The contents of the rich-text item.out. Set to 0 for the default. AgentContext agentContext = session. e.getFormattedText(false. Usage This method strips out non-text data.println(e.RichTextItem class int linelen Number of characters at which to wrap lines of text.getFirstDocument(). DocumentCollection dc = db.getNextDocument(). } } } Chapter 10: Java Classes A–Z 2161 . Set to 0 for the default.” Words without whitespace will not be wrapped. } } catch(NotesException e) { System. doc = dc. Document doc = dc.println(doc. System. such as bitmaps and file attachments.printStackTrace(). import lotus. 0. 0) + "\n").println(body.getCurrentDatabase().*.out. int maxlen Maximum number of characters to return. For example. Use this parameter only if the line contains whitespace.getAllDocuments().out. // (Your code goes here) Database db = agentContext.id + " " + e. System. “This is a school.getItemValueString("Subject")).

import java. Use a RichTextParagraphStyle object with appendParagraphStyle of RichTextItem.util. Syntax public class RichTextParagraphStyle extends Base Containment Contained by: Session Properties Alignment through getAlignment and setAlignment FirstLineLeftMargin through getFirstLineLeftMargin and setFirstLineLeftMargin InterLineSpacing through getInterLineSpacing and setInterLineSpacing LeftMargin through getLeftMargin and setLeftMargin Pagination through getPagination and setPagination RightMargin through getRightMargin and setRightMargin SpacingAbove through getSpacingAbove and setSpacingAbove SpacingBelow through getSpacingBelow and setSpacingBelow Tabs through getTabs Methods clearAllTabs setTab setTabs Creation and access To create a new RichTextParagraphStyle object. Text that follows a rich text paragraph style assumes the attributes of the rich text paragraph style.*.RichTextParagraphStyle class RichTextParagraphStyle class Represents rich text paragraph attributes. Example: RichTextParagraphStyle class This agent defines two rich-text paragraph styles and applies each. import lotus.domino. use createRichTextParagraphStyle in Session.Vector. public class JavaAgent extends AgentBase { public void NotesMain() { 2162 Domino Designer Programming Guide. Volume 3: JavaScript Classes .

").replaceItemValue ("Subject".PAGINATE_KEEP_WITH_NEXT).SPACING_SINGLE).appendText("Header").createRichTextParagraphStyle().RichTextParagraphStyle class try { Session session = getSession().getAgentContext(). try { r = s. // (Your code goes here) Database db = agentContext. Document doc = db. i++) body. r. RichTextItem body = doc.ALIGN_CENTER).setAlignment(RichTextParagraphStyle. i<16.createRichTextParagraphStyle().save(true. i++) body. i<16.appendParagraphStyle(b).appendText("Line one of body. "). for (int i=0. "Rich text paragraph style"). true). r. for (int i=0.SPACING_DOUBLE). // Save the document doc. } RichTextParagraphStyle bodyStyle(Session s) { RichTextParagraphStyle r=null.appendText("Line two of body. } catch(Exception e) { e.setSpacingAbove (RichTextParagraphStyle. body.createDocument(). } catch(Exception e) { e.addNewLine().printStackTrace().setPagination (RichTextParagraphStyle. Chapter 10: Java Classes A–Z 2163 . Item subject = doc.setSpacingBelow( RichTextParagraphStyle. body. RichTextParagraphStyle h = headerStyle(session).printStackTrace(). body.getCurrentDatabase(). body. r. } } RichTextParagraphStyle headerStyle(Session s) { RichTextParagraphStyle r=null. AgentContext agentContext = session.appendParagraphStyle(h). try { r = s. RichTextParagraphStyle b = bodyStyle(session).createRichTextItem("Body"). } return r. r.

} catch(Exception e) { e. r.ALIGN_LEFT).RichTextParagraphStyle class r.SPACING_SINGLE).setAlignment(RichTextParagraphStyle. r.RULER_ONE_INCH * 1.SPACING_ONE_POINT_50).setLeftMargin(RichTextParagraphStyle. } } Alignment property Read-write.5)). Horizontal alignment of text in each paragraph.ALIGN_LEFT RichTextParagraphStyle.setFirstLineLeftMargin ((int)(RichTextParagraphStyle. r. r.RULER_ONE_INCH). r.setInterLineSpacing(RichTextParagraphStyle.printStackTrace().SPACING_SINGLE).ALIGN_RIGHT 2164 Domino Designer Programming Guide.ALIGN_CENTER RichTextParagraphStyle. Defined in RichTextParagraphStyle Data type int Syntax public int getAlignment() throws NotesException public void setAlignment(int value) throws NotesException Legal values RichTextParagraphStyle. r.ALIGN_FULL RichTextParagraphStyle.setSpacingBelow (RichTextParagraphStyle.setRightMargin(0). Volume 3: JavaScript Classes .setSpacingAbove(RichTextParagraphStyle. } return r.ALIGN_NOWRAP RichTextParagraphStyle.

The actual int value is in “twips.RULER_ONE_INCH Usage You can apply arithmetic to the constants to obtain other measurements. For example.RichTextParagraphStyle class FirstLineLeftMargin property Read-write.RULER_ONE_CENTIMETER RichTextParagraphStyle. Left margin of first line of each paragraph. InterLineSpacing property Read-write.” where one centimeter is 537 twips and one inch is 1440 twips. Defined in RichTextParagraphStyle Data type int Syntax public int getInterLineSpacing() throws NotesException public void setInterLineSpacing(int value) throws NotesException Chapter 10: Java Classes A–Z 2165 . Vertical spacing between lines in each paragraph.75) for three-quarters of an inch. Defined in RichTextParagraphStyle Data type int Syntax public int getFirstLineLeftMargin() throws NotesException public void setFirstLineLeftMargin(int value) throws NotesException Legal values RichTextParagraphStyle. RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0.

RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0. Volume 3: JavaScript Classes .SPACING_SINGLE LeftMargin property Read-write. Left margin of each line except the first in each paragraph. How page breaks affect each paragraph. Pagination property Read-write.RichTextParagraphStyle class Legal values RichTextParagraphStyle. Defined in RichTextParagraphStyle Data type int Syntax public int getLeftMargin() throws NotesException public void setLeftMargin(int value) throws NotesException Legal values RichTextParagraphStyle. The actual int value is in “twips.75) for three-quarters of an inch. Defined in RichTextParagraphStyle Data type int 2166 Domino Designer Programming Guide. For example.SPACING_ONE_POINT_50 RichTextParagraphStyle.” where one centimeter is 537 twips and one inch is 1440 twips.SPACING_DOUBLE RichTextParagraphStyle.RULER_ONE_CENTIMETER RichTextParagraphStyle.RULER_ONE_INCH Usage You can apply arithmetic to the constants to obtain other measurements.

PAGINATE_DEFAULT RichTextParagraphStyle.PAGINATE_KEEP_TOGETHER RichTextParagraphStyle. RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0.PAGINATE_KEEP_WITH_NEXT RightMargin property Read-write.PAGINATE_BEFORE RichTextParagraphStyle. For example.RULER_ONE_INCH Usage You can apply arithmetic to the constants to obtain other measurements.” where one centimeter is 537 twips and one inch is 1440 twips. The actual int value is in “twips. Chapter 10: Java Classes A–Z 2167 . Defined in RichTextParagraphStyle Data type int Syntax public int getRightMargin() throws NotesException public void setRightMargin(int value) throws NotesException Legal values RichTextParagraphStyle. Right margin of each line in each paragraph.RULER_ONE_CENTIMETER RichTextParagraphStyle.RichTextParagraphStyle class Syntax public int getPagination() throws NotesException public void setPagination(int value) throws NotesException Legal values RichTextParagraphStyle.75) for three-quarters of an inch.

SPACING_ONE_POINT_50 RichTextParagraphStyle.RichTextParagraphStyle class SpacingAbove property Read-write.SPACING_DOUBLE RichTextParagraphStyle.SPACING_DOUBLE RichTextParagraphStyle.SPACING_SINGLE 2168 Domino Designer Programming Guide. Defined in RichTextParagraphStyle Data type int Syntax public int getSpacingBelow() throws NotesException public void setSpacingBelow(int value) throws NotesException Legal values RichTextParagraphStyle.SPACING_SINGLE SpacingBelow property Read-write. Vertical spacing above each paragraph.SPACING_ONE_POINT_50 RichTextParagraphStyle. Vertical spacing below each paragraph. Volume 3: JavaScript Classes . Defined in RichTextParagraphStyle Data type int Syntax public int getSpacingAbove() throws NotesException public void setSpacingAbove(int value) throws NotesException Legal values RichTextParagraphStyle.

elements are RichTextTab Syntax public java.Vector.util. clearAllTabs method Clears all tabs in a rich-text paragraph style.util. Tabs in a rich-text paragraph style.Vector getTabs() throws NotesException Return value java. Chapter 10: Java Classes A–Z 2169 . Defined in RichTextParagraphStyle Data type java. Usage See RichTextTab for additional information and an example.Vector A vector of RichTextTab elements representing the tabs in the rich-text paragraph style.RichTextParagraphStyle class Tabs property Read-only.util. Defined in RichTextParagraphStyle Syntax public void clearAllTabs() throws NotesException Usage See RichTextTab for additional information and an example.

Volume 3: JavaScript Classes . int type) throws NotesException Parameters int position RichTextParagraphStyle. RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0.TAB_DECIMAL RichTextParagraphStyle. The actual int value is in “twips. Defined in RichTextParagraphStyle Syntax public void setTab(int position.RULER_ONE_CENTIMETER RichTextParagraphStyle.TAB_RIGHT Usage See RichTextTab for additional information and an example.TAB_LEFT RichTextParagraphStyle.” where one centimeter is 537 twips and one inch is 1440 twips.RichTextParagraphStyle class setTab method Sets a tab in a rich-text paragraph style. You can apply arithmetic to the position constants to obtain other measurements. Defined in RichTextParagraphStyle 2170 Domino Designer Programming Guide. setTabs method Sets tabs at even intervals in a rich-text paragraph style.TAB_CENTER RichTextParagraphStyle. For example.75) for three-quarters of an inch.RULER_ONE_INCH int type RichTextParagraphStyle.

TAB_CENTER RichTextParagraphStyle.TAB_RIGHT Usage See RichTextTab for additional information and an example.75) for three-quarters of an inch.RULER_ONE_INCH int interval RichTextParagraphStyle. int interval) throws NotesException public void setTabs(int count. int startpos RichTextParagraphStyle. int startpos. int startpos. int type) throws NotesException Parameters int count Number of tabs to be set. int interval. The actual int value is in “twips.RULER_ONE_CENTIMETER RichTextParagraphStyle. RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0.TAB_LEFT RichTextParagraphStyle. You can apply arithmetic to the position and interval constants to obtain other measurements.TAB_DECIMAL RichTextParagraphStyle. Chapter 10: Java Classes A–Z 2171 .RichTextParagraphStyle class Syntax public void setTabs(int count. For example.RULER_ONE_CENTIMETER RichTextParagraphStyle.” where one centimeter is 537 twips and one inch is 1440 twips.RULER_ONE_INCH int type RichTextParagraphStyle.

and Underline properties This agent writes a text using various styles.*. and Bold.RichTextStyle class RichTextStyle class Represents rich text attributes. all the RichTextStyle properties are STYLE_NO_CHANGE. Example: RichTextStyle class. StrikeThrough. At creation. Color. FontSize. Syntax public class RichTextStyle extends Base Containment Contained by: Session and RichTextItem Properties Bold through getBold and setBold Color through getColor and setColor Effects through getEffects and setEffects Font through getFont and setFont FontSize through getFontSize and setFontSize Italic through getItalic and setItalic Parent through getParent PassThruHTML through getPassThruHTML and setPassThruHTML StrikeThrough through getStrikeThrough and setStrikeThrough Underline through getUnderline and setUnderline Creation and access To create a new RichTextStyle object. 2172 Domino Designer Programming Guide. Parent.getAgentContext(). // (Your code goes here) Database db = agentContext. import lotus. Document doc = db.getCurrentDatabase(). Volume 3: JavaScript Classes . Effects. Font. use createRichTextStyle in Session. AgentContext agentContext = session.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Text that follows a rich-text style assumes the attributes of the rich-text style. Italic. Use a RichTextStyle object with appendStyle of RichTextItem.createDocument().

header."). RichTextStyle underline = session. body.setItalic(RichTextStyle. body. byline. byline. i<11.createRichTextStyle(). // Generate Body item body.appendStyle(normal).NO).YES). RichTextStyle strike = session.appendStyle(underline).RichTextStyle class Item subject = doc.setColor(RichTextStyle. header.FONT_ROMAN).createRichTextStyle(). i++) body. RichTextItem body = doc.appendStyle(byline).setBold(RichTextStyle. header."). ").appendText("Sentence of normal text.setFont(RichTextStyle. body.COLOR_BLACK). body.setEffects(RichTextStyle.setEffects(RichTextStyle.appendStyle(normal). RichTextStyle byline = session. body. i++) body. underline.setItalic(RichTextStyle. Chapter 10: Java Classes A–Z 2173 . byline.setUnderline(RichTextStyle. // Create and define styles RichTextStyle header = session. "Rich text tab").NO). i<11.EFFECTS_NONE).appendStyle(normal).setFontSize(14).").YES).appendStyle(strike).setStrikeThrough(RichTextStyle.appendText(" Sentence of normal text.setStrikeThrough(RichTextStyle.createRichTextStyle(). for (int i=0. strike.appendText("Header").NO). normal. body. i++) body. byline. for (int i=0. body. normal.setFontSize(10).appendText("Underlined text.setBold(RichTextStyle.getParent(). body. header.appendStyle(header). normal.YES). body.setUnderline(RichTextStyle. body.createRichTextItem("Body"). header. body.createRichTextStyle(). body.").EFFECTS_SHADOW).COLOR_DARK_BLUE).appendText(" Sentence of normal text.getCommonUserName()). byline.addNewLine(2).appendText("Strikethrough text.setColor(RichTextStyle. RichTextStyle normal = session.YES). for (int i=0.appendText(" ").addNewLine(). i<11.createRichTextStyle().NO).appendText("by " + byline. body.replaceItemValue("Subject".

println(e. e.id + " " + e. Defined in RichTextStyle Data type int 2174 Domino Designer Programming Guide.out.STYLE_NO_CHANGE to maintain previous state RichTextStyle.save(true.MAYBE to maintain previous state Color property Read-write.text). Color rich-text attribute as listed below. Volume 3: JavaScript Classes . } catch(NotesException e) { System. Defined in RichTextStyle Data type int Syntax public int getBold() throws NotesException public void setBold(int value) throws NotesException Legal values RichTextStyle. Bold rich-text attribute.YES for bold RichTextStyle. } } } Bold property Read-write.RichTextStyle class // Save the document doc.printStackTrace().NO for non-bold RichTextStyle. true).

COLOR_DARK_YELLOW RichTextStyle.COLOR_LIGHT_GRAY RichTextStyle.COLOR_CYAN RichTextStyle.COLOR_DARK_RED RichTextStyle.COLOR_GRAY RichTextStyle.COLOR_WHITE RichTextStyle.COLOR_BLACK RichTextStyle.COLOR_DARK_CYAN RichTextStyle.COLOR_RED RichTextStyle. Defined in RichTextStyle Data type int Chapter 10: Java Classes A–Z 2175 .RichTextStyle class Syntax public int getColor() throws NotesException public void setColor(int value) throws NotesException Legal values RichTextStyle.COLOR_DARK_BLUE RichTextStyle.COLOR_YELLOW RichTextStyle. Effects as listed below.MAYBE to maintain previous state Effects property Read-write.COLOR_MAGENTA RichTextStyle.COLOR_DARK_MAGENTA RichTextStyle.COLOR_GREEN RichTextStyle.COLOR_DARK_GREEN RichTextStyle.STYLE_NO_CHANGE to maintain the previous state RichTextStyle.COLOR_BLUE RichTextStyle.

Volume 3: JavaScript Classes .FONT_ROMAN RichTextStyle.EFFECTS_NONE RichTextStyle.FONT_COURIER RichTextStyle.FONT_HELV RichTextStyle.STYLE_NO_CHANGE to maintain the previous state RichTextStyle.EFFECTS_SUPERSCRIPT RichTextStyle.EFFECTS_EMBOSS RichTextStyle.STYLE_NO_CHANGE to maintain the previous state RichTextStyle.MAYBE to maintain previous state 2176 Domino Designer Programming Guide.EFFECTS_SHADOW RichTextStyle.EFFECTS_SUBSCRIPT RichTextStyle. Defined in RichTextStyle Data type int Syntax public int getFont() throws NotesException public void setFont(int value) throws NotesException Legal values RichTextStyle. Font rich-text attribute as listed below.RichTextStyle class Syntax public int getEffects() throws NotesException public void setEffects(int value) throws NotesException Legal values RichTextStyle.MAYBE to maintain previous state Font property Read-write.EFFECTS_EXTRUDE RichTextStyle.

Italic rich-text attribute.NO for non-italic RichTextStyle.STYLE_NO_CHANGE to maintain the previous state RichTextStyle.STYLE_NO_CHANGE to maintain the previous state RichTextStyle. Defined in RichTextStyle Data type int Syntax public int getFontSize() throws NotesException public void setFontSize(int value) throws NotesException Legal values An integer value in the range 1-250 representing a font size RichTextStyle.YES for italic RichTextStyle. Font size in points.RichTextStyle class FontSize property Read-write. Defined in RichTextStyle Data type int Syntax public int getItalic() throws NotesException public void setItalic(int value) throws NotesException Legal values RichTextStyle.MAYBE to maintain previous state Italic property Read-write.MAYBE to maintain previous state Chapter 10: Java Classes A–Z 2177 .

STYLE_NO_CHANGE to maintain the previous state RichTextStyle. Strikethrough rich-text attribute. Defined in RichTextStyle Data type Session Syntax public Session getParent() throws NotesException StrikeThrough property Read-write.NO for non-strikethrough RichTextStyle.RichTextStyle class Parent property Read-only. Volume 3: JavaScript Classes . Defined in RichTextStyle Data type int Syntax public int getStrikeThrough() throws NotesException public void setStrikeThrough(int value) throws NotesException Legal values RichTextStyle.YES for strikethrough RichTextStyle.MAYBE to maintain previous state 2178 Domino Designer Programming Guide. The session that contains a RichTextStyle object.

NO for non-underline RichTextStyle.MAYBE to maintain previous state RichTextTab class Represents a tab in a rich text paragraph style. Syntax public class RichTextTab extends Base Containment Contained by: RichTextParagraphStyle Properties Position through getPosition Type through getType Methods clear Creation and access To create a RichTextTab object. Defined in RichTextStyle Data type int Syntax public int getUnderline() throws NotesException public void setUnderline(int value) throws NotesException Legal values RichTextStyle. Underline rich-text attribute.STYLE_NO_CHANGE to maintain the previous state RichTextStyle.RichTextTab class Underline property Read-write. use getTabs in RichTextParagraphStyle.YES for underline RichTextStyle. To set tabs. use setTab and setTabs in RichTextParagraphStyle. Chapter 10: Java Classes A–Z 2179 .

createRichTextParagraphStyle(). b2. RichTextParagraphStyle. b2tab. } // Clear last tab RichTextTab b2tab = (RichTextTab)b2. Enumeration b1tabs = b1.getType()).util.createDocument().RULER_ONE_INCH * 2. RichTextParagraphStyle b2 = session. Example: RichTextTab class This agent sets tabs in a first rich text paragraph style. // Append para style b1 and write para body.clearAllTabs().appendText("Column 1"). then copies the tabs from the first style to a second rich text paragraph style and clears the last tab. To insert tabs in rich text.getAgentContext(). while (b1tabs.elements().lastElement().hasMoreElements()) { RichTextTab b1tab = (RichTextTab)b1tabs. use clear in RichTextTab and clearAllTabs in RichTextParagraphStyle. Item subject = doc. 2180 Domino Designer Programming Guide.replaceItemValue("Subject".TAB_LEFT).getTabs().clear(). To interrogate tabs.appendParagraphStyle(b1). RichTextParagraphStyle. use getPosition and getType in RichTextTab. Volume 3: JavaScript Classes .RULER_ONE_INCH * 3.*.util.nextElement(). import java. RichTextParagraphStyle. // (Your code goes here) Database db = agentContext.setTabs(3.RichTextTab class To clear tabs.domino. Document doc = db. RichTextParagraphStyle b1 = session.setTab(b1tab. // Set b2 tabs same as b1 b2.getTabs().createRichTextItem("Body"). b1. use addTab in RichTextItem.createRichTextParagraphStyle().Enumeration. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). AgentContext agentContext = session. The agent then applies each style to a paragraph of text. import java.getCurrentDatabase().Vector. "Rich text tab").clearAllTabs(). import lotus.getPosition(). RichTextItem body = doc. body. b1tab. // Define para style b1 b1.

body. body. body.save(true. body.addTab().addTab(). } } } Position property Read-only.RULER_ONE_INCH Usage You can apply arithmetic to the constants to obtain other measurements. Defined in RichTextTab Data type int Syntax public int getPosition() throws NotesException Legal values RichTextParagraphStyle.appendParagraphStyle(b2).appendText("Column 2"). body. For example. body.addTab().RichTextTab class body. body. Chapter 10: Java Classes A–Z 2181 .appendText("Column 3").” where one centimeter is 537 twips and one inch is 1440 twips.appendText("Column 4").75) for three-quarters of an inch.addTab().RULER_ONE_CENTIMETER RichTextParagraphStyle. body.appendText("Column 2"). true). } catch(Exception e) { e.addTab(). body. RULER_ONE_CENTIMETER * 2 for two centimeters or (int)(RULER_ONE_INCH * 0. // Save the document doc.printStackTrace(). Position of a tab in a rich text paragraph style. The returned int value is in “twips.appendText("Column 3"). body. // Append para style b2 and write para body.appendText("Column 1").

TAB_CENTER RichTextParagraphStyle.TAB_RIGHT clear method Clears a tab. Type of tab. Syntax public class Session extends Base throws NotesException 2182 Domino Designer Programming Guide.TAB_DECIMAL RichTextParagraphStyle. Defined in RichTextTab Syntax public void clear() throws NotesException Session class Is the root of the Domino Objects containment hierarchy.Session class Type property Read-only. Defined in RichTextTab Data type int Syntax public int getType() throws NotesException Legal values RichTextParagraphStyle.TAB_LEFT RichTextParagraphStyle. and represents the Domino environment of the current program. providing access to the other Domino objects. Volume 3: JavaScript Classes .

RichTextStyle Properties AddressBooks through getAddressBooks AgentContext through getAgentContext CommonUserName through getCommonUserName International through getInternational IsOnServer through isOnServer NotesVersion through getNotesVersion Platform through getPlatform ServerName through getServerName UserName through getUserName UserNameList through getUserNameList UserNameObject through getUserNameObject Methods createDateRange createDateTime createLog createName createNewsletter createRegistration createRichTextParagraphStyle createRichTextStyle evaluate freeTimeSearch getDatabase getDbDirectory getEnvironmentString Chapter 10: Java Classes A–Z 2183 . DateRange. DateTime. International. RichTextParagraphStyle. Registration. Database. DbDirectory. Name.Session class Containment Contained by: AgentBase. NotesFactory Contains: AgentContext. Newsletter. Log.

public class sessionprops extends NotesThread { public static void main(String argv[]) { sessionprops t = new sessionprops(). import lotus.Session class getEnvironmentValue getURLDatabase resolve setEnvironmentVar Creation and access For stand-alone applications.getSession(). Example: Session class This application creates a new Session object and accesses its properties. A reference to the current server such as a null server parameter means that Domino server. Volume 3: JavaScript Classes .println("Common name = " + 2184 Domino Designer Programming Guide.getUserName()).out. import java.isHierarchical()) System. } public void runNotes() { try { Session s = NotesFactory. Name no = s.createSession().*. use AgentBase.domino.println("User name = " + (String)s. the Session object represents the Domino server handling the remote requests. To access the current session from a Database object. use the Parent property in Database Usage For a local session. You can access servers connected to the local environment by specifying their names. t. For agents and applets.out.getUserNameObject().createSession methods. For a remote (IIOP) session.start().*. if (no.util. A reference to the current server such as a null server parameter means the local Notes/Domino environment. System. the Session object represents the machine on which the code is running. You cannot access other servers. use one of the NotesFactory.

else server = "Local". } } catch (Exception e) { e.getServer(). System. while (e. Chapter 10: Java Classes A–Z 2185 . Vector books = s.out.util.elements().getServer() != null) server = db.getAddressBooks().getPlatform()). if (db.println("***Address books***"). The Domino Directories and Personal Address Books that are known to the current session.printStackTrace().Vector getAddressBooks() throws NotesException Usage To find out if an address book is a Domino Directory or a Personal Address Book.getFileName(). String server.getCommonUserName()).getTitle().println(server + " " + fn + " \"" + title + "\""). System.out.Vector. String fn = db. String title = db. } } } AddressBooks property Read-only.hasMoreElements()) { db = (Database)e.println("Domino " + (String)s. Defined in Session Data type java. System.util. Enumeration e = books.out.getNotesVersion() + " running on " + (String)s.nextElement().Session class (String)s. Database db. use isPublicAddressBook and isPrivateAddressBook of Database. elements are Database Syntax public java.

To access all the properties and methods. String title = db.out.*. Volume 3: JavaScript Classes . Enumeration e = books. Example: AddressBooks property This application prints the server name (or “Local”). See open in Database. class addressbooks extends NotesThread { public static void main(String argv[]) { addressbooks t = new addressbooks(). and title of all the Domino Directories and Personal Address Books known to the current session. If the program runs on a server or through remote (IIOP) calls.getServer(). import lotus. Vector books = s. String fn = db.createSession(). } } 2186 Domino Designer Programming Guide. getFilePath. isPublicAddressBook. String server. and getServer.domino. else server = "Local".nextElement(). only Domino Directories on the server are included. The following Database methods are available on the closed database: getFileName. Database db.getTitle(). isOpen.println(server + " " + fn + " \"" + title + "\"").getAddressBooks().getFileName(). t.start(). } public void runNotes() { try { Session s = NotesFactory. isPrivateAddressBook. import java.elements(). both Domino Directories and Personal Address Books are included. getParent. file name.Session class If the program runs on a workstation. you must explicitly open the database. A database retrieved through getAddressBooks is closed.getServer() != null) server = db.util. if (db.hasMoreElements()) { db = (Database)e. System.*. while (e.

if an agent is running it. this property returns null. CommonUserName property Read-only. Note This property is illegal for remote (IIOP) calls. The common name of the user that created the session.Session class catch (Exception e) { e. Defined in Session Data type String Syntax public String getCommonUserName() throws NotesException Chapter 10: Java Classes A–Z 2187 .printStackTrace(). } } } AgentContext property Read-only. Represents the agent environment of the current program. Defined in Session Data type AgentContext Syntax public AgentContext getAgentContext() throws NotesException Usage If the current program is not running from an agent. See the AgentContext class for descriptions and examples.

The international (regional) settings for the session’s operating environment. CommonUserName is the same as UserName. 2188 Domino Designer Programming Guide. System. } } } International property Read-only.Session class Usage If the user name is flat (non-hierarchical). } catch(Exception e) { e. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Common user name = " + u). Volume 3: JavaScript Classes .printStackTrace(). import lotus.domino.*.getAgentContext().out. Defined in Session Data type International Syntax public International getInternational() throws NotesException Usage See the International class for descriptions and examples. // (Your code goes here) String u = session.getCommonUserName(). Example: CommonUserName property The following agent prints the common user name.

Example: IsOnServer property This agent gets names. and from the local Domion data directory otherwise. A local session is running on a server if it is an agent in a server-based database. AgentContext agentContext = session. // (Your code goes here) Database db. if (session. daily.Session class IsOnServer property Read-only. import lotus.nsf from the user’s mail server if the program is running on a server. or monthly All other programs run on a workstation. and the agent has one of the following triggers: When new mail arrives When documents have been created or modified When documents have been pasted On schedule hourly. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Indicates if the session is running on a server.*.domino. weekly. Defined in Session Data type boolean Syntax public boolean isOnServer() throws NotesException Legal values true if the program is running on a server false if the program is running on a workstation Usage A remote (IIOP) session always runs on a server.isOnServer()) { Chapter 10: Java Classes A–Z 2189 .getAgentContext().

String v = s.getNotesVersion(). true). System.createSession().getTitle() + "\"").printStackTrace(). } else { db = session.out. The release of Domino the session is running on.getEnvironmentString("MailServer".nsf: \"" + db.*.println("Domino version = " + v). "names. } System. } public void runNotes() { try { Session s = NotesFactory. import lotus. class version extends NotesThread { public static void main(String argv[]) { version t = new version(). Volume 3: JavaScript Classes .domino. Defined in Session Data type String Syntax public String getNotesVersion() throws NotesException Example: NotesVersion property This application displays the release number of Domino installed in the local program and data directories.nsf"). db = session.getDatabase(null.Session class String ms = session.getDatabase(ms. } 2190 Domino Designer Programming Guide.out. t. } catch(Exception e) { e.println("Title of names. "names.nsf").start(). } } } NotesVersion property Read-only.

AIX®) Example: Platform property This application prints the name of the platform. HP-UX. import lotus.printStackTrace().domino.start(). class platform extends NotesThread { public static void main(String argv[]) { platform t = new platform().*. t. SCO. The name of the platform the session is running on. Defined in Session Data type String Syntax public String getPlatform() throws NotesException Legal Values “Macintosh” “MS-DOS” “Netware” “OS/2v1” “OS/2v2” “Windows/16” “Windows/32” “UNIX” Macintosh MS-DOS NetWare OS/2® 16-bit OS/2 32-bit Windows 16-bit Windows 32-bit UNIX (Sun.Session class catch (Exception e) { e. } Chapter 10: Java Classes A–Z 2191 . } } } Platform property Read-only.

2192 Domino Designer Programming Guide.println("Platform = " + p).out. Defined in Session Data type String Syntax public String getServerName() throws NotesException Usage If the server name is hierarchical.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Server name = " + u). AgentContext agentContext = session. import lotus.createSession(). // (Your code goes here) String u = session. } catch (Exception e) { e.Session class public void runNotes() { try { Session s = NotesFactory. this property returns the fully distinguished name. Example: ServerName property This agent prints the name of the server. } } } ServerName property Read-only. String p = s. The full name of the server that the session is running on. System.getAgentContext().printStackTrace(). This property is null if the session is not running on a server. System. Volume 3: JavaScript Classes .out.getServerName().*.getPlatform().

*.getAgentContext(). } catch(Exception e) { e.getUserName().Session class } catch(Exception e) { e. Defined in Session Data type String Syntax public String getUserName() throws NotesException Usage If the user name is hierarchical.println("User name = " + u). To get only the common name. Example: UserName property The following agent prints the user name.printStackTrace().printStackTrace(). import lotus.domino. System. // (Your code goes here) String u = session. use the CommonUserName property. } } } UserName property Read-only.out. AgentContext agentContext = session. } } } Chapter 10: Java Classes A–Z 2193 . this property returns the fully distinguished name. The full name of the user or server that created the session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

Defined in Session Data type Name Syntax public Name getUserNameObject() throws NotesException Example: UserNameObject property This agent gets a Name object for the current user and prints the common user name.Vector getUserNameList() throws NotesException Usage If the user does not have an alternate name.Vector. elements are Name Syntax public java.domino. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). If the user does have an alternate name.Session class UserNameList property Read-only.util. AgentContext agentContext = session. Defined in Session Data type java. UserNameObject property Read-only. 2194 Domino Designer Programming Guide. getUserNameList returns a vector of two elements containing the user name and the alternate user name. getUserNameList returns a vector of one element containing the user name. in the form of a Name object. import lotus. and the alternate name if it exists.getAgentContext().*. Volume 3: JavaScript Classes // . The name of the user or server that created the session. The name.util. of the user or server that created the session.

java.Session class (Your code goes here) Name no = session. DateTime endt The ending date-time of the range.Date startt. Date startt The starting date-time of the range using a java. String u = no. Defined in Session Syntax public DateRange createDateRange() throws NotesException public DateRange createDateRange(DateTime startt. Cannot be null. } } } } createDateRange method Creates a new DateRange object.util. Chapter 10: Java Classes A–Z 2195 . DateTime endt) throws NotesException public DateRange createDateRange(java. catch(Exception e) { e.util. Date endt The ending date-time of the range using a java.getUserNameObject().println("Common user name = " + u).Date object. Cannot be null.util.out.Date endt) throws NotesException Parameters DateTime startt The starting date-time of the range. System.getCommon().Date object.util.printStackTrace().

Defined in Session Syntax public DateTime createDateTime(String date) throws NotesException public DateTime createDateTime(java. An invalid date-time or empty string results in an “Invalid date” exception.Date object.Date date) throws NotesException Parameters String date The date and time you want the object to represent. Usage See DateTime for descriptions and examples. See DateTime for formats.util. Volume 3: JavaScript Classes . 2196 Domino Designer Programming Guide.util. java.Session class Return value DateRange The newly-created DateRange object. createDateTime method Creates a DateTime object that represents a specified date and time.Date date The date and time you want the object to represent using a java.util. Usage See the DateRange class for descriptions and examples. Return value DateTime The newly-created date-time.

it is treated as a flat name. Usage See the Log class for descriptions and examples. Return value Log The newly-created log. Chapter 10: Java Classes A–Z 2197 . For primary user names.Session class createLog method Creates a new Log object with the name you specify. Defined in Session Syntax public Log createLog(String name) throws NotesException Parameter String name A name that identifies the log. the language should be null. String lang) throws NotesException Parameters String name A user or server name. See the Language property in Name. For alternate user names. a language can be specified. createName method Creates a new Name object. Defined in Session Syntax public Name createName(String name) throws NotesException public Name createName(String name. String lang A language associated with the user name. If the name is not in the format of an abbreviated or canonical hierarchical name.

Volume 3: JavaScript Classes . createRegistration method Creates a new Registration object. creates a new Newsletter. Usage See the Newsletter for descriptions and examples. createNewsletter method Given a DocumentCollection containing the documents you want. Usage See the Name class for descriptions and examples. Defined in Session Syntax public Newsletter createNewsletter(DocumentCollection collection) throws NotesException Parameter DocumentCollection collection The documents that you want included in the newsletter. Can be null. Return value Newsletter The newly created newsletter. Note This property is illegal for remote (IIOP) calls.Session class Return value Name The new Name object. Defined in Session Syntax public Registration createRegistration() throws NotesException 2198 Domino Designer Programming Guide.

Usage See the RichTextStyle class for descriptions and examples. Defined in Session Syntax public RichTextParagraphStyle createRichTextParagraphStyle() throws NotesException Return value RichTextParagraphStyle The newly-created RichTextParagraphStyle object. Chapter 10: Java Classes A–Z 2199 . Usage See the Registration class for descriptions and examples. Defined in Session Syntax public RichTextStyle createRichTextStyle() throws NotesException Return value RichTextStyle The newly-created RichTextStyle object. Usage See the RichTextParagraphStyle class for descriptions and examples.Session class Return value Registration The newly-created Registration object. createRichTextStyle method Creates a new RichTextStyle object. createRichTextParagraphStyle method Creates a new RichTextParagraphStyle object.

Cannot be null. @DDEInitiate.util.*. @DDETerminate.Vector evaluate(String formula) throws NotesException public java. public class JavaAgent extends AgentBase { public void NotesMain() { try { 2200 Domino Designer Programming Guide.util. import java. you must use the 2-parameter method. Return value java. Examples: evaluate method 1. you can only get a result. write the result to the document with a method such as Document. @DbName. Usage If the formula contains the name of a field. @Functions that affect the user interface do not work in evaluate. @Prompt. @DbTitle. and @ViewTitle. This agent applies the @ProperCase @function to the Subject field in every document of the current database.domino. @DDEPoke.*. @DDEExecute. You cannot change a document with evaluate. Document doc The formula context. Defined in Session Syntax public java. Volume 3: JavaScript Classes .Vector The result of the evaluation.replaceItemValue. Document doc) throws NotesException Parameters String formula The formula.Vector evaluate(String formula. @PickList.util.Session class evaluate method Evaluates a Domino formula. @PostedCommand. The formula takes the field from the document specified as parameter 2. A scalar result is returned in firstElement. To change a document. import lotus. @DbManager. These include: @Command.util. @DialogBox.

getCount()). Vector v = session.out.getNthDocument(j+1).save(true. for (int j=0.printStackTrace(). AgentContext agentContext = session.getNthDocument(j+1).firstElement() + " " + doc.getCurrentDatabase(). Document doc. doc. j++) { doc = dc.Session class Session session = getSession(). } } catch(Exception e) { e.evaluate("@ProperCase(Subject)". j<dc.getItemValue("Subject")).println("Count = " + dc. j<dc. doc.getAllDocuments(). Vector v = session.replaceItemValue("Subject". doc).getCount().getAgentContext(). import lotus. AgentContext agentContext = session.getAllDocuments().out. This agent applies the @Sum @function to the Amount field (which allows multiple values) in each document and prints the result.*. v. } } } 2. // (Your code goes here) Database db = agentContext. } } } Chapter 10: Java Classes A–Z 2201 .evaluate("@Sum(Amount)". doc). false).getAgentContext().println(v. DocumentCollection dc = db. DocumentCollection dc = db. j++) { doc = dc.util. Document doc.getCurrentDatabase().printStackTrace(). for (int j=0.*. import java. System. } } catch(Exception e) { e.domino.getCount(). // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().firstElement()). System.

notes. Cannot be null. False if you want all matching times.Vector Each member of the vector is a DateRange object. import java. Example: freeTimeSearch method This application finds the first 60-minute time slot available for three people.util. boolean firstfit True if you just want the first matching date range. Object names. int duration The length in minutes of the free-time interval you want to schedule. boolean firstfit) throws NotesException Parameters DateRange window Starting and ending times within which to search for a match.*.*. The name or names of the people or groups whose free time you want to schedule.Session class freeTimeSearch method Searches for free time slots for calendaring and scheduling. int duration. Cannot be null. Defined in Session Syntax public java.Vector freeTimeSearch(DateRange window. } 2202 Domino Designer Programming Guide.util.util. The vector is null if there are no matches. Volume 3: JavaScript Classes . Return value java. Object names String or vector of strings. import lotus. class free extends NotesThread { public static void main(String argv[]) { free t = new free().start(). t.

getStartDateTime(). window. names.newInstance().createDateTime("Today")). DateRange window = s.addElement("Marybeth Enakermay"). DateTime sdt = dr.createDateTime("Tomorrow")). String db. } } catch (Exception e) { e. true). names. boolean createonfail) throws NotesException Chapter 10: Java Classes A–Z 2203 . i<freetime.addElement("Robert Erronpay").out.setEndDateTime(s. 60.out.println("No time slots").createDateRange(). System.freeTimeSearch (window.size().addElement("Kerry Oodwardway"). String db) throws NotesException public Database getDatabase(String server. System. if possible. else for (int i=0. window. Vector names = new Vector(3).println(" End = " + edt.getLocalTime()). and opens the database.println("Start = " + sdt.getLocalTime()).Session class public void runNotes() { try { Session s = Session. } } } getDatabase method Creates a Database object that represents the database located at the server and file name you specify. i++) { DateRange dr = (DateRange)freetime.out. Defined in Session Syntax public Database getDatabase(String server.setStartDateTime(s. Vector freetime = s.elementAt(i).getEndDateTime(). if (freetime == null) System. names.printStackTrace(). DateTime edt = dr. names.

Session class Parameters String server The name of the server on which the database resides. Use a full path name if the database is not within the Domino data directory. getDbDirectory method Creates a new DbDirectory object using the name of the server you want to access. creates a Database object even if the specified database cannot be opened. boolean createonfail If true. Usage See the Database class for descriptions and examples. Use null to indicate the session’s environment. Use null to indicate the session’s environment. If false or omitted. String db The file name and location of the database within the Domino data directory. Must be null for remote (IIOP) operations. Defined in Session Syntax public DbDirectory getDbDirectory(String server) throws NotesException Parameter String server The name of the server with database files you want to navigate. returns null if the database cannot be opened. 2204 Domino Designer Programming Guide. Volume 3: JavaScript Classes . Return value Database A Database object that can be used to access the database you have specified. Must be null for remote (IIOP) operations.

the method prepends “$” to the name before retrieving its value. getEnvironmentString method Given the name of a string or numeric environment variable. retrieves its value. Usage See the DbDirectory class for descriptions and examples. Defined in Session Syntax public String getEnvironmentString(String vname) throws NotesException public String getEnvironmentString(String vname. boolean issystem If true. Return value String The value of the environment variable. Chapter 10: Java Classes A–Z 2205 . If false or omitted. the method uses the exact name of the environment variable. Usage This method retrieves the environment variable from the notes.Session class Return value DbDirectory The directory on the server you specified. boolean issystem) throws NotesException Parameters String vname The name of the environment variable to get.ini file for the current session.

start().*. } catch (Exception e) { e.domino. class getenvstring extends NotesThread { public static void main(String argv[]) { getenvstring t = new getenvstring().*. import lotus.getEnvironmentString("EnvLoc".getEnvironmentString("MailServer". t. This application gets the value of the $EnvLoc environment variable. String ms = s. } public void runNotes() { try { Session s = NotesFactory. true). t. String envloc = s. false).Session class Examples: getEnvironmentString method 1. else System.domino.createSession(). Volume 3: JavaScript Classes .out.start(). class getenvstring2 extends NotesThread { public static void main(String argv[]) { getenvstring2 t = new getenvstring2().out.println("No MailServer").out. } public void runNotes() { try { Session s = NotesFactory.printStackTrace(). This application gets the value of the MailServer system environment variable. if (ms == null) System. 2206 Domino Designer Programming Guide.println("$EnvLoc = " + envloc). } } } 2.println("No $EnvLoc"). import lotus. if (envloc == null) System.createSession().

If false or omitted. } catch (Exception e) { e. Chapter 10: Java Classes A–Z 2207 .printStackTrace(). the method uses the exact name of the environment variable.out. the method prepends “$” to the name before retrieving its value. boolean issystem) throws NotesException Parameter String vname The name of the environment variable to get.println("MailServer = " + ms). retrieves its value.Session class else System. Do not use this method for string values. Return value Object The value of the environment variable. } } } getEnvironmentValue method Given the name of a numeric environment variable. boolean issystem If true. Defined in Session Syntax public Object getEnvironmentValue(String vname) throws NotesException public Object getEnvironmentValue(String vname.ini file for the current session. Usage This method retrieves the environment variable from the notes.

class getenvval2 extends NotesThread { public static void main(String argv[]) { getenvval2 t = new getenvval2().createSession().getEnvironmentValue("TimeZone".*.domino.printStackTrace().out. false). t. import lotus. } catch (Exception e) { e. } public void runNotes() { try { Session s = NotesFactory. else System.out.println("TimeZone = " + tz). if (envnum == null) System. t. } } } 2.createSession(). This application gets the value of the environment variable $EnvNum.domino.out. Object tz = s.println("No $EnvNum"). else System.getEnvironmentValue("EnvNum".println("$EnvNum = " + envnum). Volume 3: JavaScript Classes . Object envnum = s.out. This application gets the value of the system environment variable . class getenvval extends NotesThread { public static void main(String argv[]) { getenvval t = new getenvval(). true).start().start(). 2208 Domino Designer Programming Guide. if (tz == null) System. } public void runNotes() { try { Session s = NotesFactory. import lotus.*.Session class Examples: getEnvironmentValue method 1.println("No TimeZone").

getTitle() + "\"").Session class } catch (Exception e) { e.start().println("Is open"). if (db. import lotus.println("Not open").domino. class geturldb extends NotesThread { public static void main(String argv[]) { geturldb t = new geturldb().println ("Title of URL database: \"" + db.isOpen()) System.printStackTrace().out.out. Database db = s.*. System.getURLDatabase().createSession(). } catch (Exception e) { Chapter 10: Java Classes A–Z 2209 . else System. Defined in Session Syntax public Database getURLDatabase() throws NotesException Return value Database A Database object representing the default Web Navigator database. } } } getURLDatabase method Finds and opens the default Web Navigator database. t.out. Example: getURLDatabase method This application opens the default Web navigator database. } public void runNotes() { try { Session s = NotesFactory.

Document. View. Form. You must cast the return value to the expected type. or Agent object. } } } resolve method Returns the Domino object that a URL addresses.printStackTrace(). Object value) throws NotesException public void setEnvironmentVar(String vname. Object value. 2210 Domino Designer Programming Guide. boolean issystem) throws NotesException Parameters String vname The name of the environment variable to set. Return value Base A Database.Session class e. Defined in Session Syntax public Base resolve(String url) throws NotesException Parameters String url A URL that addresses a Domino object. Defined in Session Syntax public void setEnvironmentVar(String vname. setEnvironmentVar method Sets the value of a string or numeric environment variable. Volume 3: JavaScript Classes .

domino.printStackTrace(). s.*. When you examine the environment variable in the notes. t. unless you specify issystem as false or have already included a “$” as the first character of the name. you have the option of including or omitting the “$” from the variable name. } } } Chapter 10: Java Classes A–Z 2211 . } public void runNotes() { try { Session s = NotesFactory.createSession().ini (or Notes Preferences) file.” import lotus. no dollar sign character (“$”) is prepended to the variable name.start(). SetEnvironmentVar prepends a dollar sign character (“$”) to the name before setting the value of the environment variable. a dollar sign is prepended.ini (or Notes Preferences) file.setEnvironmentVar("HomeTown". Usage If an environment variable called vname already exists. This application sets the value of the $HomeTown environment variable to “Tokyo.ini file for the current session. it is assigned the new value. Examples: setEnvironmentVar method 1. boolean issystem If true. If false or omitted.Session class Object value The value of the environment variable. } catch (Exception e) { e. you see the “$” character. When retrieving environment variables with the getEnvironmentString or getEnvironmentValue methods. Date values are converted to strings. false). Otherwise. The environment variable is set in the notes. "Tokyo". class setenvvar extends NotesThread { public static void main(String argv[]) { setenvvar t = new setenvvar(). a new environment variable is added to the notes.

ViewEntry.createSession(). "Tornado". Syntax public class View extends Base Containment Contained by: Database Contains: Document. DateTime.View class 2. true).printStackTrace(). } public void runNotes() { try { Session s = NotesFactory.*. This application sets the value of the MailServer system environment variable to “Tornado. ViewEntryCollection.domino. ViewColumn.setEnvironmentVar("MailServer".start(). Volume 3: JavaScript Classes .” import lotus. t. } catch (Exception e) { e. s. } } } View class Represents a view or folder of a database and provides access to documents within it. ViewNavigator Properties Aliases through getAliases AllEntries through getAllEntries BackgroundColor through getBackgroundColor 2212 Domino Designer Programming Guide. class setenvvar2 extends NotesThread { public static void main(String argv[]) { setenvvar2 t = new setenvvar2().

View class ColumnCount through getColumnCount ColumnNames through getColumnNames Columns through getColumns Created through getCreated HeaderLines through getHeaderLines IsAutoUpdate through isAutoUpdate and setAutoUpdate IsCalendar through isCalendar IsCategorized through isCategorized IsConflict through isConflict IsDefaultView through isDefaultView IsFolder through isFolder IsHierarchical through isHierarchical IsModified through isModified IsPrivate through isPrivate IsProtectReaders through isProtectReaders and setProtectReaders LastModified through getLastModified Name through getName Parent through getParent Readers through getReaders and setReaders RowLines through getRowLines Spacing through getSpacing TopLevelEntryCount through getTopLevelEntryCount UniversalID through getUniversalID Methods clear createViewNav createViewNavFrom createViewNavFromCategory createViewNavFromChildren createViewNavFromDescendants Chapter 10: Java Classes A–Z 2213 .

2214 Domino Designer Programming Guide. To access all the views and folders in a database.View class createViewNavMaxLevel FTSearch getAllDocumentsByKey getAllEntriesByKey getChild getColumn getDocumentByKey getEntryByKey getFirstDocument getLastDocument getNextDocument getNextSibling getNthDocument getParentDocument getPrevDocument getPrevSibling refresh remove Access You access a view or folder through the Database object that contains it. Volume 3: JavaScript Classes . the View objects may also represent personal views and folders. use getViews. use getView. Returned is a View object or a vector of View objects that represent public views and/or folders in the database. There are two ways: To access a view or folder when you know its name or alias. To access a view or folder when you have a view entry. If a program runs on a workstation. use getParent in ViewEntry.

} catch(Exception e) { e. and ViewNavigator objects: A ViewEntry object represents a row in the view and can be a document.println (doc.getItemValueString("Subject")). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). View view = db. (Excluded are category and total ViewEntry objects. ViewEntryCollection.getAgentContext().getFirstDocument().domino. "NotesUA\\progwork"). A View object provides access to ViewColumn objects. Document doc = view. A ViewEntryCollection object provides access to selected or all document ViewEntry objects.out. Examples: View class 1. This agent finds the “By Category” view in a database and gets the first document in the view.) A ViewNavigator object provides methods for navigating through selected or all ViewEntry and Document objects. or total. A document entry provides a handle to the associated Document object.printStackTrace().*. which contain information on each column in the view.getView("By Category"). // (Your code goes here) Database db = session. } } } Chapter 10: Java Classes A–Z 2215 . AgentContext agentContext = session. category.View class Usage A View object provides access to ViewEntry. System. import lotus.getDatabase ("FrenchFry".

} System.getView("($All)"). "NotesUA\\progwork").isDefaultView()) break. import lotus. AgentContext agentContext = session. System.getItemValueString("Subject")). } catch(Exception e) { e. // (Your code goes here) Database db = session.getAgentContext().getFirstDocument(). } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). for (int i=0. i<views. Document doc = view. "NotesUA\\progwork").getDatabase ("FrenchFry".View class 2.getViews(). i++) { view = (View)views. } } } 2216 Domino Designer Programming Guide.printStackTrace().getDatabase ("FrenchFry".out.println (doc.println (view. if (view.getAgentContext(). Vector views = db.domino. // (Your code goes here) Database db = session.*.util.size().printStackTrace(). View view = null. import java. AgentContext agentContext = session. Volume 3: JavaScript Classes .Vector.domino.getName() + " is the default view").elementAt(i).*.out. } } } 3. This agent finds the default view in a database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. View view = db. This agent finds the “($All)” hidden view in a database and gets the first document in the view.

View class Aliases property Read-only.getName() + " has no aliases").println (view.println (view.getName() + " has 1 alias"). Defined in View Data type java. Vector views = db. The aliases of a view. else System. Use getName to return the name.getAliases(). for (int i=0.size() == 1) System.getViews(). are returned as part of the name.Vector. Old-style aliases that are in the name field. j<aliases. import lotus.domino.size().out.*. import java.util. AgentContext agentContext = session.Vector getAliases() throws NotesException Usage This property does not return the name of the view.size() + " aliases"). Vector aliases = view.getCurrentDatabase().out. if (aliases.getName() + " has " + aliases. i<views.size() == 0) System. i++) { View view = (View)views. for (int j=0.util.getAgentContext(). elements are String Syntax public java.out.util. j++) Chapter 10: Java Classes A–Z 2217 . public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // (Your code goes here) Database db = agentContext. separated from the name by vertical bars. else if (aliases. Example: Aliases property This agent displays the name and aliases for each view.size().elementAt(i).println (view.Vector.

domino. Volume 3: JavaScript Classes . // (Your code goes here) Database db = agentContext.printStackTrace(). System.out.View class System. ViewEntryCollection vec = view. import lotus. } } } AllEntries property Read-only.println ("\t" + aliases. Example: AllEntries property This agent prints the number of document entries in a view.getCount() + " entries").*. } } catch(Exception e) { e. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.getCurrentDatabase(). The document entries in a view in view order. If a view is filtered by FTSearch. View view = db.getAgentContext(). AgentContext agentContext = session.println("\"By Category\" view has " + vec. Defined in View Data type ViewEntryCollection Syntax public ViewEntryCollection getAllEntries() throws NotesException Usage A view entry collection contains only document entries (no categories or totals). this property returns the entries in the filtered view.elementAt(j)). 2218 Domino Designer Programming Guide.getAllEntries().getView("By Category").

Defined in View Data type int Syntax public int getBackgroundColor() throws NotesException Legal values RichTextStyle.COLOR_BLUE RichTextStyle.printStackTrace(). } } } BackgroundColor property Read-only.COLOR_BLACK RichTextStyle.COLOR_MAGENTA RichTextStyle.COLOR_GREEN RichTextStyle.COLOR_RED RichTextStyle.COLOR_DARK_GREEN RichTextStyle.COLOR_DARK_BLUE RichTextStyle.COLOR_DARK_MAGENTA RichTextStyle. The background color of a view.COLOR_YELLOW RichTextStyle.View class } catch(Exception e) { e.COLOR_DARK_RED RichTextStyle.COLOR_LIGHT_GRAY Chapter 10: Java Classes A–Z 2219 .COLOR_GRAY RichTextStyle.COLOR_WHITE RichTextStyle.COLOR_CYAN RichTextStyle.COLOR_DARK_CYAN RichTextStyle.COLOR_DARK_YELLOW RichTextStyle.

break.getBackgroundColor()) { case RichTextStyle. case RichTextStyle. break.COLOR_LIGHT_GRAY : msg = "light gray". case RichTextStyle. default : msg = "unknown". break.COLOR_BLACK : msg = "black". case RichTextStyle. break. case RichTextStyle. case RichTextStyle. import lotus.out. case RichTextStyle. Volume 3: JavaScript Classes . break.COLOR_RED : msg = "red". case RichTextStyle.COLOR_MAGENTA : msg = "magenta".COLOR_BLUE : msg = "blue". case RichTextStyle. case RichTextStyle.domino. // (Your code goes here) Database db = agentContext. AgentContext agentContext = session. break.COLOR_DARK_GREEN : msg = "dark green". break. View view = db.COLOR_WHITE : msg = "white". break. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getCurrentDatabase().COLOR_DARK_MAGENTA : msg = "dark magenta". case RichTextStyle. case RichTextStyle. break.getView("By Category").COLOR_GREEN : msg = "green".COLOR_CYAN : msg = "cyan". } System. switch(view.println 2220 Domino Designer Programming Guide. break. break. String msg = null.getAgentContext().View class Example: BackgroundColor property This agent prints the background color of a view. case RichTextStyle. case RichTextStyle.COLOR_GRAY : msg = "gray".COLOR_DARK_RED : msg = "dark red". break. break. case RichTextStyle.COLOR_YELLOW : msg = "yellow". break. break.*. case RichTextStyle.COLOR_DARK_CYAN : msg = "dark cyan".COLOR_DARK_YELLOW : msg = "dark yellow".COLOR_DARK_BLUE : msg = "dark blue". break.

int count = view.out. import lotus.getAgentContext(). The number of columns in a view. } } catch(Exception e) { e. } } } Chapter 10: Java Classes A–Z 2221 .*.getColumnCount().println("\t#" + new Integer(i+1) + "\t" + (String)columnNames. } catch(Exception e) { e. i++) { System.util.getColumnNames().View class ("Background color of \"By Category\" is " + msg).getView("By Category").printStackTrace().getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). for (int i=0. // (Your code goes here) Database db = agentContext.Vector. View view = db.elementAt(i)).out.size(). } } } ColumnCount property Read-only.println ("\"By Category\" has " + count + " columns:").printStackTrace(). System. i<columnNames. AgentContext agentContext = session.domino. import java. Defined in View Data type int Syntax public int getColumnCount() throws NotesException Example: ColumnCount and ColumnNames properties This agent prints the number of columns in a view and the names of the columns. Vector columnNames = view.

import java.Vector. from left to right. 2222 Domino Designer Programming Guide.Vector. elements are String Syntax public java.Vector getColumns() throws NotesException Usage The order of ViewColumn objects in the vector corresponds to the order of the columns in the view. Example: Columns property This agent prints the title of each column in a view. import lotus. from left to right. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Vector. Defined in View Data type java. Volume 3: JavaScript Classes .domino.View class ColumnNames property Read-only.Vector getColumnNames() throws NotesException Usage The order of the column names in the vector corresponds to the order of the columns in the view.util. AgentContext agentContext = session. The names of the columns in a view.getAgentContext(). Defined in View Data type java. The columns in a view.util.*.util.util. Columns property Read-only.util. elements are ViewColumn Syntax public java.

Defined in View Data type DateTime Syntax public DateTime getCreated() throws NotesException Example: Created property This agent prints the creation date of a view.getCreated().printStackTrace().elementAt(i). View view = db. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().View class // (Your code goes here) Database db = agentContext. Chapter 10: Java Classes A–Z 2223 . // (Your code goes here) Database db = agentContext.out. i++) { ViewColumn column = (ViewColumn)columns. i<columns.getAgentContext().println(column.out. } } catch(Exception e) { e.domino.getColumns(). for (int i=0. else System.getCurrentDatabase().size().out. import lotus.println("No title"). DateTime cdate = view.getCurrentDatabase().getLocalTime()).getTitle() == "") System.getTitle()). Vector columns = view. The date and time when a view was created. AgentContext agentContext = session.println ("Creation date = " + cdate. } } } Created property Read-only.getView("By Category"). if (column. View view = db.*.getView("By Category").

System.getName()). import java. Volume 3: JavaScript Classes . } } } HeaderLines property Read-only.out.size(). IsHierarchical.println(view.println 2224 Domino Designer Programming Guide.getCurrentDatabase(). The number of lines in the header of a view. if (view. i<views.printStackTrace(). and TopLevelEntryCount properties This agent prints the number of header lines.getRowLines()). top-level entry count. System. spacing interval.getViews(). // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().Vector.util.println ("\tSpacing = " + view. RowLines.getHeaderLines()). AgentContext agentContext = session.println ("\tRowLines = " + view. number of row lines.domino. import lotus. System. IsCategorized. i++) { View view = (View)views.out. Spacing.*.out. and hierarchical status for all categorized views in the current database.out.getAgentContext(). Vector views = db.println ("\tHeaderLines = " + view. Defined in View Data type int Syntax public int getHeaderLines() throws NotesException Example: HeaderLines.View class } catch(Exception e) { e.elementAt(i). System.isCategorized()) { System.out. for (int i=0.getSpacing()).

Indicates whether the View object is updated before a navigation operation if the view has changed since being opened or refreshed. } } } IsAutoUpdate property Read-write.getTopLevelEntryCount()). } } } catch(Exception e) { e. You may want to set this value to false to save time.println ("\tIsHierarchical = " + view. the View object is not updated unless you call refresh. System.out. caching is turned off. Defined in View Data type boolean Syntax public boolean isAutoUpdate() throws NotesException public void setAutoUpdate(boolean flag) throws NotesException Legal values true if the view is automatically updated (default for local operations) false if the view is not automatically updated (default for remote IIOP operations) Usage If this value is false.isHierarchical()).View class ("\tTopLevelEntryCount = " + view.printStackTrace(). Chapter 10: Java Classes A–Z 2225 . If this value is true for remote (IIOP) operations.

// Turn off auto-update before proceeding view.*.out.getView("By Category").setAutoUpdate(false).printStackTrace(). and whether conflict checking is in effect for a calendar view. 2226 Domino Designer Programming Guide.println ("Auto-update is " + view.getAgentContext().View class Example: IsAutoUpdate property This agent turns off automatic updating in a view..domino. } catch(Exception e) { e. Volume 3: JavaScript Classes .getCurrentDatabase().isAutoUpdate()). Defined in View Data type boolean Syntax public boolean isCalendar() throws NotesException Legal values true if the view is a calendar view false if the view is not a calendar view Example: IsCalendar and isConflict properties This agent displays whether each view in the current database is a calendar view or a standard outline view. } } } IsCalendar property Read-only. import lotus. // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System. // Work in view // .. Indicates whether a view is a calendar view. View view = db. AgentContext agentContext = session.

getAgentContext().getName() + " is a " + cal).View class import lotus. } } catch(Exception e) { e. System. import java. // (Your code goes here) Database db = agentContext. } else cal = "standard outline view". if (view. i<views.printStackTrace(). } } } IsCategorized property Read-only. Indicates whether a view is categorized. if (view.println (view.size(). Defined in View Data type boolean Syntax public boolean isCategorized() throws NotesException Legal values true if the view is categorized false if the view is not categorized Chapter 10: Java Classes A–Z 2227 . String cal = null. for (int i=0.util.getViews(). else cal = cal + " without conflict checking". AgentContext agentContext = session.*. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.elementAt(i).Vector.getCurrentDatabase(). i++) { View view = (View)views.isConflict()) cal = cal + " with conflict checking".isCalendar()) { cal = "calendar view". Vector views = db.out.

Indicates whether a view is enabled for conflict checking. Defined in View Data type boolean Syntax public boolean isDefaultView() throws NotesException Legal values true if the view is the default view false if the view is not the default view Example: IsDefaultView property This agent finds the default view in the current database. 2228 Domino Designer Programming Guide.*. Defined in View Data type boolean Syntax public boolean isConflict() throws NotesException Legal values true if the view is enabled for conflict checking false if the view is not enabled for conflict checking IsDefaultView property Read-only.View class IsConflict property Read-only. import lotus. Volume 3: JavaScript Classes . AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). Indicates whether a view is the default view of the database. import java.Vector.domino.util.

domino.getViews(). Vector views = db.size().getAgentContext(). i++) { View view = (View)views.getName() + "\"").printStackTrace(). break. } } } catch(Exception e) { e. Indicates whether a View object represents a folder.elementAt(i).util. Chapter 10: Java Classes A–Z 2229 . if (view.*. i<views.Vector. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). for (int i=0.println ("The default view is \"" + view. } } } IsFolder property Read-only.View class // (Your code goes here) Database db = agentContext.getCurrentDatabase().out. import java. import lotus. AgentContext agentContext = session.isDefaultView()) { System.getCurrentDatabase(). Defined in View Data type boolean Syntax public boolean isFolder() throws NotesException Legal values true if the View object represents a folder false if the View object represents a view Example: IsFolder property This agent displays whether each view object in the current database is a view or a folder. // (Your code goes here) Database db = agentContext.

Volume 3: JavaScript Classes . Defined in View Data type boolean 2230 Domino Designer Programming Guide. i++) { View view = (View)views.println (view.elementAt(i).printStackTrace(). i<views. for (int i=0. } } } IsHierarchical property Read-only. Indicates whether a view shows response documents in a hierarchy. Defined in View Data type boolean Syntax public boolean isHierarchical() throws NotesException Legal values true if the view is hierarchical false if the view is not hierarchical IsModified property Read-only.isFolder()) f = "folder".out. } } catch(Exception e) { e. else f = "view". System.getName() + " is a " + f). String f = null. Indicates whether a view is modified.getViews().size(). if (view.View class Vector views = db.

import lotus. // (Your code goes here) Database db = agentContext. import java.size().View class Syntax public boolean isModified() throws NotesException Legal values true if the view is modified false if the view is not modified IsPrivate property Read-only. i++) { View view = (View)views. i<views.elementAt(i).*.isPrivate()) System.domino. AgentContext agentContext = session. Vector views = db.println("View is private").getViews(). else Chapter 10: Java Classes A–Z 2231 .util. Defined in View Data type boolean Syntax public boolean isPrivate() throws NotesException Legal values true if the view is private false if the view is shared Example: IsPrivate property This agent displays whether each view in the current database is private or shared. for (int i=0.getCurrentDatabase(). if (view.Vector. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().out.getAgentContext(). Indicates whether a view is private or private on first use.

getCurrentDatabase(). System. View view = db. Volume 3: JavaScript Classes . import lotus. if (view.println("View is shared"). Protects $Readers items from being overwritten by replication. 2232 Domino Designer Programming Guide.getView("By Category").getAgentContext().isProtectReaders()) { view.setProtectReaders(false). } } catch(Exception e) { e.View class System.domino.out.setProtectReaders(true). // (Your code goes here) Database db = agentContext. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace(). } } } IsProtectReaders property Read-write. Defined in View class Data type boolean Syntax public boolean isProtectReaders() throws NotesException public void setProtectReaders(boolean flag) throws NotesException Legal values true if $Readers items are protected false if $Readers items are not protected Example: IsProtectReaders property This agent toggles protection for the readers field.*.out. AgentContext agentContext = session.println ("Protect readers is not set"). } else { view.

// (Your code goes here) Database db = agentContext.size().Vector.domino. } } catch(Exception e) { e. Vector views = db. Defined in View Data type DateTime Syntax public DateTime getLastModified() throws NotesException Example: LastModified property This agent gets the last modified date of the By Category view of the current database. import lotus.out. System.getViews().*.util.printStackTrace().printStackTrace(). AgentContext agentContext = session.getLastModified()). i<views.getName() + " last modified on " + view. } } } LastModified property Read-only.getAgentContext().out.elementAt(i).println (view. } } } Chapter 10: Java Classes A–Z 2233 .println ("Protect readers is set"). The date that a view was last modified. for (int i=0. import java.getCurrentDatabase(). } catch(Exception e) { e. i++) { View view = (View)views.View class System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().

i++) { View view = (View)views. The name of a view. i<views.Vector.printStackTrace(). for (int i=0. // (Your code goes here) Database db = agentContext. Example: Name property This agent gets the names of all the views in the current database.domino.println(view.getAgentContext().out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getViews(). are returned as part of the name. Volume 3: JavaScript Classes . Old-style aliases that are in the name field.size(). } } } 2234 Domino Designer Programming Guide. import java.getName()).getCurrentDatabase(). import lotus.*.util. AgentContext agentContext = session. } } catch(Exception e) { e. Defined in View Data type String Syntax public String getName() throws NotesException Usage Use getAliases to get the aliases.elementAt(i).View class Name property Read-only. System. Vector views = db. separated from the name by vertical bars.

Defined in View Data type Database Syntax public Database getParent() throws NotesException Example: Parent property This agent compares the title of the current database with the parent of the current view. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getAgentContext(). They should be the same. The database to which a view belongs. else System.println ("Db title and parent db title differ . } catch(Exception e) { e.equals(pdb. if (db. View view = db.*. // (Your code goes here) Database db = agentContext.getView("By Category").println ("Db title and parent db title are the same").View class Parent property Read-only.oops"). } } } Chapter 10: Java Classes A–Z 2235 .printStackTrace().getCurrentDatabase().getParent().domino.getTitle())) System.out. import lotus.out.getTitle(). AgentContext agentContext = session. Database pdb = view.

// (Your code goes here) Agent agent = agentContext. elements are String Syntax public java. Example: Readers property This agent adds a name to the readers field. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().*.util. Defined in View class Data type java. System.Vector getReaders() throws NotesException public void setReaders(java.printStackTrace().util. for (int i=0. View view = db.size(). setReaders(readers).util.addElement(agent.util.getComment()).Vector.getAgentContext(). i++) System. } catch(Exception e) { e. The contents of the $Readers field associated with the view. import java.Vector reader) throws NotesException Usage Setting this property replaces prior values.out.getReaders(). AgentContext agentContext = session.View class Readers property Read-write.getCurrentDatabase(). Set the property to null to remove all reader restrictions.getView("By Category"). } } } 2236 Domino Designer Programming Guide. i<readers.Vector.println("Contents of $Readers:").out. Database db = agentContext.elementAt(i)).getCurrentAgent(). readers. Volume 3: JavaScript Classes .println("\t" + readers. Vector readers = view.domino.

SPACING_ONE_POINT_25 View. The spacing between rows of a view.View class RowLines property Read-only. Defined in View Data type int Syntax public int getSpacing() throws NotesException Legal values View. Defined in View Data type int Syntax public int getRowLines() throws NotesException Spacing property Read-only.SPACING_DOUBLE View.SPACING_ONE_POINT_50 View.SPACING_SINGLE Chapter 10: Java Classes A–Z 2237 . The number of lines in each row of a view.SPACING_ONE_POINT_75 View.

*. import java. The universal ID of a view. which is a 32-character hexadecimal value that uniquely identifies a view across all replicas of a database. If the view has totals.View class TopLevelEntryCount property Read-only. Defined in View Data type String Syntax public String getUniversalID() throws NotesException Usage A typical universal ID looks like this: FF864D9ACB6E2210752561BC005867C6. import lotus.Vector. The number of top-level entries in a view. Defined in View Data type int Syntax public int getTopLevelEntryCount() throws NotesException Usage If the view is categorized.domino. 2238 Domino Designer Programming Guide. this count includes the grand total. this count is the number of main categories.util. UniversalID property Read-only. Example: UniversalID property This agent gets the universal IDs of all the views in the current database. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Volume 3: JavaScript Classes .

System. Defined in View Syntax public void clear() throws NotesException Usage Subsequent calls to getDocument methods get all documents in the view.getCurrentDatabase(). not just the search results.getName()).size(). i++) { View view = (View)views.getUniversalID() + "\t" + view.println("Universal IDs for views:"). } } } clear method Clears the full-text search filtering on a view.println (view.View class AgentContext agentContext = session.getAgentContext().out. } } catch(Exception e) { e. // (Your code goes here) Database db = agentContext. i<views. System. Vector views = db. for (int i=0. Defined in View Syntax public ViewNavigator createViewNav() throws NotesException public ViewNavigator createViewNav(int cacheSize) throws NotesException Chapter 10: Java Classes A–Z 2239 . createViewNav method Creates a view navigator for all entries in a view.printStackTrace().getViews().elementAt(i).out.

All navigation methods return null. Example: createViewNav method This agent gets all the entries in a view.isDocument()) t = "document".printStackTrace(). Use a ViewEntryCollection object to navigate a view filtered by a full-text search. Usage The navigator contains all entries even if the view is filtered for a full-text search. int n = 0. The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter. while (entry != null) { n++. An empty view results in an empty navigator. Volume 3: JavaScript Classes . import lotus.View class Parameters int cacheSize The size of the navigator cache in view entries.domino.getNext().getFirst(). AgentContext agentContext = session. } } catch(Exception e) { e. ViewNavigator nav = view. System.getCurrentDatabase(). Legal values are 0 (no cache) through 128 (default). Applies only to remote (IIOP) operations. else if (entry. // (Your code goes here) Database db = agentContext.createViewNav(). Return value ViewNavigator The new view navigator. String t = null.*. View view = db.getAgentContext(). } } } 2240 Domino Designer Programming Guide. ViewEntry entry = nav.isTotal()) t = "total".out. if (entry.getView("By Category"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().isCategory()) t = "category". else if (entry.println("Entry #" + n + " is a " + t). entry = nav.

Return value ViewNavigator The new view navigator. Legal values are 0 (no cache) through 128 (default).View class createViewNavFrom method Creates a view navigator for all entries in a view starting at a specified entry. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). int cacheSize The size of the navigator cache in view entries. Defined in View Syntax public ViewNavigator createViewNavFrom(Object entry) throws NotesException public ViewNavigator createViewNavFrom(Object entry. If the object is not found. int cacheSize) throws NotesException Parameters Object entry A Document or ViewEntry object representing the starting entry. Cannot be null. The remaining entries are all the entries in the view that follow the first entry. the result is an empty navigator. All navigation methods return null. The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter. Chapter 10: Java Classes A–Z 2241 .domino.” import lotus.*. Usage The first entry in the navigator is the specified entry. Applies only to remote (IIOP) operations. Example: createViewNavFrom method This agent gets all the entries in a view starting at the first document in “Category 2.

Applies only to remote (IIOP) operations.getView("By Category").isTotal()) t = "total". int n = 0.getAgentContext().View class AgentContext agentContext = session. Legal values are 0 (no cache) through 128 (default). System. View view = db. int cacheSize The size of the navigator cache in view entries.getFirst().println("Entry #" + n + " is a " + t). entry = nav. int cacheSize) throws NotesException Parameters String categoryName The name of a category in the view.getNext().getCurrentDatabase(). } } catch(Exception e) { e. if (entry.getDocumentByKey("Category 2"). String t = null. else if (entry.createViewNavFrom(doc).printStackTrace(). ViewEntry entry = nav. while (entry != null) { n++. } } } createViewNavFromCategory method Creates a view navigator for all entries in a view under a specified category. ViewNavigator nav = view. Document doc = view.out. // (Your code goes here) Database db = agentContext. Volume 3: JavaScript Classes .isCategory()) t = "category".isDocument()) t = "document". else if (entry. 2242 Domino Designer Programming Guide. Defined in View Syntax public ViewNavigator createViewNavFromCategory(String categoryName) throws NotesException public ViewNavigator createViewNavFromCategory(String categoryName.

String t = null. The category entry itself is excluded. entry = nav. for example. int n = 0.printStackTrace(). // (Your code goes here) Database db = agentContext. ViewNavigator nav = view. else if (entry. Example: createViewNavFromCategory method This agent gets all the entries in “category 2” of a view.isTotal()) t = "total".createViewNavFromCategory("category 2"). All navigation methods return null.out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Entry #" + n + " is a " + t).domino.View class Return value ViewNavigator The new view navigator. If the category does not exist.getFirst(). ViewEntry entry = nav.getView("By Category"). } } catch(Exception e) { e.*.getNext(). “Asia\\Korea” means the subcategory “Korea” under the main category “Asia. } } } Chapter 10: Java Classes A–Z 2243 . Subcategories can be specified using backslash notation (don’t forget to escape the backslashes). else if (entry. View view = db. System. Usage The entries in the navigator are all the entries in the view under the specified category. while (entry != null) { n++. AgentContext agentContext = session.getAgentContext(). if (entry. import lotus.isDocument()) t = "document".isCategory()) t = "category". the result is an empty navigator.getCurrentDatabase().” The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter.

Volume 3: JavaScript Classes . Usage The entries in the navigator are all the entries in the view that fall hierarchically at the next level under the specified entry. The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter. Example: createViewNavFromChildren method This agent gets all the entries that are immediate children of the first entry under “category 2.View class createViewNavFromChildren method Creates a view navigator for the immediate children of a specified entry. 2244 Domino Designer Programming Guide. Return value ViewNavigator The new view navigator.*. If the entry has no children. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). int cacheSize The size of the navigator cache in view entries. Cannot be null.domino. Defined in View Syntax public ViewNavigator createViewNavFromChildren(Object entry) throws NotesException public ViewNavigator createViewNavFromChildren(Object entry. the result is an empty navigator. The parent entry itself is excluded. int cacheSize) throws NotesException Parameters Object entry A Document or ViewEntry object representing the parent entry.” import lotus. All navigation methods return null. Legal values are 0 (no cache) through 128 (default). Applies only to remote (IIOP) operations.

println("Entry #" + n + " is a " + t).createViewNavFromChildren(doc).isTotal()) t = "total". View view = db.out. Applies only to remote (IIOP) operations.isDocument()) t = "document". while (entry != null) { n++.getNext(). int cacheSize) throws NotesException Parameters Object entry A Document or ViewEntry object representing the parent entry. else if (entry. int n = 0.getCurrentDatabase().isCategory()) t = "category". else if (entry. Cannot be null.getView("By Category"). } } catch(Exception e) { e. entry = nav.getDocumentByKey("category 2").View class AgentContext agentContext = session. // (Your code goes here) Database db = agentContext. Chapter 10: Java Classes A–Z 2245 . System. ViewNavigator nav = view. int cacheSize The size of the navigator cache in view entries. Defined in View Syntax public ViewNavigator createViewNavFromDescendants(Object entry) throws NotesException public ViewNavigator createViewNavFromDescendants(Object entry. String t = null.printStackTrace(). Document doc = view. if (entry. Legal values are 0 (no cache) through 128 (default).getAgentContext().getFirst(). } } } createViewNavFromDescendants method Creates a view navigator for all the descendants of a specified entry. ViewEntry entry = nav.

while (entry != null) { n++.out. The parent itself is excluded.” import lotus.println("Entry #" + n + " is a " + t). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). else if (entry. the result is an empty navigator. int n = 0.getAgentContext(). } } catch(Exception e) { e.isDocument()) t = "document". } } } 2246 Domino Designer Programming Guide. if (entry.createViewNavFromDescendants(doc).printStackTrace(). The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter. Volume 3: JavaScript Classes . else if (entry.getCurrentDatabase(). All navigation methods return null.domino.getFirst(). ViewNavigator nav = view. // (Your code goes here) Database db = agentContext. Usage The entries in the navigator are the entries in the view that fall hierarchically at all levels under the specified entry.isCategory()) t = "category".getNext(). Document doc = view. Example: createViewNavFromDescendants method This agent gets all the entries that are descendants of the first entry under “category 2. System. String t = null.getDocumentByKey("category 2"). AgentContext agentContext = session.getView("By Category"). View view = db. entry = nav. ViewEntry entry = nav. If the entry has no children.*.isTotal()) t = "total".View class Return value ViewNavigator The new view navigator.

Legal values are 0 (no cache) through 128 (default). Return value ViewNavigator The new view navigator. Chapter 10: Java Classes A–Z 2247 . AgentContext agentContext = session. All navigation methods return null.View class createViewNavMaxLevel method Creates a view navigator for all entries in a view down to a specified level. An empty view results in an empty navigator. Defined in View Syntax public ViewNavigator createViewNavMaxLevel(int level) throws NotesException public ViewNavigator createViewNavMaxLevel(int level.*.domino. int cacheSize) throws NotesException Parameters int level The maximum level of navigation 0 (top level) through 30 (default). Usage The entries in the navigator are all the entries in the view at levels 0 through the specified level. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). Applies only to remote (IIOP) operations. // (Your code goes here) Database db = agentContext. int cacheSize The size of the navigator cache in view entries. The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter.getAgentContext().getCurrentDatabase(). Example: createViewNavMaxLevel method This agent gets all the top-level entries in a view.

String t = null. 2248 Domino Designer Programming Guide. while (entry != null) { n++.getFirst(). Defined in View Syntax public int FTSearch(String query) throws NotesException public int FTSearch(String query.println("Entry #" + n + " is a " + t). ViewNavigator nav = view. else if (entry. if (entry.createViewNavMaxLevel(0).getView("By Category").out. This method does not find word variants. Volume 3: JavaScript Classes . int maxdocs The maximum number of documents you want returned from the search. } } } FTSearch method Conducts a full-text search on all documents in a view and filters the view so it represents only those documents that match the full-text query. System.View class View view = db. } } catch(Exception e) { e. See below. entry = nav. If you want to receive all documents that match the query.getNext(). int n = 0. else if (entry. specify 0.printStackTrace().isCategory()) t = "category".isDocument()) t = "document". int maxdocs) throws NotesException Parameters String query The full-text query. ViewEntry entry = nav.isTotal()) t = "total".

updateFTIndex(true). The View methods now navigate to the full set of documents in the view. Remember to escape quotes if you are inside a literal.getAgentContext(). and so on. int count = view. operators. you can use the regular View methods to navigate the view. AgentContext agentContext = session. Wildcards. To create an index on a local database.” The agent then puts the documents in the filtered view into the “Two-wheeled vehicles” folder. For example.domino. View view = db.getCurrentDatabase(). import lotus. Examples: FTSearch and clear methods 1. The agent then clears the view and puts the documents of the unfiltered view into the “Vehicles” folder. getAllEntries returns only those entries that match the full-text query. use isFTIndexed. The methods navigate to a subset of the documents in the view. see “To use operators to refine a search” in Notes 5 help. After calling FTSearch. getLastDocument returns the last document in the view that matches the full-text query.View class Return value int The number of documents in the view after the search.getView("Transportation").*. but less efficiently. and other syntax are permitted. Query syntax To search for a word or phrase. this method works. use updateFTIndex. enter the word or phrase as is. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). This agent full-text searches the “Transportation” view on the word “bicycle. getFirstDocument returns the first document in the view that matches the full-text query.FTSearch("bicycle"). Usage If the database is not full-text indexed. except that search keywords must be enclosed in quotes. db. Each of these documents matches the query. // View is filtered if (count == 0) Chapter 10: Java Classes A–Z 2249 . // (Your code goes here) Database db = agentContext. For the complete syntax rules. Use the clear to clear the full-text search filtering. To test for an index.

getAgentContext(). Document doc = view.domino. db.getFirstDocument().getComment().getNextDocument(doc). String searchString = agent.View class System. } } // Clear the full-text search view.out.println("No bicycles found").getFirstDocument(). while (doc != null) { doc. View view = db. } } catch(Exception e) { e.clear().updateFTIndex(true).println(count + " bicycle(s) found"). The agent then prints the number of documents located and the value of the Subject item of each document in the filtered view. else { System. doc = view. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().println("Nothing found"). Document doc = view.out.println(count + " found"). 0). while (doc != null) { doc. // View is no longer filtered Document doc = view.out. int count = view.putInFolder("Two-wheeled vehicles").printStackTrace(). import lotus.out. This agent full-text searches the “By Category” view on a word or words supplied by the user as the agent comment.getFirstDocument(). Agent agent = agentContext. AgentContext agentContext = session. doc = view. // (Your code goes here) Database db = agentContext. Volume 3: JavaScript Classes .*. else { System.getView("By Category").putInFolder("Vehicles"). if (count == 0) System. while (doc != null) { 2250 Domino Designer Programming Guide.getCurrentDatabase().getNextDocument(doc).FTSearch(searchString.getCurrentAgent(). } } } 2.

Vector keys) throws NotesException public DocumentCollection getAllDocumentsByKey(Object key) throws NotesException public DocumentCollection getAllDocumentsByKey(java.Vector keys String.util. the second element is compared to the second sorted column.println(doc.util. } } } getAllDocumentsByKey method Finds documents based on their column values within a view. } } } catch(Exception e) { e.out. boolean exact) throws NotesException public DocumentCollection getAllDocumentsByKey(Object key. Object key A String.Vector keys. The method returns all documents whose column values match the keys. Number. where each key corresponds to a value in a sorted column in the view. Chapter 10: Java Classes A–Z 2251 .getItemValueString("Subject")). and so on. DateTime.View class System.util. Number. or DateRange object that is compared to the first sorted column in the view. Defined in View Syntax public DocumentCollection getAllDocumentsByKey(java. DateTime.getNextDocument(doc). or DateRange objects that are compared to sorted columns in the view. You create a key or vector of keys. The first element in the vector is compared to the first sorted column in the view.printStackTrace(). boolean exact) throws NotesException Parameters java. doc = view.

import lotus. The use of partial matches with multiple keys may result in missed documents. and puts them in the Boots folder. This agent gets all the documents in the category “Spanish leather” in the By Category view of the current database. // (Your code goes here) Database db = agentContext. If the first key is partial and the second column does not sort the same with the partial key as with the exact key. and do not provide access to column values. If no documents match. } } } 2252 Domino Designer Programming Guide.getCurrentDatabase(). use getDocumentByKey. a partial match succeeds. Usage This method returns all the documents whose column values match the keys. } catch(Exception e) { e. AgentContext agentContext = session. Use getAllEntriesByKey for these capabilities.printStackTrace().putAllInFolder("Boots").domino. documents that fall out of sequence are missed.getAgentContext().View class boolean exact True if you want to find an exact match. DocumentCollection dc = view.getView("By Category").*. false). Volume 3: JavaScript Classes . View view = db. Documents returned by this method are in no particular order. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). dc. Examples: getAllDocumentsByKey method 1. Return value DocumentCollection All documents in the view whose column values match each of the keys. If you specify false or omit this parameter.getAllDocumentsByKey("Spanish leather". the collection is empty and the count is zero. To locate just the first document.

Defined in View Syntax public ViewEntryCollection getAllEntriesByKey(java.View class 2. Vector v = new Vector().addElement("Boots").util.domino. } } } getAllEntriesByKey method Finds view entries of type document based on their column values within a view. where each key corresponds to a value in a sorted column in the view.putInFolder("Boots"). } catch(Exception e) { e.Vector keys) throws NotesException public ViewEntryCollection getAllEntriesByKey(Object key) throws NotesException Chapter 10: Java Classes A–Z 2253 . You create a key or vector of keys. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). doc.getCurrentDatabase(). The method returns all entries whose column values match the keys.getDocumentByKey(v.Vector.printStackTrace(). AgentContext agentContext = session. v. import lotus. and puts them in the Boots folder.util. This agent gets all the documents in the category “Boots” and the subcategory “Spanish leather” in the By Category view of the current database. View view = db. false). Document doc = view. v. import java.getAgentContext().addElement("Spanish leather").getView("By Category"). // (Your code goes here) Database db = agentContext.*.

Vector keys. This example gets all document entries in the category “Spanish leather” in the By Category view of the current database. or DateRange object that is compared to the first sorted column in the view. the second element is compared to the second sorted column. The use of partial matches with multiple keys may result in missed entries. public class JavaAgent extends AgentBase { public void NotesMain() { 2254 Domino Designer Programming Guide. boolean exact) throws NotesException Parameters java. Volume 3: JavaScript Classes . If the first key is partial and the second column does not sort the same with the partial key as with the exact key. If no entries match. Examples: getAllEntriesByKey method 1. boolean exact True if you want to find an exact match. unlike getAllDocumentsByKey. use getEntryByKey.util. Entries returned by this method are in view order and provide access to column values. To locate just the first entry. a partial match succeeds.domino. Number. the collection is empty and the count is zero. entries that fall out of sequence are missed.View class public ViewEntryCollection getAllEntriesByKey(java. DateTime. Object key A String. or DateRange objects that are compared to sorted columns in the view.util. boolean exact) throws NotesException public ViewEntryCollection getAllEntriesByKey(Object key. import lotus. DateTime. and so on. Number. Usage This method returns all the view entries of type document whose column values match the keys. The first element in the vector is compared to the first sorted column in the view. If you specify false or omit this parameter. Return value ViewEntryCollection All entries of type document in the view whose column values match each of the keys.*.Vector keys String.

} catch(Exception e) { e.Vector.printStackTrace().*. v.getAllEntriesByKey(v. ViewEntryCollection vec = view. Vector v = new Vector().getAgentContext(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus.getCount()). System. false). // (Your code goes here) Database db = agentContext. } catch(Exception e) { e. ViewEntryCollection vec = view.addElement("Boots").getCurrentDatabase(). } } } 2. This example gets all document entries in the category “Boots” and the subcategory “Spanish leather” in the By Category view of the current database.println("Number of entries found = " + vec. System. false).getCurrentDatabase().println("Number of entries = " + vec.domino. } } } Chapter 10: Java Classes A–Z 2255 .out.out.addElement("Spanish leather"). View view = db.getView("By Category").printStackTrace().getAllEntriesByKey("Spanish leather". View view = db.getView("By Category").util. AgentContext agentContext = session. v.View class try { Session session = getSession().getCount()). import java.getAgentContext(). // (Your code goes here) Database db = agentContext. AgentContext agentContext = session.

getDocumentByKey("Internet").getItemValueString("Subject")). 2256 Domino Designer Programming Guide. If you’ve filtered the view with the FTSearch method. getChild returns the next document in the view. Volume 3: JavaScript Classes . Document doc = view. View view = db.getCurrentDatabase(). regardless of level. // (Your code goes here) Database db = agentContext. Cannot be null. returns the first response to the document. import lotus.out. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().domino.View class getChild method Given a document in a view. The combination of getChild and getNextSibling allows you to access a document responses. Defined in View Syntax public Document getChild(Document doc) throws NotesException Parameter Document doc Any document in the view. Example: getChild and getNextSibling methods This agent gets the first document sorted by the key “Internet” and all its response documents to two levels. To get all the immediate responses for a document unsorted. AgentContext agentContext = session. Document response = view. Return value Document The first response document to the parameter you specify. use getResponses in Document.*.println ("Project name: " + doc.getAgentContext().getChild(doc). Returns null if there are no responses to the document. use getNextSibling. Usage To find additional response documents.getView("By Category"). sorted in the same order that they appear in a view. System.

domino. } } } getColumn method Returns a specified column in a view. Return value ViewColumn The specified column. rtor = view.out.println ("\t\t" + rtor. rtor = view.getItemValueString("Subject")).getAgentContext(). Defined in View Syntax public ViewColumn getColumn(int columnNumber) throws NotesException Parameter int columnNumber A column number where 1 is the first column. Example: getColumn method This agent gets the title of the first column in a view. while (response != null) { System.View class Document rtor.getChild(response).getItemValueString("Subject")). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. } } catch(Exception e) { e. AgentContext agentContext = session.println ("\t" + response. // (Your code goes here) Chapter 10: Java Classes A–Z 2257 . Cannot be less than 1 or greater than the number of columns in the view.*. } response = view.printStackTrace().getNextSibling(response). while (rtor != null) { System.out.getNextSibling(rtor).

getView("All Documents"). ViewColumn column = view. View view = db. boolean exact) throws NotesException public Document getDocumentByKey(Object key.View class Database db = agentContext.length() == 0) title = "No title".Vector keys.getColumn(1).printStackTrace(). You create a key or vector of keys. Volume 3: JavaScript Classes . 2258 Domino Designer Programming Guide. The method returns the first document with column values that match the keys.out. Defined in View Syntax public Document getDocumentByKey(java. Object key A String. or DateRange object that is compared to the first sorted column in the view.println ("First column is \"" + title + "\""). DateTime. and so on. The first element in the vector is compared to the first sorted column in the view. String title = column.util. boolean exact) throws NotesException Parameters java. } } } getDocumentByKey method Finds a document based on its column values within a view. Number. where each key corresponds to a value in a sorted column in the view.util. DateTime.Vector keys) throws NotesException public Document getDocumentByKey(Object key) throws NotesException public Document getDocumentByKey(java. } catch(Exception e) { e. if (title. or DateRange objects that are compared to sorted columns in the view. the second element is compared to the second sorted column. Number.getTitle().getCurrentDatabase().util. System.Vector keys String.

domino. Examples: getDocumentByKey method 1.getCurrentDatabase().getAgentContext(). import lotus. This agent gets the first document in the first category that begins with “Spanish” in the By Category view of the current database. To locate all matching documents. // (Your code goes here) Database db = agentContext. } catch(Exception e) { e. Usage This method returns only the first document with column values that match the strings you indicate. import java.getView("By Category"). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). a partial match succeeds. if (doc != null) doc.getDocumentByKey("Spanish leather". Return value Document The first document in the view with column valuesthat match the keys. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). View view = db. Returns null if there are no matching documents.putInFolder("Boots").*.*. use getAllDocumentsByKey. import lotus. Document doc = view. If you specify false or omit this parameter.printStackTrace(). false).util.domino. } } } 2. AgentContext agentContext = Chapter 10: Java Classes A–Z 2259 . AgentContext agentContext = session. This agent gets the first document in the category “Boots” in the subcategory “Spanish leather” in the By Category view of the current database.View class boolean exact True if you want to find an exact match.Vector.

2260 Domino Designer Programming Guide. Volume 3: JavaScript Classes .getView("By Category"). The first element in the vector is compared to the first sorted column in the view.View class session.putInFolder("Boots"). false). Vector v = new Vector().Vector keys. } } } getEntryByKey method Finds a view entry based on its column values within a view. The method returns the first entry with column values that match the keys. Document doc = view.getDocumentByKey(v. } catch(Exception e) { e.util.util. and so on.getCurrentDatabase().addElement("Spanish leather"). You create a key or vector of keys.util.Vector keys) throws NotesException public ViewEntry getEntryByKey(Object key) throws NotesException public ViewEntry getEntryByKey(java. doc.printStackTrace().addElement("Boots"). v. boolean exact) throws NotesException Parameters java. boolean exact) throws NotesException public ViewEntry getEntryByKey(Object key. DateTime.getAgentContext(). Number. v. or DateRange objects that are compared to sorted columns in the view. // (Your code goes here) Database db = agentContext. Defined in View Syntax public ViewEntry getEntryByKey(java. the second element is compared to the second sorted column. where each key corresponds to a value in a sorted column in the view. View view = db.Vector keys String.

elementAt(i)). Usage This method returns only the first entry with column values that match the strings you indicate. Return value ViewEntry The first entry in the view with column values that match the keys. To locate all matching documents. If you specify false or omit this parameter. a partial match succeeds. ViewEntry entry = view. import java. false).getView("By Category").printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). i<v.getColumnValues().getEntryByKey("Spanish leather". This agent gets the first entry in the first category that begins with “Spanish” in the By Category view of the current database. AgentContext agentContext = session.domino.View class Object key A String.getAgentContext(). if (entry != null) { Vector v = entry. Returns null if there are no matching entries.size(). Examples: getEntryByKey method 1.*. use getAllEntriesByKey. or DateRange object that is compared to the first sorted column in the view.getCurrentDatabase(). import lotus.util. for (int i=0.out. // (Your code goes here) Database db = agentContext.Vector. } } } Chapter 10: Java Classes A–Z 2261 .println((i+1) + " " + v. i++) System. View view = db. } } catch(Exception e) { e. boolean exact True if you want to find an exact match. DateTime. Number.

} } } getFirstDocument method Returns the first document in a view.getEntryByKey(v. AgentContext agentContext = session. Defined in View Syntax public Document getFirstDocument() throws NotesException Return value Document The first document in the view. if (entry != null) { Vector columns = entry.out.util.println((i+1) + " " + columns. false). i++) System.getColumnValues(). import lotus. Vector v = new Vector(). ViewEntry entry = view. Returns null if there are no documents in the view. v. import java. } } catch(Exception e) { e. v. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). 2262 Domino Designer Programming Guide. i<columns. for (int i=0.printStackTrace(). // (Your code goes here) Database db = agentContext.addElement("Boots").elementAt(i)).View class 2.domino.size().getAgentContext(). This agent gets the first entry in the category “Boots” in the subcategory “Spanish leather” in the By Category view of the current database. View view = db. Volume 3: JavaScript Classes .Vector.*.addElement("Spanish leather").getCurrentDatabase().getView("By Category").

println ("***By Category view .*.domino. Returns null if there are no documents in the view. Document doc = view. System.getCurrentDatabase().getFirstDocument(). Defined in View Syntax public Document getLastDocument() throws NotesException Return value Document The last document in the view. View view = db. The ViewNavigator and ViewEntryCollection classes provide more efficient methods for navigating views and accessing entries. import lotus.getAgentContext().getView("By Category"). } catch(Exception e) { e. AgentContext agentContext = session. System. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getItemValueString("Subject")). Chapter 10: Java Classes A–Z 2263 .View class Usage If the view is filtered by FTSearch.out. } } } getLastDocument method Returns the last document in a view. this method returns the first document in the filtered view.first document***").println ("\t" + doc.printStackTrace(). // (Your code goes here) Database db = agentContext. Example: getFirstDocument method This agent gets the first document in the By Category view of the current database.out.

println ("\t" + doc.out.domino. System. The ViewNavigator and ViewEntryCollection classes provide more efficient methods for navigating views and accessing entries. AgentContext agentContext = session. Example: getLastDocument method This agent gets the last document in the By Category view of the current database.*. returns the document immediately following it. this method returns the last document in the filtered view. Document doc = view.getItemValueString("Subject")).getView("By Category"). Defined in View Syntax public Document getNextDocument(Document doc) throws NotesException Parameter Document doc Any document in the view.getCurrentDatabase(). // (Your code goes here) Database db = agentContext. } catch(Exception e) { e. Volume 3: JavaScript Classes .View class Usage If the view is filtered by FTSearch. } } } getNextDocument method Given a document in a view. import lotus.out. 2264 Domino Designer Programming Guide. View view = db. System.println ("***By Category view .getLastDocument().getAgentContext().printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().last document***"). Cannot be null.

getAgentContext(). AgentContext agentContext = session.out. Returns null if there are no more documents in the view. If the view is filtered by FTSearch. // (Your code goes here) Database db = agentContext.getCurrentDatabase().View class Return value Document The document in the view following the specified parameter. import lotus. Example: getNextDocument method This agent gets all the documents in the By Category view of the current database. while (doc != null) { System. response. Document doc = view. this method returns the next document in the filtered view. If you want the next sibling document in the view. Usage This method returns the next document in the view regardless of what type of document it is (document.getItemValueString("Subject")). } } } Chapter 10: Java Classes A–Z 2265 .println ("\t" + doc. View view = db. or response-to-response). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().printStackTrace().all documents***").getView("By Category").out. } } catch(Exception e) { e. doc = view. use getNextSibling.getNextDocument(doc).domino.println ("***By Category view .*. The ViewNavigator and ViewEntryCollection classes provide more efficient methods for navigating views and accessing entries. System.getFirstDocument().

Usage You can use getNextSibling to: Move from one main document to the next.View class getNextSibling method Given a document in a view. If the view is categorized. or They are both responses or response-to-responses and they share the same parent document 2266 Domino Designer Programming Guide. skipping any response documents in between Visit the response documents of a particular parent document (use getChild to find the first response) Visit the response-to-response documents of a particular parent document (use getChild to find the first response-to-response) If you filtered the view with FTSearch. the next main document in the view is returned. returns the document immediately following it at the same level. the next response document with the same parent is returned. If you send a response document. getNextSibling returns the next document in the view. If you send the method a main document. Cannot be null. Siblings Two documents are siblings if: They are both main documents. Return value Document The document following the parameter. Returns null if there are no more siblings. at the same level in the view. Defined in View Syntax public Document getNextSibling(Document doc) throws NotesException Parameter Document doc Any document in the view. the next sibling is in the same category as the original document. Volume 3: JavaScript Classes . regardless of level.

2 to indicate the second document. which returns the number of documents that remain in a view after it’s been filtered with a full-text search. Use 1 to indicate the first document in the view.View class The last sibling This method returns null when the parameter is: The last main document in a view The last response (or response-to-response) to a particular parent getNthDocument method Returns the document at a specified position in the top level of a view. this method returns only the first document in each main category (not each subcategory). Chapter 10: Java Classes A–Z 2267 . In a categorized view. Return value Document The document in the nth position in the view. Defined in View Syntax public Document getNthDocument(int n) throws NotesException Parameter int n Integer. the increment is relative to the actual value of n. and so on. not the document that was accessed. So you will access the same document repeatedly until that document actually is the nth document. response documents are excluded. This method is useful when used in combination with FTSearch. If you increment n. Usage This method accesses only top-level (main) documents in a view. Returns null if there is no document at the specified position. A number indicating the document to return. this method returns the next document to which you have reader access. If you do not have reader access to the specified document.

doc. 2268 Domino Designer Programming Guide.printStackTrace(). db. int count = view.domino. } catch(Exception e) { e.getNthDocument(i+1). It then clears the full-text search. Cannot be null. 0). returns its parent document. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). import lotus. } view.FTSearch("DELETE ME". i++) { doc = view. Volume 3: JavaScript Classes .getView("By Category"). Document doc. } } } getParentDocument method Given a response document in a view. AgentContext agentContext = session. Defined in View Syntax public Document getParentDocument(Document doc) throws NotesException Parameter Document doc Any document in the view.clear().*. i<count. View view = db.View class Example: getNthDocument method This agent performs a full-text search on the By Category view in the current database.remove(true). for (int i=0. // (Your code goes here) Database db = agentContext.” the agent removes each of these documents.updateFTIndex(true). Once the folder is filtered so that it contains only those documents with the words “DELETE ME.getCurrentDatabase().getAgentContext().

out. Example: getParentDocument and getPrevSibling methods This agent finds the parent of the last document in the By Category view of the current database and counts its direct response documents. or a response-to-response.getItemValueString("Subject") + "\""). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). } System. if (doc.getAgentContext().getParentDocument(doc). regardless of level.print ("Last document in \"By Category\" is \"" + parent. doc = view.printStackTrace(). } } } Chapter 10: Java Classes A–Z 2269 . If you have filtered the view using FTSearch. View view = db. Document doc = view.View class Return value Document The parent of the parameter (the document to which the parameter is a response). import lotus. } else System. } catch(Exception e) { e.isResponse()) { Document parent = view. // (Your code goes here) Database db = agentContext.*. while (doc != null) { count++.getLastDocument().getCurrentDatabase().getView("By Category").getItemValueString("Subject") + "\""). Usage The document returned by getParentDocument may be a main document. AgentContext agentContext = session.out. doc = view. getParentDocument returns the previous document in the view.getPrevSibling(doc). System.out.getPrevSibling(doc).domino. int count = 1. Returns null for a main document.println ("Last document in \"By Category\" is \"" + doc.println (" with " + count + " responses"). a response.

while (doc != null) { System.out. // (Your code goes here) Database db = agentContext. System.getItemValueString("Subject")).View class getPrevDocument method Given a document in a view. Volume 3: JavaScript Classes . Return value Document The document preceding the parameter.all documents in reverse***"). import lotus. returns the document immediately preceding it.getCurrentDatabase(). Defined in View Syntax public Document getPrevDocument(Document doc) throws NotesException Parameter Document doc Any document in the view.println ("\t" + doc. Document doc = view.domino.out. Cannot be null.getLastDocument().*. The ViewNavigator and ViewEntryCollection classes provide more efficient methods for navigating views and accessing entries. Returns null if there is no preceding document. this method returns the next document in the filtered view. AgentContext agentContext = session. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().getView("By Category"). 2270 Domino Designer Programming Guide.println ("***By Category view . Example: getPrevDocument method This agent gets all the documents in the By Category view of the current database in reverse order. Usage If the view is filtered by FTSearch. View view = db.getAgentContext().

Cannot be null. If you use this method on a main document. the preceding response document with the same parent is returned. Defined in View Syntax public Document getPrevSibling(Document doc) throws NotesException Parameter Document doc Any document in the view.printStackTrace().getPrevDocument(doc). the previous sibling is in the same category as the original document. getPrevSibling returns the previous document in the view. the preceding main document in the view is returned. at the same level. Usage You can use getPrevSibling to move from one main document to the next. Chapter 10: Java Classes A–Z 2271 . If you filtered the view using FTSearch. If you use it on a response document. returns the document immediately preceding it at the same level. Returns null if there is no previous sibling in the view.View class doc = view. } } } getPrevSibling method Given a document in a view. If the view is categorized. regardless of level. Return value Document The document preceding the parameter. skipping any response documents in between. } } catch(Exception e) { e.

View class Siblings Two documents are siblings if: They are both main documents. refresh occurs automatically on every navigation in the view. They should not be used for navigation or the creation of ViewNavigator objects. Additions and deletions to the view that occur after the View object is created may not be reflected in the View object until you call refresh. Defined in View Syntax public void refresh() throws NotesException Usage Navigation through a view is not normally affected by changes to the actual database. The first sibling This method returns null when the parameter is: The first main document in a view The first response (or response-to-response) to a particular parent refresh method Updates view contents with any changes that have occurred to the database since the View object was created. since the View object is a snapshot of the view contents at a particular time. refresh invalidates the cache. After a refresh. If isAutoUpdate is true. or since the last refresh. or They are both responses or response-to-responses and share the same parent document. Volume 3: JavaScript Classes . 2272 Domino Designer Programming Guide. For remote (IIOP) operations. existing ViewEntry objects may contain invalid information.

// Open view and sleep for 10 seconds View view = db. if (getdoc == null) System.out. sleep(10000). // (Your code goes here) Database db = agentContext. // Do your work Document getdoc = view. or a method of a navigator based on the view.out.refresh().*. } } } remove method Permanently removes a view from a database.getCurrentDatabase().printStackTrace(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). // Meanwhile someone else may have modified the view view.domino. Chapter 10: Java Classes A–Z 2273 .getItemValueString("Subject")).getAgentContext(). else System. Defined in View Syntax public void remove() throws NotesException Usage The removed view may still appear in the user interface until the user closes and opens the database. AgentContext agentContext = session. throws an exception.println(getdoc. A subsequent call to a method of the view.View class Example: refresh method This agent refreshes the view before retrieving a document from it if the view was modified.println("getdoc is null"). import lotus.getDocumentByKey("Latest news").getView("By Category"). } catch(Exception e) { e.

} } } ViewColumn class Represents a column in a view or folder.getAgentContext(). view. Agent agent = agentContext.getView(agent. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). View view = db. import lotus.remove().getCurrentDatabase().*. AgentContext agentContext = session.getCurrentAgent(). Syntax public class ViewColumn extends Base Containment Contained by: View Properties Alignment through getAlignment DateFmt through getDateFmt FontColor through getFontColor FontFace through getFontFace FontPointSize through getFontPointSize FontStyle through getFontStyle Formula through getFormula HeaderAlignment through getHeaderAlignment 2274 Domino Designer Programming Guide. Volume 3: JavaScript Classes .getName()).out.ViewColumn class Example: remove method This agent deletes the view specified by the user in the agent comment from the current database. // (Your code goes here) Database db = agentContext. System.getComment()).domino.printStackTrace(). } catch(Exception e) { e.println ("Removing " + view.

ViewColumn class IsAccentSensitiveSort through isAccentInsensitiveSort IsCaseSensitiveSort through isCaseInsensitiveSort IsCategory through isCategory IsField through isField IsFormula through isFormula IsHidden through isHidden IsHideDetail through isHideDetail IsIcon through isIcon IsResize through isResize IsResortAscending through isResortAscending IsResortDescending through isResortDescending IsResortToView through isResortToView IsResponse through isResponse IsSecondaryResort through isSecondaryResort IsSecondaryResortDescending through isSecondaryResortDescending IsShowTwistie through isShowTwistie IsSortDescending through isSortDescending IsSorted through isSorted ItemName through getItemName ListSep through getListSep NumberAttrib through getNumberAttrib NumberDigits through getNumberDigits NumberFormat through getNumberFormat Parent through getParent Position through getPosition TimeDateFmt through getTimeDateFormat TimeFormat through getTimeFormat TimeZoneFmt through getTimeZoneFormat Title through getTitle Width through getWidth Chapter 10: Java Classes A–Z 2275 .

public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().ViewColumn class Access You access an existing ViewColumn object through the view or folder that contains it.getAgentContext(). import java. import lotus. // (Your code goes here) Database db = agentContext.getTitle().util. if (columns.*. i<columns.util. String vtitle = column. } } } 2.out.println("By Category view").domino.elementAt(i). // (Your code goes here) Database db = agentContext.out. This agent prints the title (or “No title”) and position of the first sorted column in the “By Category” view of the current database.Vector. View view = db. AgentContext agentContext = session. Examples: ViewColumn class and Title property 1. Use getColumns or getColumn in View.getAgentContext(). AgentContext agentContext = session. import java.Vector. Volume 3: JavaScript Classes . System. } } } catch(Exception e) { e.getColumns().getPosition() + " " + vtitle). i++) { ViewColumn column = (ViewColumn)columns. 2276 Domino Designer Programming Guide. if (vtitle == "") vtitle = "No title".getView("By Category"). System. Vector columns = view.getView("By Category"). View view = db.println("\t" + column.size() != 0) { for (int i=0. This agent prints the title (or “No title”) and position of each column in the “By Category” view of the current database. System.out.printStackTrace().println("By Category view").domino. import lotus.*.getCurrentDatabase(). public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession().size().getCurrentDatabase().

out.getColumns().ALIGN_RIGHT Example: Alignment and HeaderAlignment properties This agent prints the alignment of the column and the column header.ALIGN_LEFT ViewColumn.*.Vector.ViewColumn class Vector columns = view. import java. The alignment of data in a column. } } } Alignment property Read-only.domino.size().isSorted()) { gotIt = true. if (columns. } else System. if (vtitle == "") vtitle = "No title". Defined in ViewColumn Data type int Syntax public int getAlignment() throws NotesException Legal values ViewColumn. System. if (column.printStackTrace(). } } catch(Exception e) { e.println("First sorted column is \"" + vtitle + "\" in position " + column. boolean gotIt = false.getTitle(). i<columns. import lotus. ViewColumn column = null. i++) { column = (ViewColumn)columns.println("No sorted columns"). break.size() != 0) { for (int i=0.util.getPosition()). Chapter 10: Java Classes A–Z 2277 .ALIGN_CENTER ViewColumn.elementAt(i). } } if (gotIt) { String vtitle = column.out.

getCurrentDatabase().break.getAlignment()) + ". The format of date data in a column. // (Your code goes here) Database db = agentContext. Volume 3: JavaScript Classes . break. } } } DateFmt property Read-only. } public void NotesMain() { try { Session session = getSession().ALIGN_CENTER : align = "center".getAgentContext(). case ViewColumn. } return align. break.elementAt(i).println(column. Defined in ViewColumn Data type int Syntax public int getDateFmt() throws NotesException 2278 Domino Designer Programming Guide. i++) { ViewColumn column = (ViewColumn)columns.getHeaderAlignment())).size().getColumns(). AgentContext agentContext = session. } } catch(Exception e) { e. System.getPosition() + " Alignment = " + theAlignment(column. for (int i=0.getView("By Category"). Vector columns = view.out.printStackTrace(). case ViewColumn. View view = db. Header alignment = " + theAlignment(column.ALIGN_LEFT : align = "left". i<columns.ViewColumn class public class JavaAgent extends AgentBase { String theAlignment(int n) { String align = null. switch (n) { case ViewColumn.ALIGN_RIGHT : align = "right".

break. month.getColumns().FMT_HMS : tf = "HMS". import lotus. Vector columns = view. } String df = null.FMT_HM : tf = "HM". String tdf = null. case ViewColumn. case ViewColumn.FMT_Y4M : df = "Y4M". default : tf = "not a time format". case ViewColumn.ViewColumn class Legal values ViewColumn. } String zf = null.FMT_DATE : tdf = "Date only". break.FMT_DATETIME : tdf = "Date and time".Vector. View view = db.getDateFmt()) { case ViewColumn. break. import java.DT_YM (year and month) ViewColumn. // (Your code goes here) Database db = agentContext.DT_MD (month and day) ViewColumn.FMT_ALWAYS : zf = "always" . AgentContext agentContext = session. i<columns. i++) { ViewColumn column = (ViewColumn)columns. switch (column.getTimeFmt()) { case ViewColumn. case ViewColumn. switch (column.FMT_YMD : df = "YMD". break.getAgentContext().getCurrentDatabase(). switch (column.getTimeDateFmt()) { case ViewColumn. break. } String tf = null.elementAt(i). and TimeZoneFmt properties This agent prints the column formatting information associated with dates and times. break. case ViewColumn. case ViewColumn.getTimeZoneFmt()) { case ViewColumn. Chapter 10: Java Classes A–Z 2279 .*.size(). TimeDateFmt. for (int i=0.FMT_MD : df = "MD". and day) Example: DateFmt.FMT_H : tf = "H". TimeFmt. break.DT_Y4M (4-digit year and month) ViewColumn. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). break.domino. break. break. case ViewColumn.FMT_TIME : tdf = "Time only". switch (column.util. break.getView("All Documents").DT_YMD (year.FMT_TODAYTIME : tdf = "Today and time". case ViewColumn.FMT_YM : df = "YM".

The font color of data in a column.getPosition() + " " + tdf + " " + df + " " + tf + " " + zf).COLOR_DARK_RED RichTextStyle. } } } FontColor property Read-only. Volume 3: JavaScript Classes . } } catch(Exception e) { e. } System.COLOR_GREEN RichTextStyle. default : zf = "not zoned". case ViewColumn.COLOR_GRAY RichTextStyle.COLOR_CYAN RichTextStyle.COLOR_BLUE RichTextStyle.println(column. Defined in ViewColumn Data type int Syntax public int getFontColor() throws NotesException Legal values RichTextStyle.ViewColumn class case ViewColumn.COLOR_MAGENTA 2280 Domino Designer Programming Guide.COLOR_DARK_MAGENTA RichTextStyle.out.COLOR_LIGHT_GRAY RichTextStyle.FMT_SOMETIMES : zf = "sometimes".COLOR_BLACK RichTextStyle.COLOR_DARK_YELLOW RichTextStyle.COLOR_DARK_CYAN RichTextStyle.COLOR_DARK_BLUE RichTextStyle.FMT_NEVER : zf = "never" .COLOR_DARK_GREEN RichTextStyle.printStackTrace().

break.COLOR_YELLOW : fc = "yellow". case RichTextStyle. // (Your code goes here) Database db = agentContext. break. for (int i=0. AgentContext agentContext = session. break. import java.util.COLOR_BLACK : fc = "black". Vector columns = view. View view = db.elementAt(i). break.getAgentContext().size(). break.COLOR_DARK_GREEN : fc = "dark green". break. switch (column.COLOR_MAGENTA : fc = "magenta".COLOR_RED : fc = "red". case RichTextStyle. and FontStyle properties This agent prints the column information associated with fonts. break. FontFace.COLOR_DARK_RED : fc = "dark red". case RichTextStyle. break. break. case RichTextStyle. import lotus. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). String fc = null. case RichTextStyle. break. i++) { ViewColumn column = (ViewColumn)columns.COLOR_YELLOW Example: FontColor.COLOR_BLUE : fc = "blue". break. Chapter 10: Java Classes A–Z 2281 . case RichTextStyle.COLOR_GREEN : fc = "green".getColumns().ViewColumn class RichTextStyle.COLOR_WHITE : fc = "white".getFontColor()) { case RichTextStyle.COLOR_CYAN : fc = "cyan".COLOR_RED RichTextStyle. case RichTextStyle.getView("All Documents"). i<columns. case RichTextStyle. break. case RichTextStyle.COLOR_DARK_YELLOW : fc = "dark yellow".COLOR_WHITE RichTextStyle.domino. case RichTextStyle.COLOR_DARK_MAGENTA : fc = "dark magenta". break. case RichTextStyle.COLOR_DARK_BLUE : fc = "dark blue".*. FontSize.getCurrentDatabase().Vector. case RichTextStyle.

COLOR_DARK_CYAN : fc = "dark cyan". if ((column. } String fs = null. } } } FontFace property Read-only.getFontFace() + " " + column. Defined in ViewColumn Data type String Syntax public String getFontFace() throws NotesException 2282 Domino Designer Programming Guide. if ((column. break. System.printStackTrace().FONT_ITALIC) == ViewColumn.FONT_UNDERLINE) fs = fs + " underline". else fs = "plain". case RichTextStyle. Volume 3: JavaScript Classes .getFontPointSize() + " " + fs + " " + fc).getFontStyle() & ViewColumn. } } catch(Exception e) { e.FONT_BOLD) == ViewColumn.COLOR_GRAY : fc = "gray".COLOR_LIGHT_GRAY : fc = "light gray".out.getFontStyle() & ViewColumn.getPosition() + " " + column.FONT_BOLD) fs = "bold". default : fc = "no color". case RichTextStyle. break.getFontStyle() & ViewColumn. The font face of data in a column.FONT_UNDERLINE) == ViewColumn.ViewColumn class case RichTextStyle.FONT_STRIKEOUT) fs = fs + " strikeout".FONT_STRIKEOUT) == ViewColumn.println(column. if ((column. if ((column.FONT_ITALIC) fs = fs + " italic".getFontStyle() & ViewColumn. break.

FONT_UNDERLINE ViewColumn. Defined in ViewColumn Data type int Syntax public int getFontStyle() throws NotesException Legal values ViewColumn. For example.FONT_ITALIC ViewColumn.FONT_STRIKEOUT Usage The font style can have multiple values. The font style of data in a column.FONT_ITALIC.FONT_BOLD ViewColumn. Chapter 10: Java Classes A–Z 2283 .FONT_BOLD and ViewColumn. Defined in ViewColumn Data type int Syntax public int getFontPointSize() throws NotesException FontStyle Read-only. The font point size of data in a column. the style might be ViewColumn.ViewColumn class FontPointSize property Read-only.

The formula for a column. To reliably access the field name.getAgentContext(). this property usually returns an empty string.getCurrentDatabase(). for (int i=0. public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(). System.” If the column is a formula. isFormula.out.domino.getView("By Category"). 2284 Domino Designer Programming Guide. if (vtitle == "") vtitle = "No title". this property returns the @function formula equivalent. this property returns the entire formula. and Position properties For each column in the “By Category” view of the current database. // (Your code goes here) Database db = agentContext. i<columns. isField.util. if the column is the simple function Creation Date. this agent prints the column formula or the column item name. Vector columns = view. View view = db. String colAction = null.ViewColumn class Formula property Read-only. if applicable.elementAt(i). depending on how the column is calculated. use getItemName.size(). String vtitle = column.*. i++) { ViewColumn column = (ViewColumn)columns.getTitle(). AgentContext agentContext = session.Vector. but in some cases returns the field name. Defined in ViewColumn Data type String Syntax public String getFormula() throws NotesException Usage If the column is a field. If the column is a simple function.getColumns(). For example. Example: Formula. import lotus.println("\"By Category\" view"). import java. Volume 3: JavaScript Classes . ItemName. this property returns “@Created.

The alignment of the header in a column. System.isField()) colAction = column.getItemName(). if (column.ALIGN_RIGHT IsAccentSensitiveSort property Read-only.ALIGN_CENTER ViewColumn. Indicates if a column is sorted with regard to accent. Defined in ViewColumn Data type boolean Chapter 10: Java Classes A–Z 2285 .ALIGN_LEFT ViewColumn.out. } } catch(Exception e) { e.println("\n" + column.getPosition() + " " + vtitle).println(colAction).getFormula(). else if (column.ViewColumn class System. Defined in ViewColumn Data type int Syntax public int getHeaderAlignment() throws NotesException Legal values ViewColumn. } } } HeaderAlignment property Read-only.isFormula()) colAction = column.out.printStackTrace().

IsCaseSensitiveSort property Read-only. False if the column is sorted without regard to case. Volume 3: JavaScript Classes . Indicates if a column is sorted with regard to case. False if the column is sorted without regard to accent. Defined in ViewColumn Data type boolean Syntax public boolean isCategory() throws NotesException 2286 Domino Designer Programming Guide. Indicates if a column is categorized. Defined in ViewColumn Data type boolean Syntax public boolean isCaseSensitiveSort() throws NotesException Legal values True if the column is sorted with regard to case.ViewColumn class Syntax public boolean isAccentSensitiveSort() throws NotesException Legal values True if the column is sorted with regard to accent. IsCategory property Read-only.

False if the column is not categorized. IsField property Read-only. isSorted also returns true. since columns that are categorized must also be sorted. Defined in ViewColumn Data type boolean Syntax public boolean isFormula() throws NotesException Chapter 10: Java Classes A–Z 2287 .ViewColumn class Legal values True if the column is categorized. IsFormula property Read-only. Indicates if column values are based on field values. Usage If isCategory returns true. Indicates if column values are based on a formula. Defined in ViewColumn Data type boolean Syntax public boolean isField() throws NotesException Legal values True if the column is based on field values. Usage This property returns true if the column is a field. False if the column is not based on field values.

ViewColumn class Legal values True if the column is based on a formula. Defined in ViewColumn Data type boolean Syntax public boolean isHideDetail() throws NotesException 2288 Domino Designer Programming Guide. IsHidden property Read-only. Volume 3: JavaScript Classes . Indicates if the details for total columns are hidden. even if the formula is a field name or evaluates to a field name. IsHideDetail property Read-only. False if the column is not based on a formula. The column is a formula. Defined in ViewColumn D