home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 September / PCW0999.ISO / Software / NotesR5 / edition / DATA1.CAB / DataFilesOptionalDataFiles / AgentRunner.nsf (.txt) next >
Encoding:
Lotus Notes Storage Facility  |  1999-07-08  |  320.0 KB  |  749 lines

  1. Java AgentRunner
  2. !Nz0yC
  3. C{3wD
  4. rVCMU"c
  5. 4hhrt
  6. 3feOiK
  7. jA"*JQUT
  8. ;e@Py
  9. Y.cINeb!
  10. 9bl{{:    
  11. G8t$8C-E
  12. >iU64"
  13. &3!xp
  14. !Y@dyR
  15. 'F@$i
  16. @RPLI
  17. OL]12
  18. `:pjC
  19. @U>(=
  20. unYEj
  21. FlvWW
  22. I`f*;
  23. IsvSD
  24. R0;k)
  25. l%?mw
  26. 0gg*k
  27. 1RFSG
  28. *GUhp
  29. `xDR B+
  30. % xo<
  31.  .Cx1B
  32. G 0(`
  33. 03/17/98 03:46:22 PM Robert Perron/CAM/Lotus deleted Richard Adams/CAM/Lotus
  34. 01/06/98 07:45:24 AM Richard Adams/CAM/Lotus added OtherDomainServers
  35. 01/06/98 07:45:24 AM Richard Adams/CAM/Lotus added LocalDomainServers
  36. 01/06/98 07:45:24 AM Richard Adams/CAM/Lotus updated Richard Adams/CAM/Lotus
  37. 01/06/98 07:45:24 AM Richard Adams/CAM/Lotus added Richard Adams/CAM/Lotus
  38. -Default-
  39. LocalDomainServers
  40. OtherDomainServers
  41. dUFMU 
  42. OU(iVxMU
  43.     Ks&5
  44. #KW"S
  45. T$9\T
  46. Dre2R
  47. CN=Lotus Notes Template Development/O=Lotus Notes
  48. agentcontexts
  49. ($agentcontexts)
  50. $agentcontexts
  51. agentcontext
  52. CN=Richard Adams/OU=CAM/O=LotusCN=Robert Perron/OU=CAM/O=LotusCN=Lotus Notes Template Development/O=Lotus Notesy
  53. Omplate De
  54. $Modified
  55.     1S2S3S
  56. $TITLE$FormPrivs$ForjUsers$Body$Flags$Class$Modified$Comment$AssistTrigger$AssistType$AssistFlags$UpdatedBy$$FormScript_O$LANGUAGE
  57. $Flags
  58.     0SL1S4S5S3724
  59. $TITLE
  60. CN=Richard Adams/OU=CAM/O=Lotus
  61. velopmen
  62.  AgentContexts
  63. CurrentDatabase_Server
  64. CurrentDatabase_Server
  65. CurrentDatabase_Server
  66. Local
  67.     3S4S8S9S10S11S12S13S14S15S17S19S
  68. CurrentDatabase_Server
  69. CurrentDatabase_Server
  70. Local
  71. CurrentDatabase_Server
  72.     3S4S8S9S10S11S13S15S
  73. $17$16CurrentDatabase_FilePathCurrentAgent$18Description$Conflict$REF
  74. AgentContext
  75.     L1S1V
  76. $17$16CurrentDatabase_FilePathCzrrentAgent$18
  77. CurrentDatabase_Server
  78. CurrentDatabase_Server
  79. CurrentDatabase_Server
  80. Local
  81.     3S4S8S9S10S11S12S13S14S15S17S19S
  82. $16Server
  83. CurrentDatabase_Server
  84. CurrentDatabase_Server
  85. Local
  86. CurrentDatabase_Server
  87.     3S4S8S9S10S11S13S15S
  88. CurrentDatabase_FilePathDatabaseCurrentAgentAgent$18
  89. DescriptionDescription&
  90. CN=Robert Perzon/OU=CAM/O=LotusCN=Lotus Notes Template Development/O=Lotus Notes
  91. CN=Serge Zarembsky/OU=CAM/O=Lotus
  92. Java AgentRunner
  93. ($AgentContexts)|($AgentContexts)H
  94. CurrentDatabase_Server
  95. CurrentDatabase_Server
  96. Local
  97. CurrentDatabase_Server
  98. CurrentDatabase_FilePath"
  99.     3S4S8S9S10S11S13S15S17S18S19S20R
  100. $16CurrentAgent$18$Conflict$REF
  101. AgentContext
  102.     L1S1-
  103. $16CurrentAgent$18
  104. $16Key
  105. CurrentDatabase_Server
  106. CurrentDatabase_Server
  107. Local
  108. CurrentDatabase_Server
  109. CurrentDatabase_FilePath"
  110.     3S4S8S9S10S11S13S15S17S18S19S20R
  111. CurrentAgentAgent$18Last Modified
  112. CN=Richard Adams/OU=CAM/O=LotusCN=Lotus Notes Template Development/O=Lotus Notes
  113. CN=Serge Zarembsky/OU=CAM/O=LotusCN=Lotus Notes Template Development/O=Lotus Notes
  114. Dre2R
  115. CN=Jjseph Millar/O=IrisCN=Lotus Notes Template Development/O=Lotus Notes
  116. 1AgentContext
  117. ViewList_ModifiedCurrentDatabase_ViewListProcessedDateTimesProcessedDocsSelectedDocsSavedDataLastRunLastExitStatusEffectiveUserNameDocumentContextCurrentDatabase_ServerCurrentDatabase_FilePathCurrentAgentAgentSearchCriteriaAgentRunsOnViewAgentRunsOnDescription
  118. CN=Serge Zarembsky/OU=CAM/O=LotusCN=Lotus Notes Template Development/O=Lotus Notes
  119. O=Lotus Notes
  120. O=Lotus Notes
  121. PURSAFO
  122. |.:#U
  123. O=Lotus Notes
  124. CN=Lotus Notes Template Development/O=Lotus Notes
  125. PURSAFO
  126. _nmWd'[
  127. c<-{(
  128. $ACLDigest
  129. Edit Document
  130. New AgenwContext0
  131. AgentContext
  132.     0S0E
  133. Categori_zea
  134. Send Docu_ment
  135. _Forward
  136. _Move To Folder...
  137. _Remove From Folder4
  138. Help 
  139.     0S0E
  140. O=Lotus Notes
  141. O=Lotus Notes
  142. PURSAFO
  143. |.:#U
  144. O=Lotus Notes
  145. CN=Lotus Notes Template Development/O=Lotus Notes
  146. PURSAFO
  147. ;cQD=
  148. $TITLE
  149. $Index
  150. $Formula
  151. $FormulaClass
  152. $ViewFormat
  153. $Comment
  154. $ACTIONS
  155. O=Lotus Notes
  156. O=Lotus Notes
  157. PURSAFO
  158. |.:#U
  159. O=Lotus Notes
  160. CN=Lotus Notes Template Development/O=Lotus Notes
  161. PURSAFO
  162. $TITLE
  163. $Index
  164. $Formula
  165. $FormulaClass
  166. $ViewFormaw
  167. $Comment
  168. Dre2R
  169. Symbol
  170. &Arial
  171. About - AgentRunner
  172. This tool provides Notes
  173.  agent context to a Java IDE. Once the context is set up, yow can build, run, and debug without leaving the IDE. The code executes as it would in the Notes agent. This tool was developed and tested on Sun JDK, IBM VisualAge
  174. , and Symantec Visual Cafe; it should work with other Java IDEs but was not tested in other environments. See the Using document 
  175. Java AgentRunner
  176.  for help.
  177. Queries and comments should be directed to the "Developer Discussion Forum" at 
  178. http://www.lotus.com/developers
  179.     Copyright
  180.     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 software agreement.
  181.  Copyright 1999
  182.     Lotus Development Corporation
  183.     55 Cambridge Parkway
  184.     Cambridge, MA 02142
  185.     All rights reserved. Published in the United States.
  186.     Domino, InterNotes, Notes, and Lotus Domino Toolkit for Java are trademarks and Lotus, Lotus Notes, and SmartIcons are registered trademarks of Lotus Development Corporation. cc:Mail is a trademark of cc:Mail, a wholly-owned subsidiary of  Lotus Development Corporation. IBM, OS/2, and VisualAge are registered trademarks of International Business Machines Corporation.
  187.     Other product and company names mentioned herein may be the trademarks or registered trademarks of their respective owners. 
  188.     International Correctspell. English licensed from Houghton Mifflin Company. Copyright 
  189.  1991 by Houghton Mifflin Company. All rights reserved. Reproduction or disassembly of embodied algorithms or database prohibited. Based upon The American Heritage Dictionary.
  190.     LOTUS DEVELOPMENT CORPORATION LICENSOR(S) MAKES NO WARRANTIES,'EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE SOFTWARE. LOTUS DEVELOPMENT CORPORATION'S LICENSOR(S) DOES NOT WARRANT, GUARANTEE OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF THE SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, CURRENTNESS OR OTHERWISE. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. THE EXCLUSION OF IMPLIED WARRANTIES'IS NOT PERMITTED BY SOME JURISDICTIONS. THE ABOVE EXCLUSION MAY NOT APPLY TO YOU.
  191.     IN NO EVENT WILL LOTUS DEVELOPMENT CORPORATION'S LICENSOR(S), AND THEIR DIRECTORS, OFFICERS, EMPLOYEES OR AGENTS (COLLECTIVELY LOTUS DEVELOPMENT CORPORATION'S LICENSOR(S)) BE LIABLE TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR INDIRECT DAMAGES (INCLUDING DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, AND THE LIKE) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARG EVEN IF LOTUS DEVELOPMENT CORPORATION'S LICENSOR(S) HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
  192. O=Lotus Notes
  193. O=Lotus Notes
  194. PURSAFO
  195. |.:#U
  196. O=Lotus Notes
  197. CN=Lotus Notes Template Development/O=Lotus Notes
  198. PURSAFO
  199. $Info
  200. $Body
  201. Dre2R
  202. 5Courier New
  203. Using AgentRunner
  204. R5 includes AgentRunner, a Java application program for debugging Notes/Domino agents in a Java IDE. There are two versions of AgentWunner for different package classes:
  205. lotus.domino.AgentRunner for the lotus.domino package (Notes/Domino R5) 
  206. lotus.notes.AgentRunner for the lotus.notes package (Notes/Domino R4.6.x)
  207. Also included is a set of gebug classes that access Notes context information while running in a Java IDE. You create your agent code to extend DebugAgentBase, then initially run the program as an agent inside Notes to generate an AgentContext document in AGENTRUNNER.NSF. Subsequently, you run the AgentRunner application that runs your agent code outside Notes. The AgentRunner code accesses the AgentContext document to make the program behave as though it were running as an agent. This allows you to build and run without having to switch between the IDE and Notes, and to use IDE run-time tools such as the debugger.
  208. Create a project for your agent
  209. In Java IDE:
  210. Add the fully-qualified file specification for 
  211. notes.jar
  212.  (for example, for JDK or Cafe) to your Java IDE's CLASSPATH or Import (for example, for VisualAge).
  213. Create an agent (see Java Programmer's Guide for instructigns) that extends DebugAgentBase (instead of AgentBase). 
  214. Note:
  215.  If using R4.6-style agents, use the "
  216. import lotus.notes.*;
  217. " format.  If using the new lotus.domino package in Notes R5 (recommended), then use "
  218. import lotus.domino.*;
  219. ".  You do this to select the proper version of DebugAgentBase.
  220. Build the project as an application. It does not matter if the agent has a main() method, but if your IDE requirgs one, just add a dummy (Notes will not use it).
  221. Export (for example, for VisualAge) the .class files, if necessary.
  222. Generate an AgentContext document
  223. In Notes:
  224. Create a Java agent in a Notes database and import the .class files from your project.  Ensure that the base class is the class that extends DebugAgentBase.
  225. Run the agent.  This generatgs an AgentContext document in AGENTRUNNER.NSF.
  226. Open AGENTRUNNER.NSF and examine the most recent AgentContext document. Note the name of the server, the file path of the database, and the name of the agent.  "Local" is the name of the server for a local database.
  227. In edit mode, change the "Agent Runs On" and "Search Criteria" fields to generate the UnprocessedDocuments collection that you would like to use for debugging purposes. You must supply this information because it cannot ge determined from running the agent.
  228. Note:
  229.  the "Agent Runs On" and "Search Criteria" that you specified in the agent that you ran to generate this document will produce the "Selected" document list.  
  230. Save and close the document.
  231. You can generate another AgentContext document later if you want to change the run-time environment. You can edit fields other than "Agent Runs On" and "Search Criteria" to change the run-time environment, but this is not recommended.
  232. Debug your agent
  233. In Java IDE:
  234. Specify <Agent> [<Database> [<Server>]] arguments, as displayed in the "AgentContexts" view of AGENTRUNNER.NSF, to the AgentRunner program to select the AgentContext document that you want to use for debugging your agent code. If running from a command line, type:
  235. java lotus.domino.AgentRunner <Agent> [<Database> [<Server>]]
  236. To'run an agent that uses the lotus.notes package (from R4.6.x) from a command line, type:
  237. java lotus.notes.AgentRunner <Agent> [<Database> [<Server>]]
  238. Set a breakpoint on the executable line of code in the NotesMain() method of your agent, or wherever you deem appropriate.
  239. Run or debug the project. If you are debugging and no breakpoints are set, you should step into NotesMain() to access your code.
  240. In certain IDE's (like Symantec's Visual Cafe), you can't specgfy that a project's main() entrypoint be in a class in jar/zip file, so what you need to do is create a dummy main application whose sole purpose is to call the main() method in AgentRunner, so use something like this:
  241. import lotus.domino.*;
  242. public class Main
  243.     public static void main (String[] args)
  244.     {
  245.         try
  246.         {
  247.             AgentRunner.main(args);
  248.         }
  249.         gatch (Exception e)
  250.         {
  251.             e.printStackTrace();
  252.         }    
  253.     }
  254. Note:
  255.  In Visual Age Java (2.0 or above) there is an integrated Domino AgentRunner tool that runs or debugs Domino agents by simply clicking on the agent and selecting "tools-Domino AgentRunner-run". This tool also allows updating AgentContext documents directly from the IDE, by selectgng "tools-Domino AgentRunner-properties".
  256. O=Lotus Notes
  257. O=Lotus Notes
  258. PURSAFO
  259. |.:#U
  260. O=Lotus Notes
  261. CN=Lotus Notes Template Development/O=Lotus Notes
  262. PURSAFO
  263. # U7e
  264. $Info
  265. $Body
  266. j#j_fr
  267. 6~-tP
  268. G1PP<
  269. K3(uto
  270.  ;P\gW
  271. 9$juc1
  272. h1*!A
  273. F)3Xc'
  274. <K|Wx
  275. l'    #7
  276. :UneJp
  277. d7zPCh
  278. /S4-S`Y2
  279. Qh&A\
  280. X3L:(d
  281. )uYLtC
  282. I^2o*=
  283. (l+o>
  284. &hB?Y$
  285. *L!B#J
  286. }uJ]#
  287. S>qj%
  288. *R!1e
  289. tJr>]
  290. FWrad
  291. Kky{P
  292. 7z/Wp_
  293. _KwM;
  294. heWgH
  295. n]YU;g
  296. zm7uX
  297. yYW8 
  298. er4BB
  299. RP%#i5,$p
  300. ;:Pz 
  301. Is"rl
  302. w    5X!
  303. xA#q!
  304. Nab79=?
  305. KNQOVVXW
  306. U{hx$i
  307. S&Q(QG
  308. GUSeLq$
  309. j0GGG0
  310. mO&W#\
  311. k6d0[
  312. '@#]C
  313. >1Jk@
  314. WI%QR
  315. fv{_G
  316. <6=VIh    
  317. /<F6[
  318. jI|?4
  319. cxk"f
  320. ]7A.'
  321. v|FgH
  322. Xz de[
  323. ^!xM>HD
  324. S$XuW
  325. @    FDl
  326. off^e
  327. Yiaxk
  328. 6;Iv%
  329. LLq0E
  330. }    7*vx|
  331. Yt=uu
  332. ?QYmF
  333. Me63WMSY
  334. j]7jv
  335. V5ec&
  336. -*c(m
  337. O=Lotus Notes
  338. O=Lotus Notes
  339. PURSAFO
  340. |.:#U
  341. O=Lotus Notes
  342. CN=Lotus Notes Template Development/O=Lotus Notes
  343. PURSAFO
  344. !6%g^%
  345. g$cd9
  346. $ImagesWide
  347. $ImagesHigh
  348. $ImagesColorize
  349. $ImageDgta
  350. $ImageNames
  351. $TITLE
  352. $Comment
  353. CurrentAgent
  354.  (Debug AgentContext Data)"
  355.     4S6S8S9S
  356. '++LotusScript Development Environment:2:5:(Options):0:66
  357. Option Public
  358. '++LotusScript Development Environment:2:5:(Forward):0:1
  359. '++LotusScript Development Environment:2:5:(Declarations):0:10
  360. %INCLUDE "LSCONST.LSS"
  361. Dim FirstTime As Variant
  362. Dim CloseOK As Variant
  363. AgentContext'++LotusScript Development Environment:2:5:(Options):0:66
  364. '++LotusScript Development Environment:2:5:(Forward):0:1
  365. Declare Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
  366. Declare Sub Querysave(Source As Notesuidocument, Continue As Variant)
  367. Declare Sub Queryclose(Source As Notesuidocument, Continue As Variant)
  368. '++LotusScript Development Environment:2:5:(Declarations):0:2
  369. '++LotusScript Development Environment:2:2:BindEvents:1:129
  370. Private Sub BindEvents(Byval Objectname_ As String)
  371.      Static Source As NOTESUIDOCUMENT
  372.      Set Source = Bind(Objectname_)
  373.      On Event Queryopen From Source Call Queryopen
  374.      On Event Querysave From Source Call Querysave
  375.      On Event Queryclose From Source Call Queryclose
  376. End Sub
  377. '++LotusScript Development Environment:2:2:Queryopen:1:12
  378. Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
  379.      FirstTime = True
  380.      CloseOK=True
  381. End Sub
  382. '++LotusScript Development Environment:2:2:Querysave:1:12
  383. Sub Querysave(Source As Notesuidocument, Continue As Variant)
  384.      On Error Goto Done
  385.      Source.Refresh
  386.      Dim AgentName As String
  387.      Dim DatabaseName As String
  388.      agentName = Source.FieldGetText("CurrentAgent")
  389.      databaseName = Source.FieldGetText("CurrentDatabase_FilePath")
  390.      
  391.      If(agentName = "") Then
  392.           Dim boxType As Long
  393.           boxType = MB_YES + MB_ICONEXCLAMATION + MB_DEFBUTTON1 + MB_APPLMODAL
  394.           Messagebox "You must specify agent name", boxType, "Field Contains Incorrect Value"
  395.           Continue=False
  396.           CloseOK=False
  397.           Exit Sub
  398.      End If          
  399.      If(databaseName = "") Then
  400.           Messagebox "You must specify database name", boxType, "Field Contains Incorrect Value"
  401.           Continue=False
  402.           CloseOK=False
  403.           Exit Sub
  404.      End If     
  405.      
  406.      Dim runsOn As String
  407.      runsOn = Source.FieldGetText("AgentRunsOn")
  408.      Dim serverName As String
  409.      serverName = Source.FieldGetText("CurrentDatabase_Server")
  410.      Dim db As New NotesDatabase(serverName,databaseName)
  411.      If(db.IsOpen=False) Then
  412.           If (Trim(serverName) = "") Then
  413.                serverName = "Local"
  414.           End If
  415.           boxType = MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_APPLMODAL
  416.           answer = Messagebox("Database " & databaseName & " on server " & serverName & " is not accessible", boxType, "Continue anyway?")
  417.           If(answer = IDNO) Then
  418.                Continue = False
  419.                CloseOK=False
  420.                Resume Done
  421.           End If
  422.      End If
  423.      
  424.      If(runsOn= "All unread documents in view" Or runsOn =  "All documents in view") Then
  425.           Dim viewName As String
  426.           viewName = Source.FieldGetText("AgentRunsOnView")
  427.           viewName = Ltrim(Rtrim(viewName))
  428.      'Get rid of alias if there is one
  429.           Dim pos As Integer
  430.           pos = Instr(viewName,"|")
  431.           If (pos > 0) Then
  432.                viewName = Rtrim(Left(viewName, pos - 1))
  433.           End If
  434.           If(viewName = "") Then
  435.                Messagebox "You must specify view name", boxType, "Field Contains Incorrect Value"
  436.                Continue=False
  437.                CloseOK=False
  438.                Exit Sub
  439.           End If     
  440.           Dim view As NotesView
  441.           Set view = db.GetView(viewName)
  442.           If(view Is Nothing) Then
  443.                boxType = MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_APPLMODAL
  444.                answer = Messagebox ("View " & viewName & " is not accessible", boxType, "Continue Anyway?")
  445.                If(answer = IDNO) Then
  446.                     Continue = False
  447.                     CloseOK=False
  448.                     Exit Sub
  449.                End If
  450.           End If
  451.           Exit Sub
  452.      End If
  453.      Exit Sub
  454. Done:
  455.      'Die peacefully
  456.      Exit Sub
  457. End Sub
  458. '++LotusScript Development Environment:2:2:Queryclose:1:12
  459. Sub Queryclose(Source As Notesuidocument, Continue As Variant)
  460.      
  461. End Sub
  462. '++LotusScript Development Environment:2:5:(Options):0:66
  463. '++LotusScript Development Environment:2:5:(Forward):0:1
  464. Declare Sub Exiting(Source As Field)
  465. '++LotusScript Development Environment:2:5:(Declarations):0:2
  466. '++LotusScript Development Environment:2:2:BindEvents:1:129
  467. Private Sub BindEvents(Byval Objectname_ As String)
  468.      Static Source As FIELD
  469.      Set Source = Bind(Objectname_)
  470.      On Event Exiting From Source Call Exiting
  471. End Sub
  472. '++LotusScript Development Environment:2:2:Exiting:1:12
  473. Sub Exiting(Source As Field)
  474.      
  475. End Sub
  476. '++LotusScript Development Environment:2:5:(Options):0:66
  477. '++LotusScript Development Environment:2:5:(Forward):0:1
  478. Declare Sub Exiting(Source As Field)
  479. Declare Sub Entering(Source As Field)
  480. '++LotusScript Development Environment:2:5:(Declarations):0:2
  481. '++LotusScript Development Environment:2:2:BindEvents:1:129
  482. Private Sub BindEvents(Byval Objectname_ As String)
  483.      Static Source As FIELD
  484.      Set Source = Bind(Objectname_)
  485.      On Event Exiting From Source Call Exiting
  486.      On Event Entering From Source Call Entering
  487. End Sub
  488. '++LotusScript Development Environment:2:2:Exiting:1:12
  489. Sub Exiting(Source As Field)
  490.      
  491. End Sub
  492. '++LotusScript Development Environment:2:2:Entering:1:12
  493. Sub Entering(Source As Field)
  494.      On Error Goto Done
  495.      Dim workspace As New NotesUIWorkspace
  496.      Dim uidoc As NotesUIDocument
  497.      Set uidoc = workspace.CurrentDocument
  498.      Dim flag As String
  499.      flag = uidoc.FieldGetText("ViewList_Modified")     
  500.      If(flag = "1" Or FirstTime = True) Then
  501.           Dim serverName As String
  502.           Dim databaseName As String
  503.           serverName = uidoc.FieldGetText("CurrentDatabase_Server")
  504.           databaseName = uidoc.FieldGetText("CurrentDatabase_FilePath")
  505.           Dim db As New NotesDatabase(serverName,databaseName)
  506.           If(db.IsOpen=False) Then
  507.                Dim boxType As Long
  508.                If (Trim(serverName) = "") Then
  509.                     serverName = "Local"
  510.                End If
  511.                boxType = MB_YES + MB_ICONEXCLAMATION + MB_DEFBUTTON1 + MB_APPLMODAL
  512.                Messagebox "Specified database " & databaseName & " on server " & serverName & " is not accessible", boxType, "Lookup Views Error"
  513.                uidoc.FieldClear("CurrentDatabase_ViewList")
  514.                Call uidoc.FieldSetText("ViewList_Modified", "1")
  515.                uidoc.FieldClear("AgentRunsOnView")
  516.                uidoc.Refresh
  517.                Resume Done
  518.           End If
  519.           uidoc.FieldClear("CurrentDatabase_ViewList")
  520.           Forall v In db.Views
  521.                Call uidoc.FieldAppendText("CurrentDatabase_ViewList", v.Name & ";" ) 
  522.           End Forall
  523.           Dim temp As String
  524.           temp = uidoc.FieldGetText("CurrentDatabase_ViewList")
  525.           Dim length As Integer
  526.           length = Len(Len(temp) - 1)
  527.           If (length > 0) Then
  528.                Call uidoc.FieldSetText("CurrentDatabase_ViewList",Left(temp, Len(temp) - 1))
  529.           End If
  530.           If(FirstTime=False) Then
  531.                uidoc.FieldClear("AgentRunsOnView")
  532.           End If
  533.           uidoc.FieldClear("ViewList_Modified")
  534.           FirstTime = False
  535.           uidoc.Refresh
  536.      End If
  537.      Exit Sub
  538. Done:
  539.      Exit Sub
  540. End Sub
  541. '++LotusScript Development Environment:2:5:(Options):0:66
  542. '++LotusScript Development Environment:2:5:(Forward):0:1
  543. Declare Sub Entering(Source As Field)
  544. '++LotusScript Development Environment:2:5:(Declarations):0:2
  545. '++LotusScript Development Environment:2:2:BindEvents:1:129
  546. Private Sub BindEvents(Byval Objectname_ As String)
  547.      Static Source As FIELD
  548.      Set Source = Bind(Objectname_)
  549.      On Event Entering From Source Call Entering
  550. End Sub
  551. '++LotusScript Development Environment:2:2:Entering:1:12
  552. Sub Entering(Source As Field)
  553.      Dim workspace As New NotesUIWorkspace
  554.      Dim uidoc As NotesUIDocument
  555.      Set uidoc = workspace.CurrentDocument
  556.      Call uidoc.FieldSetText("ViewList_Modified", "1")
  557. End Sub
  558. '++LotusScript Development Environment:2:5:(Options):0:66
  559. '++LotusScript Development Environment:2:5:(Forward):0:1
  560. Declare Sub Entering(Source As Field)
  561. '++LotusScript Development Environment:2:5:(Declarations):0:2
  562. '++LotusScript Development Environment:2:2:BindEvents:1:129
  563. Private Sub BindEvents(Byval Objectname_ As String)
  564.      Static Source As FIELD
  565.      Set Source = Bind(Objectname_)
  566.      On Event Entering From Source Call Entering
  567. End Sub
  568. '++LotusScript Development Environment:2:2:Entering:1:12
  569. Sub Entering(Source As Field)
  570.      Dim workspace As New NotesUIWorkspace
  571.      Dim uidoc As NotesUIDocument
  572.      Set uidoc = workspace.CurrentDocument
  573.      Call uidoc.FieldSetText("ViewList_Modified", "1")
  574. End Sub
  575. Java AgentRunner - AgentContext Data
  576. Last Modified
  577. Modified
  578. Description
  579. Description
  580. Agent Runs On:
  581. t nE@
  582. AgentRunsOnChange this to match generating agent
  583. All documents in database | 0All new and modified documents since last run | 1All unread documents in view | 2All documents in view | 3Selected documents | 4Run once | 5
  584. t nET
  585. AgentRunsOn
  586. AgentRunsOn
  587.     1S2S3S4R5S6S
  588. AgentRunsOnViewChange this to match generating agent
  589. CurrentDatabase_ViewList
  590. Search Criteria:
  591. AgentSearchCriteriaChange this to match generating agent
  592. Agent
  593. CurrentAgent
  594. CurrentAgent
  595. Database
  596. CurrentDatabase
  597. String
  598. FilePath
  599. CurrentDatabase_FilePath
  600. String
  601. Server
  602. CurrentDatabase_Server
  603. CurrentDatabase_Server
  604.     3S4S9S11S15S
  605. CurrentDatabase_Server
  606. Document
  607. DocumentContext
  608. DocumentContext
  609. DocumentContext
  610.     3S4S9S11SDocumentContext
  611. String
  612. EffectiveUserName
  613. EffectiveUserName
  614. EffectiveUserName
  615. LastExitStatus
  616. LastExitStatus
  617. LastExitStatus
  618.     3S4S5S6S8S10SLastExitStatus
  619. DateTime
  620. LastRun
  621. LastRun
  622. Document
  623. SavedData
  624. SavedData
  625. SavedData
  626.     3S4S9S11SSavedData
  627. DocumentCollection
  628. UnprocessedDocuments
  629. AgentRunsOn
  630. All documents in CurrentDatabase that meet Search Criteria
  631. AgentRunsOn
  632. All documents in CurrentDatabase minus "Processed" documents unmodified since "Processed On" that meet Search Criteria
  633. AgentRunsOn
  634. The intersection of all documents in View and "Selected" documents that meet Search Criteria
  635. AgentRunsOn
  636. All documents in View that meet Search Criteria
  637. AgentRunsOn
  638. All "Selected" documents that meet Search Criteria
  639. AgentRunsOn
  640. DocumentContext document
  641.     2RS2E3S4S6S8RS2E9S10S12S14RS2E15S16S18S20RS2E21S22S24S26RS2E27S28S30S32RS2E33S34S36S38RS2E
  642. UnprocessedDocumentsReturns
  643. Document Lists
  644. Selected
  645. "Selected" (NoteID) List -
  646. Created when an agent is run in "dumpAgentContext" mode.
  647. Used to select "unread" documents for "All unread documents in view" agents.
  648. Used as UnprocessedDocuments for "Selected documents" agents.
  649. Call to DocumentCollection removeAll removes all matching UnprocessedDocuments.
  650. Processed
  651. "Processed" (NoteID) List -
  652. Created and updated by "All new and modified documents since last run" agents.
  653. On start of first agent run, Processed List will be empty.
  654. Call to AgentContext updateProcessedDoc method adds document (NoteID).
  655. Call to DocumentCollection updateAll adds all remaining UnprocessedDocuments (NoteIDs).
  656. On start of subsequent runs, documents deleted from the database and Processed documents modified since LastRun will be removed.
  657. Call to DocumentCollection removeAll removes all matching UnprocessedDocuments (regardless of AgentRunsOn value).
  658. "Processed On" (DateTime) List -
  659. Date/Time when each adjacent document was "Processed"
  660. SelectedDocs
  661. ProcessedDocs
  662. ProcessedDateTimes
  663. CurrentDatabase_ViewList
  664. ViewList_Modified
  665. Save and Close'++LotusScript Development Environment:2:5:(Options):0:66
  666. '++LotusScript Development Environment:2:5:(Forward):0:1
  667. Declare Sub Click(Source As Button)
  668. '++LotusScript Development Environment:2:5:(Declarations):0:2
  669. '++LotusScript Development Environment:2:2:BindEvents:1:129
  670. Private Sub BindEvents(Byval Objectname_ As String)
  671.      Static Source As BUTTON
  672.      Set Source = Bind(Objectname_)
  673.      On Event Click From Source Call Click
  674. End Sub
  675. '++LotusScript Development Environment:2:2:Click:1:12
  676. Sub Click(Source As Button)
  677.      On Error Goto Done
  678.      Dim workspace As New NotesUIWorkspace
  679.      Dim uidoc As NotesUIDocument
  680.      Set uidoc=workspace.CurrentDocument
  681.      uidoc.Save
  682.      uidoc.Close
  683. Done:
  684.      Exit Sub
  685. End Sub
  686. Clear All ValuesN
  687. Description
  688. AgentSearchCriteria
  689.     0R4S
  690. CurrentAgent
  691.     0R4S
  692. CurrentDatabase_FilePath
  693.     0R4S
  694. CurrentDatabase_Server
  695.     0R4S
  696. DocumentContext
  697.     0R4S
  698. EffectiveUserName
  699.     0R4S
  700. LastExitStatus
  701.     0R4S
  702. LastRun
  703.     0R4S
  704. SavedData
  705.     0R4S
  706. SelectedDocs
  707. ProcessedDocs
  708. ProcessedDateTimes
  709. Edit Documento
  710. Help 
  711.     0S0E
  712. Categori_zen
  713. Send Docu_ment
  714. _Forward
  715. _Move To Folder...
  716. _Remove From Folder     
  717. O=Lotus Notes
  718. O=Lotus Notes
  719. PURSAFO
  720. |.:#U
  721. O=Lotus Notes
  722. CN=Lotus Notes Template Development/O=Lotus Notes
  723. PURSAFO
  724. @*    D*i
  725. ProcessedDateTime
  726. UDocs_Count
  727. $TITLE
  728. $Info
  729. $WindowTitle
  730. $Script
  731. $$Script_O
  732. $$ScriptName
  733. $$FormScript
  734. $$$FormScript_O
  735. $$AgentRunsOn
  736. $AgentRunsOn_O
  737. $$AgentRunsOnView
  738. $AgentRunsOnView_O
  739. $$CurrentDatabase_FilePath
  740. $CurrentDatabase_FilePath_O
  741. $$CurrentDatabase_Server
  742. $CurrentDatabase_Server_O
  743. LastExitStatus
  744. LastRun
  745. ProcessedDateTimes
  746. $Body
  747. $ACTIONS
  748. $SCRIPTOBJ_0
  749.