|
Introduction NeoScript provides a small collection of functions that implement Named Counters which may be used to track visit activity on a per page or a per page-set or even a per site basis. This document contains descriptions of the current state of the Named Counter feature and functions, as well as indications of our current thinking and suggested improvements, etc.
The rest of this document consists of the following sections: Please consider this an RFC of sorts and don't hesitate to send your thoughts and suggestions for improvement. Please send comments to Horace at hav@neosoft.com. Overview Named Counters is a way to break the cohesion between a page's name and the counter used to track the page's activity. A single Named Counter can be used to track the visits to one page or a collection of pages. Also, a user could actually place several Named Counters on one page: one for the individual page - another used to track a subset of pages - and yet another used to track his/her entire site. To support the use and storage of Named Counters, a special NeoScript database file called an NCRegistry has been described. Once created, a user's NCRegistry will hold and control all of the user's Named Counters. Users may create their NCRegistry using one of the new NeoScript functions (make_nc_registry). The NCRegistry database must be created (once) before a user can create/register any Named Counters. All NCRegistry databases are named "NCRegistry" and will be located, owned and controlled by the system in a protected directory structure. When creating his/her NCRegistry, the user has the option to specify the maximum number of Named Counters that can be held by the NCRegistry (range 20 ... 200). All Named Counters must be registered before they can be used. Registering a Named Counter creates the appropriate NCRegistry records. Calls with unregistered counter names are simply ignored. The new NeoScript proc (register_nc) may be used to register a new Named Counter. Once a Named Counter has been registerd, it may be used to track visits by simply including a simple server-side include command in any .html (or .htm) page. There are NeoScript procs to allow calls which increment a counter (incr_nc) or to query a counter's current value (get_nc, get_init_nc, get_real_nc, get_avg_nc). When incrementing a counter, the caller has the option to disable return of the new value.
In addition to counting total visit activity, Named Counters provide several ways to query counts. Activity may be broken down by time period and/or by browser type. Named Counters allow you to ask for the activity since the counter was registered or for a particular day. Named counters also allow you to ask for activity broken down for any of five Browser Classes:
Changes Since Last Update This section is simply a summary of the changes since first presentation. Trivial (verbiage, etc.) changes will not be listed.
Database Files
The PROCs The NeoScript functions which implement NCRegistry creation and, Named Counter registration, incrementation and query comprises 7 simple NeoScript procs:
make_nc_registry This proc is used to create a Named Counter Registry. Each UID may have one such NCRegistry file accessible from NeoScript. Each NCRegistry can hold a minimum of 20 Named Counters. The owner will specify the maximum number of Named Counters allowed as an argument to this proc. No more than 200 Named Counters per NCRegistry will be allowed. Each NCRegistry has one registry record which maintains a list of the Named Counters in the registry. Record fields are ncmax, nccount, date (quoted), comments (quoted) - also one field for each registered Named Counter (field name as the counter's name and field value is the date on which the counter was registered). This proc must be called BEFORE any register_nc calls will be honored. You can view the source of an example html page used to create a NCRegistry file.
Calling Sequence:
Operational Notes:
register_nc This proc is used to allow users to register Named Counters in the NCRegistry. A counter must be registered (once) before it can be used. You can view the source of an example html page used to register several new Named Counters. A Named Counter exists within the NCRegistry as a collection of keyed records. There are three record types for each Named Counter in an NCRegistry:
The remaining procs may be used to increment and/or retrieve named counter values. These are the procs that will be used in most user pages.
incr_nc increments the Named Counter for the current day (appropriate browser) and the counter's lifetime total (overall and for the appropriate browser). If this is the first visit of the day, then a new database record is created. Returns, by default the total lifetime visits (all browsers all days) since the counter was registered. The caller may request the daily total instead. The caller may also request only a specific browser's count be returned.
Calling Sequence:
get_nc This proc is used to retrieve the current visit counts for the counter. By default, it returns the lifetime visit count (total of all days all browsers).
Calling Sequence:
Operational Notes
get_init_nc This proc is used to retrieve the count values assigned to the Named Counter. By default, it returns the total initial count (total of all browsers).
Calling Sequence:
Operational Notes
get_real_nc This proc is used to retrieve the actual number of visits (not including initial counts assigned). By default, it returns the total initial count (total of all browsers).
Calling Sequence:
Operational Notes
get_avg_nc This proc is used to retrieve the Average Counts per Day of the Named Counter. By default, it returns the total avg count (all browsers).
Calling Sequence:
Operational Notes
Possible Improvements This is simply a quick list of currently suggested or planned improvements.
|
|
|
|
Copyright © -1995-2012 by hav.Software. All Rights Reserved.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. There may be other trademarks or tradenames listed in this document to refer to the entities claiming the marks and names or products. hav.Software disclaims any proprietary interest in any trademark, tradename or products other than its own. Modified - 08/07/99 - 25181003 - 5622032 |