'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Initialize
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:Initialize:1:10
Sub Initialize
REM =============Average agent declarations ================
Dim s As New NotesSession
Dim db As NotesDatabase
Dim HidView As NotesView
Dim AveView As NotesView
Dim CurDoc As NotesDocument
Dim NextDoc As Notesdocument
Dim LastDoc As Notesdocument
Dim SumRating As Integer
Dim AveRating As Double
Dim TotalRating As Integer
Dim CurURL As String
Dim NextURL As String
Dim AveCol As NotesDocumentCollection
Dim cutoff As New NotesDateTime("12/01/94")
Dim x As Integer
Dim allratings As notesdocumentcollection
REM ============ Rating Invalidation Declarations ============
Dim RatingsCol As NotesDocumentCollection
Dim RatingDoc As NotesDocument
Dim HtmlDoc As NotesDocument
Dim n As Integer
Dim RatingURL As String
Dim HtmlURL As String
Dim RatingDateStr As String
Dim LastModifiedStr As String
Dim RatingDate As Variant
Dim LastModified As Variant
Dim Ratingfield As Variant
Dim adminview As NotesView
Dim admindoc As NotesDocument
Dim refresh As Variant
Dim dt As NotesDateTime
Dim URLdoclink As NotesRichTextItem
Dim RefreshDoc As NotesDocument
Set db = s.CurrentDatabase
Set allratings = db.Search("Select form = ""Person Rating Form""", cutoff, 0)
'/*
'** Verify that there are ratings documents in the database
'*/
If allratings.count <> 0 Then
Set AveCol = db.Search("SELECT Form = ""Person Rating Form"" & average != """"", cutoff, 0)
Set AveView = db.GetView("(AverageRating)")
Call AveView.Refresh()
'/*
'** This is initialization code. Topten is a flag that notifies the top rating view if the rating document
'** for a URL is one of the top rated pages. When recalculating the average ratings and reselecting the
'** top ten, topten needs to be reset to empty. Also, the field, average, is reset to empty.
'*/
If AveCol.Count <> 0 Then
For j=1 To avecol.count
Set CurDoc = AveCol.GetNthDocument(j)
CurDoc.topten = ""
CurDoc.average = ""
Call CurDoc.Save(True, False)
Next
End If
Set allratings = db.Search("Select form = ""Person Rating Form"" & Rating != """"", cutoff, 0)
REM Here is the code that does the actually averaging.
REM This if-statements makes sure that there are ratings before the agents tries
REM to average.
If allratings.count <> 0 Then
REM We need to get a list of all the URLs in the database that have
REM been rated. We get an alphabetically ordered list of those URLs from
REM the hidden view, (AllRating).
Set HidView = db.GetView("(AllRating)")
Set CurDoc = HidView.GetFirstDocument()
Set LastDoc = HidView.GetLastDocument()
RatingField = CurDoc.GetItemValue("Rating")
REM Need to initialize the variable, SumRating, TotalRating, and AveRating.
REM These variable keep running totals for each rated URL so every time
REM a new URL is being averaged, these variables need to be reset. SumRating
REM keeps a running sum of all the ratings for a URL. TotalRatings keeps
REM a running total of the number of people who have rated a URL. AveRating
REM is the average rating of one URL.
REM Some of the recommended documents has no ratings. The documents are
REM automatically made by agents. They are not counted into the average rating.
If Cstr(RatingField(0)) <> "" Then
SumRating = Cint(Ratingfield(0))
TotalRating = 1
AveRating = 0
Else
SumRating = 0
TotalRating = 0
AveRating = 0
End If
REM This loop goes through each rated URL and find the average for each.
While CurDoc.NoteID <> LastDoc.NoteID
Set NextDoc = HidView.GetNextDocument(CurDoc)
RatingField = CurDoc.GetItemValue("URL")
CurURL = Cstr(RatingField(0))
RatingField = NextDoc.GetItemValue("URL")
NextURL = Cstr(RatingField(0))
REM Since, in the HidView, the URLs are ordered alphabetically, all the URLs
REM that are the same will be grouped together. So, when going through
REM the URLs in order from the view, once we find a URL different than the
REM previous one retrieved, we know we have to start a new average
REM calculation. When new URL is reached, an average rating is calculated
REM and the value found is placed into the average field in the last rating
REM document that had the previous URL. If a new URL is not reached, then
REM we just add its rating to the running sum, SumRating, and increment
REM TotalRating by one.
If CurURL = NextURL Then
RatingField = NextDoc.GetItemValue("Rating")
If Cint(RatingField(0)) <>0 Then
SumRating = SumRating + Cint(RatingField(0))
TotalRating = TotalRating + 1
Set CurDoc = NextDoc
Else
Set CurDoc = NextDoc
End If
Else
REM Only if people rated a URL can we find an average rating for the URL. This
REM if statement checks to make sure that the URL did have ratings.
If TotalRating <> 0 Then
AveRating = SumRating / TotalRating
REM In general, the more people who rate a Web page, then
REM the URL is probably a good one. Therefore, in this
REM code, if 6 or more people have rated a URL, then
REM the average rating of the URL is increased by 1. If 3
REM or more people rate a URL, then the average rating of the
REM URL is increased by 0.5.
If TotalRating >= 6 Then
AveRating = AveRating + 1
Elseif TotalRating >= 3 Then
AveRating = AveRating + 0.5
End If
CurDoc.average = Cstr(Round(AveRating, 1))
CurDoc.number = Cstr(TotalRating)
Call CurDoc.Save(True,False)
Set CurDoc = NextDoc
RatingField = CurDoc.GetItemValue("Rating")
REM Again, as above, because we are starting to calculate
REM a new average, initialization is needed.
If Cstr(RatingField(0)) <> "" Then
SumRating = Cint(RatingField(0))
TotalRating = 1
AveRating = 0
Else
SumRating = 0
TotalRating = 0
AveRating = 0
End If
Else
REM If the total number of people who have rated the URL
REM is zero, then we just get the next URL and start
REM a new average calculation.
Set CurDoc = NextDoc
RatingField = CurDoc.GetItemValue("Rating")
REM Again, initalization code...
If Cstr(RatingField(0)) <> "" Then
SumRating = Cint(RatingField(0))
TotalRating = 1
AveRating = 0
Else
SumRating = 0
TotalRating = 0
AveRating = 0
End If
End If
End If
Wend
REM Because the way the loop is structured, when we reach the last URL in
REM the view, an average is not calculated. So, this code is needed to
REM calculate the average for the last URL.
If TotalRating <> 0 Then
AveRating = SumRating / TotalRating
If TotalRating >= 6 Then
AveRating = AveRating + 1
Elseif TotalRating >= 3 Then
AveRating = AveRating + 0.5
End If
CurDoc.average = Cstr(AveRating)
CurDoc.number = Cstr(TotalRating)
Call CurDoc.Save(True, False)
End If
REM Now, take the first 10 ratings from the ($AverageRating) and set their
REM topten field to 1 so that the Top Rating View will display those
REM ratings in its view.
Call AveView.Refresh()
Set AveCol = db.Search("SELECT Form = ""Person Rating Form"" & average != """"", cutoff, 0)
If AveCol.Count <> 0 Then
Set CurDoc = AveView.GetFirstDocument()
Set LastDoc = AveView.GetLastDocument
For x = 2 To 11
CurDoc.topten = "1"
Call CurDoc.Save(True, False)
If CurDoc.NoteID = LastDoc.NoteID Then
Exit For
Else
Set CurDoc = AveView.GetNthDocument(x)
End If
Next
End If
End If
End If
End Sub
H H T
,x }\
,x }\
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$TITLE
$AssistType
$AssistLastRun
$AssistDocCount
$AssistFlags
$AssistTrigger
$AssistInfo
$AssistQuery
$AssistAction
$AssistAction_Ex
$Flags
Times New Roman
&Arial
Using Server
Web Navigator 4.5
@
@@ @
`@ `
@ @@
@@@@@
@`@@`
` @`
`@@`@
``@``
The Server Web Navigator database is designed to allow you to access information on the World Wide Web. For more information on using the Server Web Navigator database, click the User's Guide icon on the Home navigator.
Types of documents
There are three types of documents in the Server Web Navigator database:
Web page
-- A Web page is a document that the Web Navigator retrieves from an Internet server and translates into a Notes document. The Web pages can contain HTML documents, FTP file attachments or Gopher menu lists. Web pages usually contain links that you can click to jump to other Web pages. Most of the documents in the database are Web pages.
Web Tour document
-- A Web Tour is a Notes document that contains the saved history list of Web pages you have previously opened. You can create Web Tours and re-open them later. Web Tours are stored inside the database for anyone to use.
Rating document
-- A rating document is a Notes document that appears in one of the Recommended views available from the Recommended navigator (see below). You use rating documents to find out which Web pages your coworkers have recommended.
Views and folders
The Web Navigator has been designed with built-in graphical navigators to help you locate documents in the database, as well as to help you browse the Web. When you first open the Web Navigator database, you will see the Home navigator.
From the
Home navigator
, click these icons:
Sampler icons -- Displays hot lists of Web pages categorized by topic.
Database views -- Displays the View navigator (see below).
Recommended -- Displays the Recommended navigator (see below).
Directory Search -- Opens a search form that allows you to perform searches using several Internet search engines.
Open URL -- Opens the Open URL dialog box where you can open Web pages by specifying their URL.
User's Guide -- Opens the Web Navigator User's Guide.
Our Home - Opens your company's home page, if one exists.
From the
View navigator
, click these buttons:
My Bookmarks --Displays the contents of your personal "My Bookmarks" folder. You can also drag and drop Web pages onto this icon to add a link to your Bookmarks folder.
Folders -- Displays the traditional folders in the folder pane instead of the View navigator.
All Documents -- Displays all the public Web pages in this database.
By Host -- Displays all the public Web pages sorted by their host site.
File Archive -- Displays all the public Web pages with file attachments.
Web Tours -- Displays all the saved Web Tour documents.
Recommended -- Displays the Recommended navigator (see below).
Back to Home -- Displays the Home navigator.
From the
Recommended navigator
, click these buttons:
By Category -- Displays the rating documents sorted by the categories the reviewer chose in the Recommendation dialog box. This view is useful for finding pages under specific topics.
By Reviewer -- Displays the rating documents sorted by the name of the reviewer. This view is useful if you want to know what pages a particular person recommended.
Top Ten -- Displays the top ten pages with the highest cumulative ratings. This view is useful for seeing the top-rated Web pages.
Welcome to the Server Web Navigator database. The Server Web Navigator database provides you with easy access to information on the World Wide Web via a Notes server (the InterNotes server) connected to the Internet. This database acts both as a repository for Internet documents and files that have been retrieved and as an easy entry point for exploring the Internet.
Choose "Using This Database" from the Help menu for quick tips on using this database.
For more detailed information on using this database, click the User's Guide icon on the Home navigator.
-------------------
(Close this window to return to the database.)
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$INFO
$BODY
Hotspot2
WebFolders
0S0E
(Art and Culture)
0S0E
Hotspot3
WebFolders
0S0E
(Publications)
0S0E
Hotspot4
WebFolders
0S0E
(Reference)
0S0E
Hotspot5
WebFolders
0S0E
(Business and Finance)
0S0E
Hotspot6
WebFolders
0S0E
(Shopping)
0S0E
Hotspot7
WebFolders
0S0E
(Government)
0S0E
Hotspot8
WebFolders
0S0E
(Education)
0S0E
Hotspot16
Hotspot18
WebFolders
0S0E
(Recommended)
0S0E
Hotspot19
Search
Hotspot20
Hotspot21
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Navigator)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As NAVIGATOR
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:1:12
Sub Click(Source As Navigator)
Dim PrivateAddressBook As notesdatabase
Dim CurrentLocation As notesdocument
Dim LocationString As String
Dim helpdb As New notesdatabase("", "")
Dim workspace As New NotesUIWorkspace
Dim Session As New notessession
Set PrivateAddressBook = New Notesdatabase("", "names.nsf")
Art and Culture |0Business and Finance |1Computing and Internet |2Education |3Entertainment |4Government |5Publications |6Recreation and Sports |7Reference |8Shopping |9
Edit title:
Comments
Comments
Category_Selection
Content
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$TITLE
$INFO
$WINDOWTITLE
$$Script_O
$$ScriptName
$BODY
Person Rating Form'
Title
Title
Category:
Content
Content
ArtBusinessComputersEconomyEducationEntertainmentEnvironment and NatureEventsGovernmentHealthHumanitiesLawNewsPoliticsPublicationsRecreation and SportsReferenceRegional InformationScienceSocial ScienceSociety and CultureShopping
Rating Average:
average
Ajusted Average
Adj_rating
Number of ratings:
number
Top Ten
topten
Rating:
Rating
Rating
Word_Repr.
Word_Repr.
Comments:
Comments
Comments
Author:
Author
0S0E
RatingDate
URL
Invalid?:
invalid
SaveOptions
0S0E
Click here to launch:
If you see this form, you are using a version of the Notes Client that does not support auto-launching of URL links in Notes forms. See your Notes administrator to either upgrade your software to version 4.1 or later, or to revert this Notes application to an earlier version.
Print "Unable to find the correct admin document. "
Print "Refresh agent did not refresh."
End If
End If
End Sub
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$TITLE
$AssistType
$AssistLastRun
$AssistDocCount
$AssistFlags
$AssistTrigger
$AssistInfo
$AssistQuery
$AssistAction
$AssistAction_Ex
Categori_zeK
_Edit Document
Send Docu_ment
_Open URL
_Home
WebFolders
0S0E
(Home)
0S0E
_Directory Search
Search
0S0E
_Forward
_AdministrationKT
WebAdmin
_Move to Folder...
_Remove from Folder...
Home NavigatorX
WebFolders
0S0E
(Home)
0S0E
WebFolders|
0S0E
Views NavigatorKb
WebFolders
0S0E
(All Documents)
0S0E
WebFolders|
0S0E
Recommended Navigator
WebFolders
0S0E
(Recommended)
0S0E
WebFolders|
0S0E
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$ACTIONS
$TITLE
$Name
$Index
$Formula
$FormulaClass
$VIEWFORMAT
$Comment
Launch URLv
SaveOptions
[WebMaster]
1S2S3R12S
SaveOptions
[WebMaster]
SaveOptions
SaveOptions
Enter a URL to Launch:
httpF
mailtoF
gopherF
fingerF
You must enter the protocol for the url string.
0S0E
URLYou must enter the protocol for the URl (eg. http://www.lotus.com)
0S0E
Click here to launch:
Enter a descriptive comment (the title is the default):
Comments
If you see this form, you are using a version of the Notes Client that does not support auto-launching of URL links in Notes forms. See your Notes administrator to either upgrade your software to version 4.1 or later, or to revert this Notes application to an earlier version.
Why do I have to do this?
Select a category for the document:
Content
Art and Culture |0Business and Finance |1Computers and Internet |2Education |3Entertainment |4Government |5Publications |6Recreation and Sports |7Reference |8Shopping |9
SaveOptions
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$TITLE
$FormUsers
$AUTOLAUNCH
$INFO
$$ScriptName
$$FormAction1
$$FormAction6
$BODY
Categori_zeK
_Edit Document
Send Docu_ment
_Forward
_Move to Folder...
_Remove from Folder...
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
<<b.0
$TITLE
$Index
$Formula
$FormulaClass
$VIEWFORMAT
$Comment
$ACTIONS
'++LotusScript Development Environment:2:5:(Options):0:74
Option Public
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub UpdateAddressBook
Declare Sub Initialize
Declare Sub ChangeStatusCodes
Declare Sub ChangeURLField
Declare Sub ReformatHeader
Declare Sub RenameHTMLSourceField
Declare Sub RenameCDTextField
Declare Sub RenamePrivatePage
'++LotusScript Development Environment:2:5:(Declarations):0:10
Dim Session As notessession
Dim WebDB As Notesdatabase
Dim CurrentWebPage As Notesdocument
Dim WebColl As notesdocumentcollection
'++LotusScript Development Environment:2:2:UpdateAddressBook:1:8
Sub UpdateAddressBook
Dim ServerView As notesview
Dim ServerDocument As NotesDocument
Dim WebAdminView As Notesview
Dim AdminDoc As notesdocument
Dim InterNotesServer As String
Set WebAdminView = WebDB.GetView("($Admin)")
If ( Session.IsOnServer ) Then
InterNotesServer = Session.Username
Else
InterNotesServer = WebDB.Server
End If
Set WebAdminDoc = WebAdminView.GetDocumentByKey(InterNotesServer, False)
If Not(WebAdminDoc Is Nothing) Then
Dim PublicAddressBook As New Notesdatabase(InterNotesServer, "names.nsf")
Set ServerView = PublicAddressBook.GetView("($Servers)")
Set Serverdocument = ServerView.Getdocumentbykey(InterNotesServer, False)
If Not (Serverdocument Is Nothing) Then
If Serverdocument.WebDbName(0) = "" Then Serverdocument.WebDbName(0) = "web.nsf"