Dec 4, 2009

Basics of iHTML

In this artilce, we are going to discuss on a clear content idea of iHTML page, a server-side dynamic web page and its basic tags in constructing a web application.

iHTML is a server side scripting language, which is used to create dynamic website and web applications. A web application is a collection of static and dynamic web pages. Static web page as the name signifies is the one that does not change when a site visitor requests it. The web server sends the page to the web browser without any modifications. In contrast, a Dynamic web page is modified by the server before it is sent to the browser. The changing nature of the page is why it’s called dynamic

Expansion of iHTML: Inline Hyper text Markup Language

What is iHTML?

  • IHTML is a server side scripting language, which is used for developing dynamic internet content.
  • IHTML provides the tools to build dynamic websites and web applications.
  • IHTML allows real time interaction between user and content being presented.

Description of iHTML

  • IHTML is a server extension tool kit.
  • IHTML is a powerful and flexible interface to ODBC (Open Data Base Connectivity) compliant databases which contain a complete set of tags that allows the implementation of additional features, flow control and mathematical calculations.
  • IHTML tags are placed directly into regular HTML files to perform additional functions such as
      • Accessing databases,
      • Performing mathematical calculations,
      • Defining IF/THEN constructs LOOPS and Error handlers.
  • IHTML is a very flexible extension, so that all Web users will be able to access all the functionalities of Web pages.
  • It is easy to learn iHTML, since the standard tag structures used in IHTML are similar to HTML.

Technologies involved in iHTML

  • Data Base integration
  • Internet
  • Dynamic graphics
  • Traditional programming
  • Back page processor
  • Flow control
  • Other technology

Database integration

It is the process of handling multiple concurrent connections to web servers and database connections between different database systems by using ODBC.

We can use iHTML to access multiple data sources in a single HTML page, since it provides database access on webpage in real-time.

The following Table contains a list of the tags associated with database access

Tag Name Function

iCOPYFILE

Copies a file on the server hard drive

BCOLUMN

Used in conjunction with iDBTABLE for defining sets of columns for its use

iDBLOOP

Allows looping through the results sets from the iDBQUERY query

/iDBLOOP

Marks the end of the iDBLOOP

iDBQUERY

Makes the SQL structure familiar to Cold Fusion users

/iDBQUERY

Closes the iDBQUERY tag structure

iDBRESULTS

Gets the results from a iDBQUERY tag set

/iDBRESULTS

Closes the iDBRESULTS tag set

iDBTABLE

Creates a table layout using the database data

/iDBTABLE

Closes the iDBTABLE tag set

iDIR

Allows the creation of fancier directory listing with filtering

iDOTDOT

Drops down one directory level on the server path

iDSN

Gets the default datasource name

iFILE

Accesses a flat text file for read, write or append purposes

iFILEINFO

Gets information/attributes about a file

iHTML

The original database tag, simply give it an SQL statement to execute

iRANDOM

Generates a random record from a database (i.e: random ads)

iSQL

For more advanced database access, such as nest queries and multiple datasources

/iSQL

Closes the iSQL tag set

iSQLCOLUMNS

Gets the column names for a specified database table

iSQLFETCH

Gets a result record one at a time

iSQLMORE

Allows the reuse of the same connection for another SQL statement

iSQLNEXTSET

Allows multiple result sets in a query

iSQLPROCCOLUMNS

Gets stored procedure columns

iSQLPROCS

Gets a list of the stored procedures for a specified database

iSQLTABLES

Gets the table names for a specified database

iSQLTRANS

Allows grouping a set of SQL commands in a transaction

/iSQLTRANS

Closes off the SQL transaction set

iTEMPNAME

Creates a temporary file name

Internet

iHTML addresses specific features that are available on the Internet such as DNS lookup, POP and SMTP Mail, Web advertisement management, or server push technology by providing its built-in features so that it reduces cost and increases the skill level of creating more advanced Web-based systems.

The following Table contains a list of the tags associated with Internet functions.

Tag Name Function

Environment Variables

Accesses Browser Type, IP Address etc., as variables in Web pages

iADDHEADER

Adds your own header information from the server

iBANNER

Completes banner ad management system in two tags

iBANNERLOG

Completes banner ad management system in two tags

iCLASSC

Gets the Class C address of the current visitor

iCLEAN

Replaces words with alternates on specified text

iCONTENT

Retrieves content type

iCOUNTER

Gets a value from automated counters for a page

iDOWNLOAD

Allows downloading of files to the browser

iFINGER

Does a finger lookup

iFORMAT

Formats results when replacing tags with data, similar to PRE

/iFORMAT

Closes the iFORMAT tag

iFTP

Opens an FTP session

/iFTP

Closes an FTP session

iFTPACTION

Performs an FTP action

iGETMIMEFILE

Gets a file that was uploaded through a browser

iGETMIMENAME

Gets the name of a file uploading with a browser

iHTMLDECODE

Replaces < and > with &lt and &gt

iHTTP

Does an HTTP request to a specified URL and returns page contents

iIP

Gets the domain given an IP or IP given the domain

iLINK

Formats an HREF link (basically just a macro)

iMAIL

Allows sending of email messages from an HTML page

/iMAIL

Closes the iMAIL feature

iPAY

Links to popular electronic payment systems

iPEEK

Used with iPUSH to determine client existence

iPING

Returns time in milliseconds for specified IP address

iPOP

Setup structure to get mail from a POP server

/iPOP

Closes the iPOP tag set

iPOPFETCH

Fetches mail messages from a POP server

iPOPHEADER

Retrieves the header information for a message into variables

iPUSH

Server Push for use in pushing graphical images to a browser client

iREDIR

Redirects the browser to a specified URL

iREM

Remarks out confidential notes, so that the View Source function in the browser cannot see them

iSRVR

Gets the value from any server or environment variable

iTELGET

Gets data for a telnet session

iTELNET

Opens a telnet session

/iTELNET

Closes a telnet session

iTELSET

Sends data for a telnet session

iTHREADS

Returns the number of active threads running on the server

iURLENCODE

Encodes characters for use in a URL (spaces, <, >, etc.) as %ascii value

iVIEWFILE

Views WP files natively on a Web page

 

Dynamic Graphics

iHTML is a powerful graphics engine. Thus, it is possible to program graphics, draw images on the fly, or overlay one graphic image on top of another within an HTML document.

Combined with the database access tools, it can be used to generate charts and graphs from data stored in a corporate database system.

No special browsers or plug-ins are required for IHTML.

IHTML can also natively load over 10 different graphics file formats such as BMP and PCX, and do the conversion to non-compressed GIF, JPC and XBM on the fly.

The following Table contains a list of the tags associated with dynamic graphics and graphics filters.

Tag Name Function

Graphics Filters

Natively loads 10 different graphics file on a Web page (BMP, PCX, etc.)

iIMAGEARC

Draws an ARC

iIMAGECLEARCOLOR

Clears a specified colors from an image

iIMAGECOPY

Copies one image to another

iIMAGECREATE

Creates a new memory position for a graphic

iIMAGEDESTROY

Destroys the image being built in memory

iIMAGEFILL

Fills an image with a particular colour

iIMAGEFROMFILE

Loads an image from a file

iIMAGEGETCOLOR

Gets the colour of a specified pixel

iIMAGEGETCOMPONENT

Gets the red, green, or blue component of a pixel colour

iIMAGEGETINFO

Gets the information on a specified image

iIMAGEGETPIXEL

Gets the colour index of pixel at x,y in an image

iIMAGELINE

Draws a line

iIMAGERECT

Draws a rectangle

iIMAGESETBRUSH

Sets a brush style

iIMAGESETINTERLACE

Sets whether a GIF is stored as interlaced (quickdraw) or not

iIMAGESETPIXEL

Sets a specified pixel

iIMAGESETSTYLE

Creates a new style for brushes and fills

iIMAGESETTRANSPARENT

Sets the image as transparent

iIMAGESTRETCH

Stretches, shrinks or resizes the image

iIMAGETEXT

Displays text in the image

iIMAGEWITHIN

Puts one image within another

iIMAGEWRITE

Writes the built image to disk

 

Traditional Programming Functions

iHTML includes features to manipulate strings, perform mathematical calculations and use or create dates.

It can create variables, find lengths of strings and perform most of the functions you would find in a traditional programming language.

The following Table contains a list of the tags associated with traditional programming.

Tag Name Function

/iFUNCTION

Ends an inline function

iABS

Gets the absolute value of a specified value

iASC

Gives the ASCII code for the specified ASCII character

iASSIGN

Creates and defines global variables

iBASECONV

Converts between different Base notations (Hex to Dec, Bin, etc.)

iBIT

Performs bitwise operations

iCEIL

Rounds a number up

iCHR

Gives the ASCII character for the specified ASCII code

iCOOKIE

Creates all cookie versions

iCRDATE

Creates a valid date string when given month, day and year

iCRDATETIME

Creates a single date/time string

iCRTIME

Creates a valid time string

iDATE

Displays the current date or specified date in any format required

iDATEDIFF

Returns the number of days between two dates

iDATEEXT

Returns extended information about a given date, day of week, day of year, etc.

iDATETIME

Returns the date and time as a single string

iDEFAULT

Sets a variable default value if not defined

iDTSTRUCT

Breaks a date into its component parts

iEQ

Creates and assigns values to variables, also for cookies (see iSET)

iEVAL

More powerful than iMATH, uses English notation for a math statement

iFLOOR

Rounds a number down

iFUNCCALL

Calls an inline function

iFUNCTION

Starts an inline function

iGMTIME

Returns Greenwich Mean Time

iISALPHA

Returns TRUE if the text is alphanumeric

iISDATE

Returns TRUE if the date is a valid format

iISDEF

Returns TRUE if the specified variable is defined

iISDIGIT

Returns TRUE if the text is numeric

iISFORMAT

Determines if a source text is of a particular format

iISLEAP

Returns TRUE if the specified year is a leap year

iISTIME

Returns TRUE if the specified time is a valid time

iISTRUE

Returns whether the argument is true or not

iLISTCREATE

Creates a new list

iLISTGET

Gets an item from a list

iLISTINSERT

Inserts an item in a list

iMATH

Does basic mathematical functions and calculations (see iEVAL)

iMATH

Performs more complicated Mathematical operations (see iEVAL)

iMAX

Gets the maximum number from a list of numbers

iMIN

Gets the minimum number from a list of numbers

iNUMTEXT

Returns English words for a specified number

iPRINTF

Like C printf functions to display text in a particular format

iREGEXFIND

Finds an item in a list using REGEX

iREGEXLIST

Handles regular expression lists

iREGEXREPLACE

Replaces items in text using REGEX

iREPLACE

Replaces certain text in a string with other text

iRNDNUM

Generates a random number between limits specified

iSET

More powerful than iEQ, allows use of multiple assignments

iSHIFT

Does bit shifting

iSTRCAT

Concatenates two strings

iSTRCMP

Compares two strings, case sensitive

iSTRCSPAN

Spans a text string until a specified character is found

iSTRICMP

Compares two strings, case insensitive

iSTRIN

Finds the position in a string of a sub-string

iSTRIPCHR

Strips characters from a string of text

iSTRJUST

Justifies specified text to left, right or center

iSTRKEEP

Keeps or omits certain characters within a string

iSTRLEFT

Gets the left specified number of characters

iSTRLEN

Gets the length of a string

iSTRLPAD

Pads a string to the left with a specified character

iSTRLWR

Changes the string to lower case

iSTRNCMP

Compares two strings for N characters, case sensitive

iSTRNICMP

Compares two strings for N characters, case insensitive

iSTRREM

Removes a sub-string from a text string

iSTRREV

Reverses a string

iSTRRIGHT

Gets the right specified number of characters

iSTRRPAD

Pads a string to the right with a specified character

iSTRSPAN

Like Basic mid$, returns text from a specified position in a string

iSTRTRIM

Trims a string from the left or right of spaces

iSTRUPR

Changes the string to upper case

iSTRWITH

Includes or excludes a sub-string in a string

iTIME

Displays the current time in specified format

iTIMEDIFF

Returns an amount of time between two times

iTIMESLOT

Performs the specified action if the current time is within the specified time

iUNDEFINE

Undefines a variable

iUNDEFINESET

Undefines a set of variables

iVAL

Gives the value of leading numeric characters on a string

 

Backward Page Processing

A powerful capability of IHTML is a set of unique background page processing features.

IHTML allows the creation of true web applications and works like adding a processor to a web page that can access and run that page in the background and perform the specified functions.

IHTML can be used to build many applications, such as a Mailing List manager that could poll a mail server, query a database for subscriber email addresses and redistribute that mail to the subscribers.

The following Table contains a list of the tags associated with back page processing

Tag Name Function

iBPPE GUI

Graphical Interface for entering pages to be Back Processed

iCGI

Runs any CGI, EXE, or Batch program on the server

iHTX

Hooks to add custom user written DLL programs within iHTML

iSCHEDULE

Allows addition of entry to the Back Page Processor Engine

Flow Control and Error Handling:

IHTML adds logical processing to Web pages with the following constructs:

  • WHILE loops,
  • IF/ELSE constructs
  • CASE statements
  • FOR/NEXT looping capabilities

IHTML allows the inclusion of one HTML file within another and when processing is finished on one page, the browser can automatically be redirected to another page.

The following Table contains a list of the tags associated with flow control

Tag Name Function

iAUTHOR

Leaves the original source in the page sent to the browser

/iAUTHOR

Ends the iAUTHOR block

iBREAK

Breaks out of a loop or case statement

iCASE

Allows actions based on different cases (see iIF)

/iCASE

Closes the iCASE tag set

iCLEAR

Clears all processed content from the buffer

iELSE

Executes the FALSE block

iELSEIF

Acts as an IF statement on an ELSE

iERROR

Creates an error block that is executed on an error

/iERROR

Closes the error block

iERRORPAGE

Actions to take on an error, provides more diagnostics

iHEAPDUMP

Displays all the defined variables and values as well as error codes

iIF

Checks a TRUE or FALSE condition, and executes the TRUE block

/iIF

Closes the iIF tag set

iINCLUDE

Includes an HTML file within another, for reusing code

iLOOP

Loops a certain number of times

/iLOOP

Closes the loop block

iNAP

Waits for a specified period of time

iREMBLOCK

Block out sections of code

/iREMBLOCK

Closes the iREMBLOCK tag

iSTOP

Stops page execution

iSWITCH

Used with iCASE for a default condition

/iSWITCH

Closes the iSWITCH tag set

iWHILE

Loops while a specified statement is TRUE

/iWHILE

Closes the iWHILE tag set

Other Technology

IHTML has tags that perform hardware manipulation including access to joysticks, serial ports, pagers and fax machines.

It is also possible to use IHTML tags to make registry setting changes within Windows NT.

IHTML can also configure itself with the back page processor application.

The following table contains a list of the tags associated with other technology

Tag Name Function

iCONFIG

Configures iHTML registry settings

iFAX

Sends faxes from the Web server (needs Fax modem)

/iFAX

Closes the iFAX tag set

iPAGER

Send messages to a numeric/alphanumeric pager (needs modem)

iREFRESH

Rereads the program settings from the registry

iREGKEY

Allows reading and writing to Windows NT registry key

iREGVAL

Allows reading and writing to Windows NT registry key

iSHIFT

Does bit shifting

iSVC

Starts and stops NT services

iVIDCAP

Captures live video from Connectix, or any AVI device onto the Web

iVIEWFILE

Views WP and other files natively on the Web without conversion

 

IHTML File Elements:

An iHTML file consists of a sequence of the following elements:

  • Tags
  • Colon variables
  • Name Value Pairs
  • Text
  • iHTML Markers

The Attributes for each of the above files are as follows:

  • Tags may contain the following:
  • an HTML or iHTML tag name
  • colon variables
  • name value (NV) pairs
  • text
  • Colon variables may contain the following:
  • a colon as a starting delimiter
  • white space or tag delimiters as an ending delimiter
  • clean text only between the delimiters
  • period (.), underscore (_), dollar sign ($) and dash (-) are also valid characters for a colon variable
  • Name Value Pairs may contain the following:
  • a white space beginning delimiter
  • a clean text name
  • an = combined with optional white space delimiter
  • a clean or quoted text or tag or colon variable for a value
  • a white space or end of tag delimiter
  • Clean text may contain the following:
  • any characters except ", white space, and < or >
  • A “sign may be present if escaped by %.
  • A number cannot be the first character of a variable except when used in a database query as the column number.
  • Quoted text may contain the following:
  • quotation delimiters on each end
  • a combination of clean text and white space between delimiters
  • tags and variables
  • escape characters
  • iHTML Markers include following tags, such as
  • iERROR, /iERROR, iWHILE, /iWHILE, iPOP, /iPOP, iCASE, /iCASE, iSQL, /iSQL, iLOOP and /iLOOP. They are treated differently by the parser, and their locations within the source file determine what and how other things are parsed.

How iHTML integrates with the Web Server

The following procedure explains the process of how iHTML integrates with the Web server. The integration is completed through the following steps:

1. IHTML gets initialized the moment when a client browser requests a page on the Web server running IHTML. This depends on the webserver.

2. The HTTP request is intercepted by IHTML, after the server has loaded it into memory based on the mimic type mapped to the IHTML engine.

3. A quick check is done to see if the <!ihtml> tag is on the page. If it is, then IHTML knows that it needs to parse that page; otherwise control is given back to the web server software.

4. The IHTML parsing engine checks for tags that start with <i and if it is a known tag, the tag resolves to data which may be from the server environment, a database, hardware device, etc. IHTML is recursive so it is possible to store variables and other tags within other variables or a database. When these are resolved the new results on the page are resolved. In this way, your HTML pages can change on the fly.

5. Once all processing is done, IHTML passes the page back to the Web server.

The Web server then sends the page to the client browser.

Diagram to represent iHTML Connections

The following figures show a graphical representation of this procedure, as well as the IHTML parsing procedure.

clip_image002

Actions mentioned by Numbers

1. Client requests a page on the Web server

2. Server loads the requested Page

3. IHTML engine intercepts the processing request

4. IHTML searches the requested file and run queries. Replace its tags with data.

5. Requested Page is then sent to server.

6. Server sends the page obtained to client.

0 comments:

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by