NetVIOS

Application Programmer Interface

 

The NetVIOS dll contains the following classes:

Checkaccess Class
Dbaseworks Class
Feature Class
Filefunctions Class
Formitems Class
Headerworks Class
Roleworks Class
Siteworks Class
Templateworks Class
Userroleworks Class
Userselfworks Class
Usertypeworks Class
Userworks Class
Webtopworks Class
Wosfile Class
Wosheader Class
Wosheadercell Class
Woshelp Class
Buttonworks Class

 

 

CHECKACCESS CLASS

iaccess = CheckRoleAccess (pageID, UserID)

Description

This function checks the amount of right a user has to a page or resource using the page ID.

Input

pageID is the page ID no. This ID is unique and is derived from the Page table.

userID is the current user’s ID.

Output

iaccess = 0 the user does not have any right to the resource

iaccess = 7 the user has the right to access the resource

iaccess = 8 the user has the right to modify or edit the resource

iaccess = 10 the user has the right to administer the resource (includes grant others access)

 

 

iaccess = CheckPAccess (pageID, UserID)

Description

This function checks whether a user has to access a page or resource using the page ID.

Input

pageID is the page ID no. This ID is unique and is derived from the Page table.

userID is the current user’s ID.

Output

iaccess = 0 the user does not have any right to the resource

iaccess = 7 the user has the right to access the resource

Error Output

iaccess = 2 a page ID was not supplied

iaccess = 5 a user ID was not supplied (or user has not logged in)

iaccess = 1 the page or resource was not found in the Page table

iaccess = 20 the OS license has expired

 

 

 

iaccess = CheckPAccessbypath (pagepath, UserID)

Description

This function checks whether a user has to access a page or resource using the full resource path.

Input

pagepath is the full page path.

Output

iaccess = 0 the user does not have any right to the resource

iaccess = 7 the user has the right to access the resource

Error Output

iaccess = 2 a page path was not supplied

iaccess = 5 a user ID was not supplied (or user has not logged in)

iaccess = 1 the page or resource was not found in the Page table

iaccess = 20 the OS license has expired

 

 

PageSecure (page)

Description

This routine maintains a page’s security. The routine calls CheckPAccessbypath and redirects control as required (e.g. if CheckPAccessbyPath is 5, control is transferred to the loginrt.asp page).

Input

page is the full page path.

Action

Directs control depending on whether the current user has the right to access the page or not.

 

 

 

SecurePage ()

Description

This routine maintains a page’s security. The routine calls CheckPAccessbypath and redirects control as required (e.g. if CheckPAccessbyPath is 5, control is transferred to the loginrt.asp page).

Input

No input. This subroutine automatically extracts the file name from which it is called. Insert a call to this subroutine at the start of any page that needs to be secured by NetVIOS. The only restriction on this call is that the file has to be part of NetVIOS’ file system

Action

Directs control depending on whether the current user has the right to access the page or not.

DBASEWORKS CLASS

CreateInDbase (conn As Object, sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numfields As Variant, ByRef ierror As Variant)

Description

This routine inserts the records contained in the arguments into the database.

Input

conn – an open ADODBC connection.

sfieldname – array representing the field name of the field in the database table

sfieldtype – array representing the type of data expected in the field

sfieldvalue – array representing the default value assumed if the request object corresponding to the fieldname is empty (may be null)

sguitype – array representing the GUI type that encases the input

sfieldtable – array representing the table name

sessionvar – array representing the string name for a session variable in which the value will be stored

numfields – the number of records to process

ierror – an error number that is returned in case there is an error.

Action

The subroutine sorts through sfieldtable variable and creates a record for the fields belonging to each separate table found in sfieldtable.

Example

Passing the following array into CreateInDbase

sfieldname = {FirstName, LastName, Email, Title, Description}

sfieldtable = {Users, Users, Users, Events, Events}

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

will cause in the following records to be created:

Table: Users

 

FirstName

LastName

Email

Value in:

Request("FirstName")

Request("LastName")

Request("Email")

Table: Events

 

Title

Description

Value in:

Request("Title")

Request("Description")

CreateInUserDbase (conn As Object, sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numfields As Variant, iuserid As Variant, ByRef ierror As Variant)

Description

Similar to CreateInDbase above except that it works on User tables only and always inserts a field – UserID.

Input

iuserid – User ID of the user (usually stored in the variable Session("UserIDWOS"))

The other input variables are similar to those in CreateInDbase.

Action

Similar to CreateInDbase except that a field UserID is always inserted into every table’s field in addition to the fields included in the array arguments.

Example

Passing the following array into CreateInUserDbase

sfieldname = {FirstName, LastName, Email, FirstName, Title}

sfieldtable = {Users, Users, Users, Profile, Profile }

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

will cause in the following records to be created:

Table: Users

 

UserID

FirstName

LastName

Email

Value in:

iuserid

Request("FirstName")

Request("LastName")

Request("Email")

Table: Profile

 

UserID

FirstName

Title

Value in:

iuserid

Request("FirstName")

Request("Title")

 

 

 

 

UpdateCreateInDbase (sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numufields As Variant, iuserid As Variant, scriteria As Variant, ByRef ierror As Variant)

Description

This routine attempts to edit an entry in the user table corresponding to the filter in the argument – scriteria. If an entry for the user represented by userid does not exist int he table, the subroutine acts the same way as CreateInUserDbase.

Input

iuserid – User ID of the user (usually stored in the variable Session("UserIDWOS"))

scritera – a filter to apply to the edit process

The other input variables are similar to those in CreateInUserDbase.

Action

Edits or creates a record in a user table. Using this routine there can be only one record per user in a user table.

Example

Passing the following array into UpdateCreateInDbase

sfieldname = {FirstName, LastName, Email, FirstName, Title}

sfieldtable = {Users, Users, Users, Profile, Profile }

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

scriteria = "where UserID = iuserid"

will cause in the following records to be edited or created if it does not exist:

Table: Users

 

UserID

FirstName

LastName

Email

Value in:

iuserid

Request("FirstName")

Request("LastName")

Request("Email")

Table: Profile

 

UserID

FirstName

Title

Value in:

iuserid

Request("FirstName")

Request("Title")

 

 

UpdateCreateDbaseRec (sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numufields As Variant, iuserid As Variant, scriteria As Variant, ByRef ierror As Variant)

Description

This routine attempts to edit an entry in the user table corresponding to the filter in the argument – scriteria. If the entry does not exist in the table, the subroutine acts the same way as CreateInUserDbase.

Input

iuserid – User ID of the user (usually stored in the variable Session("UserIDWOS"))

scritera – a filter to apply to the edit process

The other input variables are similar to those in CreateInUserDbase.

Action

Edits or creates a record in a user table. Using this routine there can be more than one record per user in a table (depending on the value of scriteria).

Example

Passing the following array into UpdateCreateDbaseRec

sfieldname = {FirstName, LastName, Email, FirstName, Title}

sfieldtable = {Users, Users, Users, Profile, Profile }

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

scriteria = "where UserID = iuserid"

will cause in the following records to be edited or created if it does not exist:

Table: Users

 

UserID

FirstName

LastName

Email

Value in:

iuserid

Request("FirstName")

Request("LastName")

Request("Email")

Table: Profile

 

UserID

FirstName

Title

Value in:

iuserid

Request("FirstName")

Request("Title")

 

 

 

 

 

 

UpdateInDbase (conn As Object, sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numufields As Variant, scriteria As Variant, ByRef ierror As Variant)

Description

This routine edits the records contained in several database tables filtered by the scriteria argument.

Input

conn – an open ADODBC connection.

sfieldname – array representing the field name of the field in the database table

sfieldtype – array representing the type of data expected in the field

sfieldvalue – array representing the default value assumed if the request object corresponding to the fieldname is empty (may be null)

sguitype – array representing the GUI type that encases the input

sfieldtable – array representing the table name

sessionvar – array representing the string name for a session variable in which the value will be stored

numfields – the number of records to process

scriteria – filter or edit criteria

ierror – an error number that is returned in case there is an error.

Action

The subroutine sorts through sfieldtable variable and edits the record for the fields belonging to each separate table found in sfieldtable filtered by the argument - scriteria.

Example

Passing the following array into UpdateInDbase

sfieldname = {FirstName, LastName, Email, FirstName, Title}

sfieldtable = {Users, Users, Users, Profile, Profile}

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

scriteria = "where FirstName = ‘SiteOwner’"

will cause in the following records to be edited:

Table: Users

 

FirstName

LastName

Email

Value in:

SiteOwner = Request("FirstName")

Request("LastName")

Request("Email")

Table: Profile

 

FirstName

Title

Value in:

SiteOwner = Request("FirstName")

Request("Title")

 

UpdateDbaseRec (sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numufields As Variant, scriteria As Variant, ByRef ierror As Variant)

Description

This routine edits the records contained in the arguments into the database filtered by the scriteria argument.

Input

sfieldname – array representing the field name of the field in the database table

sfieldtype – array representing the type of data expected in the field

sfieldvalue – array representing the default value assumed if the request object corresponding to the fieldname is empty (may be null)

sguitype – array representing the GUI type that encases the input

sfieldtable – array representing the table name

sessionvar – array representing the string name for a session variable in which the value will be stored

numfields – the number of records to process

scriteria – filter or edit criteria

ierror – an error number that is returned in case there is an error.

Action

The subroutine sorts through sfieldtable variable and edits the record for the fields belonging to each separate table found in sfieldtable filtered by the argument - scriteria.

Example

Passing the following array into UpdateDbaseRec

sfieldname = {FirstName, LastName, Email, FirstName, Title}

sfieldtable = {Users, Users, Users, Profile, Profile}

sguitype = {Input, Input, Input, Input, Input}

sfieldtype = {String, String, String, String, String }

numufields = 5

scriteria = "where FirstName = ‘SiteOwner’"

will cause in the following records to be edited:

Table: Users

 

FirstName

LastName

Email

Value in:

SiteOwner = Request("FirstName")

Request("LastName")

Request("Email")

Table: Profile

 

FirstName

Title

Value in:

SiteOwner = Request("FirstName")

Request("Title")

UpdateWOSRec (sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, stable As Variant, sessionvar As Variant, numufields As Variant, scriteria As Variant, ByRef ierror As Variant)

Description

This routine edits the record in a database table filtered by the scriteria argument.

Input

sfieldname – array representing the field name of the field in the database table

sfieldtype – array representing the type of data expected in the field

sfieldvalue – array representing the default value assumed if the request object corresponding to the fieldname is empty (may be null)

sguitype – array representing the GUI type that encases the input

stable – table in which record to edit resides

sessionvar – array representing the string name for a session variable in which the value will be stored

numfields – the number of records to process

scriteria – filter or edit criteria

ierror – an error number that is returned in case there is an error.

Action

The subroutine edits the record in the table modifying the values of the table’s fields corresponding to every field found in the fieldname array. The edit process is filtered by the argument - scriteria.

Example

Passing the following array into UpdateWOSRec

sfieldname = {FirstName, LastName, Email}

stable = Users

sguitype = {Input, Input, Input}

sfieldtype = {String, String, String}

numufields = 5

scriteria = "where FirstName = ‘SiteOwner’"

will cause in the following records to be edited:

Table: Users

 

FirstName

LastName

Email

Value in:

SiteOwner = Request("FirstName")

Request("LastName")

Request("Email")

 

 

CreateWOSRec (sfieldname As Variant, sfieldtype As Variant, sfieldvalue As Variant, sguitype As Variant, sfieldtable As Variant, sessionvar As Variant, numufields As Variant, ByRef ierror As Variant)

Description

This routine creates record in a database table.

Input

sfieldname – array representing the field name of the field in the database table

sfieldtype – array representing the type of data expected in the field

sfieldvalue – array representing the default value assumed if the request object corresponding to the fieldname is empty (may be null)

sguitype – array representing the GUI type that encases the input

stable – table in which to create the record

sessionvar – array representing the string name for a session variable in which the value will be stored

numfields – the number of records to process

scriteria – filter or edit criteria

ierror – an error number that is returned in case there is an error.

Action

The subroutine inserts a record in a table corresponding to all the fields found in the sfieldname array.

Example

Passing the following array into CreateWOSRec

sfieldname = {FirstName, LastName, Email}

stable = Users

sguitype = {Input, Input, Input}

sfieldtype = {String, String, String}

numufields = 5

scriteria = "where FirstName = ‘SiteOwner’"

will cause in the following records to be created:

Table: Users

 

FirstName

LastName

Email

Value in:

Request("FirstName")

Request("LastName")

Request("Email")

 

 

UpdateWOSFeat (sfieldname, sfieldtype, sfieldvalue, sguitype, stable, sessionvar,

ifields, scriteria, ByRef ierror)

Description

This routine updates the value of a feature in a feature table.

Input

sfieldname – name of the GUI control containing the input

sfieldtype – field type

sfieldvalue – default value to assign if control contains no input (may be Null)

sguitype – GUI type

stable – name of the feature table

sessionvar – name of a session variable in which to store the value

ifields – compatibility argument (not used)

scriteria – filter or edit criteria

ierror – an error number that is returned in case there is an error.

 

 

UpdateWOSCookie (sfieldname, sfieldtype, sfieldvalue, sguitype, scopename, sessionvar, ifields, scookietype, ByRef ierror)

Description

This routine sets the value of a cookie.

Input

sfieldname – name of the GUI control containing the input

sfieldtype – field type

sfieldvalue – default value to assign if control contains no input (may be Null)

sguitype – GUI type

stable – name of the feature table

sessionvar – name of a session variable in which to store the value

ifields – compatibility argument (not used)

scookietype – may be a site-wide, application-wide, or page-level cookie

scopename – used to form the name of the cookie.

If site-level cookie, the cookie name will b prefixed with "WOSSiteFeature"

If application-level, the cookie name will b prefixed with "WOSAppFeature_"

If page-level cookie, the cookie name will b prefixed with "WOSPageFeature_"

The cookie subname will be sfieldname.

ierror – an error number that is returned in case there is an error.

 

FEATURE CLASS

Methods

Sub ProcessFeature()

 

Description

This subroutine processes a NetVIOS GUI feature. This subroutine performs three functions:

  1. Returns the most current value of a feature (in memory or cache) if the feature has been previously accessed or retrieves the value from the feature database if the feature is being accessed the first time in the current user’s session.
  2. Archives the feature into the database if the feature is not in the database (the feature has never been accessed by any user).
  3. Maintains the feature cache so that most frequently and most recently requested feature are quickly served.

The following properties of the feature class would have been set before calling this class subroutine.

Properties

Name A name for the feature. Needs to be unique by Scope

Value This subroutine provides this value

Default Default value for feature if there is no stored/memory value for it

FeatureType GUI type (see list of supported NetVIOS GUI elements)

OrderNumber Used if you wish to sort the features at feature input/modification

Scope May be Site, Application or Page

ScopeID An ID you wish to assign the feature

ScopeName This will be the application code for application features or is ignored for the other scopes

IsCookie True/False (True for Cookie)

Caption Label at feature input/modification

SiteID Space holder for compatibility with IOS-1

FeatureList A comma separated field for FeatureType = DropDown, Button

Category Optional Field for grouping features at feature input/modification

Examples

Check the file _sitepreferences.asp for examples of how to use the feature attributes of NetVIOS.

FILEFUNCTIONS CLASS

 

Function iGetParent (ipageID)

Description

Returns the parent folder ID of a file

Input

ipageID File ID

 

Function GenerateTotalTree (spath, ByVal ilevel, ByVal iparent)

Description

Generates NetVIOS file table for folder specified by spath

Input

spath Full path of folder

ilevel Level of folder

iparent Parent of folder

 

Function CleanupFileTable ()

Description

Cleans up the file table and removes non-existent files or folders (that may have been the result of external delete operations such as through the higher OS or ftp).

 

Function DeleteFile (sfile)

Description

Deletes a file. Checks that the invoking user has the right to delete the file (The appropriate access right is of administrative right over the file or ownership).

Input

sfile File to delete

Return Values

  1. No file input supplied
  1. File not in allocation table
  2. No right to delete the file
  3. Specified input is a folder
  4. File was successfully deleted

 

Function DeleteFolder (foldername)

Description

Deletes a folder (if the folder is empty). Checks that the invoking user has the right to delete the folder (The appropriate access right is of ownership of the folder).

Input

foldername Folder to delete

Return Values

  1. Foldername not supplied
  1. Folder not in allocation table
  2. Folder does not exist
  1. Invoking user does not have the right to delete the folder
  1. Folder not empty

337 Folder successfully deleted

Function CreateFolder (foldername, folderparent, ierror)

Description

Creates a folder. Checks that the invoking user has the right create a subfolder in the specified folder (The appropriate access right is of administrative right over the parent folder or ownership).

Input

foldername Folder to create

folderparent Parent folder

 

Function CopyFile (source, destination, ByRef ierror)

Description

Copies a file. Checks that the invoking user has the right create a copy the file.(The appropriate access right is of administrative right over the parent folder or ownership). Also checks that the user has the right to copy to the folder implicitly contained in the filetocopyto input.

The function recognizes special NetVIOS files such as composite pages and webtops and generates a complete copy of the pages and its components.

Input

source File to copy

destination File to copy to

ierror Returned error (1 no foldername supplied, 2 no folderparent supplied)

Return Values

318 – No source file provided

321 – No destination file provided

331 – No right to copy file

327 – File not in allocation table or file does not exist

330 – File already exists and is not of the same type as source

314 – No right to create file (destination folder)

1000 – File already exists and no overwrite confirm

324 – File already exists but not in NetVIOS file table

328 – Destination folder not in allocation or folder does not exist

325 – Specified destination folder is not a folder (conflict in folder name)

329 – No right to create file in the destination folder

322 – Unknown errors during copy

323 – No error

 

 

Function ChangeOwner (PageID, UserID)

Description

Changes the owner of a file. The user who invokes this command must have the right privilege to assign a new owner to the file. Ownership of a file or rights to administer a file is the required privilege to change a file’s owner.

Input

PageID Page ID

UserID New owner of file

Error Codes

  1. Successful execution
  2. No PageID was supplied
  3. No UserID was supplied

 

Sub EmptyTrash ()

Description

Completely clears deleted files from the NetVIOS table and removes them from the Trash (_DeletedFiles) folder.

FORMITEMS CLASS

Sub Form_HiddenField (Name, Value)

Description

Draws a hidden field in html. It is the responsibility of the developer to already have a form enclosing the hidden field.

Input

Name Name of the hidden field

Value The hidden field’s value. May be Null

 

 

Sub Form_Label (Label, Control)

Description

Draws a label field in html.

Input

Label Text value of the label

Control Name of the control that the label qualifies. May be Null.

 

 

Sub Form_Labelb (Label, Control)

Description

Draws a bolded label field in html.

Input

Label Text value of the label

Control Name of the control that the label qualifies. May be Null.

 

 

 

 

 

Sub Form_LabelFlag (Label, Control)

Description

Draws a label field in html with a flag preceding the label.

Input

Label Text value of the label

Control Name of the control that the label qualifies. May be Null.

 

 

Sub Form_LabelFlagb (Label, Control)

Description

Draws a bolded label field in html with a flag preceding the label.

Input

Label Text value of the label

Control Name of the control that the label qualifies. May be Null.

 

 

Sub Form_TextBox (Label, Name, MaxLength, Size, Value)

Description

Draws a bolded label field in html with a flag preceding the label.

Input

Label Text value of the label

Name Name of the textbox

Maxlength Maximum length of the text box

Size Character length of the textbox

Value Initial value in the textbox

 

 

 

Sub Form_Password (Label, Name, MaxLength, Size, Value)

Description

Draws a password field in html.

Input

Label Text value of the label

Name Name of the textbox

Maxlength Maximum length of the text box

Size Character length of the textbox

Value Initial value in the textbox

 

 

Sub Form_TextArea (Label, Name, Rows, Cols, Value, MaxValue)

Description

Draws multi-line text box in html.

Input

Label Text value of the label

Name Name of the textbox

Row Number of text rows

Cols Number of text columns

Value Initial value in the text area

MaxValue Not used

 

 

Sub Form_ResetButton (Name, Value)

Description

Draws reset button in html.

Input

Name Name of the button

Value Text to place on the reset button

 

 

 

Sub Form_CommandButton (Name, Value, OnClickText)

Description

Draws reset button in html.

Input

Name Name of the button

Value Text to place on the reset button

OnClickText An action text to add if the button is clicked

 

 

Sub Form_SubmitButton (Name, Value)

Description

Draws reset button in html.

Input

Name Name of the button

Value Text to place on the reset button

 

 

Sub Form_RadioButton (Label, Name, Value, Checked)

Description

Draws a radio button in html.

Input

Label Text value of the label

Name Name of the button

Value Text to place on the reset button

Checked If true, the radio box is checked

 

 

 

Sub Form_Checkbox (Label, Name, Value, Checked)

Description

Draws a check button in html.

Input

Label Text value of the label

Name Name of the button

Value Text to place on the reset button

Checked If true, the radio box is checked

 

 

Sub Form_Begin (Action, OnSubmitText)

Description

Inserts the html text that opens a post form.

Input

Action Action text

OnSubmitText An action text to add if the form is submitted

 

 

Sub Form_End ()

Description

Inserts the html text that closes a form.

 

 

Sub Form_ComboBox_Begin (Label, Name, Size, Multiple, OnChangeText)

Description

Draws the start of a combo box in html.

Input

Label Text value of a label for the combo box

Name Name of the combo box

Size Number of visible rows of combo box

Multiple Allow selection of more than one rows

OnChangeText Action text on selection of a combo box item

 

Sub Form_ComboBox_Item (Value, Text, Selected)

Description

Draws a combo box item in html.

Input

Value Value of the combo box item on selection

Text Text of the combo box item

Selected True/False indicating if the item should be flagged as selected

 

Sub Form_ComboBox_End ()

Description

Draws a combo box end.

 

Sub Form_ComboBox (Label, Name, DefaultVal, Values, Texts, numitems, Size, Multiple, OnChangeText)

Description

Draws a complete combo box in html.

Input

Label Text value of a label for the combo box

Name Name of the combo box

DefaultVal Current selected value of the combo box

Values Array of values of the combo box items

Texts Array of texts for the combo box items

Numitems Number of combo box items

Size Number of visible rows of combo box

Multiple Allow selection of more than one rows

OnChangeText Action text on selection of a combo box item

Sub Page_Title (Title)

Description

Draws an html page title.

Input

Title Text value of the page title

 

Sub Paragraph_Center (Text)

Description

Draws a centered html paragraph.

Input

Title Text of the paragraph

 

Sub Paragraph_Left (Text)

Description

Draws a left justified html paragraph.

Input

Title Text of the paragraph

 

 

Sub Paragraph_Right (Text)

Description

Draws a right justified html paragraph.

Input

Title Text of the paragraph

 

 

 

Sub Form_Var_Align (Align)

Sub Form_Var_Valign (VAlign)

Sub Form_Var_Name (Name)

Sub Form_Var_Value (Value)

Sub Form_Var_Type (TypeVal)

Sub Form_Var_Size (Size)

Sub Form_Var_ID (ID)

Sub Form_Var_MaxLength (MaxLength)

Sub Form_Var_Length (Length)

Sub Form_Var_Width (Width)

Function FormatMoney (Value)

Sub Link_Show (LinkText, HRef)

Description

Draws an html link.

Input

LinkText Text of the link

Href URL of the link

 

Sub showmonth (Name, idefault)

Description

Draws an html combo box of the months of the year. Month text is abbreviated eg. "Jan, Feb". Month value is from 1 – 12 while 0 is for no selection.

Input

Name Name of the combo box

idefault selected month index

 

 

Sub showday (Name, idefault)

Description

Draws an html combo box of the days of the month. Day values and text is from 0 – 31 where 0 is for no selection.

Input

Name Name of the combo box

idefault selected day index

 

Sub showyear (Name, iyearst, iyearend)

Description

Draws an html combo box of years. Technically, it can be used for any integer range. The developer may create a call that spreads the start and end year within a range of the current year to maintain permanent validity of the html scripts with time.

Input

Name Name of the combo box

iyearst starting year

iyearend end year

 

Sub showhour (Name, idefault)

Description

Draws an html combo box of the hours of the day. Ranges from 0 – 23.

Input

Name Name of the combo box

idefault selected hour index

 

Sub showminute (Name, idefault)

Description

Draws an html combo box of the minutes of the hour. Ranges from 0 – 59.

Input

Name Name of the combo box

idefault selected hour index

 

 

Sub drawFormitem (guitype, fieldname, ifieldsize, isize, _fieldvalue, fieldlist, fieldlabel, Sessionvar, fielddefault, eventtext, Optional fieldreq)

Description

This subroutine displays a GUI html form controls in a two-column table. The developer is responsible for the html text that would begin the table. The label of the control is placed right justified in the left hand column while the control itself is placed left justified in the right column.

Input

guitype The control type. Check the NetVIOS list of GUI controls.

fieldname Name of control

ifieldsize Size limit of control. For text boxes and passwords this is the maximum number of characters accepted by the control. For a Memo (textarea) control field, this is the number of rows.

isize Size of the control. For text boxes, this is the visible number of characters accepted by the control. For cmbo boxes, this is the number of visible rows of the box. For a Memo (textarea) control field, this is the number of columns.

fieldvalue Initial value of the control. For combo boxes or radio and check boxes, this is an comma-delimited string of values

fieldlist This input is used only by combo boxes and radio button or check box arrays This is the listed value of the combo box or radio buttons in a comma-delimited string

fieldlabel Label of the control (placed right justified to the left of the control

Sessionvar string representing a session variable in which the control value should be stored. If the developer is not interested in storing the value of the control in a session variable, a single mop session variable is used that has been created with the purpose of mopping up unneeded session variable declarations

fielddefault Default value to be placed in the control

eventtext If the control responds to a javascript action, an action string is placed in the eventtext input. The following controls respond to an event

fieldreq A Boolean variable that indicates that the form should be displayed flagged as required

 

 

 

 

 

Sub viewFormitem (guitype, fieldname, ifieldsize, isize, fieldvalue, fieldlist, fieldlabel, Sessionvar, fielddefault, eventtext, Optional fieldreq)

Description

This subroutine displays the value a label and its value in a two-column table. This is ued to view the results of a form using exactly the same input (drawFormitem). The developer is responsible for the html text that would begin the table. The label of the control is placed right justified in the left hand column while the control’s value itself is placed left justified in the right column.

Input

Guitype The control type. Check the NetVIOS list of GUI controls.

fieldname Name of control

ifieldsize This input is not used.

isize This input is not used

sfieldvalue This input is not used.

fieldlist This input is not used

fieldlabel Label of the control (placed right justified to the left of the control

Sessionvar string representing a session variable in which the control value is stored.

fielddefault This input is not used

eventtext This input is not used

fieldreq A Boolean variable that indicates that the form should be displayed flagged as required

 

 

 

Sub DrawGUIForm (guitype, fieldname, ifieldsize, _

fieldvalue, fieldlist, fieldlabel, sessionvar, fielddefault, eventtext, _

fielddisplay, isizemax, numfields)

Description

This subroutine displays a set of GUI html form controls in a two-column table. The developer is responsible for the html text that would begin the table. The label of the control is placed right justified in the left hand column while the control itself is placed left justified in the right column.

Input

All the input described below are arrays of the number of controls in the set.

guitype Array representing the control type. Check the NetVIOS list of GUI controls.

fieldname Array representing the name of controls

ifieldsize Array representing the size limit of control. For text boxes and passwords this is the maximum number of characters accepted by the control.

sfieldvalue Initial value of the control. For combo boxes or radio and check boxes, this value is a comma-delimited string

fieldlist This input is used only by combo boxes and radio button or check box arrays This is the listed value of the combo box or radio buttons and is a comma delimited string

fieldlabel Label of the control (placed right justified to the left of the control

Sessionvar string representing a session variable in which the control value should be stored. If the developer is not interested in storing the value of the control in a session variable, a single mop session variable is used that has been created with the purpose of mopping up unneeded session variable declarations

fielddefault Default value to be placed in the control

eventtext If the control responds to a javascript action, an action string is placed in the eventtext input. The following controls respond to an event

fielddisplay Indicates whether the control should be drawn

isizemax Maximum visible size of any control. For text boxes, this is the visible number of characters accepted by the control. For cmbo boxes, this is the number of visible rows of the box.

Numfields represents the number of control fields in the array.

See Also

drawFormitem for the singular version of DrawGUIForm.

Sub DrawCatGUIForm (guitype, fieldname, ifieldsize, _

fieldvalue, fieldlist, fieldlabel, sessionvar, fielddefault, eventtext, _

fielddisplay, sfieldcat , isizemax, numfields)

Description

This subroutine is the same as DrawGUIForm except that the controls are sorted into categories. The string representing each controls category is stored in fieldcat.

See Also

DrawGUIFrom, drawFormitem

 

 

 

Sub PutValidation (guitype, fieldreq, fieldlabel, _

fieldname, fielddatatype, formname)

Description

This subroutine inserts the process to validate a control in an open javascript form. The developer is responsible for opening the Javascript form and for supplying all supporting validation functions such as CheckDate, OnlyNumber etc.

Input

Guitype The control type. Check the NetVIOS list of GUI controls

FieldReq Boolean indicator of whether the input is mandatory

FieldLabel Label of the control field

Fieldname Name of control

FieldDataType Data type of the control. Check the current list of NetVIOS datatypes.

FormName Name of the html form enclosing the control

 

 

Sub ValidateForm (guitype, sfieldreq, sfieldlabel, _

sfieldname, sfielddatatype, sfielddisplay, _

sformname, numfields)

Desciption

Array version of PutValidation. All input variables are arrays except for numfields. Numfields represents the number of control fields in the array. The input fielddisplay determines if the control in the array requires a validation.

See Also

PutValidation

HEADERWORKS CLASS

 

Function PutMetas (HeaderID, icreate)

Description

This subroutine puts metas and other necessary javascript functions within the header tag. The subroutine is useful only for externally configured NetVIOS headers.

Input

HeaderID Header number

icreate create tag (1 for complete html page, 0 for html include)

 

 

Function GenerateHeader (HeaderID, icreate)

Description

This subroutine generates the html of a NetVIOS header.

Input

HeaderID Header number

icreate create tag (1 for complete html page, 0 for html include)

 

 

Function ChangeHeader (File, Header)

Description

This subroutine changes the header ID of a NetVIOS file. The file must have a .asp extension.

Input

File File name of the html file

HeaderID New header for the current file

 

 

Function CopyHeader (headertocopy, sheadername, ithesite, iuser, homepg)

Description

Creates a clone of a NetVIOS header

Input

headertocopy ID of header to copy

headername Name or title to give to the copy (will be the same as the source if this is not specified

SiteID Not used

Iuser User who invokes the subroutine

Homepg Variable not used

 

 

Function AddIconCount (iCellID)

Description

Increments the number of clicks of a Header cell

Input

CellID Header cell ID

 

 

Function ResetClicks (iCellID)

Description

Resets the number of clicks of a Header cell

Input

CellID Header cell ID

 

 

 

 

Function drawcell (CellID, ierror)

Description

Draws a single NetVIOS header cell in html.

Input

CellID Header cell ID

Ierror error indicator

    1. no cell ID supplied to function
    2. specified cell ID not found in database
    3. Header to which the cell belongs to does not exist or has been deleted

 

 

Function MoveCellUp (CellID, therow)

Description

Moves cell up in order among all cells in the same header.

Input

CellID Header Cell

Therow Row to which cell belongs

Return Values

  1. No cell supplied to function
  2. No row supplied
  3.  

     

    Function MoveCellDn (CellID, therow)

    Description

    Moves cell down in order among all cells in the same header.

    Input

    CellID Header Cell

    Therow Row to which cell belongs

    Return Values

  4. No cell supplied to function
  5. No row supplied

 

 

 

Function CreateHeaderXML (filename, filename1, HeaderID)

Description

Writes the specified header as XML in two XML files. Note that the files will be overwritten if they exist.

Input

Filename File name to which to write the header

Filename1 File name to which to write the header cells

HeaderID Header to write to file

 

 

Function GenerateHeaderXML (filename, filename1)

Description

Generates a NetVIOS file from two XML files – one containing the header and the other containing the header cells.

Input

Filename XML file containing the header

Filename1 XML file containing the header cells

Return Values

-4 One of the files not supplied to the function

-5 One of the files does not exist

-1 Header file does not contain header information

-2, -3 Inconsistency in the number of specified header cells and that contained in file

 

 

 

Function GenerateHeaderXMLf (iprefix, icreate)

Description

Generates a NetVIOS file from XML files – one containing the header and the other containing the header cells. This function differs from GenerateHeaderXML in that it automatically composes the source XML files using the name of the file from which the function is called.

If the reference file is "samplefilename", then the XML files containing the header information for "samplefilename" will be _hX-samplefilename and _cX-samplefilename for the header cell XML file. X is the value of ipnut variable iprefix.

Input

iprefix indicator for generating XML file sources

icreate Create flag (1 to generate as complete html page, 0 for section to be inserted in html page).

 

Function CopyHeaderXML (filename, filename1, headername, isite, iuser, homepg)

Description

Copies a header from an XML into NetVIOS database

Input

Filename XML file containing the header

Filename1 XML file containing the header cells

headername Name or title to give to the copy (will be the same as the source if this is not specified

SiteID Not used

Iuser User who invokes the subroutine

Homepg Variable not used

 

 

Function CopyHeaderXMLf (filename, iheader, sheadername, isite, iuser, homepg)

Description

Copies a header from an XML into NetVIOS database. This function differs from CopyHeaderXML in that it automatically composes the source XML files using the name of the file from which the function is called.

If the input filename is "samplefilename", then the XML files containing the header information for "samplefilename" will be _hX-samplefilename and _cX-samplefilename for the header cell XML file. X is the value of ipnut variable iprefix.

Input

Filename File name (base of both header and header cell XML files)

headername Name or title to give to the copy (will be the same as the source if this is not specified

SiteID Not used

Iuser User who invokes the subroutine

Homepg Variable not used

 

ROLEWORKS CLASS

Sub roleconfiguration ()

Description

Handles the configuration of a role (GUI and enforcement).

 

 

 

SITEWORKS CLASS

Function SysLogout()

Description

Logs out the user logged in and releases all session resources.

 

Function GetSiteData()

Description

Retrieves site variables such as home page, headers etc.

.

Function ChangeSiteData()

Description

Releases and then retrieves site variables such as home page, headers etc.

 

Function SysLogin (Optional slogname, Optional spass)

Description

Logs in a user using the user’s log in name and password. The name and password may be supplied from the command line or it may be read fro the request object (as part of the form submitted from the calling page). The request variable names are "lognamem" and "passm" respectively.

Input

slogname Login name

spass Password

 

Function LoadColors ()

Description

Reloads colors from the file _colors.txt in the same folder as the script that makes the call. The logged ion user must be the administrator or the script will redirect control to the home page.

Function LoadFonts ()

Description

Reloads fonts from the file _fonts.txt in the same folder as the script that makes the call. The logged ion user must be the administrator or the script will redirect control to the home page.

 

Sub DropEdit(iuser)

Description

Releases a page that a user is currently editing from being locked or flagged as edited. Usually called when a user logs out or is timed out.

 

 

TEMPLATEWORKS CLASS

Function CopyTemplate (sfile, sfile2, copydestination, inewsite, iheader)

Description

Installs a template file into a site. This command inserts the header indicated in the argument in the new file. The command sckips every line between the <CUSTOMFEATURE></CUSTOMFEATURE> tag.

A template web file may include images which need to also be copied when the template is installed. The files that need to be copied are inserted into a <FILESTOCOPY></FILESTOCOPY> tag. The syntax is as shown below:

<FILESTOCOPY>

filetocopy1 ,filetocopyto2

filetocopy2, filetocopyto2

</FILESTOCOPY>

Input

sfile template file (full path)

sfile2 file to install template to (full path)

copydestination path to install sfile2 to relative to the root path

inewsite not used

iheader header to install with template

 

 

Function CopyHomeTemplate (sfile, sfile2, copydestination, inewsite, iheader)

Description

Same as CopyTemplate above except that the copydestination argument is ignored.

 

USERROLEWORKS CLASS

Function roleregform (iuserid)

Description

Displays the form of a user’s data for editing. Based on the site set up of the user’s type and the rights of the accessing user.

Input

iuserid id of the user being edited.

 

 

Function roleregValidate (iuserid)

Description

This function inserts javascript validation for the same GUI controls that are described by the roleregform function.

Input

iuserid id of the user being edited.

 

 

Function roleregsave (iuserid)

Description

This function saves form results to user tables for the same GUI controls that are described by the roleregform function.

Input

iuserid id of the user being edited.

 

Function roleregformview (iuserid)

Description

Displays the form of a user’s data for viewing. Based on the site set up of the user’s type and the rights of the accessing user.

Input

iuserid id of the user being edited.

 

USERSELFWORKS CLASS

Function selfregform()

Description

Displays the form of a user’s own data for editing. Based on the site set up of the user’s type and the access rights to the user’s own data.

 

Function selfregValidate()

Description

This function inserts javascript validation for the same GUI controls that are described by the selfregform function.

 

Function selfregsave() As Variant

Description

This function saves form results to user tables for the same GUI controls that are described by the selfregform function.

 

Function selfviewform()

Description

Displays the form of a user’s own data for viewing. Based on the site set up of the user’s type and the rights of the accessing user.

 

USERTYPEWORKS CLASS

Sub userconfiguration()

Description

Handles the configuration of a user type (GUI and enforcement).

 

USERWORKS CLASS

 

Function userregform ()

Description

Displays the form for registering a new user. Based on the site set up of the user’s type that is being registered to. The user type is stored in the session variable UserTypeID prior to calling this function.

 

Function userregValidate ()

Description

This function inserts javascript validation for the same GUI controls that are described by the userregform function.

 

Function userregsave () As Variant

Description

This function saves form results to user tables for the same GUI controls that are described by the userregform function. The function also handles the post-registration behavior. For instant registration, users are allowed to login after registration. For mail validation, a unique ID is sent to the user’s email by this function. For Admin validation, an email is sent to the administrator informing of a new registration awaiting validation. In addition, the function assigns the user to a default role, if one has been indicated forhe user type.

 

 

Function ExtractUsers (usernames, iByID, iproperty, ByRef suserlist, ByRef inumreal, ByRef snotfound, ByRef spropertyempty)

Description

This function extracts the users from the string usernames of the arguments. Extraction can be done either by user ID or by login name. Properties that can be extracted include the user ID, login name, or user email.

Arguments

username Comma separated string representing a group of login names or user ID

iByID 1 if username is a group of user IDs

iproperty User property to extract, 1 for userID, 2 for login names and 3 for user’s emails

suserlist resulting extraction or comma separated list

inumreal number of users extracted

snotfound comma separated string from the input or users not found in NetVIOS

spropertyempty comma separated string of login names of users for which the property does not exist. Obviously, this applies only if iproperty is 3.

 

Function DeleteUsers (usernames, iByID)

Description

Deletes NetVIOS users contained in the string – usernames of the arguments. Users in the list may be specified by userIDs or ling names.

Arguments

username Comma separated string representing a group of login names or user ID

iByID 1 if username is a group of user IDs

 

 

 

Function SendEmail (emails, subject, message)

Description

Sends an email containing the string in message of the argument to the list of emails contained in the string emails of the argument.

Input

emails Comma separated email list

subject String representing the email subject

message String representing the email message

Return Values

Returns 0 for successful operation

Returns 1 if the message string is null.

 

 

Function GetUsers (userlisttype)

Description

Used in the user register to present a form for selecting users by role or usertype and displays the list

Input

Userlisttype ‘y’ or ‘yes’ to show both login name and screen name else only login name will be displayed.

 

 

Function UsersinRole (userlisttype)

Description

Used to present a form for selecting a user role and displays a list of users belonging to that role.

 

Function RemoveFromRole (iassign)

Description

Removes a user from a role using the role assignment ID.

 

 

Function GetUserID (UserName, UserID)

Description

Simple function to supply a single user’s ID based on the user’s login name.

Arguments

UserName Login name of user

UserID ID of the user as the result

Return Values

Returns 1 if UserName is null or an empty string

Returns 2 if the user is not found

 

 

Function GetUserName (UserID, UserName)

Description

Simple function to supply a single user’s login name based on the user’s ID.

Arguments

UserID ID of the user

UserName Login name of user as the result

Return Values

Returns 1 if UserID is null or 0

Returns 2 if the user is not found

 

 

Function SendMessageByType (ithetype, ifound)

Description

Sends emails to all users belonging to the user type – ithetype – of the arguments. The email subject and message is contained in a request object. (emailsubject and emailmessage respectively)

Argument

Ithetype User type number or the string "Every"

Ifound Resulting number of users to which the message was sent.

Return Values

Returns 0 for successful completion

Returns 1 if a type was not provided

 

 

Function SendMessageByRole (itherole, ifound)

Description

Sends emails to all users belonging to the user role – ithetrole – of the arguments. The email subject and message is contained in a request object. (emailsubject and emailmessage respectively)

Argument

Itherole User role number or the string "Every"

Ifound Resulting number of users to which the message was sent.

Return Values

Returns 0 for successful completion

Returns 1 if a type was not provided

 

 

Function AssignToRole (irole, iuser, icreator, isite)

Description

Assigns a user to a role

Input

iole Role to which to assign the user

iuser The user ID to be assigned

icreator User responsible for this assignment

isite Redundant input

 

 

 

WEBTOPWORKS CLASS

Function GenerateWebtop (iwebtop, icreate)

Description

Generates the html for a NetVIOS webtop.

Input

iwebtop WebtopID

icreate 0 to insert in an existing page or 1 for create a complete webtop page.

Return Values

Returns a string containing the html text.

Returns –1 if no webtop ID is supplied.

 

Function AddIcon Count(iconID)

Description

Increments the click count for a webtop icon

Input

iconID ID of the webtop icon.

 

Function ResetClicks (iconID)

Description

Resets the click count for a webtop icon

Input

iconID ID of the webtop icon.

 

 

 

Function GenerateApptop (Optional webtopback, Optional webtopfore, Optional webtopimage)

Description

Generates a webtop containing the icons of all applications installed on the OS.

Input

webtopback background color of webtop

webtopfore font color of webtop

webtopimage background image of webtop

 

 

Function GenerateNettop (Optional webtopback, Optional webtopfore, Optional webtopimage)

Description

Generates a webtop containing the icons of the role pages of all the roles to which the user logged on belong.

Input

webtopback background color of webtop

webtopfore font color of webtop

webtopimage background image of webtop

 

 

WOSFILE CLASS

PROPERTIES

Name_f Name of file

Path_f Full path of file

FileLevel_f File level (0 is the topmost NetVIOS folder)

Parent_f ID of the parent folder

FileType_f File type (0 for folder, 1 for file, 2 for file with NetVIOS header, 3 for pagecomposer file, 4 for webtop file, 9 for a portlet

Owner_f ID of file owner (a NetVIOS user ID)

Hidden_f Boolean indicating if file is hidden in WebManager view

Restricted_f Boolean indicating whether this file should be secured

OnlyAdmin_f Boolean indicating whether only the administrator can access this file

PageDesc_f Description of the file

PageTitle_f File title

IconFile_f Path of icon or picture to use with this file (the file icon shows in NetVIOS webtops or in advanced versions of NetVIOS FileManager)

Header_f Header ID of the header inserted in the file.

 

 

METHODS

Function NewFolder (ByVal ilevel, ByVal iparent, icreator) As Variant

Description

This function inserts a new folder into the NetVIOS file system.

Input

ilevel Level of the parent folder

iparent ID of the parent folder

icreator owner or creator of the folder. The value of this input is assigned to the property Owner_f

Note: The other properties of NewFolder would be set after creation of the NewFolder class.

Return Values

Returns 0 for successful creation

Returns –1 if no creator was supplied

Returns –2 if no parent was supplied

Returns –3 if no level is supplied

 

Function NewFile (ByVal ilevel, ByVal iparent, icreator) As Variant

Description

This function inserts a new folder into the NetVIOS file system.

Input

ilevel Level of the parent folder

iparent ID of the parent folder

icreator owner or creator of the file. The value of this input is assigned to the property Ownerf

Note: The other properties of NewFile would be set after creation of the NewFile class.

Return Values

Returns 0 for successful creation

Returns –1 if no creator was supplied

Returns –2 if no parent was supplied

Returns –3 if no level is supplied

 

 

WOSHEADER CLASS

PROPERTIES

HeaderID

HeaderName

HeaderFormat

HeaderWidth

NumMenuCells

NumTitleCells

MenuCellHeight

TitleCellHeight

MenuBorderSize

MenuBorderColor

LeftMarginSize

TopMarginSize

HeaderBackColor

HeaderBackImage

CreatorID

CreatedDate

Deleted

Undeletable

HeaderFile

 

WOSHEADERCELL CLASS

PROPERTIES

CellID

HeaderID

RowNumber

CellType

CellURL

CellWidth

CellText

CellFont

CellFontAlternative

CellFontSize

CellFontColor

CellColor

CellRolloverColor

CellImage

CellRolloverImage

OrderNumber

Deleted

CellHalign

CellVAlign

CellTarget

 

WOSHELP CLASS

Private Sub AddHelp (ByVal ihelpid As Integer)

Description

Inserts a help item in the help buffer (which is 10 items deep)

Input

ihelpid ID of help item

 

Sub ProcessHelp()

Description

Displays NetVIOS help

 

BUTTONWORKS CLASS

NetVIOS button filenames have the following form.

    1. Core name of button representing a button type e.g
    2. Buttona1p.gif

    3. Color letter – a through z.
    4. Buttona1p.gif

    5. Type number 1 through 9.

Buttona1p.gif

Button extensions may be either .bmp, .gif or .jpg.