Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hit count on a domino web page

Posted on 1999-01-03
3
Medium Priority
?
286 Views
Last Modified: 2013-12-18
i have launched a web page on domino server of my organization, now i want to know that how many people have hit that page. How can can i get the hit count and show it on my web page. I am using release 4.6.2
0
Comment
Question by:amit_dutta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
dmpdmpdmp earned 300 total points
ID: 1117859
It's quite easy - all you need to do is to create a LotusScript Agent which runs on the Domino Server. This Agent is then triggered with the OnWebOpen form event. All you need then is a field on your form to store the hit count.

The Agent is as follows:

Sub Initialize
     Dim Session As New NotesSession
     Dim ProfileDoc As NotesDocument
     Dim doc As NotesDocument
     Dim num As Double
     Dim NumStr As String
     
     Set db = Session.CurrentDatabase
     
     'The following line gets a handle to the current document
     Set doc = Session.DocumentContext
     
     'The following line creates a Profile document called 'Domino' the first time
     'it is executed and from then on modifies the existing 'Domino' document
     Set ProfileDoc = db.GetProfileDocument("Domino")
     
     NumStr = ProfileDoc.num(0)
     If NumStr = "" Then
          num = 1
     Else
          num = Cdbl(NumStr) + 1
     End If
     
     ProfileDoc.num = Cstr(num)
     Call profiledoc.save(False,False)
     
     doc.Number = num
     
End Sub


Once you have created the agent (on the Server) you then need to create a field on your Web page - call the field "Number", set it's type to "Numeric" and "Computed". Type "Number" in the Formula box (to tell the field to display it's own value).

To trigger the Agent you need to set the WebQueryOpen Event of your form to run the Agent with:

@Command([ToolsRunMacro];"CounterAgent")


That should be it! Good luck.
0
 
LVL 4

Expert Comment

by:stamp
ID: 1117860
Without agents it looks like this:

FIELD CountDate := CountDate;
FIELD Counter := Counter;
count := @GetProfileField("WebCounter";"Counter";"Anonymous");
date := @Now;
@If(count='';@Do(@SetField("count";1);@SetProfileField("WebCounter";"CountDate";date;"Anonymous"));@SetField("count";count+1));
@SetProfileField("WebCounter";"Counter";count;"Anonymous");
@SetField("Counter";count);
@SetField("CountDate";@GetProfileField("WebCounter";"CountDate";"Anonymous"))

Put above code into "Value" event of a field named "CountDate" of type "Time: Sow Date".
Have another filed named "Counter" of type "Number".

This code in a value event do the same as the agent from dmpdmpdmp above. It's up to you what you like to use.

0
 

Expert Comment

by:ccgarciam
ID: 8035920
Here is a modification to the same agent that do almost the same, the difference is that in this case the hit counter is independent for each document a user access from the website (using the same form)


Sub Initialize
     Dim Session As New NotesSession
     Dim doc As NotesDocument
     Dim counter As Double
     Dim countStr As String
     
     Set db = Session.CurrentDatabase
     Set doc = Session.DocumentContext
     
     countStr = doc.FCounter(0)
   
     If countStr = "" Then
          counter = 1
     Else
          counter = Cdbl(countStr) + 1
     End If
     
     doc.FCounter = counter
     Call doc.save(False,False)
End Sub

Put this code on an agent, which should be on the WebQueryOpen of your form.
FCounter should be on your form and its type is Number and Computed

Good Luck!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question