menu
  Home  ==>  papers  ==>  web  ==>  intraweb_architecture   

Intraweb Architecture - Felix John COLIBRI.


1 - Intraweb, the VCL for the Web

IntraWeb is a Delphi Tool used to build web sites. The developer creates pages in the same way that he builds Windows application:
  • by selecting controls from the Palette
  • and droping them on a design surface which is the template of the future window (HTML page) that the User will see.
Things get a little bit more complex since the HTML pages are not directly loaded from the User PC, but are requested from a Web Server. So IntraWeb places the templates on the Web Server, and the Server loads them and ships them to the User.

In this paper, we will present:

  • a general explanation about how the Delphi Rad, machinery, Palette, Object Inspector and tForm, can be used to produce .HTML pages
  • the two basic IntraWeb working modes: Application mode and Page mode
  • finally the IntraWeb CLASS architecture



2 - How a RAD HTML generator works

Let's assume that we want to generate the following simple .HTML page:

image

To produce .HTML pages, we must generate an .HTML file with a content similar to:

 
<HTML>
  <BODY>
    <FORM method="POST" ACTION="http://127.0.0.1/scripts/training.exe"><BR>
      <TABLE width="100%">
        <TR >
          <TD >
            <TABLE width="100%" bgcolor="#FFBBFF">
              <TR >
                <TD width="22%" valign=top>
                  <IMG SRC="pascal_institute_2.jpg">
                </TD>
                <TD >
                  <H3>Delphi Training Courses</H3>
                </TD>
              </TR>
            </TABLE>
          </TD>
        </TR>
        <TR >
          <TD >
            <TABLE width="100%" cellpadding=4>
              <TR >
                <TD width="23%" bgcolor="#FFBBFF" valign=top>
                  <A HREF="delphi_tutorial">Delphi Tutorial</A><BR>
                  <A HREF="dellphi_2006">Delphi 2006</A><BR>
                  <A HREF="interbase_client_server">Interbase C/S</A>
                </TD>
                <TD bgcolor="#FFFFFF">
                  The Pascal Institute organizes each month
                  Delphi Trainings. To get the list of all
                  available dates:<BR>
                   <UL>
                     <LI> Delphi Tutorial
                     <LI> Delphi 2006 for .Net
                     <LI> Interbase Client Server<BR>
                  </UL>
 
                  To get the full documentation, and the
                  calendar of the next sessions, please
                  enter your e-mail and
                  clic the "Submit" button:<BR>
                  <INPUT TYPE="text" NAME="Edit1" VALUE="my.mail@xxx"> <BR>
                  <INPUT TYPE="submit" NAME="Button1" VALUE="submit"> <BR>
                </TD>
              </TR>
            </TABLE>
          </TD>
        </TR>
        <TR >
          <TD >
            <TABLE width="100%" bgcolor="#FFBBFF">
              <TR >
                <TD width="23%" valign=top>
                </TD>
                <TD >
                    <A HREF="index">Felix Colibri Home</A><BR>
                    <A HREF="source_code">Articles</A> with
                    full Source Code<BR>
                </TD>
              </TR>
            </TABLE>
          </TD>
        </TR>
      </TABLE>
    </FORM>
  </BODY>
</HTML>

And to do so, we can

  • create a Delphi tForm, with tPanels used as layout containers:

    delphi_web_designer

  • analyze the tForm.Controls array to generate the .HTML page


A complete Delphi feasability project transforming a standard tForm with tPanels used as formating containers into an .HTML page has been presented in the Delphi Web Designer paper.

Instead of using standard tPanel as layout containers, IntraWeb offers many dedicated components, usually descending from the standard Delphi tEdit, tButton, tCheckBox. And in addition, IntraWeb offers either the complete .HTTP Server (the Application mode) or allows to call the generated pages as ISAPI filters (the Page mode)




3 - Intraweb "Application mode" and "Page mode"

IntraWeb contains 2 sets of components:
  • those used at design time
  • those included in the runtime project
The design-time components (Wizards, PROPERTY Editors, Designers) will help us to create the web pages. They are incorporated in the Delphi IDE, and using them will produce UNITs which represents our pages.

The produced pages can

  • either be sent to the User by using an IntraWeb .HTTP Server
  • or used as ISAPI .DLLs, called by Microsoft IIS (Internet Information Server) or the Apache Server


This can be represented by the following figure:

image

where:

  • the Delphi + IntraWeb framework are used to generate the pages (the deep blue rectangles)
  • a runtime, we can use
    • either the IntraWeb standalone .HTTP Server
    • or any standard Server, like IIS


    The runtime block diagram looks like this:

    intraweb_block_diagram



On the Client side
  • the User can load IntraWeb pages from a large variety of Browsers, including Internet Explorer, Opera etc
  • the pages sent to the User include JavaScript code, which is interpreted by the JavaScript interpreter installed on the User PC
  • we can also use .XML files to cache some data at the User PC



4 - The Intraweb Class Library

4.1 - The Intraweb CLASSes

We looked at the Intraweb 5.3 classes and, based on the inheritance of each CLASS, we came up with the following organization:

TIWBaseControlClass(TControl)
  TIWControlClass(TIWBaseControlIIWControl)
    TIWCustomObjectClass(TIWControl)
      TIWActiveXClass(TIWCustomObject)
      TIWCustomFlashClass(TIWCustomObject)
        TIWFlashClass(TIWCustomFlash)
      TIWCustomQuickTimeClass(TIWCustomObject)
        TIWQuickTimeClass(TIWCustomQuickTime)
      TIWMPEGClass(TIWCustomObject)
    TIWAppletClass(TIWControl)

    TIWCSCustomNavigatorClass(TIWControl)
      TIWCSNavigatorClass(TIWCSCustomNavigator)
    TIWCustomButtonClass(TIWControl)
      TIWButtonClass(TIWCustomButton)
    TIWCustomCheckBoxClass(TIWControl)
      TIWCheckBoxClass(TIWCustomCheckBox)
      TIWDBCheckBoxClass(TIWCustomCheckBox)
    TIWCustomDynamicChartClass(TIWControl)
      TIWDynamicChartClass(TIWCustomDynamicChart)
    TIWCustomDynamicChartLegendClass(TIWControl)
      TIWDynamicChartLegendClass(TIWCustomDynamicChartLegend)
    TIWCustomDynGridClass(TIWControl)
      TIWDynGridClass(TIWCustomDynGrid)
    TIWCustomEditClass(TIWControl)
      TIWCustomFileClass(TIWCustomEdit)
        TIWDBFileClass(TIWCustomFile)
        TIWFileClass(TIWCustomFile)
      TIWDBEditClass(TIWCustomEdit)
      TIWEditClass(TIWCustomEdit)
    TIWCustomGridClass(TIWControl)
      TIWCalendarClass(TIWCustomGrid)
      TIWDBGridClass(TIWCustomGrid)
      TIWGridClass(TIWCustomGrid)
    TIWCustomImageClass(TIWControl)
      TIWDynamicImageClass(TIWCustomImage)
        TIWImageClass(TIWDynamicImage)
        TIWDBImageClass(TIWDynamicImage)
      TIWImageFileClass(TIWCustomImage)
    TIWCustomLabelClass(TIWControl)
      TIWCustomCSLabelClass(TIWCustomLabel)
        TIWCSLabelClass(TIWCustomCSLabel)
      TIWDBLabelClass(TIWCustomLabel)
      TIWLabelClass(TIWCustomLabel)
    TIWCustomListComboClass(TIWControl)
      TIWCustomComboBoxClass(TIWCustomListCombo)
        TIWComboBoxClass(TIWCustomComboBox)
        TIWDBComboBoxClass(TIWCustomComboBox)
        TIWDBLookupComboBoxClass(TIWCustomComboBox)
      TIWCustomListboxClass(TIWCustomListCombo)
        TIWDBListboxClass(TIWCustomListbox)
        TIWDBLookupListBoxClass(TIWCustomListbox)
        TIWListboxClass(TIWCustomListbox)
    TIWCustomMemoClass(TIWControl)
      TIWDBMemoClass(TIWCustomMemo)
      TIWMemoClass(TIWCustomMemo)
    TIWCustomRadioGroupClass(TIWControl)
      TIWRadioGroupClass(TIWCustomRadioGroup)
      TIWDBRadioGroupClass(TIWCustomRadioGroup)
    TIWCustomRectangleClass(TIWControl)
      TIWRectangleClass(TIWCustomRectangle)
    TIWCustomTextClass(TIWControl)
      TIWDBTextClass(TIWCustomText)
      TIWTextClass(TIWCustomText)

    TIWDBNavigatorClass(TIWControl)
    TIWHRuleClass(TIWControl)
    TIWLinkBaseClass(TIWControl)
      TIWCustomURLClass(TIWLinkBase)
        TIWURLClass(TIWCustomURL)
      TIWLinkClass(TIWLinkBase)
    TIWListClass(TIWControl)
    TIWMenuClass(TIWControl)
    TIWProgressBarClass(TIWControl)
    TIWTimerClass(TIWControl)
    TIWTreeViewClass(TIWControl)
    TIWURLWindowClass(TIWControl)
  TIWControlAccessClass(TIWBaseControl)

TIWContainerClass(TScrollingWinControl)
  TIWModuleDsnClass(TIWContainer)
    TIWBaseFormClass(TIWModuleDsn)
      TIWFormClass(TIWBaseForm)
        TIWAppFormClass(TIWForm)
          TIWShowMessageClass(TIWAppForm)
        TIWPageFormClass(TIWForm)
  TIWRegionClass(TIWContainer)

===

TIWPaintHandlerClass(TObject)
  TIWPaintHandlerDsnClass(TIWPaintHandler)
    TIWPaintHandlerButtonClass(TIWPaintHandlerDsn)
    TIWPaintHandlerCheckBoxClass(TIWPaintHandlerDsn)
    TIWPaintHandlerComboBoxClass(TIWPaintHandlerDsn)
    TIWPaintHandlerComponentClass(TIWPaintHandlerDsn)
    TIWPaintHandlerCSNavigatorClass(TIWPaintHandlerDsn)
    TIWPaintHandlerDBNavigatorClass(TIWPaintHandlerDsn)
    TIWPaintHandlerEditClass(TIWPaintHandlerDsn)
    TIWPaintHandlerHRuleClass(TIWPaintHandlerDsn)
    TIWPaintHandlerImageClass(TIWPaintHandlerDsn)
    TIWPaintHandlerLabelClass(TIWPaintHandlerDsn)
    TIWPaintHandlerLinkClass(TIWPaintHandlerDsn)
    TIWPaintHandlerListClass(TIWPaintHandlerDsn)
    TIWPaintHandlerListBoxClass(TIWPaintHandlerDsn)
    TIWPaintHandlerMemoClass(TIWPaintHandlerDsn)
    TIWPaintHandlerProgressBarClass(TIWPaintHandlerDsn)
    TIWPaintHandlerRadioGroupClass(TIWPaintHandlerDsn)
    TIWPaintHandlerRectangleClass(TIWPaintHandlerDsn)
    TIWPaintHandlerTextClass(TIWPaintHandlerDsn)

TIWBaseClass(TObject)
TIWFileParserClass(TObject)
TIWFormListManagerClass(TObject)
TIWFormPreviewGeneratorClass(TObject)
TIWLicenseClass(TObject)

TIWFileReferenceClass(TPersistent)
  TIWBackgroundClass(TIWFileReference)

TIWGridBorderColorsClass(TPersistent)
  TIWDynGridBorderColorsClass(TIWGridBorderColors)

TIWBorderOptionsClass(TPersistent)
TIWDBNavConfirmationsClass(TPersistent)
TIWDBNavImagesClass(TPersistent)
TIWDefaultDynGridCellClass(TPersistent)
TIWFontClass(TPersistent)
TIWJpegOptionsClass(TPersistent)
TIWMenuStyleClass(TPersistent)
TIWURLTargetClass(TPersistent)
TIWReEntryOptionsClass(TPersistent)
TIWSSLOptionsClass(TPersistent)
TIWTemplateFilesClass(TPersistent)
TIWTreeViewImagesClass(TPersistent)

TIWLayoutMgrBaseClass(TComponent)
  TIWLayoutMgrClass(TIWLayoutMgrBase)
    TIWLayoutMgrFormClass(TIWLayoutMgr)
    TIWLayoutMgrHTMLClass(TIWLayoutMgrIIWLayoutMgrHTML)
    TIWTemplateProcessorHTMLClass(TIWLayoutMgr)

TIWApplicationClass(TComponent)
TIWHTTPServerModuleClass(TComponent)
TIWHTMLManagerClass(TComponentIDesignNotificationIHTMLLayoutComponent)
TIWStandAloneServerClass(TComponent)
TIWModuleControllerClass(TComponentIWebDispatch)

TIWClientSideDatasetBaseClass(TComponent)
  TIWClientSideDatasetClass(TIWClientSideDatasetBase)
  TIWClientSideDatasetDBLinkClass(TIWClientSideDatasetBase)

TIWHTMLElementClass(TCollectionItem)
  TIWHTMLTagClass(TIWHTMLElement)
    TIWHTMLTableClass(TIWHTMLTag)
  TIWTextElementClass(TIWHTMLElement)

TIWGridCellClass(TCollectionItem)
  TIWCalendarCellClass(TIWGridCell)
  TIWDBGridColumnClass(TIWGridCell)

TIWColorFormClass(TForm)
TIWDsnTreeViewClass(TFormIIWTreeViewDesigner)

TIWServerControllerBaseClass(TDataModule)

TIWPageProducerClass(TCustomPageProducer)
TIWServerClass(TCustomWebDispatcher)
TIWSessionsClass(TThreadList)
TIWStreamClass(TStream)
TIWTagParamsStringListClass(TStringList)

===

TIWCalendarCellsClass(TOwnedCollection)
TIWDBGridColumnsClass(TOwnedCollection)
TIWGridCellsClass(TOwnedCollection)
TIWHTMLTagCollectionClass(TCollection)
TIWObjectParamClass(TCollectionItem)
TIWObjectParamsClass(TOwnedCollection)
TIWScriptEventsClass(TOwnedCollection)
TIWScriptEventsItemClass(TCollectionItem)
TIWTreeViewItemClass(TCollectionItem)
TIWTreeViewItemsClass(TOwnedCollection)

TIWApplicationWizardClass(TNotifierObjectIUnknownIOTARepositoryWizardIOTAProjectWizardIOTAWizard)
TIWDataModuleCreatorClass(TNotifierObjectIOTAModuleCreatorIOTACreator)
TIWDataModuleFileClass(TNotifierObjectIOTAFile)
TIWDataModuleFormFileClass(TNotifierObjectIOTAFile)
TIWDataModuleHeaderClass(TNotifierObjectIOTAFile)
TIWProjectCreatorClass(TNotifierObjectIOTAProjectCreator50IOTAProjectCreatorIOTACreator)
TIWProjectFileClass(TNotifierObjectIOTAFile)
TIWServerControllerCreatorClass(TNotifierObjectIOTAModuleCreatorIOTACreator)
TIWServerControllerFileClass(TNotifierObjectIOTAFile)
TIWServerControllerFormFileClass(TNotifierObjectIOTAFile)
TIWServerControllerHeaderClass(TNotifierObjectIOTAFile)
TIWUnitCreatorClass(TNotifierObjectIOTAModuleCreatorIOTACreator)
TIWUnitFileClass(TNotifierObjectIOTAFile)
TIWUnitFormFileClass(TNotifierObjectIOTAFile)
TIWUnitHeaderClass(TNotifierObjectIOTAFile)
TIWUnitWizardClass(TNotifierObjectIUnknownIOTARepositoryWizardIOTAProjectWizardIOTAWizard)

TIWMainUpdateSessionsClass(TIdNotifyMethod)

TIWColorEditorClass(TColorPropertyICustomPropertyListDrawingICustomPropertyDrawing)

TIWPreviewFormClass(TDefaultEditor)
TIWImageListClass(TImageList)
TIWTreeViewComponentClass(TComponentEditor)

===

TLayoutMgrHTMLComponentClass(TComponentEditor)
TLayoutMgrHTMLPropertyClass(TPropertyEditor)

TLocalSelectionClass(TDesignerSelections)
TPersistentCrackerClass(TPersistent)
TRC4Class(TObject)
TSessionTimeoutThreadClass(TThread)
TSWServiceModuleClass(TService)
TSWServiceThreadClass(TThread)
TSyncLogClass(TIdNotify)
TTreeViewItemsPropertyClass(TPropertyEditor)

TformAppWizardClass(TForm)
TformFormWizardClass(TForm)
TFormIWMainClass(TForm)
TfrmEventsEditorClass(TForm)

THTMLPaletteItemClass(TObject)
THTTPFileClass(TObject)
THTTPFilesClass(TObjectList)



It would have been possible to present those in simplified block diagrams, or in full fledged UML CLASS diagram, but, given the sheer number of those CLASSES, we feel that the resulting huge map would have been difficult to use. In addition, the Intraweb hierarchy is not very deep.



4.2 - The CLASS Organization

The above structure is a pure syntactical construction. It would be more helpful to separate the classes according to where they are used
  • at design time only: those CLASSEs are used to integrate IntraWeb to the Delphi IDE. The developer will use them implicitely to build the pages, but they will not be part of the deployed files. In this category, we can place:
    • all the Property Editors
    • OTA (Open Tool Api) extensions (the CLASSes that help expand the base IDE
  • at runtime
    • by the IntraWeb Server
    • by the WebBroker or DataSnap ISAPI libraries


In addition, to better group the CLASSes, it would be necessary to fully analyze the IntraWeb feature list. For instance, IntraWeb:
  • manages sessions
  • has access to databases
  • manages several .HMTL pages


4.3 - Intraweb UML Class Diagram

We wrote a 160 K IntraWeb tutorial (referenced by GOOGLE), and therefore had to dwelve more into the Page mode CLASSes.

For the Page mode:

  • the ServerController is a tDataModule descendent, mainly used for handling
    • User sessions
    • exceptions
    Here is the (partial) CLASS diagram

    servercontroller_class_diagram

  • tIwAppForm is the ancestor of all our pages, and is used as a container for our IntraWeb controls. It contains all page properties

    The (partial) CLASS diagram is:

    iwappform_class_diagram

  • tIwAppForm uses one of the tIwLayoutMgr to layout the controls:

    intraweb_iwlayoutmgr_class_diagram

  • the tIwApplication CLASS can be described in more detail by:

    intraweb_iwapplication_class_diagram

  • when a user opens the connection, tIwControllerBase starts a new User session, which creates a new tIwApplication with a new pages list, one of those pages being the active page:

    intraweb_servercontroller_application_form



All those CLASS diagram were build by looking into the help, the Object Inspector and the Delphi 6 IntraWeb .DCUs. It goes without saying that it would have been a lot easier if AToZed (the IntraWeb editor) somehow published the UNIT INTERFACEs.




5 - Building Web Sites with Delphi

5.1 - IntraWeb in perspective

There are many other way to build Web sites with Delphi. To name a few:
  • non-RAD approaches:
    • CGI or ISAPI helper libraries (hRef or similar)
    • WebBroker and DataSnap, which are part of Delphi
  • RAD building tools
    • from Developper Express, there is Internet Express Web (IEW)
    • on the Microsoft front, there are .ASP and .ASP .NET
    • and, of course, IntraWeb
The first Delphi tools available (WebBroker and WebSnap) were non-RAD. Nobody could understand why Borland, who had offered us the Delphi IDE, never added a true .HTML RAD tool. Well, IntraWeb did the trick, and since Delphi 7, it seems to be one of the most popular tools.



Here are a couple of links with comparisons of the IntraWeb, Developer Express and Asp.Net approaches, and they contain additional references:



5.2 - Our Site Building Framework

Note that we use a different approach to create our pages. First we created our site before IntraWeb was offered on the Delphi Palette. And, more important, our site mainly contains static text pages with a couple of images. So a text editor is more appropriate than a "control layouter".

Therefore:

  • we simply write pages with our custom ColiEd editor. This is a simple text editor like Notepad, and writing the text is lightning fast. In addition to the ASCII content that you see, each page also contains
    • some markers to incorporate .PNG images
    • some simple typographic tags to delimit .HTML links or headers, add bullets or other typographic features like bold italic etc
  • the .ED file is placed in the appropriate folder. The disc organization exactly mirrors the hierarchical site path organization
  • we then use a Delphi project, SiteEditor to transform each .ED editor file into an .HTML file.
    The generator then adds the purple outer region which contains:
    • the top location link (where you are in the page tree)
    • the left-side indented menu
    • the bottom addresses
    And navigation links between pages are built according to the disk pathes



6 - Your Comments

As usual:
  • please tell us at fcolibri@felix-colibri.com if you found some errors, mistakes, bugs, broken links or had some problem downloading the file. Resulting corrections will be helpful for other readers
  • we welcome any comment, criticism, enhancement, other sources or reference suggestion. Just send an e-mail to fcolibri@felix-colibri.com.
  • or more simply, enter your (anonymous or with your e-mail if you want an answer) comments below and clic the "send" button
    Name :
    E-mail :
    Comments * :
     

  • and if you liked this article, talk about this site to your fellow developpers, add a link to your links page ou mention our articles in your blog or newsgroup posts when relevant. That's the way we operate: the more traffic and Google references we get, the more articles we will write.



7 - Intraweb Home Page

IntraWeb was originally designed by Chad Z. HOWER, alias KUDZU, back in 1996/97, and was then called Portcullis/IAG. Chad was the creator of Winshoes, later renamed Indy, which is the actual Socket and TCP/IP Protocol component suite implementation for Delphi. This explains why IntraWeb includes a full featured .HTTP Server, even including the very nice SSL layer.

The current version of IntraWeb is maintained by a developer team at Atozed Software. Chad is no longer actively involved with IntraWeb's further development. He is still an end user of IntraWeb and gives input to the development team.

We also wish to thank all of those who corrected our first presentation of this Intraweb history.



The IntraWeb product as such is available since Delphi 7. The 5.3 version is also backward compatible with Delphi 6. With Delphi 2006 Architect, we had the version 8. We usually do not perform third product overview, but since this once came with Delphi ...

The above CLASS list was analyzed on the 5.3 free trial version. This is mainly because we have a Delphi 6 .DCU analyzer, and analyzing the IntraWeb version which comes with Delphi 2006 would require the upgrade of our .DCU analyzer to handle those binaries.



You will find more information, as well as demo versions (not time limited, but some features are not available) and the full version at:




8 - The author

Felix John COLIBRI works at the Pascal Institute. Starting with Pascal in 1979, he then became involved with Object Oriented Programming, Delphi, Sql, Tcp/Ip, Html, UML. Currently, he is mainly active in the area of custom software development (new projects, maintenance, audits, BDE migration, Delphi Xe_n migrations, refactoring), Delphi Consulting and Delph training. His web site features tutorials, technical papers about programming with full downloadable source code, and the description and calendar of forthcoming Delphi, FireBird, Tcp/IP, Web Services, OOP  /  UML, Design Patterns, Unit Testing training sessions.
Created: jul-07. Last updated: jul-15 - 98 articles, 131 .ZIP sources, 1012 figures
Copyright © Felix J. Colibri   http://www.felix-colibri.com 2004 - 2015. All rigths reserved
Back:    Home  Papers  Training  Delphi developments  Links  Download
the Pascal Institute

Felix J COLIBRI

+ Home
  + articles_with_sources
    + database
    + web_internet_sockets
      – tcp_ip_sniffer
      – socket_programming
      – socket_architecture
      – simple_web_server
      – simple_cgi_web_server
      – cgi_database_browser
      – whois
      – web_downloader
      – web_spider
      – rss_reader
      – news_message_tree
      – indy_news_reader
      – delphi_web_designer
      – intraweb_architecture
      – ajax_tutorial
      – bayesian_spam_filter
      + asp_net
    + oop_components
    + uml_design_patterns
    + debug_and_test
    + graphic
    + controls
    + colibri_utilities
    + colibri_helpers
    + delphi
    + firemonkey
    + compilers
  + delphi_training
  + delphi_developments
  + sweet_home
  – download_zip_sources
  + links
Contacts
Site Map
– search :

RSS feed  
Blog