119904418 intraweb tutorial 2

Upload: lucasfranca

Post on 04-Jun-2018

281 views

Category:

Documents


2 download

TRANSCRIPT

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    1/69

    Criando um dialog de confirmao

    1. Adicione um TIWButton no form.

    2. Implemente a propriedade Confirmation do TIWButton.

    3. Desta forma, s ir chamar os eentos do !ot"o, se no Dialo# o usurio confirmar.

    Chamando um evento do boto com JavaScript

    1. Adicione um TIWEdit e um TIWutton no form.

    !. "o evento #nClic$ do boto% digite&

    WebApplication.Sho'(e))age*+te)te+,-

    . "a propriedade ScriptEvent) do Edit% digite&

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    2/69

    /e))a forma% 0uando for pre))ionado E"TE no Edit% ir2 chamar o evento onClic$ do oto.

    Intraweb

    PorRafael E. Guarasemini

    1. O que Intraweb?

    Intraweb uma biblioteca de componentes de desenvolvimento de htmls deforma simples, rpida e eficiente. Este biblioteca desenvolvida pela empresawww.atozedsoftware.comque trabalha com tecnoloia para Internet a !" anos.

    2. Recursos

    # biblioteca de componentes do Intraweb traz a maioria das ferramentasnecessrias para o desenvolvimento de web paes, adicionando a facilidade deprorama$%o de ferramentas de desenvolvimento de sistemas.

    & Intraweb esta dispon'vel para vrias linuaens de prorama$%o, entre elas(

    o )orland *elphi+ ferramenta base para este documento-o )orland /li0+o 1icrosoft 2isual .net+o )orland 3 )uilder+o Etc...

    mailto:[email protected]://www.atozedsoftware.com/mailto:[email protected]://www.atozedsoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    3/69

    &s componentes fornecem desenvolvimento de sites convencionais, din4micos,com acesso a base de dados, utiliza$%o de 566, anima$7es em eral.

    3. Funcionamento

    & desenvolvimento de sites com o Intraweb bastante simples, seufuncionamento em um servidor de Internet tem como funcionamentodetalhado na fiura abai0o(

    #s aplica$7es Intraweb, diferente do desenvolvimento tradicional de web site,

    era apenas ! arquivo, onde nele contm todo o pro8eto desenvolvido come0ce$%o base de dados e fiuras-.

    3.1. Tipos de sistemas em Intraweb

    Para se desenvolver sistemas utilizando o Intraweb necessrio saber alumascoisas, principalmente, sobre onde ficar esta aplica$%o, isto quer dizer, qualser o sistema operacional e qual ser o servidor de web dispon'vel para seutilizar.

    9endo estas respostas necessrio saber a quais sistemas operacionais e aquais servidores de web o Intraweb fornece suporte de desenvolvimento.

    & Intraweb oferece suporte para tais sistemas(

    1icrosoft :indows I66 #pache;inu0 utlizando o )orland/li0-

    #pache

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    4/69

    4. Comeando a utii!ar o Intraweb

    & )orland *elphi oferece as duas alternativas de desenvolvimento com oIntraweb citados no cap'tulo anterior. 6endo estes encontrados em(

    ile? =

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    5/69

    Insira uma diretiva de ;oad1odule, onde deve ser colocado o nome do searquivo .so, sendo a sinta0e a seuinte(

    LoadModule nome do module gravado nome do .so

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    6/69

    4.3. "ppication Form

    6eue o esquema de quando se esta desenvolvendo um sistema convencionalno *elphi e se dese8a inserir um novo >ormulrio.

    Este 'cone apenas acrescenta uma nova pina >orm- para se desenvolver.

    4.4. I%"&I "ppication

    tiliza para desenvolver aplica$7es para servidor 1icrosoft :indows utilizandoservidores de Internet I66.

    5omo compila$%o final, erado uma dll deve ser confiurada da seuinteforma e0emplo-(

    5opie do arquivo I6#PI9ER.dll do diretBrio de instala$%o do *elphibinnetsc%00- para 123etsca%eServer3sa%i45am%lesdiretBrio de

    instala$%o do servidor-

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    7/69

    orm ao mais sinistro 99ee5hart.

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    8/69

    # 5;J F 5omponent ;ibrar/ for 5rossFPlatform K s%o quase todos oscomponentes do *elphi, s%o utilizados para se desenvolver uma aplica$%o no*elphi e preparaFla para ser recompilada no )orland /li0 no ;inu0. #inda nemtodos os componentes que e0istem na 25; e0istem na 5;J, mas em breveser por completo.

    &s componentes n%o s%o separedos em 25; e 5;J, o que for 25; , tambm 5;J, isso pode ser reparado no cBdio fonte dos componentes.

    & Intraweb no *elphi divido em L palhetas, cada uma dividida por cateoriade componentes, desde componentes simples como o 9I:;abel ocomponentes 9;abel da 25;- como componentes para cria$%o de rficosdin4micos 9I:*/namic5hart similar ao 9*)5hart da 25;-.

    ma caracter'stica importante que os componentes do Intraweb sB podemser utilizados em aplica$7es Intraweb e essas aplica$7es tambm sB aceitamseus prBprios componentes. m 8eito de se certificar disso tentar colocar um

    componente da 25;D5;J em uma Intraweb #pplication.

    ".!.&s 5omponentes 6tandard

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    9/69

    '.3. Os componentes Cient %ide

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    10/69

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    11/69

    Estes outros componentes s%o todos encontrados na 2;5 do *elphi e a suamanipula$%o id@ntica se proramados em sistemas convencionais.

    5omo podemos visualizar na fiura abai0o, estamos utilizando checMbo0,listbo0, combobo0, edit, button e shape , onde, cada um desses componentesest%o referenciados a partir da 25;, para se utilizar os do Intraweb, bastacolocar o prefi0o I: ao nome dos componentes, com e0ce$%o do shape que noIntraweb se chama I:Rectanle e inferior ao shape.

    uanto a utiliza$%o, id@ntica a prorama$%o com a 25;.

    ).4. ,-empo 4

    uivo?,string?,string?,boolean:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    12/69

    ).'. ,-empo '

    ile.

    & I:>ile esse con8unto de cai0a de te0to e o bot%o (rocurar. Essecomponente parecido com o O%enDialogda 25;, ele permite voc@ buscar noseu hd o arquivo para se fazer upload, esse processo, ele faz sozinho.

    Para se efetuar o upload de um arquivo, h uma fun$%o do componenteI:>ile(

    Save)o7ile8%ath?:

    salva %ara o hd o ar>uivo escolhido

    &u

    Save)oStream8%ath?:salva %ara uma stream 8vari$vel de mem@ria:

    ).). ,-empo )

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    13/69

    -dd)o6nit(roc8A3e*9indo*8AAA B )rim8!L?: B AAA, AAMy9indo*AA, AAAA:

    6omente h um edit para se diitar a R; tem que ter o http(DD- e um bot%opara abrir.

    ).*. ,-empo *

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    14/69

    >uncionado id@ntico ao 9I:9emplateProcessorN91;, porm, ele tem inclu'donele um editor de html basta dar duplo clique sobre o componente-, comovisto na fiura abai0o(

    Independente do componente que se for utilizar, e0istem alumas coisas quedevem ser feitas para que o 9emplate funcione(

    9oda e qualquer pina html sB pode ser html, ele n%o aceita htm-,tem que ser salva em uma pasta chamada )em%latesque deve sercriada no mesmo n'vel que esta a sua aplica$%o+

    6e voc@ criar um html, colocFlo na pasta 9emplates e no seu formulrioIntraweb que vai utilizar este 9emplate voc@ colocar um bot%o e loo emseuida rodar a sua aplica$%o, acessar a pina que voc@ acabou defazer....o que voc@ ter Q

    2oc@ ir ver somente o seu html, nada dos componentes que voc@ colocou ques%o do Intraweb.

    Para que se8a poss'vel acessar os componentes do Intraweb, necessrioutilizar os tas dos componentes no html. 2e8a seq@ncia abai0o(

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    15/69

    ormulrio no elphi, h somente um I0)e!t, um I01uttone um componente para utili2a34o de )emplate

    5ste 6 a isuali2a34o do html com o sistema rodando, perceba 7ueos componentes isuais do Intraweb 8I0)e!t e I01utton9 n4o

    aparecem

    nesta figura, colocamos no c;digo html as tags dos componentesIntraweb, o 7ue nada mais 6 do 7ue seguir a sinta!e: /0 nome do

    componente 0, como isto na parte sublinhada da figura

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    16/69

    "gora, 7uando oc< rodar noamente a aplica34o, os componentesdo Intraweb estar4o acesseis.

    ).. ,-empo

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    17/69

    (esta figura, estamos demonstrando um grfico esttico, onde

    somente setamos no componente do grfico 7ual ser a coluna e alinha

    (esta figura, o grfico 6 gerado dinamicamente, e!iste combobo!onde se seleciona 7ual ser os campos na ertical e hori2ontal

    ).15. ,-empo 15

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    18/69

    # utiliza$%o de rid din4mico feita a partir de um *ata6et liado aocomponente I:*/nGrid, onde 8 ser erado um rid com filtros e ordemautomaticamente.

    "7ui 6 demonstrado um grid esttico com os registro de uma tabela,no caso, um ar7uio !ml

    "7ui 6 demonstrado um grid din>mico onde e!iste filtros e ordem

    dinamicamente montados

    ).11. ,-empo 11

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    19/69

    #ssim como em uma aplica$%o normal com o 1ain1enu da 2;5, voc@ somentenecessita colocar um I:1enu e liaFlo com o formulrio do Intraweb, porm,h uma necessidade de se colocar tambm um 91ain1enu da 25;, pois ocomponente do Intraweb utiliza como base ele.

    Para isso, basta colocar um 91ain1enu no formulrio Intraweb, montar aestrutura de menus. liaFlo com o I:1enu e pronto. # estrutura de menusfeita no 91ain1enu estar dispon'vel no I:1enu.

    & funcionamento pode ser visto na fiura abai0o(

    ).12. ,-empo 12

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    20/69

    *. Concus6es 7inais

    5omo visto em todo este documento, a utiliza$%o do Intraweb alo bastantesimples, principalmente pelo motivo de se proramar da mesma maneira quese prorama em aplica$7es normais, anhando em rapidez e efici@ncia, poisestar aproveitando tudo o que a ferramenta )orland *elphi oferece paraprorama$%o.

    S. )ibliorafia

    http(DDwww.blon.com http(DDwww.drbobLA.com http(DDbdn.borland.com

    5lique aquie fa$a download dos e0emplos utilizados nesse artio.

    Sobre o "utorRafael E. Guarasemini - Tltimo ano de )acharel de 6istemas de Informa$%o pela>aculdade 5laretianas de Rio 5laro.Proramador *elphi a " anos e membro do

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    21/69

    stou com uma dificuldade, uma dll &ue e-ecuta uma consulta estdisponi!iliada num II/, de duas m&uinas diferentes enio determinadaconsulta diferente de cada ma&uina e ao dar enter ao mesmo tempo, retorna amesma consulta nas duas m&uinas mesmo sendo consulta diferente.como posso solucionar esse pro!lema0

    a#rade$o se puder me audar................................................

    Aafael 5. uarasemin - CD/CH/CCB - E:ED:CE,mande uma email para mim, assim fica mais facil de conersarmos.#uarasemin4horion.com.!r

    567s................................................

    ?arcos #. omes - CJ/CH/CCB - EH:DK:DB

    8amos centraliar as d9idas na lista:delphi4;ahoo#rupos.com.!r esseespa$o ' apenas para comentrios #erais so!re o material acima.

    Atenciosamente

    arcos >>

    ?!ri#ados desde . #ostei muitos de seus e-emplos de WB................................................

    Aafael 5. uarasemin - EJ/CH/CCB - EE:E:? pro#rama ' stand alone, n"o d para c pu!lica:lo diretamente, c pode!ai-ar um pro#rama na communit; do *uinther &ue transforma aplica$@esstand alone para os dll ou apache.

    ................................................elipe Aodrigues - D/CH/CCB - EF:FH:E

    *ostei muito do seu arti#o, inclusie eu tenho al#uns proetos em mente, paradesenoler nesse tipo de plataforma.

    *ostaria de sa!er mais detalhes so!re como desenoler essa rela$"o entre oform da p#ina e o DataBase.

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    22/69

    ................................................#/ elipe Aodrigues - CB/CK/CCB - EB::ED

    8c poderia entrar em contato por email para conersarmos so!re isso................................................

    Lalmor - CK/CK/CCB - CM:B:D

    *ostaria de sa!er, como o!tenho o pro#rama &ue transforma aplica$@es standalone para dll, &ual o endere$o da communit; do *uinther................................................

    Aonaldo S. Lieira - /CK/CCB - E:CB:FJstou desenolendo um aplicatio usando o IntraWe!, a#ora es!arrei numpro!leminha ... Como faer relatorio usando IntraWe! 0

    /e al#uem sou!er, por faor de um to&ue.

    #rato

    onaldo.................................................

    ?arcelo - /CK/CCB - EH:K:ECaro aphael,

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    23/69

    uma delas atende a ne#cio pela internet onde nosso cliente tendo comclientes tr%s !ancos.G sem d9ida uma alternatia e-celente.stamos a disposi$"o para suporte, &ue contamos tam!'m com um curso detreinamento especialiado.

    laercio4di#irio.com.!r................................................

    (orial NObner - M/CK/CCB - CJ:EH:EK

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    24/69

    Duas tecnolo#ias &ue chamaram aten$"o no Delphi foram os e! serices e o nooframeorJ para desenolimento AD para WB o IntraWB, nesta mat'ria erermoscomo utiliar estas duas tecnolo#ias em conunto para criar um cliente e! serice. Comoe-emplo utiliaremos o famoso seri$o de tradu$"o Ba!elKish, para oc% &ue n"o iu asduas mat'rias de minha autoria so!re o assunto ea a primeira clicando aquie a se#unda

    aqui.Vamos ao desenvolvimento

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    25/69

    )i'ura : A confi#ura$"o do /erer Controller.

    8olte ao formulrio principal NKormainN e selecione o componente HTT lo#o a tela do /eridor /tand Alone se a!re,pressione K noamente &ue o nae#ador ' e-ecutado, ea nas 3 fi#uras a!ai-o o e-emploem e-ecu$"o.

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    26/69

    )i'ura 4 - ? /eridor /tand Alone

    )i'ura 5 -A aplica$"o em e-ecu$"o.

    )i'ura 6 -A mensa#em traduida.

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    27/69

    Para fazer o download deste e0emplo clique aquiU

    IntraWeb Component Evaluation)

    Evaluation) of the follo'ing component) are di)tributed 'ith IntraWeb. To in)tall% ma$e )ure to )elect Arcana Component)'hen in)talling Intra'eb.

    IntraWeb /ialog) 3ac$

    IntraWeb Control 3ac$

    IntraWeb Tran)lator

    IntraWeb #penSource 3ac$

    #ther elated /o'nload)&

    4ilename 4ile Si5e 6a)t 7pdated

    IntraWeb #penSource 3ac$ IW 8 9 : ; ArcIW#penSource:.5ip 888

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    28/69

    9his update looMs at what issues need to borne in mind when usin *elphi to create:eb applications for #pache runnin on :indows. >ortunatel/, thins are a bit simplerhere than the/ are in ;inu0 a welcome relief-. 9his article should be considered anupdate to the oriinal article rather than standalone, so if /ou are unfamiliar with#pache and *6&s or shared modules- I recommend /ou have a read of it. 3ust inorean/ references to ;inu0 issues alon the wa/, particularl/ about recompilin #pache

    there is no need to do this with the :indows version of #pache-.

    our first question miht be to asM wh/ we should bother looMin at #pache an/wa/.#fter all, #pache on :indows is certainl/ not as well established as #pache on ;inu0, orII6 on :indows. :ell, /ou should consider that whilst :indows AWWW Professional shipswith a cop/ of II6, it onl/ has a !W user limit. If /ou want /our :eb server to worM well/ou will need to uprade to :indows AWWW 6erver and et the appropriate additionallicensin.

    1ore thins in #pacheXs favour include the fact that it is completel/ free and has its fullsource code freel/ available for download. #dditionall/, it is straihtforward toconfiure throuh one te0tual confiuration file and has updates made to its sourcecode tree far more frequentl/ than II6. &n top of this, the main source code base isevidentl/ well established, iven the mass acceptance of #pache on Internet serversprimaril/ ni0 s/stems-, and the documentation states that it can even load up I6#PI*;;s.

    9here is also the fact that the basic loic /ou place in a :eb)roMer or :eb6napapplication is much the same no matter what :eb server protocol /ou are taretin,so /ou can easil/ taret #pache :eb server from /our e0istin :eb server applicationsb/ creatin a new pro8ect file set up appropriatel/. # minimal amount of worM canresult in another :eb server platform that /ou can sa/ that /ou taret.

    #dditionall/, it is 8ust at home on :indows V", VS or 1e as it is under :indows

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    29/69

    (ote:*elphi Y has onl/ been certified for use with #pache up to version A.W.OV as thatwas the most current version available when it was sent to manufacturin. #pacheA.W.LW introduces more chanes that breaM the *elphi support and requirinmodifications to the support units. Nowever, all is not lost as unofficial patchinformationsupplied b/ a )orland enineer is available online that allows #pacheA.W.LW and hiher to be used with shared modules written in *elphi.

    igure E: elphi K "pache support

    /li0 O was released 8ust before *elphi Y indeed *elphi Y includes a cop/ of the *elphilanuae version of /li0 O in the bo0-, but #pache A support did not maMe it into thatproduct. 9his ma/ happen with an update pacM, but in the meantime /ou could alwa/str/ ZborrowinZ the pertinent #pache A source files from /our cop/ of *elphi Y andusin those instead of the #pache ! files in /our shared module pro8ect. 9he #pache

    source files are located in [*E;PNI-\6ource\Internet, where [*E;PNI- is the main*elphi installation director/.

    9he units used in #pache ! applications are(

    #pache#pp.pas, used in the pro8ect source #pacheN99P.pas, used b/ #pache#pp N99P*.pas, used b/ #pache#pp and #pacheN99P

    9he files used in #pache A applications are(

    #pache9wo#pp.pas, used in the pro8ect source

    #pache9woN99P.pas, used b/ #pache9wo#pp N99P*A.pas, used b/ #pache9wo#pp and #pache9woN99P

    6o in theor/ /ou could cop/ the #pache A support files across to /our pro8ect director/and modif/ the pro8ect usesclause to use #pache9wo#pp instead of #pache#pp.

    (ote:that this suestion is speculative F I havenXt tested it.

    http://www.drbob42.com/delphi7/apache2040.htmhttp://www.drbob42.com/delphi7/apache2040.htmhttp://www.drbob42.com/delphi7/apache2040.htmhttp://www.drbob42.com/delphi7/apache2040.htm
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    30/69

    Installing "pache

    )efore writin an/ #pache shared modules, /ou need to et hold of #pache and installit. ou can et a ]IP file containin the source code from httpd.apache.orDdistDhttpd,but that requires /ou to have 2isual 5^^ to compile it. Instead, I recommend /ou et

    the precompiled version without source code fromhttpd.apache.orDdistDhttpdDbinariesDwinOA. I downloaded version !.O.AW,apache_!.O.AWFwinOAFno_srcFrA.msi, which is a :indows Installer file that can be usedto install #pache. 5learl/ this means /ou need the :indows Installer on /our machine,but if /ou havenXt /ou can download it from the 1icrosoft :eb site.

    9he last time I checMed there were two main versions of #pache available, one is aversion !.0 #pache !.O.A- and one is a version A.0 #pache A.W.LW-. #s discussedearlier, if /ou are usin *elphi /ou must download the !.0 version as support for A.0onl/ arrives in *elphi Y.

    )efore installin, /ou should terminate an/ other :eb servers /ou have runnin I hadII6 runnin on :indows AWWW-, as the/ will t/picall/ all fiht for the same default 95Pport port SW-. I suspended II6 throuh the Internet Information 6ervices 5ontrolPanel applet in 5ontrol PanelXs #dministrative 9ools folder-.

    :hen /ou run the file, the installation wizard will start(

    igure : Installing "pache for 0indows

    :hen it ets around to asMin /ou about /our :eb server information, /ou will be bestplaced to answer the questions. 6ince I want to access m/ :eb server b/ specif/in itsmachine name 5ube-, thatXs what I tell the installation proram(

    http://httpd.apache.org/dist/httpdhttp://httpd.apache.org/dist/httpd/binaries/win32http://httpd.apache.org/dist/httpd/binaries/win32/apache_1.3.20-win32-no_src-r2.msihttp://www.apache.org/dist/httpd/binaries/win32/apache_1.3.26-win32-x86-no_src.msihttp://www.apache.org/dist/httpd/binaries/win32/apache_2.0.40-win32-x86-no_ssl.msihttp://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Apache1Or2%23Apache1Or2http://httpd.apache.org/dist/httpdhttp://httpd.apache.org/dist/httpd/binaries/win32http://httpd.apache.org/dist/httpd/binaries/win32/apache_1.3.20-win32-no_src-r2.msihttp://www.apache.org/dist/httpd/binaries/win32/apache_1.3.26-win32-x86-no_src.msihttp://www.apache.org/dist/httpd/binaries/win32/apache_2.0.40-win32-x86-no_ssl.msihttp://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Apache1Or2%23Apache1Or2
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    31/69

    igure B: Specifying my 0eb serer settings

    9his will mean I can browse to http(DD5ube from an/where on m/ networM and ainaccess to 5ubeXs :eb server.

    iure Othat the installation asMs if /ou wish #pache to run as a service. &n:indows iure Lshows the menustructure for the service installation.

    http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure3%23Figure3http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure4%23Figure4http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure3%23Figure3http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure4%23Figure4
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    32/69

    igure F: )he "pache serice Start ?enu roup

    If /ou chose the other option manuall/ startin #pache in >iure O-, the Comenu willnot be present, but /ou will have one e0tra menu item under Ah, which sa/s StartApacheinC nsole.

    If /ou installed #pache as a service, it will be runnin each time /ou start :indows.ou can stop #pache with the Stmenu item and start it with the Startitem. 9he Restitem will

    attempt to stop #pache if it is runnin, and then start it aain. 9his is a convenient wa/of ettin #pache to reFread its confiuration file, after /ou have made chanes to it.

    If #pache is installed for manual invocation, the StartApacheinC onsoleitem will start the #pache process in aconsole window in #pache !.O.L and earlier, this option was called ApacheServer-. 9his process canbe terminated b/ pressin Ctrl+Cin the console window in version !.O.!O and later-or b/ clicMin the console windowXs cross button in version !.O.!" and later-.

    >or both installation t/pes, /ou can also terminate #pache b/ passin it appropriatecommandFline switches it miht be convenient to add a new shortcut with thiscommand line to the #pache 6tart menu folder, if /ou installed it for manualinvocation-(

    C:\Program Files\Apache Group\Apache\Apache.exe -k shutdown

    :hen #pache is runnin, /ou can invoMe /our :eb serverXs home pae, withhttp(DDlocalhost, and /ou should et the default #pache home pae(

    http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure3%23Figure3http://localhost/http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure3%23Figure3http://localhost/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    33/69

    igure D: )he default "pache homepage

    0riting a Shared ?odule

    9o create a shared module in *elphi , choose FiNe|O, then choose WAp. In the :eb 6erver#pplication wizard, choose ApacheSharedMoand press O. 9his creates a *;;Fbased :eb)roMerapplication, where we need to focus on the pro8ect file choose Project | View Sour-.

    (ote:*elphi Y and later will ive /ou a choice of #pache versionsto taret, whichaffects the #pache support unit used in the pro8ect source file.

    9he default content of the pro8ect file looMs liMe(

    libraryProject!

    uses

    "e#$roker% ApacheApp% //or ApacheTwoApp

    http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure1%23Figure1http://www.blong.com/Articles/Apache%20For%20Windows/ApacheWindows.html#Figure1%23Figure1
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    34/69

    &nit in'Unit1.pas'{WebModule1: TWebModule}!

    {$R .res}

    exports

    apache'module name '!ro"ect1#odule'!

    begin

    Application.(nitiali)e! Application.CreateForm*"e#,odule% "e#,odule! Application.un!end.

    In this case, I saved the pro8ect as #pache9est.dpr, which will enerate a binar/ filecalled #pache9est.dll. 9o Meep thins consistent with the modules supplied with#pache, I added the compiler directives below to the pro8ect file to chane the outputname to mod_#pache9est.so instead so is the file e0tension of *;; equivalents on;inu0, called shared ob8ects-.

    {$% so} //chan&e binar (ile e)tension (ro .dll to .so{$*+,!R%-+ 'od#'}//pre(i) binar (ile nae with od#

    (ote:/ou can also use the-%%licationpae of the pro8ect options dialo to chanethe e0tension and prefi0. 9he other chane here was to update the default e0portedmodule record name from Pro e, resultin in(

    libraryApacheest!

    uses

    "e#$roker% ApacheApp% //or ApacheTwoApp Apacheest& in'ApacheTestU.pas'{WebModule1: TWebModule}!

    {$R .res}

    {$% so}{$*+,!R%-+ 'od#'}

    exports

    apache'module name 'ApacheTest#odule'!

    begin

    Application.(nitiali)e! Application.CreateForm*"e#,odule% "e#,odule! Application.un!end.

    #t this point, the application can have functionalit/ added to it, as in an/ other:eb)roMer pro8ect. In m/ sample shared module I have a :eb action set up on the:eb module doubleFclicM the :eb module or use the propert/ editor for the Actions

    http://www.blong.com/Articles/Apache%20For%20Windows/ApacheTest.ziphttp://www.blong.com/Articles/Apache%20For%20Windows/ApacheTest.zip
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    35/69

    propert/- that has no Path(n/o, but sends a simple piece of N91; bacM in its0nActionevent handler.

    procedure"e#,odule."e#,odule"e#Action(temAction*1ender: 0#ject! e2uest: "e#e2uest! esponse: "e#esponse! var3andled: $oolean!

    begin esponse.Content :4 '010ello World/01'end!

    9his should suffice to prove whether we can et a *6& worMin or not.

    Psing )he Shared ?odule

    9he ne0t step is to compile the pro8ect into the correct director/, and tell #pache touse it. In the pro8ect options dialo, the Directories/1onditionalspae specifies wherethe compiled e0ecutable will be placed the &utput director/( option-. 6et this to

    wherever #pache stores its shared modules, which, on a default setup, is 5(\Proram>iles\#pache Group\#pache\modules. or the e0ample, this will be /del

    cois taMen from the caseFinsensitive Covariable and defaults to a lowercase strinthat includes the module name without the e0tension, with -appended. In m/e0ample, this is mohan d l e r

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    36/69

    If we plu these bits into the frameworM above, we et this(

    5oad,odule Apacheest'module modules8mod'Apacheest.so75ocation 8delphi9 1et3andler mod'apachetest-handler

    785ocation9

    #dd these LoadModuleand Locadirectives to the confiuration file and then save it.

    (ote:8ust before restartin #pache /ou should be aware of the Clear,odule5istdirective. If this is present in the confiuration file /ou should ensure it occurs before/our 5oad,oduledirectives, as it unloads both staticall/ linMed modules and alsod/namicall/ loaded modules shared modules-.

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    37/69

    igure K: )elling elphi how to debug your shared module

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    38/69

    Do,nload %ee0hart Pro for Intra,e# components. 8(49B:

    Intra,e# v.6.(

    Kor Delphi L *ownload

    Intra,e# v.6./

    Kor Delphi L *ownload

    Do,nload %ee0hart Pro 6 for Intra,e# components. 8;9B:

    Intra,e# v.6./

    Kor Delphi L *ownloadKor Delphi XL *ownload

    Kor Delphi and otherL *ownload

    Intra,e# v.4.6./

    Kor Delphi XL *ownloadKor Delphi and otherL *ownload

    Run ;ive demo U

    9ree9ree and Intraweb

    Intra:eb 9utorial F Implementin a ZNello :orldZ application#uthor( #tozed 6oftwareNomepae( http(DDwww.atozedsoftware.com

    Welcome!

    Hello and welcome to the exciting world of IntraWeb. In this tutorial you'll see in a few simple steps

    how to create and execute an IntraWeb application

    http://www.steema.com/products/teechart/applications/IntraWeb/TeeChart6_IntraWeb51_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChart6_IntraWeb5_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChart5_IntraWeb5_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb5_D6.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb5_D5.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb5_D5.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb350_D6.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb350_D5.ziphttp://www.berneda.com:3323/starthttp://www.steema.com/products/teetree/applications/intraweb/index.htmhttp://www.atozedsoftware.com/http://www.steema.com/products/teechart/applications/IntraWeb/TeeChart6_IntraWeb51_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChart6_IntraWeb5_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChart5_IntraWeb5_D7.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb5_D6.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb5_D5.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb350_D6.ziphttp://www.steema.com/products/teechart/applications/IntraWeb/TeeChartIntraWeb350_D5.ziphttp://www.berneda.com:3323/starthttp://www.steema.com/products/teetree/applications/intraweb/index.htmhttp://www.atozedsoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    39/69

    Prerequisites

    To run the example in this tutorial you'll need the following:

    IntraWeb 5.1 in Application Mode (to get an evaluation copy of IntraWeb, please go to the Atozed

    Software website -http://www.atozedsoftware.com)

    One of the following : Delphi (5, 6 or 7), Kylix (2 or 3), C++ Builder (5 or 6) or JBuilder. Visual

    Studio.NET is currently under development

    Approximately 20 minutes of your time (installation time not included)

    *reating a new application

    his application is built using IntraWeb Borland Edition and application mode.

    The first step is to create a new IntraWeb application. To do this select the File menu, then New

    (Select New, not New Application, etc), then Other. A "New Items" dialog will appear. Select the

    "IntraWeb" tab. It should look like this:

    IntraWeb New Dialog

    Using this dialog you can start a new IntraWeb application or add new IntraWeb forms to your

    existing applications.

    After selecting "IntraWeb Application Wizard", the wizard will launch and you'll be presented with

    http://www.atozedsoftware.com/http://www.atozedsoftware.com/http://www.atozedsoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    40/69

    the following dialog:

    The IntraWeb Application Wizard

    For this application we'll select "StandAlone Application". This will produce a self contained

    executable, that will be the only thing on the server side that you'll need to run your application. You

    do not need a web server of any kind.

    Notice the other available options: you could make your application a Windows service, and ISAPI

    extensions for web servers that support ISAPI, like IIS and OmniHTTPD, and even an Apache

    module.

    The options in the right panel specify whether the application should have a DataModule by default,

    if support for user sessions will be available, whether the HTML output should be 3.2 or 4.0 (default

    is 4.0 unless you check the "Create Main form as 3.2" box) and if the ISAPIThreadPool unit should

    be used (for the IIS server only).

    Each new IntraWeb application consists of three modules:

    1. Project1.dpr - This is the project file.

    2. Unit1.pas and IWUnit.dfm - This is the main form of your application. You can change this by

    editing the project file, or even have multiple main forms determined by an incoming HTTP variable.

    3. ServerController.pas and ServerController.dfm - This is the server controller and used to

    configure your IntraWeb application and create application level events. In a new application you

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    41/69

    can leave all properties as default.

    If you want, you can rename any of the files by doing a Save As from the File menu.

    Implementing +Nello 0orld+

    If you have worked with other web technologies you are probably gearing up for a very big tutorial

    on simply how to implement even the simplistic "Hello World". I hope we will not disappoint you, but

    this tutorial will be very short, but only because IntraWeb makes this so amazingly simple.

    Open the main form of the application (Unit1). It will appear as a blank form like this:

    Blank IntraWeb Form

    You will quickly notice the form is blank. Do not worry - this is just like a new normal Delphiapplication when we create it. The main form is blank and we must implement our application.

    Select the IntraWeb standard components tab (IW Standard tab) on the component palette as

    shown here:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    42/69

    IntraWeb Standard Palette

    In the standard palette you'll see the base components for web development. However, that's not

    all. You an look in the other IntraWeb palettes to see components for database access, HTML 3.2

    output, client side processing etc. For a complete reference of IntraWeb components, please see

    the IntraWeb Reference file. You can download this file from the Atozed Software website.

    Select the TIWLabel and then place it on the form. It should look something like this:

    Main form with label

    Now just like a normal Delphi application use the property inspector to change the caption of the

    label. Change the caption to "Hello World Wide Web!". You will notice that the label on the form

    http://www.atozesoftware.com/http://www.atozesoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    43/69

    updates itself to reflect this change:

    Caption of the label has changed

    Now all that is left to do is to run the application and test it.

    Aunning the application

    We have created this application as a stand alone application. What this means is that it will

    execute completely stand alone and become its own web server. This is extremely useful fordebugging and testing, but it can also be deployed in this manner. Not only can it run stand alone,

    but it can be installed as a service on Windows NT, Windows 2000 and Windows XP. Please see

    the IntraWeb documentation for more information on this.

    To test our application, simply run it as you would any other Delphi application. You will then see a

    dialog similar to this:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    44/69

    IntraWeb Stand Alone Information Dialog

    This is a dialog to assist you in testing and debugging. To test it in the browser click Run then

    Execute or press the F9 key.

    This will launch your default browser with the start URL for the application:

    The browser window

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    45/69

    *onclusion

    Congratulations! You have just created a web application! All of this with no HTML, and it was just

    like a normal Delphi application was it not?

    Now you might say "Well that is fine and dandy, but what about input? You are just showing us

    limited pieces and there are hidden gotchas." Trust me, there are no such "gotchas" waiting for you.

    IntraWeb handles input just like any other Delphi application. Want to handle a button? Define the

    OnClick event, that is it. Want to read the value of a text box? Read its text property.

    But please, do not simply take our word for it:

    See the next tutorial - User Input.

    Downloadthe fully functional evaluation edition and look at the demos.

    Intra:eb 9utorial F ser Input#uthor( #tozed 6oftwareNomepae( http(DDwww.atozedsoftware.com

    http://www.atozedsoftware.com/http://www.atozedsoftware.com/http://www.atozedsoftware.com/http://www.atozedsoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    46/69

    Introduction

    In this tutorial you'll learn how to use multiple forms, how to handle user input and how to use

    sessions.

    In order to understand and run the example in this tutorial you should read the "Hello World" tutorial

    first.

    What is Next

    This application is built using IntraWeb's application mode.

    The last tutorial was very basic and designed to simply show you how easy it is to get an IntraWeb

    application up and running. As you will soon see the code used is still standard Delphi code. We

    challenge you to try even something this simple with any other web development tool. Other

    development tools require you to set up adaptors, bindings, or handle the HTTP variables your self.

    Not IntraWeb, IntraWeb is truly componentized.

    For this demo, we will continue by modifiying our "Hello World" application built in the Hello World

    demo. If you have not created this project yet, you will need it for this demo.

    Changes to the Main Form

    Set the form's Title property to "What is your name?". This will be displayed as the page title

    when shown in the browser.

    Change the label's Caption to read "What is your name?"

    Add a TIWEdit to the form.

    Set the Text property to be blank.

    Set the Name property to editName.

    Add a TIWButton to the form.

    Set the Caption property to "Talk to me!".

    Your form should now look something like this:

    New Main Form

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    47/69

    Handling a Button Click

    If you have never worked with web development tools before, this next step will not seem like magic

    for you as you will think, "This is the way it should work, no?". However if you have worked with

    other web development tools, you will now really begin to see where IntraWeb is different.

    To handle a button click in IntraWeb, it is just like a normal Delphi application. Simply create a

    OnClick event for your button and add code. To do this, double click on the button. Delphi will

    create a shell event for you similar to this:

    Add the following code to the event:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    48/69

    Testing the Application

    Run the application as we did in the previous demo, and press F9 again after the debug windowappears to launch the browser. The browser should appear like this:

    In Internet Explorer

    Notice the browser has picked up on the page title as set in the form's title property.

    Enter your name in the edit box and press the button. The browser will respond like this:

    Hello !

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    49/69

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    50/69

    / /T ohandthebuttonclicallw edidwasdefia nOnEndo fstorWOW!

    Multiple Forms

    ust to show you that there are no hidden gotchas with IntraWeb, let's continue on and show you

    how easy it is to do multiple forms with IntraWeb.

    Select New | Other from the File menu, and select the IntraWeb tab. This time select New Form and

    click OK:

    Creating a New IntraWeb Form

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    51/69

    The following dialog will appear, allowing you to select the form type:

    New Form Wizard

    This dialog allows you to select whether you want a Page Mode form, or an Application Mode form.

    For each of those, the HTML type is also selectable, so you can chose to produce a HTML 3.2 form

    or a HTML 4.0 form. For this tutorial we'll chose "Application Form", which will produce a HTML 4.0

    application mode form. For a detailed explanation of page mode and application mode, please refer

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    52/69

    to the IntraWeb Manual.

    You will now have a new blank form again:

    New Blank Form

    Using the property inspector, apply the following changes:

    Change the form Name property to formHello.

    Add a TIWLabel

    Set the Name property to lablHello.

    For the Font property:

    Bold = True

    Size = 24

    Name = Arial Narrow

    Color = clRed

    AutoSize = False. We will be adjusting the text at run time and thus will be manually

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    53/69

    adjusting the width.

    Width = 300

    Add a TIWLink

    Set the Caption property to Close.

    Create an OnClick event by double clicking on the TIWLink.

    Add the following statement to the event:

    Your form should now look something like this:

    Now let's move back to our main form. Change the button click event to read as follows:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    54/69

    Let's also add one more TIWButton to the main form. Set its caption to Done, and create an

    OnClick event to read:

    Now run the application and press F9 when the debug window appears. The browser should appear

    similar to this:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    55/69

    Enter your name and click the Talk to Me! button. The browser now displays your second form like

    this:

    Notice that even the browser caption has been updated with your name. Click the Close link. The

    browser will return to your main form:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    56/69

    Now click the Done button. The browser will terminate the application and display this message:

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    57/69

    Wow! Multiple forms, transparent user input, automatic session management, the works! And we

    still have not written a single line of HTML or Javascript. Does it get better? Yes it does, but you will

    need to see for yourself by trying IntraWeb.

    Code Examination

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    58/69

    Faster Web Development

    If you are a Delphi shop, there is no doubt your programmers can be up and running with IntraWeb

    in a matter of minutes while continuing to use their existing skills. You can develop web applications

    in days instead of months, and you can take on web projects previously deemed impossible or too

    time consuming. Now, can you honestly say that about any other web development tool?

    Conclusion

    This tutorial took the next step and demonstrated the ease of handling user input and managing

    multiple forms.However IntraWeb is far more powerful and has many more features than what has

    been demonstrated here. To see the full power of IntraWeb you need to look at the included demos

    and better yet, write your own application.

    The evaluation version is fully functional, so what are you waiting for?

    Download IntraWeb Now!

    Enviando te>to ?T(6 para uma @anela do navegador&

    procedure TIW4orm1.IWutton1Clic$*Sender& T#b@ect,-var )76% )#pt% )"ome& )tring-

    begin

    )76 & ++- )"ome & +Te)te+- )#pt & +)crollbar)no%'idthBB%height1BB+-

    AddToInit3roc*+"ovaJanela'indo'.open*+D)76D+% + D )"ome D +%+ D )#pt D +,-+,- AddToInit3roc*+"ovaJanela.document.'rite*IntraWeb,-+,- AddToInit3roc*+"ovaJanela.document.clo)e*,-+,-

    end-

    6endo a 76 0ue aparece na barra de endereo do navegador&

    :eb#pplication.Request.Referer

    http://www.atozedsoftware.com/http://www.atozedsoftware.com/http://www.atozedsoftware.com/
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    59/69

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    60/69

    Abstract:This article explains a way to be able to use visual form inheritance with IntraWeb(5.1). Something that normally is not woring.

    Introduction

    When I started &ith m' first real appli"ation in IntraWeb( I &anted to ma$e a "onsistent la'out

    throu)h out m' appli"ation. Sin"e &ith IntraWeb 'ou "an ma$e a &eb appli"ation *ust li$e anormal +elphi appli"ation, m' first thou)ht &as, *vi)ual, form inheritance-FI. So I startedhappil' pro)rammin) ma$in) a baseform as a parent for all m' other forms( puttin) on it a titlebar( and started inheritin) from it. nd it &or$ed, I had the title bar on all m' forms1

    ut after I started pro)rammin) reall' fun"tional forms( I soon also &anted to "han)esomethin) about m' baseform( ma$e the la'out a bit ni"er and better fittin) &ith the forms I&as ma$in). nd then it happened, I had added somethin) to m' baseform( "ompiled theappli"ation and it *ust )ave an e%"eption, Control +IWutton1+ ha) no parent 'indo'. Ihadnt "han)ed an'thin) reall'( e%"ept enhan"in) m' baseform, and there &asnt even aIWutton on m' baseform( it &as on m' mainform1 Well after a little debu))in)( I loo$ed atthe IntraWeb ne&s)roups and its &ebsite and soon found the ans&er, IntraWeb doesnt

    support vi)ualform inheritan"e. ou "an use inherited "ode( but 'ou "ant inherit the visualla'out...

    4inding the problem...

    Sin"e I am a stubborn person -I &anted to use visual form inheritan"e1( and in m' opinionproblems are there to be solved( I started di))in) deeper in the problem. With the help of+elphis 7 "ode -one of the thin)s I love most about +elphi, 'ou "an al&a's loo$ at thesour"e1 I soon found out in &hi"h part I had to sear"h for the problem, the SetN#rder3o)itionmethod of TControl. When 'ou add "ontrols to a form 'ou have inherited from -the baseformthe orderin) of the "ontrols on 'our des"endant forms -in m' "ase the 8ainform "han)es. ou"an see this orderin) &hen 'ou loo$ at the dfm file of a des"endant form, 'ou see numbers inbra"$ets : after the "ontrols. hese numbers tell +elphi in &hi"h order the "ontrols appear. Inthis Set;!rder#osition method there is a "all to alid#arentForm -found in Forms.pas thatreturns the parent form of the "urrent "ontrol if that parent forms is a des"endant ofustomForm. nd that &as the problem, a IWppForm is not a des"endant ofustomForm1

    ...and trHing to fi> it.

    Well onl' findin) the problem doesnt solve it( I needed to find a &a' to fi% it. 8' first thou)ht&as, I &anted that orland had made alid#arentForm a virtual prote"ted method of ontrol(so an'one "ould override it( and the )u's from IntraWeb "ould have made a spe"ial versionthat &or$ed &ith IntraWeb forms. ut sin"e that &asnt the "ase( I had to )o one level up to theSet;!rder#osition method. nd found out that that one is private to ontrol( so no "han"e of

    overridin) that. (!.T.W. If that one coul" have be overri""en it woul" have also meant that itha" to be "one in TIW!ase#ontrol$ an" I woul" not be able to "o that.)So I needed to )o upone level, the "aller of Set;!rder#osition &hi"h &as in this "ase the Sethild!rder method ofWinontrol( &here this Winontrol &as a"tuall' m' 8ainform. nd the ni"e ne&s &as thatSethild!rder of Winontrol "ould be overridden1

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    61/69

    Seein) that I needed to override Sethild!rder of m' 8ainform( and sin"e that one inheritedfrom m' baseform, I put m' implementation of Sethild!rder in m' baseform. 8'implementation loo$ed as follo&s,

    So if the hild is a IWaseontrol I "all a spe"ial implementation of Set;!rder#osition else I*ust "all the inherited version. hat spe"ial implementation of Set;!rder#osition I put in a "lass"alled IWaseontrol

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    62/69

    TrHing it out

    nd no& the e%"itement be)ins, does it all &or$@ So I started runnin) m' &eb appli"ation, andit )ave no error1 o reall' test it I made a lot of "han)es to m' baseform( I made "han)es to m'mainform and other forms, and it $ept on &or$in). I also "han)ed the order of the "ontrols onm' baseform and mainform b' sele"tin) the "ontrol and ri)htA"li"$( "hoose ontrol AB sent toba"$ and brin) to front( sin"e that a"tuall' manipulates that ;A!rderin)( but it $ept &or$in).

    Conclu)ion

    So this finishes m' solution for usin) visual form inheritan"e -FI &ith IntraWeb 5.-.2C in+elphi D in appli"ation mode. We are usin) it for >uite some time no&( and havent run into an'bu)s. ou "an )et the sour"e of this solution( in"ludin) a small test pro*e"t at "ode"entral.

    In"luded in that sour"e is a IWaseFIForm -in IWaseFIForm.pas that 'ou "an use toinherited from. !f "ourse 'ou "an also *ust "op' the "ode from that form to 'our o&n baseform.

    Eemember one thin) &hen usin) this solution, the developer of IntraWeb doesnt support FI(so I have no idea if it &ill &or$ for other versions of IntraWeb nor if it &ill &or$ &ith pa)emode1 Ialso havent tested this "ode &ith IntraWeb in +elphi 5 or 6( but a >ui"$ s"an of the relevantsour"e "ode of those implementations of ontrol doesnt sho& an' possible problems, so *usttr' it out.

    7)ing P(6ro$er 'ith IntraWeb ; bH Quinther 3auli

    Abstract:This article will explain how to use the %&'!roer in a IntraWeb application caching"ata an" up"ates in browser. n" finally how to solve this up"ates to "atabase server.

    +elphi 5 brou)ht the Internet %press te"hnolo)' that allo&s the "reation of hinAlients to8ultiier appli"ations( based on a Web ro&ser. ' usin) the G87ro$er &e "an "onne"t it toa +ataSet#rovider and e%tra"t information from an appli"ation server in a G87 format( &hi"h issent to the bro&ser. he data is then updated -"reatin) a lo"al "a"he "alled HdeltaH and sentba"$ to the G87ro$er( &hi"h repasses the updatin) to the o +ataSet#rovider and finall' todatabase server.

    he pa)es interfa"e -the

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    63/69

    o build this e%ample 'ou need IntraWeb 5. or hi)her and +elphi nterprise. Somefeatures used here are not available in the IntraWeb 5.0 and +elphi #rofessional. he=p)rade to IntraWeb 5. is free for +elphi D users.

    %he

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    64/69

    0reatin' the main form

    Ko to the main form and usin) IW7abels( IWdits and IWuttons -from IW Standard build'our user interfa"e( some li$e the pi"ture belo&. avaScript files

    reate a dire"tor' "alled file)in the dire"tor' &here 'ou saved the pro*e"t files -or &here thestand alone appli"ation &ill be run. op' to this dire"tor' the >mldb.@)and >mldi)p.@)filesthat are in the dire"tor' T-+7#

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    65/69

    We need to do a little modifi"ation in the >mldb.@)file so that there is not a "onfli"t &ith thefun"tions defined b' the IntraWeb. !pen this file and on line 33 "han)e the de"larationHalidateH for H+oalidateH. +o the same on line 409.

    ttention, ?ote that even usin) IntraWeb 'ou are ma$in) use of 8I+S/+ataSnapte"hnolo)ies. he use of Web8idas te"hnolo)' re>uires a li"ense from +elphi nterprise.See the orland do"umentation for further information about the developin) &ith8I+S/+ataSnap.

    he ne%t step is to "reate a avaS"ript file &hi"h defines the )lobal variables used b'Web8idas. reate a file "alled defvar).@)in the same dire"tor' -file). he "ontent of the fileis the follo&in),

    var,5$roker'1!var;ataForm!varFieldGroup'% null% null!;ataForm 4 document./orms?@1u#mitForm@!FieldGroup'

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    66/69

    Add1criptFile*@8/iles8de/ars.js@!end

    ?ote that &e do not in"lude the initialiUation file of the avaS"ript -initvar).@) variables. his"ode must be added to the initialiUation of the @! ,5.Contents.Addext*;ata,odule.,5$roker.Get,5ecords*(%D%?! >xtra3eader.Clear! 88 clear >xtra3eaders >xtra3eader.Add*,5.ender! 88 add the ,5 ;ata Packetinally

    ,5.Free!

    end// add initiali2ation 3ariables to the +nitiali2e (unctiono( +W docuent15:41tring5ist.create!try

    15.5oadFromFile*@/iles8initars.js@! Addo(nitProc*15.ext!inally

    15.Free!end

    end

    Eemember to de"lare IW?T(6Tagin uses.

    Gettin' the Delta and sendin' it to the ?ppServer

    !pen the ?idden4ield)propert' of the IntraWeb main form and add the follo&in) line,

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    67/69

    postdeltaR

    his is the field that &ill $eep the +elta &hi"h &ill be sent ba"$ to the Web server appli"ation.he ne%t step is to )et the delta in the server and repass it to the G87ro$er.

    When &e &or$ &ith Internet%press appli"ations( the G87ro$er is automati"all' re)istered asthe main "omponent of dispat"h. G87ro$er )et the +elta and repassin) it to the serverappli"ation -+ataSet#rovider( &ithout the need of re>uisition handle. We "an also "reate aevent handler for its !nKetEesponse and appl' the "a"he manuall' usin) the method

    ppl'G87=pdates. =sin) G87ro$er &ith IntraWeb &e "ant to use this auto dispa"thme"hanism

    o manuall' )et and appl' the delta in the IntraWeb ppli"ation( in the !nli"$ event ofIWutton9 t'pe the follo&in),

    delta:4;ata,odule.,5$roker.Get;elta*"e#Application.e2uest! // &et delta;ata,odule.,5$roker.Appl6,5&pdates*delta%(! // appldelta

    +e"lare a lo"al strin) variable named delta( and an Inte)er named I.

    In the start of this arti"le &e pla"e a avas"ript "ode in the !nli"$ event of this button( to sendthe delta to the IntraWeb server. his fun"tion submit the form internall'( &ithout the IntraWebhandlin). s &e manuall' submit the form( then &e have a problem( the !nli"$ event in theIntraWeb server never fire.

    o do this( &e need to set manuall' a

  • 8/13/2019 119904418 IntraWeb Tutorial 2

    68/69

    Do,nload

    +o&nload this e%ample from odeentral

    di"ionando um h'perlin$ a um IWIma)e

    #ara "li"ar em uma ima)em( e ser redire"ionado a um site( no evento onli"$ doseu "omponente IWIma)e es"revaWebppli"ation.Koo=E7-V&&&.intra&.hp)."om.br.

    http://codecentral.borland.com/codecentral/ccweb.exe/author?authorid=222668http://codecentral.borland.com/codecentral/ccweb.exe/author?authorid=222668
  • 8/13/2019 119904418 IntraWeb Tutorial 2

    69/69

    3ara habilitar o oltarAvanar do navegador% a@u)te a propriedade?i)torHEnabled da unit IWServerController para true.

    3ara rodar )ua aplicao IntraWeb em uma porta e)pecRfica% a@u)te apropriedade 3ort da unit IWServerController.

    Ar0uivo) ace))ado) com a 76 )o arma5enado) pelo bro')er. Se vocede)e@a criar ar0uivo) dinmico) 0ue no )e@am arma5enado)% u)e..file)ncKfilenameL% em ve5 de% ..file)KfilenameL. /e)ta maneira o bro')er)er2 in)truRdo para no arma5en2;lo).

    Yuando oc% desenole uma aplica$"o Intrae! para o Apache 2, oc% precisa ter certea&ue incluiu a unit IWInitApacheTo na clusula uses. /e oc% criou uma aplica$"o Apache2 usando o iard, isto ' feito automticamente.?!sL 8oc% precisa faer as mudan$as apropriadas na 8C do Delphi antes de seusmdulos rodarem com o Apache 2.ais detalhes no Dr. Bo!Us e!site emLhttp(DDwww.drbobLA.comD*elphiYD#pacheAWLW.htm

    http://www.drbob42.com/Delphi7/Apache2040.htmhttp://www.drbob42.com/Delphi7/Apache2040.htm