AJOMS Tutorial

 

This tutorial is an Overview of AJOMS (Asynchronous JavaScript Object Management System), a unique Web-site development and execution Client-side Framework. Before proceeding the reader should have a basic understanding of JavaScript (JS, Object Oriented Programming (OOP), and Time Sharing (TS) Process/Thread execution control concepts as well. It would also be useful to have some understanding of other Web technologies such as:  HTML, CSS, AJAX, JSON, and JQUERRY.

 

1.    AJOMS Framework Synopsis and Nomenclature

 

The AJOMS Framework manages the creation, servicing, updating, and termination of all Active Page Object(s) (APO’s) and their associated control code AJOMS Thread Object(s) (ATO’s) of the Web-site design. An AJOMS Framework employed Web-site design begins with the division/layout of the Page/Document  into  Primary visual  elements called Frames.  A Frame is a “Place-holder” APO of fixed location and size within the Page/Document.  (A “Place-Holder” is an HTML instruction type DIV or SPAN declared APO whose “innerHTML attribute’s contents, at any point in time, specify the current HTML instructions presenting the visual and functional state of the Frame ).

 

There are two types of Frames: Static (Fixed Contents), and Dynamic (Changing Contents). Static Frames house the application’s non-changing contents, such as: Title info, Logos, Banners, Site navigation lists, Frame Control ICONs, etc. Dynamic Frames are employed by varied Application Methods/Functions ATO’s to receive input and display processing results such as:  play requested Videos, obtain Server-side interface data (i.e., SQL data-base interface, etc.),  query Page/Document APO’s to set, request and display contents, specify and validate application input data, etc.

 

The location and size of an AJOMS Framework  APO (Frame or element type)  must  always be specified in absolute  terms (which makes its location and size   positions always relative to the devices’ (PC, Smart Phone, IPAD. etc.)  Page  representation at any point in time).

 

All  AJOMS Framework  operations are dependent on the named identification of all Objects (APO and ATO) created within the Client-side of the Application Web-Site.

An Active Page Object (APO) is identified by a unique  HTML “ID” attribute that must be assigned at its creation.  The absolute location (Top & Left)  and size (Height & Width) attributes of a APO is established or altered via changes to it’sstyle”  settings via:

 

a.      ACCESS command (JQUERY  like ) “style”  references to the ID-named Frame or Element APOs and/or named Cascading Style Sheet (CSS) table entries.

b.      HTML In-line Style specifications accompanying the HTML ID-named Object  creation.

c.       A named Class entry in the Cascading Style Sheet (CSS) table/file, that  specifies the associated HTML object (APO)  Location and Size style attributes.

 

 An Ajoms Thread Object (ATO) is identified by a unique Thread Process ID Number (PID) assigned via execution of an ajoms function. At invocation, the “ajoms function  will:

 

a.      Instantiate an Ajoms  Thread Object (ATO) in a “free” entry position  (TID) of  the  AJOMS Thread Entry Table (Ajoms.Entry ).

b.      Assigns a unique  thread Process ID (PID) number to the new Thread Object Xecution Table entry(ATOXT).

 

1.1.   AJOMS Class

 

The AJOMS Framework  is an Object Oriented Class  of predefined Methods, and Attributes that when enhanced with User/Application Methods/functions and attributes  provides  the  Web-Site programmer with its’  asynchronous mechanism to accomplish  application goals in a single page Client-side execution program design. AJOMS is written in the Object Oriented JavaScript Programming language. JavaScript is an interpretive programming language, that provides strict/consistent Client-side programming, Visual Presentation,  and Server-side  interface functionality Standards employed by all Internet Accessing device (PC’s, Ipods, Tablets, Smart Phones, etc.) Processors  (Browsers).

The Ajoms class statement provides access to all the framework Web-site Design and execution facilities. When a Class Statement (Class-Function) is instantiated, the result is an independent asynchronous program Object that has accesses to all Framework Methods and  Capabilities and Application Designed Method Features. The format  of  a  Class statement to declare a Web-site Application’s Function/Method participation in the Ajoms JavaScript Object Management System  (AJOMS) Framework features  is as follows:

 

Ajoms_class.prototype.Method  = function(Args)

 

a.      Method   -   The name of the Class Method/Function

b.      Args   -   The  AJSON*-structured Argument list of the Method Object

 

NOTE:  AJSON is the standard AJOMS notation to communicate/pass  information ( named data) between Client and/or Server side Methods/functions.  AJSON, the notation used in the AJOMS framework, is an extension of the Jva-Script Object Notation  (JSON) universal named data standards ( See Section C. of this Overview).

 

1.2.  AJOMS Object Creation/Instantiated Function

 

The ajoms function encapsulates Ajoms Thread Object (ATO) creation (via Ajoms_class instantiations, and table managed access to Framework facilities (Predefined Methods and data/attributes). This simplified function establishes an Ajoms Object Thread (ATO) to be installed in a free table entry position (TID)  in the AJOMS Thread Entry Table,  associate with a  declared destination(s) Frame(s) ( APO’s). An ATO entry is employed, via class extended methods and data, to perform asynchronous operations upon XML/HTML a page container-object(s) (APO’s) and to separately (asynchronously) control discrete logics of the desired WEB application functionality and rendering. Each AJOMS Dispatch Cycle, an Ajoms.Entry  table entry (ATO) is  placed in execution  based on a “Round-robin” like scheduling/time-sharing algorithm.

           

            Function call to create an Ajoms Thread Object (ATO):

 

                        ajoms(ATO-input data, APO-frame-id(s))

 

1.3.  AJOMS Method/Function Data Communication Standards

 

The AJOMS framework requires data structure conformity to exchange named data Items (arguments and results) between Program Object Methods/functions.  The AJOMS data message  structure  (AJSON) is an extension of  the format for  JSON universal data structure standards:

 

{“AJOMS-method”:JSON-data-format}

 

a.      AJOMS-method   -   The name of a declared Client-side Ajoms_class.prototype method/function  or Server-side function to process the named data.

b.      JSON-data-format   -    The JSON structure of  named data

a.      {“data-type”:{“name1”:”value1”, ”: “name2”:”value2”,.’.}}

 

           

Example:

 

 

AJOMS('{"IO_getdir":{"d":"./music","ICborder":"BORDER"}}','_data1' );

 

 

 

1.4.  Active Page Object (APO) Addressing

 

Active Page Objects (APO’s) are all the HTML elements accessible within the Page/Document at any point in time. These Objects are created and destroyed by the application of new HTML instructions/statements directed to a parent Frame Place holder or to a specific APOinnerHTML” attribute.  Each AJOMS APO must have been assigned an IDentification  (ID)  name at its’ creation, such that  it can be addressed to alter its’ functionality or existence via the application of APO altering  commands  (AJOMS ACCESS command)  at a later date.

 

APO ID’s are assigned as follows:

 

a.      By the Website Programmer,  to define a Frame APO (Static and Dynamic /Place-holder)  of the Application Design, and (automatically)

b.      By AJOMS framework logic, when creating the fixed position layout “Grid”, within a Frame ,  of APO member ICONS in response to AJOMS “Surface” method  request specifications (arguments).

c.       By AJOMS framework logic, to establish Static Frame ICON entries, when requested/specified, for the purpose of providing the Website applications’  User community  with ” Dynamic Frame Control”.

 

 

1.5.  Ajoms Thread Object (ATO) Creation

The AJOMS Framework is coded in JavaScript (JS), the standard Language of all Web-site Browsers. AJOMS internal design takes full advantage of the dynamic “Object Oriented” nature of JS to provide its’ Asynchronous Object management Services:

 

a.      A Single Parent Class Function  (Ajoms_class)  for all  AJOMS System and Web-site Application  Method/functions.

b.      Ajoms_class  System and Application Associated (Prototype)  Class Functions/Methods.

 

Format: Ajoms_class.prototype.Func-name (Ajoms Class Method)

 

An Ajoms Thread Object (ATO) is created by Instantiation (Objectifying)  the Framework Ajoms_Class function:

 

ATO =  new Ajoms_Class ( Method&Args, Frame-APO –ID )

 

a.      ATO   -    Object Created ,Initialized, and Placed in the AJOMS Thread Entry Table.

b.      Method&Args    -  A JASON string of Ajoms class Method/Function and argument data  to instantiate the (ATO) thread.

c.       Frame-APO –ID  -  The Frame APOs associated with this object thread.

 

All  JS/AJOMS Object Methods and named storage are automatically accessible and/or created  when  referenced. AJOMS Thread Object (ATO) methods and named storage are referenced(ref) in two ways:

 

a.      this.ref - Direct reference to the established Object in the ATET

b.      Ajoms[tid].ref - Ajoms Thread Entry Table[tid].

 

1.5.1. Thread (ATO)  Method Global Storage Referencing

 

A  thread (ATO), using the AJOMS Method (this.ajoms), can specify execution of a named ATO Methodand/or Server-side Function  in the course of performing their defined goal(s):

 

a.      Client-side Method - this.ajoms(‘{“Method”:{Args}}’) ;

b.      Server-side Function - this.ajoms(‘*{“Function””:{Args}}’) ;

 

 In these cases the invoked methods employ the ATO’s Global storage referencing standards (this.ref) to access variables.

 

 

1.5.2.  AJOMS Reserved Class and Object (ATO) Names

 

Since AJOMS named control Functions/Methods and storage occupy the same Object Space, Web-site programs cannot use any of  AJOMS reserved names for Application purposes:

 

 

Ajoms

ajoms

AJOMS

STATE

CNTRL

AJAX

EXEC

NOTIFY

Stat

AJargs

mk_entry

SETUP

aj_init

_RESP

SETerr

ISiterr

ermode

ERproc

SRVopen

SRVsend

IO

DISPATCH

Mesg

 

 

 

 

1.6..  AJOMS Message Control Structure (AJSON)

 

AJSON is an enhanced version the Java Script Object Notation (JSON) named data standards. All Java Script Language processors (Browsers and Server-side Library utilities) abide by the JSON standards to describe named-data values and tree level membership :

 

     {……………..}

 

a.      Named Variable Value            “name”:”value ,……

b.      Named-Array Values             name”:[“val-1”,”val-2”,…]

c.       Next Tree level name “name”:{……………..}

 

AJSON standards enhances JSON by allowing the second character (position 1) , in the text declaration , to substitute for all double quote  (“) characters  of  a JSON structure:

 

            {“ ~=  {^ ~= {!  ~= {.

 

AJOMS employs the AJSON standards to sanely exchange data internally (Client-side Methods) and externally (Server-side functions):

 

a.      To initiate an AJOMS Thread Object (ATO) with named-data for processing on the Client-side or cause execution of a function on the Server-side of the Web-site Application.

b.      To standardize the structure of named-data conveyed (called and returned) by Methods/Functions invoked by an ATO.

 

1.7.  Active Page Object  (APO) Control

 

The Client-side JavaScript Processor  (Browser)  manages the attributes (ID, node-name, etc.), state,  and visual presentation of all active  Page Objects  via its internal Document Object Model (DOM) tables. Page objects are created by HTML instructions provided at page initialization/ startup and later by modifications made to an Object’s Parent  Document Object Model (DOM) entry.

 

The Style (size, position, color, index, etc.) of a Page Object is established at Page Initialization:

 

a.      Via the in-line HTML style declaration, and/or

b.      Specifications of a named (style-rule) entry within the Browsers Cascading Style Sheet (CSS) table.

 

1.7.1. AJOMS Object/CSS  Access Command

 

The AJOMSACCESS” command provides complete read/write access to APO conditions (Style, Attributes, etc.) via its’ address ( ID name and tree path members):

 

Format: $_(address).type({‘condition’, value})

 

Format:

$_(address).obj ( ‘attr’, value)           

 

Set Attr. value 

 

$_(address).obj(‘attr’)           

 

Get Attr. value

 

$_(address).obj()       

 

Get Object Node

 

$_(address).nodes()   

 

Get array of Nodes

 

$_(address).style ( ‘key’)

           

Get Style value

 

$_(address).style ([‘key: value’,.])

           

Set Style value (s)

 

$_(address).event ( ‘event’, action(s))           

 

Set event action(s) 

 

$_(address).event ( ‘event’)   

Get event value 

 

1.7.2. AJOMS Command Access to CSS Information

 

 

The ACCESS Command also provides read/write access to Style Rule information in the Browser CSS table:

 

Format:

$_(:rule}).cssstyle()    

Get  Style rule

 

$_(:rule}).cssrule(‘REMOVE’)

Remove Style Rule

 

$_(:).cssrule({‘ADD’, new-rule})

Add new Style Rule

 

 

1.7.2. AJOMS Internal Use of the ATO/CSS ACCESS Command

 

 AJOMS uses the ACCESS command extensively to assist in providing predefined ATO Methods, and for scheduling ,  dispatching,  and  logging of  asynchronous Threads (ATO’s).

 

2.  AJOMS Framework Execution Environment

 

The client-side JavaScript instruction interpreter (Browser) is an Event driven Processer. The Browser executes JavaScript instructions and handles all external triggered event notifications established (via declared “event handling” code) by Application Program logic:

           

a.      Application’s initial (HTML, CSS & JavaScript) code has “Loaded” (“onload”), and

b.      Mouse or Touch-screen movements and Clicks/Touches associated with  APO elements,  and

c.        Timer run-out notifications, and

d.       Embedded Device (Ex. mp4 video) control processing signals, and

e.        Server-side Message response notification status updates.

 

 2.1. Browser Control Processing

 

            The Browser is a multi-language  (JavaScript & HTML)  text statement processer and Run-time Page Object Management controller for all internet accessing devices( PC, Ipads, Ipods, Smart phones, etc). Of course all device Browsers must execute text language statements and manage Page objects exactly the same to assure Web-site/Internet Application program sanity:

 

a.      Update Browser  Document Object tables caused by changes in the conditions  (HTML Creation, Deletion, or Style modifications) of  page APO’s, and

b.      Scan for triggered events to process for notification and handling, and

c.       Maintain/generate the current page visual presentation image based on the current state of the Page/Documents APO style conditions.

 

2.1.1.  Browser JavaScript Language processing

 

JavaScript is the programming language provided by the Browser for Web-site Application design.  JavaScript is an “Object Oriented” type language, whose text statements are interpreted (decoded and executed), dynamically at “run time” by the Browser.

 

2.1.2. Browser Page Object Management

 

The visual presentation of an Application Web-Site is provided by a “tree-structure” network of related Presentation, Input-data, and “Place-Holder” type Application Page Object elements (APO’s).

The Browser provides a simplified manner of managing Page Objects via it’s  Hyper Text Markup Language (HTML) that can Create  and Destroy APO elements within the Page/Document. HTML Statements placed within the BODY section of an HTML file or assigned to the “innerHTML” attribute of an existent Page element (APO)Object will be translated into a new network of APO elements.

AJOMS provides a simplified means of obtaining and altering the attributes and style of Page Objects via AJQUERY references.

 

2.1.3.   Browser Event Processing

 

When an event occurs (is triggered), the Browser will execute the Application’s declared JavaScript code to “handle” the event. Control reverts to normal Browser functional activity, when:

 

a.      Application Event Handling code completes, or

b.      A JavaScript function return statement is executed that returns to the end of Application Event Handling code.

 

2.2.  AJOMS Thread Object (ATO) Creation and Processing

 

The AJOMS Framework provides for the: Creation, Termination, Execution, and Suspension (Sleep state) of all asynchronous program threads (ATO’s):

 

A.   Creation – A program thread object (declared as a named method (NM) of the AJOMS class ) is created by the ajoms function call with argument data (including the method name (NM), and it’s associated  Frame ID (APO) reference. The created thread/object is saved in a free position (TID) of the AJOMS Active Thread Table Array (ATTA).

 

B.  Termination – An active program thread (ATO) is terminated (removed from the AJOMS Active Thread Table (ATTA) when:

 

1.      The Thread (ATO) issues an AJOMS END instruction (END method call).

2.      When a create new thread (ATO) call (ajoms, AJOMS, or SURFACE) is issued, all current Threads (ATO’s) associated with the Frame Are terminated.

3.      When an AJOMS Frame (APO) is cleared (via a $.clear method call), all Threads (ATO’s) associated with the Frame are terminated.

4.       When a logged entry (sleeping) in a Frame log queue is awakened/restored (via a manual Restore click), the current Thread (ATO), if any, associated with the Frame is terminated.

 

C.  ExecutionAJOMS dispatches program-threads (ATO’s) for execution, within the AJOMS Active Thread Table (ATTA), via ATO-Frame queues in an equitable “Time Sharing” manner. Each dispatch cycle:

 

1.      The oldest “Schedule-time” member in the next ATO-Frame queue is selected, and

2.       The ATO’s “Schedule-time” is updated (set to the current Time Of Day (TOD), and

3.       The ATO’s “PASS” value (0-n) is updated by 1, and

4.      The ATO thread is placed in execution (a call issued to the ATO Method name (NM).

 

D.  Dispatching - During each Dispatch-cycle, AJOMS selects the oldest “Schedule-time” entry from its Active Thread Table (ATTA) ready for execution. A Dispatch-cycle is initiated (A call is made to the AJOMS Dispatch function):

 

1.      Upon completion of processing a new Thread (ATO) function (ajoms call), and

2.      As a result of a “timer” event notification to itself, queued by the Dispatch function, at completion of each Dispatch-cycle.

 

2.3.  AJOMS Frame Controls ( Logging, Restoring , Clearing)

 

The “Ajoms.LOG. frames” statement, when employed,  enables Application  code to permit User control of  specified Frame contents (APO/ATO) Logging, Restoring, and Clearing. When executed, the “Ajoms.LOG. frames” statement places three adjacent colored selection ICONS above on the right-hand side of each specified Frame:

 

Icon Position

Icon Symbol

Icon Color

Frame Control Operation When Icon Selected (Clicked)

Left

-#-

Blue

Restore the contents of the Frame (APO and ATO) with the saved Frame data from the top position of the Frame’s  Log-queue”.

Center

-^-

White

Log/Save the current contents of the Frame (APO and ATO) in the top position of the Frame’s  Log-queue”.

Right

-x-

Red

Clear the Frame contents (APO and ATO)

 

 

 

           

           

 

 

 

3 . Application Programming in the AJOMS Environment

 

The AJOMS Framework may seem somewhat incomprehensible; however an astute programmer should have little trouble using its unique programming language, guidelines, and features to accomplish their Web-site Application design tasks. The following are some basic tenets of Application program execution in the Browser Event Driven and AJOMS Control Environment :

 

3.1. The Browser executes (passes control to)  pre-established/programmed JavaScript “Event-code elements” when their associated events are triggered (occur).

(Events such as:   Mouse actions,(Like onclick, when positioned over a visual page object (APO) , Time of Day (TOD) notification, Etc.)

 

3.2.  A  Web-site Application consists of  table positioned (tid) resident AJOMS named method Objects (Ajoms.Entry[tid]).  Each Object is instantiated  (objectified) from their named JavaScript program Method/Function declaration which becomes an addition  to the single AJOMS parent Class, “Ajoms_class “:

 

Format: Ajoms_class.prototype.method_name = function()

 

3.3.  Once created, Application Object Global named storage and functions  are referenced as follows:

 

Name  Reference Type

Format

this pointer

this.name

Ajoms Table Array Entry

Ajoms.Entry[tid]. name

 

 

 

3.4.  AJOMS Creates Program Thread Objects (ATO’s) and Dispatches execution in a equitable “Round-robin” manner.

 

 An Application Program thread  (ATO), in the AJOMS environment, is a grouping of JavaScript “Event-code elements”,  to process the occurrences of specific internal conditions and/or external events.

 

a.      AJOMS dispatches all Application Threads (ATO’s) at a “Method- name”  location  (initially the Class name/ATO name), and

b.      When  AJOMS  Dispatch logic selects the next Program (ATO) for event processing execution, the  Method’s  PASS count  this.PASS()” is updated;   initially it is set to 0(zero) and subsequently  incremented  by 1(one) to reflect Method/Function re-entry.

 

3.5. Types of AJOMS Functions and Methods

 

An AJOMS Program Thread Object (ATO) may be comprised of conventional function routines and a variety of  Class Method types of components. There are four types of AJOMS routines available to provide Application Thread logic structural functionality and access to Global and/or Local defined object storage:

 

Program Element

Access to ATO  Global Storage

SERVER-side  Access

Event PASS managed

Routine Return operations

Main ATO  Ajoms CLass Created Method

yes

yes

yes

End Statement execution terminates ATO

Subroutine (SUBR) Method

yes

yes

yes

RETURN statement terminates execution and returns control and data to caller.

Object Method

yes

no

  no

Standard JavaScript return(data) statement

JavaScript Function

no

no

no

Standard JavaScript return(data) statement

 

 

3.6. AJOMS Program Threads (ATO’s) “event-cycle passes

 

An AJOMS program/ thread (ATO) , is associated with a Page Object (APO), and executes in cycles/passes processing its’ established event  notifications. Each time a thread (ATO) is dispatched the relevant named-method “event-cycle passes” counter is incremented. A thread (ATO) can obtain its’ current state of the “event-cycle passes” counter, via the AJOMSPASS” method:  this.PASS(). An AJOMS program consists of one or more cycles (passes)  of: an  Event request followed by its’ completion  notification event:

 

Thread  Event Request

Completion  Event

this.PASS() Notification Value

ATO  Method Invocation

Initial call to Method (ATO Initialization code)

0

this.NEXT(Wait-time))  Statement request for notification when aspecified wait-time is reached

Requested wait-time Notification  is reached

N + 1

this.CONTINUE(n)  resets the PASS counter to re-process method code.

Changes the PASS value for next ATO cyccle

N (value set by CONTINUE statement)

this.SERVER statement Request for Server-Side Action (SQL, File data, Etc.)

Server-side completion message

N + 1

Call to a SUBR declared Method.

RETURN statement execution within the SUBR method

N+1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.7 Subroutine Method Execution and event-cycle passes

 

A Subroutine  Method can initiate/call another Method (with/or without arguments) that processes in an “event-cycle passes” mode. A subroutine executes in a similar fashion as a Main ATO, by processing one or more cycles (passes) of  Event requests, and then exiting via a RETURN statement  to the calling Method.

 

            FORMAT: this.method(args)


3.7.1  Subroutine Establishment Statement (this.SUBR(name)

 

The Subroutine Method  identifies itself by executing a SUBR(name)  Statement at commencement of its logic. to establishes its’ initial “event-cycle passes” counter value( 0),            FORMAT: this.SUBR(“method-name”)

 

For each cycle, the relevant Subroutine’s named-method “event-cycle passes” counter is incremented. The method logic can obtain the current state of its’ “event-cycle passes” counter, via the AJOMSPASS” method:  this.PASS().

 

Subroutine Event Request

Completion  Event

this.PASS() Notification Value

Execution of SUBR(name) statement to identify Method as a Subroutine

Completion of SUBR(name) statement

0

this.NEXT(Wait-time))  Statement request for notification when aspecified wait-time is reached

Requested wait-time Notification  is reached

N + 1

this.CONTINUE(n)  resets the PASS counter to re-process method code.

Changes the PASS value for next ATO cyccle

N (value set by CONTINUE statement)

this.SERVER statement Request for Server-Side Action (SQL, File data, Etc.)

Server-side completion message

N + 1

Call to a SUBR declared Method.

RETURN statement execution within the SUBR method

N+1

RETURN statement execution

The subroutine method is ended and control and data(if specified) ispassed to  the callers return event.

 

 

 

3.7.2  Return From a Subroutine Method (RETURN Statement)

 

An AJOMS Subroutine type method  must execute a RETURN statement to complete its logic:

 

            FORMAT:  this.RETURN(Subr-name”, Return--data)

 

Execution of the RETURN  statement completes the Subroutine logic as follows:

 

a.      The “Invoker/caller” Methods’ “event-cycle passescounter is incremented, and

b.      The “Invoker/caller” is dispatched with the specified “Return-data”, if any’, as a first argument provided to Invoker/caller”.

 

 

 

 

3.8.  AJOMS Program Thread Objects (ATO’s)  execute in either of  two modes:

 

a.      Normal – In this mode the Program thread Object (ATO) executes for two (2)  event-cycle passes  or until an AJOMS “END” statement is detected. This mode is specified by a call to the “ajoms”, or “surface” function to create the method thread (ATO).

b.      Stay – In this mode the Program thread Object (ATO)  stays” permanently executable (it can process any number of “event-cycle passes” ).  Execution of an AJOMS “END” statement will not terminate the thread (ATO). This mode is specified by a (uppercase) call to “AJOMS”, or “SURFACE” function to create the Method thread, or the Objects Method name is specified as an argument to the  Ajoms.ATO.stay function.

 

3.9.  AJOMS/Browser HTML Text Processing

 

The Browser Executes Text Language statements (HTML, XHTML, HTML5)  that  generate, remove, and modify the style of page element objects  (APO’s), communicate with external logic (Server-side Applications, etc) and control embedded systems (Video Player(s), etc.). The AJOMS framework utilizes this Browser  HTML Text processing capability to implement all its’ Page element (APO) modifying logic.

At any point in time  theinnerHTML attribute of a page element (APO) describes/defines, in HTML representation, the layout of elements (APO’s) below it (“Children”) in the Page/Document “tree” structure. The AJOMS framework alters Page element (APO’s) structures via Text (HTML statement s) assigned to “parent” level page elements’ (APO’s), via their  innerHTML” attribute.

 

3.10.   AJOMS Text Processing and Macros

 

The AJOMS framework performs its’ major operations based upon the standard structure of Text strings: HTML statements and JSON constructed Method argument and Results information.  To accommodate these dynamic text creation needs, AJOMS provides a Macro expansion function (“_STR.xmacro”) that can generate a resultant text string by expanding a Macro definition (“Template”) with positional referenced text argument data . The _STR.xmacro  functions’ arguments  are specified in:

 

a.      An array containing the Template Text in array location (0), followed by positional replacement text (args-1-n)  in locations ( 1-n) of the array, or

b.      Argument positions (Arg-0 thru Arg-n ) of the STR.xmacro function call, with the Macro Template  specified in Arg-0  and its’ expansion data in (Arg-1 thru Arg-n )

 

FORMAT:

_STR.xmacro([Template,arg-1,arg-2,…,arg-n]), or

 

_STR.xmacro(Template,arg-1,arg-2,…,arg-n)

Template

Text output definition for expansion with argument substitution locations noted with a tilde character(~) followed by the argument reference number (~1 thru ~n).

arg-1 – arg-n

The Text strings in the argument array (1 – n) to replace the Template  references (~1 - ~n) during the Macro expansion process.

 

 

4. AJOMS Server-side Interface

 

AJOMS provides requirements for the exchange of information with a Server-Side Program. The exchange is in the form of a Message, sent to a Server-side program requesting  service (File access, SQL data base operations, Etc.)  and  a Message response  at completion of the desired  service.  AJOMS manages Thread (ATO) Message communication by assigning a  Browser AJAX communication  object to provide the Client-Server data channel pathway.

 

 

 

4.1. Request for Server-side Program Service (SERVER Statement)

 

Of course,  a most important element in any Web-site Framework is the ease and competency of message communication with companion Server-side components to request and receive data.  The AJOMS Framework Manages communication with Server-side Web-sites Utilizing Object (ATO)  independently assigned  AJAX  Communication Engine Software. This unique approach provides separate communication channels between an AJOMS Object Thread (ATO) method and a desired function within a selected Server-side Web-site program. The Server-side program URL address (SRV-Addr ) and the ‘link type’ of the  CGI” message conveyance (Post separate message:Post-Flg = 1) are assigned by the standard AJOMS  SERVER Statement  format (Option 1) or may be specified in (Options 2 and 3 ) of the SERVER Statement formats( See Below).

 

In the standard SERVER Statement  case (Option 1 ), AJOMS  obtains the  URL (Universal Resource Location ) address of a Web-site Server Program  From the contents of the AJOMS URL Web-site variable (Ajoms.site). The contents of  Ajoms.site” is initially set to the URL address (“Ajoms.url”) of the Client_side program with the “_client name portion changed to “_server”:

Ajoms.url = window.location.pathname; Ajoms.del = '_' ;

Ajoms.site = _STR.beg_str(Ajoms.url,Ajoms.del) + Ajoms.del + 'server.'                                       +_STR.end_str(Ajoms.url,'.') ;

 

4.1.1.  AJOMS SERVER Statement  Format

 

The AJOMS SERVER  Statement  is used to pass a “JSON” structured Service Request Message  to a Server-side Function (Req-funct) with named argument data (Req-Args), and and recieve a Response Message triggered event,. There are three (3) types of SERVER Statements formats for Service Request Message communication :

 

FORMAT:

1.     this.SERVER(“Req-funct”,’ Req-Args);

2.     this.SERVER(“Req-funct”,’ Req-Args’,’SRV-Addr)

3.     this.SERVER(“Req-funct”,’ Req-Args’,’SRV-Addr’,’Post-flg);

 

 

 

EXAMPLE: this.SERVER(getinfo",’tp":{"file":{"name":"'+this.file+'"}}’);

 

 

 

Request Message Example

getinfo

The Server-side request Function Service name

tp

The type key for  the request

file

Request is for a Server-side file

name

Tag that indicates data is a file name

this.file

File name

 

 

4.1.2.  AJOMS Server-side Message Processing Standards

 

AJOMS will send it’s Service Request  Message, utilizing AJAX Comunication logic,   to a  Web-site (URL) program via a named variable (ajoms-rqst) within the CGI (Common Gateway  Interface) standard protocol structure: (ajoms- rqst=Request Message&ajoms-page=value).  The Contents of the JSON structured Request Message contains the type of service requested (Req-funct) and the named data ( Req-Args) for processing the request.

 

a.     Response Message text must be preceded with a two character Response Message Descriptor (RMD). The first position (RMD[0] ) is an octal value specifiing the named variable delimiting character (‘\5’), and the second position (RMD[1]) specifies the delimiter for the contained named variables (‘=’).

b.    The AJOMS compliant Server program processing the request responds by generating a text string, beginning with Response Message Descriptor  (RMD), followed by message text containing one or more named variables (name=value)  separated by RMD [0]  delimiters.

c.      The Server program can signal failure status via the contents of a generated predefined named variable (ermesg) , and AJOMS,  during Response Message processing , will detect its’ presence, abort the thread  (ATO)  and report (alert) the error message.

 

4.1.3.  AJOMS Server-side Program

 

The Client-side AJOMS Application depends upon a Server-side Program(s) to interface (API) external   functionalities (Data bases, File systems, Email, Etc.).

The language (PHP, C, C++, etc.) available to program the AJOMS Server-side support page(s) varies depending on the Server system (Apatche, MS, etc.). In this example of AJOMS,   Apache is the Server system software and PHP4 is the supported Server-side programming Language and Utility Library (The AJOMS Server-side Programming Support Program is: ajoms_server.php).  If a programming language, other than PHP is selected for AJOMS Server-side deployment, all the existing AJOMS built-in API interfaced features (contained in “ajoms_server.php”), would have to be duplicated/programmed in that language and its’ library.

 

4.1.4. AJOMS Processing of Server-side Response Message

 

An AJOMS Service Request Message may be thought of as an external event definition and when completed/triggered (it’s Response Message is received and processed), it becomes a completed external event for the thread (ATO) that issued the request. When a Response Message is received, AJOMS identifies its’ associated Thread (ATO, generates an array of  Response Message elements (from the “Rep-Del“ delimited segments),  and performs the following processing operations: for each Response Message element:

 

a.     If the Element contents do not begin with a ‘name=’ string, the contents are stored in  the  AJOMS” global variable (“this.Stat.AJOMS”).

b.    If the Element contents begin with an ‘ermesg=’ string, the value of ermesg is reported  (alert) and the associated Thread (ATO)  processing is aborted (this.END).

c.      If the Element contents begin with an ‘DEBUG=’ string, the value of DEBUG is reported  (alert) .

d.    If the Element contents begin with a ‘name=’ string (not “ermesg=”), the value of the “name=  element  is stored in  the  AJOMS” global variable (“this.Stat.name”).

 

After all the Elements are processed , the  this.ajoms” NEXT-Method-name  argument’s  PASS()  Counter is incremented, and  the  NEXT-Method is dispatched for execution.         

 

 

5.  AJOMS Programming Statements

 

AJOMS is an Event driven Framework facility, and that concept must be understood to effectively construct program threads to complete a Web-site’s Application development goals.

Each thread (ATO) component of Application program design must determine the events that it will manage and then develop the logic to initiate and handle their occurrence in a cyclical re-entrant fashion (PASS  0 - N) to completion. The basic AJOMS structured design dictates that the initial pass  (PASS(0) ) through the thread logic receives the named Input Argument Data (JASON Structure) and establishes the Global Storage required for the remainder of the Re-entrant Event Coded Passes (PASS(1 – N) through the thread (ATO) logic. The following is a summary of the AJOMS Programming Statements designed to assist in the development of AJOMS Framework Managed Web-site Event-driven Applications.

 

5.1.  AJOMS Programming Statement Descriptions

 

STATEMENT  FORMAT

 

DESCRIPTION

AJOMS(“Method-name”,” arg-data”,”APO-id”)

Create (instantiate) an Object Thread (ATO) of the method (Method-name) with argument data (arg-data), for management of a Page Object /APO (APO-id).

this.SUBR(name)

Register the current Method (name) as a Subroutine. The SUBR statement must appear in the beginning of the method code. Subroutine logic terminates, and generates a completion event to the caller Method, upon execution of a RETURN statement.

this.SERVER(“req-func”, ”req-args”)

The SERVER Statement  sends a “JSON” structured Service Request Message  to a Server-side Function (Req-funct) with named argument data (Req-Args), and triggers a Service Completion event with data, when the Server-side responds.

this.PASS()

Return the current event cycle/ PASS number (0 – N) of the parent  ATO  or subroutine (SUBR) method code.

this.NEXT(wait-time)

Trigger an event cycle for an ATO or Subroutine (SUBR) Method after waiting the specified micro-seconds  of time (wait-time).

this.CONTINUE(PASS-reset)

Continue parent ATO or Subroutine Method Event processing at the reset (PASS-reset) value  for event cycle PASS() counter.

this.RETURN(name,data)

Exit from Subroutine (name) and trigger an event re-entrance cycle for the calling method including specified return argument data (data).

this.END(end-flg)

End the existence of a “Temporary” status  THREAD  (ATO), and  if the flag ( end-flg) is specified, end the Thread (ATO)  regardless of  thread status.

this.SPAWN(pass,ATOname,ATOargs,APO-id)

Create/Spawn a “child  thread (ATO) with “Wakeup” info for notification to the “Parent/this. ATO “ upon completion.

1. pass –the  PASS() value to be set for  the parent (this.ATO)  Wakeup” notification when the spawned Child ATO completes its logic ( executes this.EXIT() statement).

2. Child ATO creation Data:

a. ATOname -  Method name

b. ATOargs -  Method arguments

c. APO-id of the Managed Page Object (APO)

 


 

 

 

5.2.   Sample AJOMS Method Program

 

The following is a simple example of employing the AJOMS Framework to create a simple Thread/Method (“PR_file”) that displays the contents of a Server-side file  file” in an APO  (ID = “_Page”) :

 

<?php include "gtes.js";include "amac.js"; ?>

<html xmlns="http://www.w3.org/1999/x9html">

<script language="JavaScript">

function startup()

            {

            Ajoms.site = 'ajoms_server.php';

            Ajoms.LOG.frames(['_Page']);

Ajoms_class.prototype.PR_file = function()

            {

            var answer ;    

            if( !this.PASS() )

                        {

                        this.file = this.Mesg.get('f','Z') ;

                        this.html = "<textarea  style='~1' >~2</textarea>";

                        this.style = "height:100%;width:100%;background-color:#FFFF00";

                        this.SERVER("getinfo",'"tp":{"file":{"name":"'+this.file+'"}}','ajoms_server.php' ) ;

                        }

            else

                        {

                        answer = this.Stat.AJOMS ;  

                        $_(this.STATE.DEST[0]).obj('innerHTML',

                                    _STR.xmacro([this.html,this.style,answer])) ;

                        this.END();                            

                        }

            };        

            AJOMS('{"PR_file":{"f":"./Comands.txt"}}','_Page') ;                    

            };

</script>

<body onLoad="startup();">

  <div id='_Page' style='position:absolute;top:4%;left:0%;width:100%;height:92%'></div>    

</body>                                             

</html>