CSWAM Framework: a New Web-site Design Paradigm

Web Site software may be categorized into distinct logical components:

 

  • Presentation (Providing the Visual design of the Master & information reporting pages)
  • Website Navigation ( Providing access to Web site features/information)
  • Application (The User Service(s) provided by the Site).
  • External Application Program Interfaces (API’s) to external Server logics (Data-base, Email, Etc.)

 

Web-site Presentation and Navigation is provided by standard Browser native program language processors: Java Script and the HTML (Hyper Text Mark-up Language). HTML and Java-script code provide the means of:

1.      Defining/layout objects (location, and attributes) within the Page/Document (Document Object Model).

2.      Specifying the style of Page objects, CSS (Cascading Style Sheets).

3.      Responding to User initiated object events (Mouse clicks, positioning, etc).

4.      Assigning other language processor Plug-ins (Java, Flash, Quick Time player, Media player, etc) to provide visual action (movies, etc) to Page presentation object areas(s).

 

Web-site layout design usually divides these sections into permanent and variable containers of information. The permanent sections of a Web-site layout/format are referred to as the Master Page and consist of one or more of the following sections:

  • Top of page
  • Left-side of page
  • Right-side of page
  • Bottom of page

 

The variable Center section(s) of the page is usually allocated for display of information requested via navigation lists in one or more of the permanent sections. Since all HTML sections (permanent and variable) must be regenerated for each Web-site data request event, a copy of the permanent Master page sections is included as a preface for all Web-site page contents. Classical Web-site design frameworks, such as ASP.NET

 (Active Server Page) were created to accommodate this archaic page level request and response design approach and force use of their own proprietary Web-site Server System. This esoteric Page event based framework system is in a continuous state of flux and must add incomprehensible “bells and whistle” controls to accommodate modern Web-site utilization needs (AJAX).

 

CSWAM (Client Side Web-site Application Management) is a Web-site development/enhancement Framework. Its purpose is to employ the Client-side (Browser/Java-script) of a Web-site application as the primary partner to improve the performance and response time of its Presentation and Navigation components. The Browser's native programming language (Java-script) although a powerful Object Oriented programming language is seldom employed effectively in Web-site software. Instead Web-sites have depended on crude snippets of undocumented Java-script code to perform critical Server and Web-site functions because a software framework did not exist that addressed these needs. The CSWAM Framework was created to fill this void and provide a documented Client-side support facility (Object Oriented designed system) and Server-side standards to simplify implementation and improve the performance of current and future Web-site Application programs. In short, the CSWAM framework changes the design theory of a Web-site from an Active Server Page (ASP) to an Active Client Page (ACP) approach.

 

 

OVERVIEW

 

Traditionally, Web-site applications are totally Server-side controlled activities that provide a new HTML (Hyper-Text Markup Language) document /page for each notified Client event. When a Client event is detected, a synchronous “Event occurred” (refresh the page) call is sent to the Server for new HTML data. The Client/Browser then refreshes/renders the entire screen with the new Server generated HTML page.

The CSWAM Framework was developed to enable integrated management of application events on the Client-side of the Web-site:

 

  • Installing initial elements of the Application.
  • Responding to User request events for new application elements and data.
  • Updating elements (portions) of the screen with current information.
  • Controlling Timed Application events.
  • Validating Application input data.
  • Message/Data Communication with Server-side Programs
  • Logging and Restoring (on click) Application presentation data.
  • HTML Startup Macros for Browser ‘add-on’ language processors (plug-ins).

 

The feasibility of this shift in Web-site application structure is based upon six (6) main factors:

 

  • The standardization and support of AJAX, by all Browsers, as a Client/Server message communication vehicle.

 

  • The standardization and support of Java Script, by all Browsers, as the Client-side Web-site support programming language (Internet Explorer, Netscape, Firefox-Mozilla, Safari, etc).

 

  • The inherent Object Oriented power of Java-Script Programming language.

 

  • Dynamic Browser execution of new/changed HTML code inside (within the innerHTML attribute) of all HTML DIV objects in the document/page.

 

  • Dynamic Browser application of style attributes for all HTML objects via Cascading Style Sheet (CSS) logic.

 

  • Web-site servers (Server-side application code) already depend on client-side Java Script code (Asp.net especially). Almost all (95%) Web-site applications will not work if Java Script is not available at the Client-side (ie., disabled in the Browser).

 

 AJAX (Asynchronous Java-script And Xml) is a technique for creating better, faster, and more interactive Web-site applications. With AJAX an application (HTML web-page) can communicate directly with its Server components without reloading the page. CSWAM uses AJAX HTTP requests to provide both asynchronous and synchronous data transfer message control between the Client (Browser) and Server side of a Web-site application. The use of AJAX communication permits small Client/Server exchanges instead of whole pages of data.

 

CSWAM Framework employs AJAX communication (via its Ajax.Iface logic) and provides the following Client-side Web-site Management activities:

 

  1. AMAC: The AJAX Message Application Control (AMAC) component to send and receive message data with Web Server logics/page, and execute message error or response processing logic.

 

  1. TMAC: The Timed Managed Application Control (TMAC) component to control (setup, start, execute, pause, and close/remove) timed event Application code.

 

  1. VMAC: The Validation Managed Application Control (VMAC component to provide Client-side (Browser) and Server verification, and error notification of HTML input data items (ex. Input Forms).

 

  1. GTES :  General Table, Error and String components, servicing the logics of all CSWAM Framework application components(AMAC, TMAC & VMAC)

 

 

 

Utilization of the CSWAM Framework package (pk.cswam.framework.js) revolutionizes the approach to Web-site programming. CSWAM provides element/object level design of Web-site page activities and integrated management of application events from the Client-side of the Web-site:

 

1.      Installing initial Permanent Container elements (the Master Page) of the Application.

 

2.      Managing all variable Application activities (Variable Containers)

·       Responding to User request events for new application elements and data.

·       Updating elements (containers) of the page with current information.

·       Controlling Timed Application events.

·       Validating Application input data.

·       Logging and Restoring  (on click) the contents of Application Containers.

 

3.      Producing inherent Structured Program Code

 

·        No Page Post-back confusion.

·        Separate (Functional) control of all of application presentation elements (containers).

·        Easy/safe Maintenance and enhancement of the Web-site because it is accomplished at the element level without affecting the integrity of other components.

·        The Client/Server Program partners utilize a common communication language (AMAC) and a standard library (amac_lib.lang) of string manipulation and argument parsing functions.

 

A.     Design of CSWAM Program/Page files

 

CSWAM Web-site program files are designed to operate in pairs, a Client-side page layout (container-definition) file and its companion Server-side page updating ( container-populating) program file. Each presentation element (container) on a page is defined by a unique ID name in the layout file and references its style/attributes declared in the Cascading Style Sheet (CSS) file. The initialization and updating of HTML objects and data within Client-side (Browser) container elements are managed by corresponding ID related named functions in the companion Server-side program.

 

Client-side Program

Server-side Program

 

  • Setup ID names for all containers
  • Startup function – Populate Master (Permanent) Containers
  • Application code that may use CSWAM facilities.
  • HTML predefined presentation sections.

 

  • Library functions to obtain the function name and argument data from the  CMAC request string ( cmac-rqst).
  • Master page initialization functions to populate Client-side ID containers with HTML presentation objects and CSWAM event response calls.
  • Input data verification functions
  • Application functions to set, retrieve Server (Data-base, etc) information, carry-out Web-site algorythm logic, and generate HTML presentation objects to report results via a Client-side container.

 

A.     Web-site Page Presentation Control

 

CSWAM Web-site design relies on Cascading Style Sheets (CSS), for Container definitions (position within containers, and presentation attributes). The Browser always applies CSS definitions to any change of HTML objects on the page. Therefore, when a AMAC call completes updating the contents a container (ID), all the new HTML objects and attributes are instantly updated, dynamically refreshing that section/container(s) in the page.

 

B.     CSWAM Page Element/Container Updating with Server-side data

 

The CSWAM framework alters the design and programming of Web-site software from the classical Active Server Page (ASP) approach to an Active Server Page Container (ASPC) approach. In the CSWAM/ASPC design approach, Containers/objects within the page are the smallest unit of Web-site presentation and event management, instead of the classical ASP approach of page level updating for all container events. The AMAC Server request statement is the means of updating Client-side page containers (HTML DIV and SPAN objects). The request statement has three general components:

·        The address of the web-site program to satisfy the request (URL and CGI variable data)

·        The addressed function and argument data within the server program to process the request and generate the channel(s) of message response information.

·        The destination relationship of Client-side container ID(s) to be updated with response message data channel information (AMAC named variables).

 

 

C.     CSWAM Tandem Application Programming Files

 

Web-site programming utilizing the CSWAM framework dictates close integration of pairs of application program files: a client-side request and server-side action/response program file.

 

Client-side Program Operations

Server-side Program Operations

 

1. Request, with argument data, that a named function in a companion Server-side program is to generate the HTML and/or Application response information to populate/update its ID Object container(s).

 

 

1. Execute the requested function with argument data to fulfill the Client-side request, and respond with the desired HTML and/or Application response data.

2. Initiate and control timed changing container content (TMAC) activity.

2. Execute a requested function with argument data to provide the Client-side TMAC control with the desired file name response data.

 

3. Client-side Validation of an  input forms data fields in accordance with VMAC instructions,

3. Execute a requested function with argument data to validate a form data entry when requested (during Client-side VMAC instruction execution) and provide the VMAC with a pass or fail response indication (1 or 0).

 

4. Error reporting of Client-side and Server-side encountered System and Application Error conditions.

4. Provide unique error condition responses encountered while processing Client-side request for Application services.

 

5. Record/Log all Requested Server-side response data, and update page Containers IDs by the act of clicking the Left or Right arrow Icons.

 

 

D.    CSWAM Framework Service Calls

 

The CSWAM Framework provides a complete set of service calls to structure and simplify most major Web-site design programming operations.

These CSWAM framework calls perform all communication with an addressed Server companion Program function to populate a container(s) with the request response data. The following communications and bookkeeping features are managed in the background to complete this type of CSWAM framework programming service call:

 

    • AJAX communication interface control.
    • Table/queue management of Server call request/response message data.
    • Update standard CSWAM variable set with embedded Server response channel data.
    • Interface, call and Server-side Error management, and reporting.
    • Client-side container(s) updating with response data.
    • Recording all ID-response data in the CSWAM History log.
    • Providing User click-activated recall of all history log records

 

E.     AJAX Managed Application Control (AMAC) Communication Standards

 

The CSWAM Framework programming environment is based upon the following key concepts:

    • The layout and Program management of all Page HTML container elements/objects (DIV, SPAN, etc.).
    • Use of the AMAC message format rules to request Server-side function execution with named argument data and to update Client-side ID container(s) with the results.
    • Use of AMAC named variables that provide unique message response sub-channels (Error messages, separate data response messages to update different Client-side Container ID’s).
    • Familiarity with the AMAC library  routines to retrieve function call argument data and easily access Server-side IO API logic( file systems , data-base systems, etc)

 

1.      Relationship of Server-side Functions and Client-side Container(s)

 The CSWAM framework provides program control (updating) of each separate HTML Page presentation element (container object) when a relevant event(s) is triggered, rather than “post-back” of the entire page when any event occurs. Once Client-side containers (the “Master page”) are established with unique ID names, the AMAC Server request message call is used to populate them. An AMAC server request forwards a function name with its argument data message to a specified Web-site Server program function for execution. The Server function generates a response message that is parsed into Client-side Amac named variables that are used to populate specified ID named containers/objects with HTML data.

 

 

2.      AMAC Server-side Function Execution Service Call

 

The keystone of Web-site design within the CSWAM Framework is use of the AMAC Server-side Message Service Call (See CSWAM Framework Manual). This AMAC Server call provides the means of triggering and asynchronous updating Client-side containers with content generated by Server-side program function output. There are two AMAC message call function formats that are used for these purposes, excite and samesite. In both AMAC cases a Web-site program file (URL-Address) is addressed and a Message-request is directed to execute an internal function which generates response message segments to be stored in Client-side Containers(Client-Destination-list) .

 

a.      URL-address

The Universal Resource Locator Address (URL-Address) is the location with data of the Internet Web-site Program/file that is requested. A URL-Address has the following general format:

 

FORMAT:

Web-site/File-address?Request-data

 

Web-site

The location of a Server Web-site within the Internet

 

File-Address

The Address of the requested File/program within the Server File system. The question mark (?) character is the CGI separator from the subsequent Request-data part of the URL.

 

Request-Data

The named CGI encoded data variables, separated by an ampersand (&) delimiter(s), that accompanies the request.

NOTE: CGI = Common Gateway Interface internet message communication standards

 

b.      AMAC Exsite Message Format Call

The exsite function call is used to receive Server-side function execution response results from a specified URL-addressed program. The format is as follows:

exsite( URL-Address, Message-Request, Client-Destination-list)

 

c.       AMAC Samesite Message Format Call

The samesite function call is used to receive Server-side function execution response results from the same URL-addressed program. The URL-address used by this function is the current value of the Ajax.site variable setting in the Client-side program/file that issued the call. (See CSWAM Framework Document) The format is as follows:

 

samesite(Message-Request, Client-Destination-list)

 

3.      AMAC Message-Request

CSWAM employs AJAX communication protocol to transfer data-string messages between the Client (Browser) and Server executed Web-site programs. CSWAM-AMAC message strings have simple structural rules (AMDS) that enable quick efficient parsing of its information into named segment-argument and argument-field components. In most cases (99%), there is no justification to overburden Client-Server communication with the complexities and inefficiency of the esoteric XML message structure to identify and access application data within messages.

The AMAC Message Data Structure (AMDS) was designed to provide concise and versatile rules to convey data values and structures between CSWAM Client and Server side programs.

 

 

 

 

F.      AMDS Message Structure

 

CSWAM employs AJAX communication protocol to transfer data-string messages between the Client (Browser) and Server executed Web-site programs. The CSWAM/ AMAC message contents obey simple structural rules (AMDS) that enable quick parsing of its information into named arguments and argument-field components.

·       AMDS Message Data Segment Delimiters

The first 2 characters of AMDS message are delimiters used to parse the following information (char. Positions 2 – N) into distinct data segments. The first delimiter (char. position 0), is used to split the message data into Argument (A) segments. The second delimiter (char. position 1) is used to parse an argument (message-segment) into Fields (F) of argument related data.

AFmessage-data

·       AMDS Named Argument Message Data

An AMDS data argument/segment may be named (arg-name) at the beginning of its segment. This feature provides for defining different categories of information within the AMDS message-data.

 

·       AMDS Named Field Message Data

An AMDS argument field may be identified by its name followed by an “=” character (name=) at the beginning of its field. This named field feature allows for specifying different attributes of information associated with an argument/segment.

 

CSWAM employs the AMDS message structure to:

·       Forward Server function argument data.

·       Maintain Web-site general Page/Session information.

 

1. AMAC Request for Server Function Execution Message

An AMAC Server request call employs the AMDS message structure to

pass the name and arguments to a Server function for execution. The first argument is the name of the Server function to execute followed by positional or named arguments.

 

“,|ldfile,  [f]./include/amac_lib,php|  cnt=1000”

 

In this case the Server program is requested to execute its ldfile function with the following argument and field values:

 

Arg #

Arg  name

Arg-fld name

Argument/Field Value

Argument Purpose

0

 

 

 

ldfile

Function name

1

 

 

f

 

./include/amac_lib.php

Name of File contents to return

1

f

cnt

1000

Count of chars. to return

          

2. CSWAM General Page/Session information Message

The CSWAM framework maintains general session related information utilizing an AMDS the message object ( PAGE) to provide access to its content. Every AMAC Server request call forwards the PAGE message string to provide Server side access to the general Web-site session information.

 

G.     AMAC Message Channels

 

In accordance to CGI (Common Gateway Interface) conventions a Server program in execution has all output directed to its Standard-Output (Fid 1) file. This Standard-Output message is returned to the Client-side program that initiated the Server request call. AMAC message management provides unique named communication channels within this standard message response pathway. These data channels are identified as AMAC named-variables on the Client-side and AMAC named-data segments on the Server-side.

 

Client-side

Channel data reference variable

Server-side Channel Data segment Identification

Server-side Channel use

Stat.response

 

 

 

No channel identification is applied

Default/Standard Data

return channel

Stat.answer

 

 

\n[[amac-answer=channel-data]]

Data

Return channel

Stat.data1

 

 

\n[[amac-data1=channel-data]]

Data

Return channel

Stat.data2

 

 

\n[[amac-data2=channel-data]]

Data

Return channel

Stat.data3

 

\n[[amac-data3=channel-data]]

Data return channel

Stat.errror

 

 

\n[[amac-error=channel-data]]

Server Error Message return channel

Stat.ercode

 

 

\n[[amac-ercode=channel-data]]

Server Error code Message

Stat.exec

 

 

\n[[amac-exec=channel-data]]

Execute Client-side CSWAM commands

Stat.rtype

\n[[amac-rtype=channel-data]]

Specify type of response

channel data

 

 

 

I.       CSWAM Access to Container/Objects ($ object class)

 

One factor that defines the usefulness of a Web-site development/control framework is the ease of retrieving and altering ID named HTML page elements/object attributes/values.

The CSWAM framework provides simple referencing to retrieve and update all established container/object attributes and values via the ($) static class function(s)/method(s). These functions enable the programmer to:

 

Purpose

Referencing notation

Reference Description

Get an HTML object reference

node = $(id)

Variable node is set with a pointer to the id named HTML object.

 

Get an HTML object attribute

Value = $(id, attr)

Variable value is set with the value HTML id named object.

 

Set an HTML object attribute

$(id, attr,value )

The HTML id named object’s attr (attribute/style) is set with  value.

 

Clear the list of HTML Objects

$.clear(list)

$.clear(‘id-1,id-2,…’)

Clear the contents (value or innerHLML attribute) of the id named objects in list (comma delimited list of id’s).

 

 

1.      Client-side Modification of Client HTML Objects

The Client-side Web-site controller (the Browser) initiates execution of Java-script code under the following conditions:

 

·       When the requested Web-site page is retrieved. In this case all the blocks of Java-script code specified within HTML <script> and </script> tags are executed.

 

·       When the Web-site page is first started. In this case all the Java-script code within the HTML body tag onload attribute are executed (<body onload=”Java-script code    . . . >).

 

·       When an HTML container/object event ( onclick,onmove,etc) is triggered. In this case the specified attribute-event Java-script code, within the associated HTML tag, is executed.

·        

(EX: <input onclick= ”Java-script code    . . . >)

 

 

2.      Server-side Modification of Client HTML Objects via Exec-channel

 

The CSWAM framework maintains a logical message communication path (exec- channel) for the purpose of sending Server-side Java-script code snippets to its Client-side partner for execution. AMAC processes exec-channel data as the last step in completing the Server-side message response of a AMAC function execution request.

Therefore, a Server-side function can update the attributes of any Client-side HTML Object by employing the exec-channel to return ($) references for execution as below (in this example, PHP is the Server-side programming language):

 

                  _SND::rsp('exec', ("$('tfn','value','cswam.doc');") ;

 

When executed, the HTML container/object with an ID name of tfn will have it’s value attribute set to cswam.doc.

 

3.      AMAC Server Function Message Request Processing

 

One corner stone of CSWAM framework is AMAC management of message communication for Server-side function execution. AMAC processes a Server-side function request as follows:

·       Prepares a Server-side Function  request message to send to the Server(URL address)

·       Sends a asynchronous Function Request message to the Server.

·       Completes Function Request processing when the response message is received from the Server.

                                                                                                                     i.       

AMAC preprocesses all provided request message argument data for the appearance of _STR(………) method reference strings. If a _STR method string is detected, AMAC will initiate its execution and replace the original string with the _STR methods results. Since the _STR(..) method executes the string between the Parenthesis, thus  providing the means of delivering the most current HTML object attribute settings to Server-side function execution.

 

EX. onclick="samesite(',|ldfile,[f]_STR( $(\'tfn\',\'value\')','*_response,_answer' ); "

 

K. CSWAM General Page/Session information Message

The CSWAM framework maintains general session related information utilizing an AMDS message object ( PAGE) to provide access to its content. Every AMAC Server request call forwards the PAGE message string to provide Server side access to general Web-site session information:

·       Client-side Browser identification and OS information.

·       General Session type information (Client IP address, login, etc).

·        Browser Plug-in HTML OBJECT/EMBED Macro definitions.

 The first argument in the PAGE Object string is the name ’page’ followed by the following named argument entries and field data:

 

Page Argument name

Field name

Description

[Browser]

 

name=

version=

os=

 

Client Browser and OS idetification:

 

Browser name

Browser version number

Client side operating system

[Client]

 

calls=

userid=

login=

passwd=

Client Website Access Information:

The number of calls to the server

User internet identification address

User Web-site login name

User Web-site login passwd

 

swf

 

Flash Player plug-in HTML EMBED macro prototype

 

flv

 

Flow Player plug-in HTML EMBED macro prototype:

 

mov

 

Quick Time Player plug-in HTML EMBED macro prototype:

 

wmv

 

Media  Player plug-in HTML OBJECT/EMBED macro:

 

xap

 

Silverlight  Player plug-in HTML OBJECT macro prototype:

 

 

 

 

J.       CSWAM Management of Browser Plug-in (Add-on) Processors

 

Developers employ other programming languages (other than HTML or Java-script) and action processors to provide dynamic presentation activities to a Web-site design such as:

·       Flash Player

·       Silverlight Player

·       Java player

·       Quick time Player

·       Media Player

·       Flow Player

 

The Browser HTML language provides for ‘placeholder’ type statements (object and embed) to allow a ‘plug-in’ program (different instruction processor) to manage the associated container/object area within the presentation page. These placeholder type HTML statements specify the following general control features for execution of ‘add-on’(plug-in) language processors:

·       The location (area within the page) assigned to the ‘plug-in’.

·       The Server-side URL address of the ‘plug-in’ if not already Client-side resident.

·       The Server-side name (URL address) of the action type program file.

·       Argument data (HTML object or embed element attributes and processor options) to be provided for the specified ‘plug-in’ processor.

 

1.                  Plug-in File Types

 

A corner stone of Client-side (Windows) and Server-side (Web-site) system control is the format standards applied to all file names.

 

FORMAT:

Ident.Type

 

 

Ident

This is a general User-application assigned functional Identification for the file within a folder/directory.

Type

This field indicates the type of Client (Windows) or Server system component (process) to manage the file.

 

The Type portion of a Web-site file name designates what Client-side ‘plug-in’ program is used process it as follows:

 

File Type

Client (Browser Plug-in) Processor

 

 

swf

Flash Player(Action script)

xap

Silverlight Player

flv

Flow Player (movies)

mov

Quick Time Player (movies)

wmv

Media Player (movies)

class

Java Applet Player(processor)

 

2.                  Use of PAGE Object to Setup HTML Code to Execute ‘Plug-in’ type Files

 

CSWAM Framework provides the HTML statement structure to cause Browser execution of Web-siteplug-in’ type files via Session/Page data. The CSWAM session/$_PAGE object contains Macro information for each ‘plug-in’ type file that can be expanded into the correct HTML object/embed element sequence for Browser execution. The applicable Macro prototype is retrieved using the arg_data method as follows:

 

$Macro = $_PAGE->arg_data($plug-in-file-type, null, "X") ;

 

 The plug-in Macro Prototype is expanded into the correct HTML element/statement sequence (Html_seq) via execution of the _STR::make library function with the Macro prototype followed by five additional positional arguments (~1,~2,~3,~4,~5) as follows:

 

$Html_seq = _STR::make($Macro, $file, $id, $bk, $attr, $param) ;

 

 

 

Macro

The “plug-in” Macro prototype string.

file

The name of the Web-site “plug-in” file.

id

The ident attribute (id= ident) to be given the HTML object or embed element.

bk

The background color of the HTML object or embed element.

attr

Additional HTML object or embed element attribute(s)

param

Additional HTML object element param= arguments