Domino Code Fragment

Code Name*
FTP Mirror
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.52.14.240.178
Description*
Created By: Teresa Deane on 02/07/96 at 03:59 PM
Category: Miscellaneous Minimum required Notes: Notes 4.0
Author: Teresa Deane
Company: Iris Associates
E-Mail Address: InterNotes@iris.com Description of the Agent: This agent refreshes pages with attachments. It should be run in the background preferably after the refresh agent has run.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Dim db As notesdatabase

Dim ftpcoll As notesdocumentcollection

Dim refreshed As Integer

Dim Select_Formula as string

Sub Initialize
Dim s As New notessession

Set db = s.currentdatabase
Print "Starting FTP Mirror agent...."
ProcessDocuments
Print "FTP Mirror agent finished..."
Print "Refreshed "+Cstr(refreshed)+" documents out of "Cstr(ftpcoll.count)+"."
ProcessDocuments

Sub ProcessDocuments
'*
'* This statement select the documents to be refreshed. The formula selects documents with attachments (ftp) which are not private pages
'*
Dim ndt As New notesdatetime ("1/1/94")
refreshed = 0
Select_Formula = "SELECT @contains(url;""ftp"")&privacy_flags!=1"
Set ftpcoll = db.search (Select_Formula, tm, 0)
Dim currentdoc As notesdocument

'*
'* If some documents have been found which match the selection criteria, this loop refreshes them provided that they are not already current.
'*

Print "Found "+Cstr(ftpcoll.count)+" ftp documents to refresh."
If ftpcoll.count <> 0 Then
For j = 1 To ftpcoll.count
Set currentdoc = ftpcoll.GetNthDocument(j)
If currentdoc.hasitem("url") Then
url = currentdoc.getitemvalue("url")
If Datevalue(currentdoc.getitemvalue("time_date")(0)) <> Datevalue(Today)Then
db.getdocumentbyurl url(0), 1
refreshed=refreshed+1
End If
End If
Next
End If

End Sub
End sub