ASPForms - Programmer's Guide


Table of Contents

Preface
1. Introduction To ASPForms
Prerequisites
Overview of ASPForms Object Model
2. ASPForms - A Sample Application
Overview
Creating An Instance Of ASPForm
Adding Elements To An ASPForm Object
A Sample HTML Form Page
Loading The Request Into Our ASPFormV1 Object
Dumping the current configuration and state
Creating Rulesets And Rules
Validating Data
Validation against an entire ruleset
Validating a single element
The IsValid And IsDirty Flags
A Note About The Errors Object
Looking At The Results Of Validation With The Errors Object
Iterating through the Errors
Dumping the errors
Creating An Adapter
AdapterMappings
Using The Adapter
Next Steps
3. ASPFormV1 API Information
Adapters
Clear
Clone
Copy
CreateAdapter
DumpConfig
DumpErrors
DumpState
getXML
IsDirty
IsValid
LoadFromRequest
LoadFromSession
LoadXML
StoreStateInSession
Validate
Version
4. Elements API Information
Count
getXML
Item
LoadXML
Remove
5. Element API Information
Error
getXML
IsDirty
IsRequired
IsValid
LastRulesetUsed
LoadXML
Name
sqlValue
Validate
Value
6. Rulesets API Information
Clear
Count
CreateRuleset
getXML
Item
LoadXML
Remove
7. Ruleset API Information
CreateRule
getXML
IsDefault
LoadXML
Name
Rules
SetAsDefault
Validate
8. Rules API Information
Clear
Count
CreateRule
getXML
Item
LoadXML
Remove
9. Rule API Information
appliesTo
ErrorDescription
getXML
LoadXML
Name
Param1
RuleType
10. Errors API Information
Clear
Count
getXML
Item
LoadXML
Remove
11. Error API Information
Description
Element
getXML
LoadXML
Rule
12. Adapters API Information
Clear
Count
CreateAdapter
getXML
Item
LoadXML
Remove
13. AdapterADO API Information
getInsertSQL
getUpdateSQL
CreateMapping
getXML
loadXML
Mappings
Name
TableName
14. ADOMappings API Information
Clear
Count
CreateMapping
getXML
Item
LoadXML
Remove
15. ADOMapping API Information
appliesTo
dataField
fieldType
getXML
LoadXML
Name
16. IAdapter API Information
Name

List of Examples

2.1. Creating an ASPForm Object
2.2. Adding Elements To An ASPForm Object
2.3. An ASP page with a basic HTML form
2.4. Retrieving Data From The Request Object
2.5. Dumping the configuration and current state
2.6. Configuring a validation ruleset
2.7. The CreateRule Method
2.8. Validating With An Entire Ruleset
2.9. Validating The Name Element
2.10. Iterating through the errors collection
2.11. DumpErrors method
2.12. Using CreateAdapter
2.13. Creating An AdapterMapping
2.14. The CreateMapping method
2.15. Using The ADO Adapter

Preface

When Active Server Pages was first released it ushered in a new era of web development, allowing developers to take HTML,mix it with a stripped down version of visual basic/javascript/perl and create dynamic content, and web applications. The decision to base things on visual basic allowed them to take advantage of the COM infrastructure that they had been refining for the last year or two and to create a powerful platform on which to build web applications.

Versioning and remote deployment difficulties within COM, the short sightedness that the Windows server products had suffered during their infancy in the server market led to some real problems when trying to deploy/maintain and upgrade web applications. Other tools could be bought off the shelf and used to manage these servers but these products also made public servers even more susceptible to attack by crackers.

Many developers found the best way to deal with all of these problems was simply to wholly embrace the scripting portion of ASP for their development needs. COM components carrying the core business logic were left behind as the difficulties of turnovers, maintenance, etc began to manifest themselves.

This worked well for most applications, as is evident in the number of ASP-based web-applications that can be found online today. However, one of the core difficulties with ASP/VBScript is that it is a typeless language. As more and more database applications were put onto intranets, the validation of the data became more important, there were lots of rules for validating any piece of data that the user may have entered, and the rules could be different for different users, or different times of day. This led to nasty nests of if-then/select statements that quickly became unmanageable.

Something else was needed.

In the summer of 1999 we started to work on a tool that would allow us to solve this problem, allowing for quick and fastvalidation, quick coding, and allow the reuse of validation rules. Over the course of the next 2 years we refined these concepts into what is now known as ASPForms.

Chapter 1. Introduction To ASPForms

Prerequisites

This user guide is written for active web developers, and assumes a working knowledge about how ASP applications work. Before getting started you should understand the basics of these core technologies :

The HTTP Request/Response sequence

The canonical source for this is RFC 2616 - Hypertext Transfer Protocol (HTTP/1.1)

Active Server Pages

information about asp

eXtensible Markup Language

information about XML

Regular Expressions

information about Regular Expressions

Overview of ASPForms Object Model

overview information

Chapter 2. ASPForms - A Sample Application

Overview

We're going to take the ASPForms component and construct a sample application that should be able to get you through the basicsof using this component. Once we're done you will have a basic understanding of elements, rulesets, rules, errors, and adapters. We are not going to go through approaches for determining if you have a page post or how to structure your ASP sites/pages, it is assumed that you are familiar with the various strategies involved in asp development.

Creating An Instance Of ASPForm

The ASPForm class is the base class and there must be at least one instance of this created in order to utilize ASPForms.Below is an example of VBScript code that will create an instance of an ASPForm and assign the handle to a variable

Example 2.1. Creating an ASPForm Object

set hASPForm = Server.CreateObject("ASPForms.ASPFormV1")

Adding Elements To An ASPForm Object

The ASPForm class is not very useful by itself, and an example showing the utility of the component at this point would be rather pointless so we are going to add a few elements and then return to the details of the ASPForm class. We'll create a few elements that we can use for the next few examples.

Example 2.2. Adding Elements To An ASPForm Object

	'create an ASPForms object
	set hASPForm = Server.CreateObject("ASPForms.ASPFormV1")
	
	'create a name element in the form
	hASPForm.Elements.CreateElement "name", true
	
	'create an address1 element in the form
	hASPForm.Elements.CreateElement "address1", true
		
	'create an address2 element in the form
	hASPForm.Elements.CreateElement "address2", false
	
	'create a city element in the form
	hASPForm.Elements.CreateElement "city", true				
	
	'create a state element in the form
	hASPForm.Elements.CreateElement "state", true				
	
	'create a zipcode element in the form				
	hASPForm.Elements.CreateElement "zipcode", true
	
	'store the form's state and configuration into the session
	hASPForm.StoreStateInSession "addressInfo"

A Sample HTML Form Page

Below is a page that creates an HTML form. This will be what is presented to the user for them to fill in, once they click submit the information they entered will be picked up by our ASPFormsV1 object.

Example 2.3. An ASP page with a basic HTML form

	<html>
	  <head>
		<title>A Sample Form</title>
	  </head>
	  <body>
		<form id="form1" action="sample.asp" method="post">
		  <input type="hidden" name="pagepost" size="25" value="1">				
		  <input type="text" name="name" size="25">		
		  <br>
		  <input type="text" name="address1" size="25">
		  <br>
		  <input type="text" name="address2" size="25">
		  <br>
		  <input type="text" name="city" size="25">		  
		  <br>
		  <input type="text" name="state" size="25">
		  <br>
		  <input type="text" name="zipcode" size="25">	
		  <br>		  
		  <input name="cmd" type="submit" value="Save">
		  <input name="cmd" type="submit" value="Cancel">
		</form>
	  </body>
	</html>

Loading The Request Into Our ASPFormV1 Object

We are going to load the information from the previous form into our object, to do so we need to create an instance of our object load the element configuration from the session, then retrieve the data returned from the browser with the LoadFromRequest method.

Example 2.4. Retrieving Data From The Request Object

	'create an ASPForms object
	set hASPForm = Server.CreateObject("ASPForms.ASPFormV1")
	
	'load the previous state of the table from the session
	hASPForm.LoadFromSession "addressInfo"
	
	'create a name element in the form
	hASPForm.LoadFromRequest

The LoadFromRequest method iterates through the list of elements that are defined by the form then attempts to find an named item in the request that matches the element name. if a match is found then the corresponding value is placed into the element value otherwise it is left blank.

Dumping the current configuration and state

It is often helpful to be able to view the current state of your application without having to write a lot of messy code. for that reason we have created a few helper functions that allow you to easily see what is going on within any ASPFormV1 object.

Example 2.5. Dumping the configuration and current state

	
	'continuing from the previous example..

	'dump the current configuration of the aspform
	hASPForm.dumpConfig
	
	'dump the current state of the aspform
	hASPForm.dumpState	

The LoadFromRequest method iterates through the list of elements that are defined by the form then attempts to find an named item in the request that matches the element name. if a match is found then the corresponding value is placed into the element value otherwise it is left blank.

Creating Rulesets And Rules

Loading post data, or grabbing information from a session isn't terribly useful by itself, in fact it would be easier to write code by hand to load this information every time. All data that is posted via a web interface should be validated for length, type, format, among others, with the ability to turn off javascript in the newer browsing clients, validation at the client is not enough, it must be done on the server as well.

ASPForms has a sophisticated mechanism for managing the validation of data. For now, we will cover the basic set of the components features, and in a later chapter we will cover some more advanced features of the system. Below we will construct a ruleset for the form, adding rules to validate all of the elements in our form.

Example 2.6. Configuring a validation ruleset

	'create an ASPForms object
	set hASPForm = Server.CreateObject("ASPForms.ASPFormV1")
	
	
	'*** add some elements to the form ***
	
	'create a name element in the form
	hASPForm.Elements.CreateElement "name", true
	
	'create an address1 element in the form
	hASPForm.Elements.CreateElement "address1", true
		
	'create an address2 element in the form
	hASPForm.Elements.CreateElement "address2", false
	
	'create a city element in the form
	hASPForm.Elements.CreateElement "city", true				
	
	'create a state element in the form
	hASPForm.Elements.CreateElement "state", true				
	
	'create a zipcode element in the form				
	hASPForm.Elements.CreateElement "zipcode", true
	
	'store the form's state and configuration into the session
	hASPForm.StoreStateInSession "addressInfo"


	'*** create a ruleset and some rules for validation ***
	
	'create a new ruleset for the form
	hASPForm.Rulesets.CreateRuleset("master")
	
	'add a maximum length rule for the name element	
	hASPForm.Rulesets("master").CreateRule "name_maxlength", "name", ASPFORMS_MAXLength, "The Name is Too Long", 15
	
	'add a rule to only allow the characters A-Z, a-z, 0-9 and spaces in address1
	hASPForms.Rulesets("master").CreateRule "address2_allowablechars", "address1",  ASPFORMS_RegularExpression, "Only A-Z, a-z, and 0-9", "^[A-Za-z0-9 ]+"

Looking at the CreateRule Method used above you will notice that there are several arguments passed in, the function breaks down like this :

Example 2.7. The CreateRule Method

	'the create rule method	
	ASPFormV1.Rulesets([rulesetname]).CreateRule [rulename], [elementname], [ruletype], [error_string], [param1]

	[rulesetname] - name of the ruleset that this rule should apply to
	[rulename] - name for this rule, ever rule in a ruleset must have a unique name
	[elementname] - name of the element that this rule applies to
	[ruletype] - there are several ruletypes that are available within aspforms we will cover these in a bit
	[error_string] - the string that should appear as the description of an error object if the rule conditions are not met
	[param1] - a parameter that has a different meaning for different ruletypes ( see api documentation for details )

Validating Data

We've created elements, created a ruleset with some rules, and have captured a request from an html form. Our next step is to take a look at a few ways that we can perform validation on the elements, and also see how errors and validity are indicated within the component.

Validation against an entire ruleset

Many times when validating information from a form you simply want to determine whether all of the information is valid or not, this is easily accomplished with the Validate method of the ASPFormV1 class. In our example, we simply would call validate, if you have multiple rulesets configured ( something that won't be talking about in this example ), then you can either specify a ruleset or specify nothing and have all rulesets validate against the data. The example below shows how we would validate our example, note that validate returns whether the data is valid, this information is also stored in the IsValid property of the class.

Example 2.8. Validating With An Entire Ruleset

	'the validate method
	retVal = hASPForm.Validate
	
	'determining whether the data is valid through the isvalid property
	fIsValid = hASPForm.IsValid

Validating a single element

There are times where you might want to validate a single element instead of your entire element set. To facilitate this two different methods were created, one allows you to specify the element name to validate from the ASPFormV1's validate method, the other is using a validate method that we created for the element class, this method has an optional argument to allow you to specify a ruleset name ( multiple rulesets are not being utilized in this example, so we will just leave it blank ). Below is an example of how we might validate the name element.

Example 2.9. Validating The Name Element

	'using the ASPFormV1 validate method
	retVal = hASPForm.Validate( "", "name")
	
	fIsValid = hASPForm.Elements("name").IsValid
	
	'using the Element's validate method	
	retVal = hASPForm.Elements("name").Validate
	
	fIsValid = hASPForm.Elements("name").IsValid

The IsValid And IsDirty Flags

As seen above the IsValid property is available in both the ASPForm class and the Element class. IsValid returns false until it is validated, that way you don't have to worry about forgetting to validate your elements and the thing returning true, that would be bad.

The IsDirty flag is another property that should be mentioned at this time, the IsDirty flag simply indicates whether the value of an element has changed since the last the element was validated, it works like you would expect, simply returning a boolean value.

A Note About The Errors Object

There is another way to look at the results of a validation and that is through the use of the Errors object. We mention it here for completeness, but we will defer discussion to the next session.

Looking At The Results Of Validation With The Errors Object

When the validate method is called on ASPForm class it resets the errors collection before it begins to validate the elements. The errors will remain in the error collection until validate is called again, this allows the error collection to be referenced by the programmer, for things such as notifying the user which elements are invalid.

When an error is identified, details are pulled out and placed into the error object before it is added to the errors collection. The details of the error describe all essential information for discerning how/why an error occurred. They are as follows :

  • A description of the error that is contained in the rule, the ruleset name of the rule

  • The name of the element that is the source of the error

  • The name of the rule that generated the error

  • The name of the ruleset that contains the rule that generated the error

Iterating through the Errors

The Errors class is a standard custom collection, so it is relatively easy to iterate through the errors and see what's going on, the code below shows an example of this.

Example 2.10. Iterating through the errors collection

    For i = 1 To hASPForm.Errors.Count
        response.write "Element : " & hASPForm.Errors(i).Element & "<br>"
        response.write "Description : " & hASPForm.Errors(i).Description & "<br>"
        response.write "Rule : " & hASPForm.Errors(i).Rule & "<br>"
        response.write "<hr>"        
    Next

Dumping the errors

We've included a helper method to simply dump all of the errors that exist to the object context. Below is an example usage :

Example 2.11. DumpErrors method

	'dump existing errors
	hASPForm.DumpErrors		

Creating An Adapter

An adapter is a tool used for mapping ASPForm Elements to a datasource. At this time there is only one adapter in the ASPForms component, however the design allows for seamless implementation of new types of adapters as they become available.

Example 2.12. Using CreateAdapter

	'create a new ADO adapter named 'sample'
    Set adaptADO = hASPForm.CreateAdapter("sample", ASPFORMS_ADO)
    
    'set the tablename where the data
    adaptADO.TableName = "sqlTableName"

NOTE: while it passes back a handle to the adapter, the adapter still exists within the adapters collection

AdapterMappings

The adapter contains a collection of adapterMappings that define the details of how an element maps to a the datasource. We use the CreateMapping method of an adapter to create mappings for that adapter, an example is below :

Example 2.13. Creating An AdapterMapping

	
	'add mappings to the adapter
	hASPForms.Adapters("sample").CreateMapping "mapName", "name", "name", ASPFORMS_String	

The details of the CreateMapping method are shown below

Example 2.14. The CreateMapping method

	
	'the create rule method	
	ASPFormV1.Adapters("sample").CreateMapping [mappingName], [appliesTo], [fieldName], [field_type]

	[mappingName] - name of the adapterMapping being created
	[appliesTo] - name of the element that this mapping refers to
	[fieldName] - name of the field in the database that the element should be mapped to
	[field_type] - the datatype of the field in the database

Using The Adapter

Once you have created an adapter and some adaptermappings for the adapter, you can use the adapter to interact with your datasource. The ADO Adapter currently generates SELECT, INSERT, and UPDATE SQL statements.

Example 2.15. Using The ADO Adapter

	'get a adapter from our form object
	set hAdapter = hASPForm.Adapters("sample")
	
	'get an insert statement
	sSQL = hAdapter.getInsertSQL
	
	'get an update statement
	sSQL = hAdapter.getUpdateSQL
	
	'get a select statement
	sSQL = hAdapter.getSelectSQL
	

NOTE : this does not generate any criteria for you application, you simply concatenate this to the returned string

Next Steps

We've now been over the basic objects, and features of the ASPForms component, this should be enough for many users of this component. Please refer to the api documentation for more detailed information about the product, and feel free to contact us at support 'at' myndkryme dot com if you have any questions.

Chapter 3. ASPFormV1 API Information

Adapters

Name

Adapters - Adapters custom collection

Description

The Adapters class is a custom container that holds all of the adapters that are configured for an ASPForm. Please see the Adapters API information for more details.

Clear

Name

Clear - Clears Data In ASPFormV1

Description

Clears the value from each element contained within the form.

Clone

Name

Clone - clones the Form object

Description

Creates a duplicate of the Form and returns it as a new object

Copy

Name

Copy - copies a form

Description

Creates a copy of each of the elements contained within the form object passed as an argument.

CreateAdapter

Name

CreateAdapter - creates new adapter

Description

Creates a new adapter in the adapters class.

DumpConfig

Name

DumpConfig - dump the form object's current configuration

Description

Sends the current configuration of a form object to the current object context

DumpErrors

Name

DumpErrors - dump the form object's current errors

Description

Sends the current errors of a form object to the current object context

DumpState

Name

DumpState - dump the form object's current state

Description

Sends the current state of a form object to the current object context

getXML

Name

getXML - retrieves XML from form object

Description

Retrieves the current state of a form object and all of its child objects and returns it to the calling function as a valid XML string.

IsDirty

Name

IsDirty - element data has changed

Description

Returns whether the element data for the form has been changed since the last validation. Always returns dirty until the form is validated for the first time.

IsValid

Name

IsValid - current data is valid

Description

Returns whether all of the data contained within the elements has been determined valid. If any of the elements are not valid then it returns false. Returns false if validate has never been called in the life of the object.

LoadFromRequest

Name

LoadFromRequest - loads data from request

Description

Loads data from the request that matches the name of elements in the form object

LoadFromSession

Name

LoadFromSession - loads state/config from session

Description

Loads all state and configuration information from a specified location in the session

LoadXML

Name

LoadXML - loads an xml string

Description

Loads an XML string into the form object, using the information contained within to set all properties of the form and its child objects

StoreStateInSession

Name

StoreStateInSession - stores state/config in session

Description

Stores all state and configuration information into a specified location in the session

Validate

Name

Validate - validates the form

Description

validates the form's element data against the form object's ruleset or rulesets

Version

Name

Version - the version of the component

Description

Returns the version of the aspform currently being used

Chapter 4. Elements API Information

Count

Name

Count - the element count

Description

Returns the current number of elements

getXML

Name

getXML - Returns XML As String

Description

retrieves the current state of the elements object and it's child objects and returns it as an xml string

Item

Name

Item - returns the specified item

Description

Returns the item specified by either a key value or an index value

LoadXML

Name

LoadXML - loads an xml string

Description

loads an xml string into the elements object using the information within to set all properties of the elements object and its children

Remove

Name

Remove - Removes an element

Description

Removes the element specified, from the elements collection. The element may be specified by either the index or key value.

Chapter 5. Element API Information

Error

Name

Error - error description

Description

When the validate routine is run, if an element is in error, the description for that error will be placed in this read-only string for the element. If you use multiple rules, or rulesets, for a particular element, note that error will only contain the most recent error.

getXML

Name

getXML - Returns XML As String

Description

retrieves the current state of the element object and it's child objects and returns it as an XML string

IsDirty

Name

IsDirty - element data has changed

Description

Returns whether the element data has changed since it's last validation. Always returns true until it is validate for the first time

IsRequired

Name

IsRequired - the element must have a value

Description

This flag will allow the element to raise an error if it is set to true, and there is not data in the value property of the element. This can be done with a ruleset, it was added as a convenience for developers

IsValid

Name

IsValid - current data is valid

Description

Returns whether all of the data contained within this element was determined to be valid during the last validation against a ruleset. Returns false if validate has never been called on the form that contains this element.

LastRulesetUsed

Name

LastRulesetUsed - last ruleset used for validation

Description

holds the name of the last ruleset used to validate this element, this is useful for debugging.

LoadXML

Name

LoadXML - loads an xml string

Description

Loads an XML string into the element object, using the information contained within to set all of the properties of the form and its child objects.

Name

Name

Name - name of the element

Description

The name of the element, this is also used to map this element to the request name that it should load it's data from

sqlValue

Name

sqlValue - returns a "sql safe" value

Description

returns a "sql safe" value to the calling code by escaping all single quotes contained with the value to two single quotes.

Validate

Name

Validate - validates element

Description

Validates the element using a single ruleset if one is specified, otherwise it validates the element against all of the rulesets contained within the parent form object.

Value

Name

Value - the element's value

Description

sets/gets the value that the element current holds

Chapter 6. Rulesets API Information

Clear

Name

Clear - clears all rulesets

Description

Removes all existing rulesets from the collection

Count

Name

Count - number of rulesets

Description

Returns the number of ruleset objects contained within this object

CreateRuleset

Name

CreateRuleset - creates new ruleset

Description

Creates a new ruleset in the rulesets class.

getXML

Name

getXML - retrieves XML from rulesets object

Description

Retrieves the current state of a form object and all of its child objects and returns it to the calling function as a valid XML string.

Item

Name

Item - returns the specified item

Description

Returns the ruleset specified by either a key value or an index value.

LoadXML

Name

LoadXML - Loads an XML string

Description

Loads an XML string into the rulesets object, using the information contained within to set all properties of the rulesets object and its child objects.

Remove

Name

Remove - removes a ruleset

Description

Removes the ruleset specified, from the rulesets collection. The ruleset may be specified by either the index or key value.

Chapter 7. Ruleset API Information

CreateRule

Name

CreateRule - creates a new rule

Description

Creates a new rule in the current ruleset

getXML

Name

getXML - retrieves xml from ruleset object

Description

Retrieves the current state of a ruleset object and all of its child objects and returns it as a valid xml string

IsDefault

Name

IsDefault - default ruleset

Description

Returns a boolean value signifying whether the it is the default ruleset for the parent form.

LoadXML

Name

LoadXML - loads an XML string

Description

Loads an XML string into the ruleset object, using the information contained within to set all properties of the ruleset and its child objects

Name

Name

Name - Name of the ruleset

Description

Name of the ruleset

Rules

Name

Rules - Rules class

Description

Rules class that contains all of the rules associated with this ruleset.

SetAsDefault

Name

SetAsDefault - Set As Default

Description

This method allows you to specify the ruleset to be the default ruleset for its parent form object.

Validate

Validate

Validate - Validate Form

Description

Validates the form's elements with the rules that are contained within this ruleset

Chapter 8. Rules API Information

Clear

Name

Clear - clear all rules

Description

Removes all existing rule objects from the collection

Count

Name

Count - number of rules

Description

Returns the number of rule objects contained within this object

CreateRule

Name

CreateRule - creates new rule

Description

Creates a new rule in the rules class.

getXML

Name

getXML - Retrieves XML from rules object

Description

Retrieves the current tstate of the rules object and all of its child objects and returns it to the calling function as a valid XML string.

Item

Name

Item - returns the specified item.

Description

Returns the rule specified by either a key value or an index value.

LoadXML

Name

LoadXML - Loads an XML String

Description

Loads an XML string into the rules object, using the information contained within to set all properties of the rules object and its child objects.

Remove

Name

Remove - removes a rule

Description

Removes the rule specified from the rules collection. The rule may by specified by either the index or key value.

Chapter 9. Rule API Information

appliesTo

Name

appliesTo - element rule applies to

Description

When the rule is used to validate a set of elements, this specifies which element this rule applies to.

ErrorDescription

Name

ErrorDescription - Description Of Error

Description

If an element fails validation of a particular rule the ErrorDescription property is used to populate an error object that is added to the errors collection. The ErrorDescription is a user-friendly message that explains why the rule found the element value to be invalid.

getXML

Name

getXML - retrieves XML from rule object

Description

Retrieves the current state of a rule object and returns it as a valid XML string.

LoadXML

Name

LoadXML - Loads an XML string

Description

Loads an XML string into the rule object, using the information contained within to set the state of the rule object.

Name

Name

Name - name of rule

Description

the name of the rule object

Param1

Name

Param1 - a parameter property

Description

This property has different meanining depending on what the ruletype is for the rule object.

RuleType

Name

RuleType - the rule type

Description

The RuleType determines how the rule is used in validation routines. It can signify whether the rule should be checking for some pre-defined type, or a max/min length or if it should be validated via a regular expression.

Chapter 10. Errors API Information

Clear

Name

Clear - clears all errors

Description

Removes all existing error objects from the collection.

Count

Name

Count - the error count

Description

Returns the current number of error objects.

getXML

Name

getXML - Returns XML As String

Description

retrieves the current state of the errors object and it's child objects and returns it as an XML string

Item

Name

Item - returns the specified item

Description

Returns the item specified by either a key value or an index value

LoadXML

Name

LoadXML - loads an xml string

Description

loads an xml string into the errors object using the information within to set all properties of the errors object and its children

Remove

Name

Remove - Removes an error

Description

Removes the error specified, from the errors collection. The error may be specified by either the index or key value.

Chapter 11. Error API Information

Description

Name

Description - error description

Description

This contains the description of the error, it is populated directly from the rule.ErrorDescription property when a validate of that rule returns false.

Element

Name

Element - Element name

Description

The name of the Element that this error relates to.

getXML

Name

getXML - retrieves XML from error object

Description

Retrieves the current state of a error object and returns it as a valid XML string.

LoadXML

Name

LoadXML - Loads an XML string

Description

Loads an XML string into the error object, using the information contained within to set the state of the error object.

Rule

Name

Rule - rule name

Description

The name of the rule that created this error.

Chapter 12. Adapters API Information

Clear

Name

Clear - clears all adapters

Description

Removes all existing adapter objects from the collection

Count

Name

Count - number of adapters

Description

Returns the number of adapter objects contained within this object

CreateAdapter

Name

CreateAdapter - creates new adapter

Description

Creates a new adapter object in adapters.

getXML

Name

getXML - retrieves XML from adapters object

Description

Retrieves the current state of an adapters object and all of its child objects and returns it to the calling function as a valid XML string.

Item

Name

Item - returns the specified item

Description

Returns the adapter specified by either a key value or an index value. Please note that this returns the adapter as a handle to the adapter's IAdapter interface.

LoadXML

Name

LoadXML - Loads an XML string

Description

Loads an XML string into the adapters object, using the information contained within to set all properties of the adapters object and its child objects.

Remove

Name

Remove - removes an adapter

Description

Removes the adapter specified, from the adapters collection. The adapter may be specified by either the index or key value.

Chapter 13. AdapterADO API Information

getInsertSQL

Name

getInsertSQL - returns sql string

Description

Returns a valid sql string that will insert the data in the elements collection that maps to the adapter's mapping into the table specified by the adapter.

getUpdateSQL

Name

getUpdateSQL - returns sql string

Description

Returns a valid sql string that will update the data in the elements collection that maps to the adapter's mapping into the table specified by the adapter.

CreateMapping

Name

CreateMapping - Creates a mapping

Description

Creates a new ado mapping for the adapter

getXML

Name

getXML - Returns XML as string

Description

retrieves the current state of the AdapterADO and its child objects and returns it as an XML string.

loadXML

Name

loadXML - loads an XML string

Description

Loads an XML string into the AdapterADO object, using the information contained within to set all of the properties of the AdapterADO and its child objects.

Mappings

Name

Mappings - MappingsADO class

Description

public reference to the class's MappingsADO class.

Name

Name

Name - Adapter Name

Description

THe name of the Adapter.

TableName

Name

TableName - name of table

Description

The name of the table that this adapter references.

Chapter 14. ADOMappings API Information

Clear

Name

Clear - clears all mappings

Description

Removes all existing ADOMapping objects from the collection

Count

Name

Count - number of ADOMappings

Description

Returns the number of ADOMapping objects contained within this object

CreateMapping

Name

CreateMapping - creates a new mapping

Description

Creates a new ADOMapping object in the ADOMappings class.

getXML

Name

getXML - retrieves XML from ADOAdapters object

Description

Retrieves the current state of a adoadapters object and all of its child objects and returns it to the calling function as a valid XML string.

Item

Name

Item - returns the specified item

Description

Returns the adomapping object specified by either a key value or an index value.

LoadXML

Name

LoadXML - Loads an XML string

Description

Loads an XML string into the adoMappings object, using the information contained within to set all properties of the rulesets object and its child objects.

Remove

Name

Remove - removes a adomapping

Description

Removes the adomapping specified, from the adomappings collection. The adomapping may be specified by either the index or key value.

Chapter 15. ADOMapping API Information

appliesTo

Name

appliesTo - element this mapping applies to

Description

the name of the element in the elements collection that this adomapping references.

dataField

Name

dataField - the name of the data field

Description

the name of the data field in the database that this adomapping references.

fieldType

Name

fieldType - field type of mapped field

Description

the field type of the field in the database that this mapping references.

getXML

Name

getXML - retrieves XML from object

Description

Retrieves the current state of the ADOMapping object and returns it as a valid XML string.

LoadXML

Name

LoadXML - loads an XML string

Description

Loads an XML string into the ADOMapping object, using the information contained within to set all of the properties of the ADOMapping object.

Name

Name

Name - Name Of Mapping

Description

The name of this ADOMapping object.

Chapter 16. IAdapter API Information

Table of Contents

Name

Name

Name

Name - Name of adapter

Description

Returns the name of the adapter.