Vous êtes sur la page 1sur 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 e entos do !ot"o, se no Dialo# o usurio confirmar.


Chamando um evento do boto com JavaScript
1. Adicione um TIWEdit e um TIW utton no form.

!. "o evento #nClic$ do boto% digite& WebApplication.Sho'(e))age*+te)te+,.. "a propriedade ScriptEvent) do Edit% digite&

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

Intraweb
Por Rafael E. Guarasemini

1. O que Intraweb? Intraweb uma biblioteca de componentes de desenvolvimento de htmls de forma simples, rpida e eficiente. Este biblioteca desenvolvida pela empresa www.atozedsoftware.com que trabalha com tecnolo ia para Internet a !" anos. 2. Recursos # biblioteca de componentes do Intraweb traz a maioria das ferramentas necessrias para o desenvolvimento de web pa es, adicionando a facilidade de pro rama$%o de ferramentas de desenvolvimento de sistemas. & Intraweb esta dispon'vel para vrias lin ua ens de pro rama$%o, entre elas(
o o o o o

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

&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, seu funcionamento em um servidor de Internet tem como funcionamento detalhado na fi ura abai0o(

#s aplica$7es Intraweb, diferente do desenvolvimento tradicional de web site, era apenas ! arquivo, onde nele contm todo o pro8eto desenvolvido ,com e0ce$%o base de dados e fi uras-. 3.1. Tipos de sistemas em Intraweb

Para se desenvolver sistemas utilizando o Intraweb necessrio saber al umas coisas, principalmente, sobre onde ficar esta aplica$%o, isto quer dizer, qual ser o sistema operacional e qual ser o servidor de web dispon'vel para se utilizar. 9endo estas respostas necessrio saber a quais sistemas operacionais e a quais servidores de web o Intraweb fornece suporte de desenvolvimento. & Intraweb oferece suporte para tais sistemas( 1icrosoft :indows I66 #pache #pache

;inu0 ,utlizando o )orland ./li0-

4. Comeando a uti i!ar o Intraweb & )orland *elphi oferece as duas alternativas de desenvolvimento com o Intraweb citados no cap'tulo anterior. 6endo estes encontrados em( <o menu =>ile? =<ew? =&ther?, na aba =Intraweb?, aqui voc@ seleciona o tipo de aplica$%o que ir desenvolver. # fi ura abai0o demonstra a tela para se escolher o tipo de aplica$%o.

4.1. "pac#e 2 $%O "pp ication *esenvolvimento de aplica$7es para :indows utilizando o servidor de web #pache vers%o A ou superior e se baseia no desenvolvimento de um ob8eto de compartilhamento din4mico. Este tipo de aplica$%o era um arquivo com a e0tens%o so ,shared ob8etc- que deve ser confi urado para ser carre ado no servidor #pache nas diretrizes de Load Modules no httpd.conf ,arquivo de confi ura$7es do #pache-, isso deve ser feito da se uinte maneira( o arquivo .so deve ser colocado no diretBrio de Modules do #pache+

no arquivo de confi ura$7es do #pache, localize a chave Dynamic Shared Object, neste local onde se confi ura os mBdulos que ser%o carre ados com o #pache+

Insira uma diretiva de ;oad1odule, onde deve ser colocado o nome do se arquivo .so, sendo a sinta0e a se uinte( LoadModule nome do module gravado nome do .so <Location / !L" Set#andler vari$vel de %onteiro do .so </Location" &nde( nome do module gravado o do pro8eto do Intraweb no *elphi, encontrado no dpr ,Pro8eto- da aplica$%o iniciada. E0iste uma varivel e0portado do *elphi com o nome a%ache&module name. & conteCdo desta declara$%o case sensitive. <ome do .so nome do nome do arquivo erado no final da compila$%o. DER; o ponto de e0ecu$%o para um broswer, um e0emplo seria /del%hi. Esta varivel case sensitive varivel de ponteiro do .so uma varivel case sensitive onde se inclui o nome da module com o sufi0o 'handle Para se debu ar uma aplica$%o deste tipo, deveFse fazer os se uinte passos(

no menu !un (arameters, coloque o path do servidor #pache, como fi ura abai0o(

habilite no menu )ools Debugger O%tions a op$%o s%a*ned %rocesses "pac#e $%O "pp ication

4.2.

6e ue o mesmo modelo do capitulo +.,. -%ache . DSO -%%lication

4.3.

"pp ication Form

6e ue o esquema de quando se esta desenvolvendo um sistema convencional no *elphi e se dese8a inserir um novo >ormulrio. Este 'cone apenas acrescenta uma nova p ina ,>orm- para se desenvolver. 4.4. I%"&I "pp ication

Etiliza para desenvolver aplica$7es para servidor 1icrosoft :indows utilizando servidores de Internet I66. 5omo compila$%o final, erado uma dll deve ser confi urada da se uinte forma ,e0emplo-(

5opie do arquivo I6#PI9ER.dll do diretBrio de instala$%o do *elphi ,bin/netsc%00- para 12/3etsca%e/Server/3sa%i/45am%les ,diretBrio de instala$%o do servidor<o arquivo de confi ura$%o do servidor ,&)3.5&<>-, encontre a linha(

fn=load-types mimi-types=mimi.types e inseria a se uir Init funcs=handle-isapo, check-isapi, log-isapi fn=load-modules Shlib=c:/netscape/ser er/nsapi/e!amples/IS"#Iter.dll #inda no arquivo &)3.5&<>, encontre a se$%o( $%b&ect name=default' e encontre a linha (ame)rans fn=document-root root=*:/(etscape/Ser er/docs E inseria a se uinte diretiva( (ame)rans from=+/scripts+ fn=+pf!,dir+ dir=+*:/(etscape/Ser er/docs/scripts+ name=+isapi+ E no fim do arquivo arquivo &)3.5&<> coloque $%b&ect name=+isapi+' #ath*heck fn=+check-isapi+ %b&ect)ype fn=+force-type+ type=+magnus-internal/isapi+ Ser ice fn=+handle-isapi+ $/%b&ect'

<o arquivo no fim do arquivo 1I1E.9GPE6, coloque a linha

)ype=magnus-internet/isapi e!ts=dll 4.'. &a(e Form

H para se inserir uma nova p ina de html para se desenvolver na aplica$%o. 4.). %tand " one "pp ication

5ria uma aplica$%o para testes, tem funcionamento id@ntico a qualquer outra aplica$%o com Intraweb, porm, quando permite que se8a rodada na I*E do *elphi, pois, tem um servidor de web interno para se e0ecutar e debu ar. ;o o abai0o h uma fi ura com o servidor de web interno do Intraweb

4.*.

%tand " one "pp ication wit# $ata +odu e

>uncionamento id@ntico ao 6tand #lone #pplication, porm, 8 se inicia com um *ata 1odule. '. O Intraweb no $e p#i

& *elphi, a partir da vers%o I, dividido em duas blibliotecas de componetes, a 25; e a 5;J # 25; K 2isual 5omponents ;ibrar/ K s%o =todos? os componentes do *elphi, desde o 9>orm ao mais sinistro 99ee5hart.

# 5;J F 5omponent ;ibrar/ for 5rossFPlatform K s%o quase todos os componentes do *elphi, s%o utilizados para se desenvolver uma aplica$%o no *elphi e preparaFla para ser recompilada no )orland ./li0 no ;inu0. #inda nem todos os componentes que e0istem na 25; e0istem na 5;J, mas em breve ser 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 cBdi o fonte dos componentes. & Intraweb no *elphi divido em L palhetas, cada uma dividida por cate oria de componentes, desde componentes simples como o 9I:;abel ,o componentes 9;abel da 25;- como componentes para cria$%o de rficos din4micos 9I:*/namic5hart ,similar ao 9*)5hart da 25;-. Ema caracter'stica importante que os componentes do Intraweb sB podem ser utilizados em aplica$7es Intraweb e essas aplica$7es tambm sB aceitam seus prBprios componentes. Em 8eito de se certificar disso tentar colocar um componente da 25;D5;J em uma Intraweb #pplication. ".!. &s 5omponentes 6tandard <esta palheta est%o localizados os componentes mais simples do Intraweb, podeFse notar uma similaridade com a palheta 6tandard do *elphi. <ela se encontrar labels, buttons, combobo0, times, rids, checMbo0, menu etc K que s%o mais comuns K at componentes para html em si , como linM, ER;, applet, flash, la/ers, etc. # palheta I: 6tandard pode ser vista na fi ura abai0o(

'.2.

Os Componentes $ata

<esta palheta est%o localizados os componentes para controle da base de dados para qual estiver se conectando. &s componentes desta palheta s%o similares aos da palheta *ata 5ontrols da 25;D5;J, s%o componentes como *)Grid, *);abel, *)Edit, *)<avi ator e demais parecidos com a palheta da 25;D5;J. #ssim como os da 25;D5;J, eles s%o li ados com um *ataset. &s componentes dessa palheta podem ser vistos na fi ura abai0o(

'.3.

Os componentes C ient %ide

<esta palheta est%o componentes para =quem esta acessando a p ina html?. 6%o componentes para rficos e le endas din4micas, rids din4micos, com labels e navi ators. &s componentes dessa palheta podem ser vistos na fi ura abai0o(

'.4.

Os componentes Contro

<esta palheta est%o componentes para controle da p ina a ser e0ibida, contm controles para la/out ,templates- e produtores de p inas. N um componente ,I:;a/out1 rN91;- que contm um editor html interno ,basta dar um duplo clicM-. &s componentes dessa palheta podem ser vistos na fi ura abai0o(

).

,-emp os

1ostraremos a ora al uns e0emplos para utiliza$%o dos componentes do Intraweb e modelos de aplica$7es que servem como base para maior desenvolvimento. <%o h um e0emplo de como se fazer linMs entre as p inas do Intraweb, mas a estrutura ( )6*-%%7orm8!9eb-%%lication.-ctive7orm:.!elease; <nome do =ormul$rio >ue se >uer abrir?.1reate8!*eb-%%lication:.Sho*; ).1. ,-emp o 1

<este primeiro e0emplo, apenas mostraremos a cumplicidade da pro rama$%o em *elphi e seu desenvolvimento para web.

<ada mais do que mandar escrever em um label o que foi di itado em um memo.

).2.

,-emp o 2

<este se undo e0emplo, mostraremos os tipos de mensa ens e popus que o Intraweb nos oferece. # base para as mensa ens a mesma do *elphi, o conhecido sho*Message, a diferen$a que por se trabalhar em um servidor de Internet, n%o e0iste a I*E a plataforma de suporte :inOA, devemos ent%o mandar o servidor de web dar a mensa em, isso feito a partir da sinta0e( 9eb-%%lication.Sho*Message8<te5to?,<ti%o de mensagem?,<tem%late msg?: E como podemos ver na fi ura abai0o, se trata somente de um memo onde se di ita o te0to, um radio roup para o tipo da mensa em e um bot%o para e0ecutar a mensa em.

).3.

,-emp o 3

<este terceiro e0emplo, iremos demonstrar a utiliza$%o de outros componentes que o Intraweb oferece.

Estes outros componentes s%o todos encontrados na 2;5 do *elphi e a sua manipula$%o id@ntica se pro ramados em sistemas convencionais. 5omo podemos visualizar na fi ura abai0o, estamos utilizando checMbo0, listbo0, combobo0, edit, button e shape , onde, cada um desses componentes est%o referenciados a partir da 25;, para se utilizar os do Intraweb, basta colocar o prefi0o I: ao nome dos componentes, com e0ce$%o do shape que no Intraweb se chama I:Rectan le e inferior ao shape. Puanto a utiliza$%o, id@ntica a pro rama$%o com a 25;.

).4.

,-emp o 4

<este quarto e0emplo, mostraremos como efetuar downloads a partir de uma aplica$%o Intraweb. Estaremos utilizando a idia de se mostrar o que pode ser feito donwload ,utilizando uma rotina de 6earRec em um diretBrio e mostrando tudo o que tiver e0tens%o .3PG-. & bot%o download faz o download da fi ura em stream e mostra no pro rama para qual estiver confi urado para visualizar fi uras. &s componentes s%o os comuns do Intraweb e para se efetuar o download de al o, e0iste a se uinte fun$%o( 9eb-%%lication.Send7ile8<ar>uivo?,<string?,<string?,boolean:

).'.

,-emp o '

<este quinto e0emplo, iremos demonstrar como se efetuar upload a partir de uma aplica$%o Intraweb. 5omo podemos visualizar na fi ura abai0o, e0iste, visualmente, O componentes+ porm, na verdade estamos utilizando apenas A componentes( um I:)utton e um I:>ile. & I:>ile esse con8unto de cai0a de te0to e o bot%o (rocurar. Esse componente parecido com o O%enDialog da 25;, ele permite voc@ buscar no seu 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 componente I:>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:

).).

,-emp o )

<este se0to e0emplo, iremos ver como acessar uma nova p ina ou site para uma nova 8anela. 9udo se tratar apenas de uma chamada de fun$%o que na verdade 8 e0iste no *elphi.

-dd)o6nit(roc8A3e*9indo*8AAA B )rim8< !L?: B AAA, AAMy9indo*AA, AAAA: 6omente h um edit para se di itar a ER; ,tem que ter o http(DD- e um bot%o para abrir.

).*.

,-emp o *

<este stimo e0emplo, demonstraremos um refresh pro ramado. Esse recurso bastante usado em chats para se atualizar o p ina para novas mensa ens. Para se fazer este processo, utilizamos o componente I:9imer, que tem o funcionamento similar ao 9imer da 25;, nele, pro ramamos o tempo de intervalo ,no e0emplo A se undos- e no evento &n9imer voc@ pode verificar se esta ocorrendo o processo, no caso, aparece a mensa em da fi ura abai0o mostrando quantas vezes o html foi atualizando.

)...

,-emp o .

<este oitavo e0emplo, iremos ver como utilizar 9emplates. 9emplates s%o htmls 8 formatados por al um editor de html, desde o 1acromedia *ream:eaver, 1icrosoft >rontPa e ou mesmo para os mais espertos, no bom e velho )loco de <otas do :indows. Estes htmls podem contar qualquer tipo de la/out. Para se utilizar 9emplates, o Intraweb fornece al uns componentes, iremos falar sobre A deles que s%o os mais fceis e comentados.

9I:9emplateProcessorN91;

5omo ele, basta voc@ colocFlo no formulrio Intraweb e setar a propriedade )em%late(rocessor do seu formulrio.

9I:;a/out1 rN91;

>uncionado id@ntico ao 9I:9emplateProcessorN91;, porm, ele tem inclu'do nele um editor de html ,basta dar duplo clique sobre o componente-, como visto na fi ura abai0o(

Independente do componente que se for utilizar, e0istem al umas coisas que devem ser feitas para que o 9emplate funcione(

9oda e qualquer p ina html ,sB pode ser html, ele n%o aceita htm-, tem que ser salva em uma pasta chamada )em%lates que deve ser criada no mesmo n'vel que esta a sua aplica$%o+ 6e voc@ criar um html, colocFlo na pasta 9emplates e no seu formulrio Intraweb que vai utilizar este 9emplate voc@ colocar um bot%o e lo o em se uida rodar a sua aplica$%o, acessar a p ina que voc@ acabou de fazer....o que voc@ ter Q

2oc@ ir ver somente o seu html, nada dos componentes que voc@ colocou que s%o do Intraweb. Para que se8a poss'vel acessar os componentes do Intraweb, necessrio utilizar os ta s dos componentes no html. 2e8a seqR@ncia abai0o(

-ormul.rio no /elphi, h. somente um I0)e!t, um I01utton e um componente para utili2a34o de )emplate

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

:. nesta figura, colocamos no c;digo html as tags dos componentes Intraweb, o 7ue nada mais 6 do 7ue seguir a sinta!e: /0 1nome do componente2 03, como isto na parte sublinhada da figura

"gora, 7uando oc< rodar no amente a aplica34o, os componentes do Intraweb estar4o acess= eis. ).4. ,-emp o 4

<este nono e0emplo, demonstraremos a utiliza$%o de rficos estticos e din4micos. # utiliza$%o de qualquer de um dos tipos de rficos e bastante simples, somente necessrio saber utilizar o componente I:5lient6ide*ataset*);inM ou I:5lient6ide*ataset onde se pode li ar com um *ata6et ,I:5lient6ide*ataset*);inM - ou inserir os re istro manualmente ,I:5lient6ide*ataset-. & componente responsvel pela era$%o do rfico o I:*/namic5hart e opcionalmente pode se utilizar le endas com o componente I:*/namic5hart;e end.

(esta figura, estamos demonstrando um gr.fico est.tico, onde somente setamos no componente do gr.fico 7ual ser. a coluna e a linha

(esta figura, o gr.fico 6 gerado dinamicamente, e!iste , combobo! onde se seleciona 7ual ser. os campos na ertical e hori2ontal ).15. ,-emp o 15 <este dcimo e0emplo, demonstraremos como se erar rades , ridsestaticamente e dinamicamente. # utiliza$%o dos rid esttico feita a partir de um *ata6et li ado ao componente I:*)Grid que tem a sua utiliza$%o id@ntica ao *)Grid da 2;5.

# utiliza$%o de rid din4mico feita a partir de um *ata6et li ado ao componente I:*/nGrid, onde 8 ser erado um rid com filtros e ordem automaticamente.

"7ui 6 demonstrado um grid est.tico com os registro de uma tabela, no caso, um ar7ui o !ml

"7ui 6 demonstrado um grid din>mico onde e!iste filtros e ordem dinamicamente montados ).11. ,-emp o 11 <este dcimo primeiro e0emplo, mostraremos como utilizar menus no Intraweb.

#ssim como em uma aplica$%o normal com o 1ain1enu da 2;5, voc@ somente necessita colocar um I:1enu e li aFlo com o formulrio do Intraweb, porm, h uma necessidade de se colocar tambm um 91ain1enu da 25;, pois o componente do Intraweb utiliza como base ele. Para isso, basta colocar um 91ain1enu no formulrio Intraweb, montar a estrutura de menus. li aFlo com o I:1enu e pronto. # estrutura de menus feita no 91ain1enu estar dispon'vel no I:1enu. & funcionamento pode ser visto na fi ura abai0o(

).12. ,-emp o 12 <este dcimo se undo e0emplo, demonstraremos como se fazer um formulrio de inser$%o de dados. & la/out dos campos para se entrar com os dados, pode se utilizar I:Edits ou I:*bEdits, no e0emplo, utilizamos I:Edits e I:5ombo)o0. # monta em id@ntica de quando se faz um formulrio de inser$%o para aplica$7es normais, e a maneira de se fazer a inser$%o pode ser escolhida pelo pro ramador, voc@ pode dar um comando 6P; de insert ou utilizar um Post ou ate mesmo, como no e0emplo, um InsertRecord direto. 9oda e qualquer tipo de controle que necessrio se fazer em aplica$7es comuns, s%o feitas da mesma maneira.

*.

Conc us6es 7inais

5omo visto em todo este documento, a utiliza$%o do Intraweb al o bastante simples, principalmente pelo motivo de se pro ramar da mesma maneira que se pro rama em aplica$7es normais, anhando em rapidez e efici@ncia, pois estar aproveitando tudo o que a ferramenta )orland *elphi oferece para pro rama$%o. S.

)iblio rafia
http(DDwww.blon .com http(DDwww.drbobLA.com http(DDbdn.borland.com

5lique aqui e fa$a download dos e0emplos utilizados nesse arti o.

Sobre o "utor

Rafael E. Guarasemini - Tltimo ano de )acharel de 6istemas de Informa$%o pela


>aculdade 5laretianas de Rio 5laro.

Pro ramador *elphi a " anos e membro do <EPE*6 ,<Ccleo de Pesquisa e *esenvolvimento de 6istemas da >aculdade 5laretianas
*%?5()@AI%S

*6sar (ascimento - BC/CD/,CCB - EB:F,:EE

Cara, pe#uei um sistema de instala$"o desen ol ido por oc% &ue nunca tinha ista antes t"o eficiente e ami# el. oc% ' muito !om ' nota 1((((((((( )*ostaria de sa!er um pouco do &ue oc% sa!e...+ ................................................
G? - C,/CH/,CCB - ,E:,,:CH

,stou com uma dificuldade, uma dll &ue e-ecuta uma consulta est disponi!ili.ada num II/, de duas m&uinas diferentes en io determinada consulta diferente de cada ma&uina e ao dar enter ao mesmo tempo, retorna a mesma consulta nas duas m&uinas mesmo sendo consulta diferente. como posso solucionar esse pro!lema0 a#rade$o se puder me a1udar ................................................
Aafael 5. Iuarasemin - CD/CH/,CCB - E,:ED:CE

23, mande uma email para mim, assim fica mais facil de con ersarmos. #uarasemin4hori.on.com.!r 567s ................................................
?arcos #. Iomes - CJ/CH/,CCB - EH:DK:DB

8amos centrali.ar as d9 idas na lista:delphi4;ahoo#rupos.com.!r esse espa$o ' apenas para comentrios #erais so!re o material acima. Atenciosamente 3arcos <. *omes 3oderador ................................................
samuel mar7ues - EK/CH/,CCB - E,:DF:FK

eu #ostaria desa!er como c coloca isto realmente pra funcionar na =et, e-iste al#um comando especifico. estou com du idas>>> ?!ri#ados desde 1. #ostei muitos de seus e-emplos de W,B ................................................
Aafael 5. Iuarasemin - 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$@es stand alone para os dll ou apache. ................................................
-elipe Aodrigues - ,D/CH/,CCB - EF:FH:,E

*ostei muito do seu arti#o, inclusi e eu tenho al#uns pro1etos em mente, para desen ol er nesse tipo de plataforma. *ostaria de sa!er mais detalhes so!re como desen ol er essa rela$"o entre o form da p#ina e o DataBase.

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

8c poderia entrar em contato por email para con ersarmos so!re isso ................................................
Lalmor - CK/CK/,CCB - CM:,B:D,

*ostaria de sa!er, como o!tenho o pro#rama &ue transforma aplica$@es stand alone para dll, &ual o endere$o da communit; do *uinther ................................................
Aonaldo S. Lieira - ,,/CK/,CCB - E,:CB:FJ

,stou desen ol endo um aplicati o usando o IntraWe!, a#ora es!arrei num pro!leminha ... Como fa.er relatorio usando IntraWe! 0 /e al#uem sou!er, por fa or de um to&ue. #rato Aonaldo. ................................................
?arcelo - ,,/CK/,CCB - EH:,K:,E

Caro Aaphael, <rimeiramente &uero para!eni.:lo pelo arti#o de intraBe! escrito no delphi!r. Bem #ostaria de uma orienta$"o, como fa$o para mi#rar um sistema inteiro feito em delphi C para Be! usando delphi D se possE el, me falaram so!re usas -ml, mas tenho nem no$"o por onde come$ar por isso, #ostaria de sa!er como de o come$ar o pelo menos onde poderia procurar al#o a respeito. Desde 1 a#rade$o ................................................
#/ as pessoas 7 esta - ,F/CK/,CCB - ,,:EM:BE

olha... reparei & al#umas pessoas estaum com du ida so!re como desen ol er no iB ou mi#ra sistemas para esse modelo. && coisa, fi&uem a ontade de me en iarem um email )esta no meu nome do inicio do tutorial+ & farei o possi el para a1uda:los. o!ri#ado e 567s ................................................
Gaercio Iuer3o Aodri - ,K/CK/,CCB - EE:DB:EK

D,<?I3,=T? A&ui em nossa empres, nosso #rupo de tra!alho 1 a an$ou !astante em IntraWe!. F contamos com tr%s aplicati os usando esta tecnolo#ia, inclusi e,

uma delas atende a ne#cio pela internet onde nosso cliente tendo com clientes tr%s !ancos. G sem d9 ida uma alternati a e-celente. ,stamos a disposi$"o para suporte, 1 &ue contamos tam!'m com um curso de treinamento especiali.ado. laercio4di#irio.com.!r ................................................
(ori al NObner - ,M/CK/,CCB - CJ:EH:EK

<ara!ens pelo arti#o. ,st de e-celente &ualidade. Apo eitando a oportunidade, #ostaria de sa!er se as Aplica$@es IntraBe! desen ol idas com do Delphi D ,nterprise precisam ser licenciadas. desde 1 o!ri#ado. =ori al HI!ner nori al4hu!ner.eti.!r ................................................
?arcio Aoberto - C,/CM/,CCB - EJ:FJ:,D

<ara!ens por esta materia, foi muito util e #ostaria de sa!er aonde posso dirar maior du idas so!re este assunto aleu. ................................................
Gigia torres lima - CD/CM/,CCB - EC:EJ:CK

<ara!'ns pro este arti#o> tenho al#umas aplica$@es em delphi e #ostaria de utili.ar esta ferramenta. *ostaria de o!ter mais informa$@es a respeito o uso do intraBe! com delphi D. ?!ri#ada. ................................................
5n ie seu coment.rio (ome *oment.rios

Delphi 7 - WEB Services com IntraWEB Por Danilo Bertholini

Duas tecnolo#ias &ue chamaram aten$"o no Delphi D foram os Be! ser ices e o no o frameBorJ para desen ol imento AAD para W,B o IntraW,B, nesta mat'ria erermos como utili.ar estas duas tecnolo#ias em con1unto para criar um cliente Be! ser ice. Como e-emplo utili.aremos o famoso ser i$o de tradu$"o Ba!elKish, para oc% &ue n"o iu as duas mat'rias de minha autoria so!re o assunto e1a a primeira clicando aqui e a se#unda aqui. Vamos ao desenvolvimento <ara iniciarmos o desen ol imento, no Delphi crie uma no a aplica$"o IntraW,B do tipo /tand Alone Application adicione ao formulrio principal )Korm3ain+ os se#uintes componentesL IWEdit! IWButton! IW"a#el : Todos locali.ados na #uia IW/tandard. $%%PRI& : 2ocali.ado na #uia W,B /er ices. <osicione:os de acordo com a fi'ura(.

)i'ura ( - o Kormulrio principal. A#ora com o desi#n de nosso e-emplo pronto, amos importar o ser i$o W,B para isso em Kile M =eB M ?ther na #uia W,B /er ices selecione a op$"o W/D2 Importer, na pr-ima 1anela di#ite no campo o endere$o do W/D2L http*++,,,.-methods.net+sd+.//(+Ba#el)ishService.,sdl feito isso ' s se#uir na importa$"o do ser i$o, e1a no primeiro arti#o da s'rie Ncrie seu tradutorN passo:a:passo como importar um ser i$o. Com nosso ser i$o importado amos confi#urar o /er er Controller, para isso pressione /hiftOK12 e o selecione. ,m sua propriedade 0omInitiali1ation altere para ci2ulti%hreaded e1a na fi'ura . o ?!1ect Inspector.

)i'ura . : A confi#ura$"o do /er er Controller. 8olte ao formulrio principal NKorm3ainN e selecione o componente HTT<AI?1 e o confi#ure de acordo com o &uadro a!ai-oL WSD""ocation - httpLPPBBB.-methods.netPsdP2((1PBa!elKish/er ice.Bsdl Service - Ba!elKish<ort Port - Ba!elKish<ort <ronto, =osso HTT<AI? foi confi#urado> A#ora pressione A2TOK11 para utili.ar a Qnit do ser i$o importado e no e ento onclicJ do IWButton di#ite as se#uintes linhas de cdi#osL var PP Declara uma refer%ncia R interface do ser i$o, PP criada pelo Bi.ard na importa$"o. Bs L Ba!elKish<ortT;peS #e'in PP Iniciali.a o ser i$o. Bs LT HTT<AI?1 as Ba!elKish<ortT;peS PP In oca o ser i$o e passa ao IWla!el os resultado. IW2a!el1.Caption LT Bs.Ba!elKish)UptVenU,IWedit1.Te-t+S end3 A#ora ' s e-ecutar nossa aplica$"o> , lo#o a tela do /er idor /tand Alone se a!re, pressione KW no amente &ue o na e#ador ' e-ecutado, e1a nas 3 fi#uras a!ai-o o e-emplo em e-ecu$"o.

)i'ura 4 - ? /er idor /tand Alone

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

)i'ura 6 - A mensa#em tradu.ida.

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 1elated /o'nload)&

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


Final release for IW5 and IW6. Support for IW4 has been removed.

4ile Si5e 6a)t 7pdated 888<= <1<88


5/24/2003

IntraWeb #penSource 3ac$ ; ArcIW#penSource.5ip

2/9/2003

he latest updates to the IW !penSour"e #a"$. In"ludes sour"e for IW 5.% and demos for 5.0.%.

"pache Shared ?odules in /elphi


Crian Long ,www.blon .com Introduction 5hoosin #pache ! or #pache A Installin #pache 5ontrollin #pache :ritin # 6hared 1odule Esin 9he 6hared 1odule *ebu in 6hared 1odules #bout )rian ;on

Introduction
)acM in Issue IV ,1a/, AWW!- of 9he *elphi 1a azine in -%ache Shared Modules, I looMed at the #pache :eb server runnin on ;inu0 and how ./li0 could be used to write 5GI applications and also #pache shared modules or *6&s ,the main thrust of the article-. 9hat was shortl/ after ./li0 had been released, and discussed how to overcome a variet/ of problems, includin the fact that the standard #pache binar/ distribution is not suitable for usin shared modules.

9his update looMs at what issues need to borne in mind when usin *elphi I to create :eb applications for #pache runnin on :indows. >ortunatel/, thin s are a bit simpler here than the/ are in ;inu0 ,a welcome relief-. 9his article should be considered an update to the ori inal 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 i nore an/ references to ;inu0 issues alon the wa/, particularl/ about recompilin #pache ,there is no need to do this with the :indows version of #pache-. Gour first question mi ht 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, or II6 on :indows. :ell, /ou should consider that whilst :indows AWWW Professional ships with a cop/ of II6, it onl/ has a !W user limit. If /ou want /our :eb server to worM well /ou will need to up rade to :indows AWWW 6erver and et the appropriate additional licensin . 1ore thin s in #pacheXs favour include the fact that it is completel/ free and has its full source code freel/ available for download. #dditionall/, it is strai htforward to confi ure throu h one te0tual confi uration file and has updates made to its source code tree far more frequentl/ than II6. &n top of this, the main source code base is evidentl/ well established, iven the mass acceptance of #pache on Internet servers ,primaril/ Eni0 s/stems-, and the documentation states that it can even load up I6#PI *;;s. 9here is also the fact that the basic lo ic /ou place in a :eb)roMer or :eb6nap application is much the same no matter what :eb server protocol /ou are tar etin , so /ou can easil/ tar et #pache :eb server from /our e0istin :eb server applications b/ creatin a new pro8ect file set up appropriatel/. # minimal amount of worM can result in another :eb server platform that /ou can sa/ that /ou tar et. #dditionall/, it is 8ust at home on :indows V", VS or 1e as it is under :indows <9 or AWWW, so can be used for nonFsensitive :eb servers on a compan/ Intranet. If /ou need to test #pache out ,because /ou are thinMin of settin up a ;inu0 :eb server, for e0ample-, tr/in it out under :indows can be much more comfortable if /ou are new to ;inu0. Get the han of whatXs required of #pache in :indows, then that is one problem out of the wa/ when /ou set up /our ;inu0 bo0. #n/wa/, the bottom line is that it provides another option on top of 1icrosoftXs II6 or P:6, or <etscape server, or 5GI applications, so it can be useful to Mnow how to taMe advanta e of it.

*hoosing "pache E or "pache ,


#pache A was released after *elphi I and introduces some important issues. 9he #pache A module format differs from the #pache ! module format and as a consequence, *elphi I can onl/ worM with #pache !.0. 9o build shared modules for #pache A requires *elphi Y, which introduces additional support for #pache A.0. 9he Me/ difference in an #pache A.0 shared module, when compared with an #pache !.0 shared module is the pro8ect file uses clause. 6hared modules tar etin #pache !.0 use the #pache#pp.pas unit, whereas #pache A.0 pro8ects use #pache9wo#pp.pas.

(ote: *elphi Y has onl/ been certified for use with #pache up to version A.W.OV as that was the most current version available when it was sent to manufacturin . #pache A.W.LW introduces more chan es that breaM the *elphi support and requirin modifications to the support units. Nowever, all is not lost as unofficial patch information supplied b/ a )orland en ineer is available online that allows #pache A.W.LW and hi her 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 *elphi lan ua e version of ./li0 O in the bo0-, but #pache A support did not maMe it into that product. 9his ma/ happen with an update pacM, but in the meantime /ou could alwa/s tr/ Zborrowin Z the pertinent #pache A source files from /our cop/ of *elphi Y and usin 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 uses clause to use #pache9wo#pp instead of #pache#pp. (ote: that this su estion is speculative F I havenXt tested it.

Installing "pache
)efore writin an/ #pache shared modules, /ou need to et hold of #pache and install it. Gou can et a ]IP file containin the source code from httpd.apache.or DdistDhttpd, but that requires /ou to have 2isual 5^^ to compile it. Instead, I recommend /ou et the precompiled version without source code from httpd.apache.or DdistDhttpdDbinariesDwinOA. I downloaded version !.O.AW, apache_!.O.AWFwinOAFno_srcFrA.msi, which is a :indows Installer file that can be used to 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 a version !.0 ,#pache !.O.AI- and one is a version A.0 ,#pache A.W.LW-. #s discussed earlier, if /ou are usin *elphi I /ou must download the !.0 version as support for A.0 onl/ arrives in *elphi Y. )efore installin , /ou should terminate an/ other :eb servers /ou have runnin ,I had II6 runnin on :indows AWWW-, as the/ will t/picall/ all fi ht for the same default 95P port ,port SW-. I suspended II6 throu h the Internet Information 6ervices 5ontrol Panel 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 best placed to answer the questions. 6ince I want to access m/ :eb server b/ specif/in its machine name ,5ube-, thatXs what I tell the installation pro ram(

-igure B: Specifying my 0eb ser er settings 9his will mean I can browse to http(DD5ube from an/where on m/ networM and ain access to 5ubeXs :eb server. <otice in >i ure O that the installation asMs if /ou wish #pache to run as a service. &n :indows <9DAWWW, this will be a ood choice for a production s/stem, as it Meeps #pache runnin from bootFup to shutdown, but is not recommended on :indows V0, as it is still at an e0perimental sta e on these platforms. &n a development s/stem ,and on :indows V0-, /ou mi ht find it easier to choose the other option, which installs it for manual invocation in a console window. 9his option maMes it strai htforward to debu /our #pache shared modules and is the recommended option when installin on :indows V0.

*ontrolling "pache
:hen installation is done, about L1b of disM space will have been consumed ,even thou h the installation pro ram su ests it will taMe about !"1b- and #pache should be read/ for use. *ependin whether /ou chose to install #pache as a service or not, /our #pache 6tart menu folder will be or anised differentl/. >i ure L shows the menu structure for the service installation.

-igure F: )he "pache ser ice Start ?enu Iroup If /ou chose the other option ,manuall/ startin #pache in >i ure O-, the C menu o will not be present, but /ou will have one e0tra menu item under , A h which sa/s S . i C A p n ta a c h e r t e l o If /ou installed #pache as a service, it will be runnin each time /ou start :indows. Gou can stop #pache with the S t menu item and start it with the S item. t a r t 9he R item e s t will attempt to stop #pache if it is runnin , and then start it a ain. 9his is a convenient wa/ of ettin #pache to reFread its confi uration file, after /ou have made chan es to it. If #pache is installed for manual invocation, the S A i C p n item t a c rt h e will e start l o the s #pache n process o in a console window ,in #pache !.O.L and earlier, this option was called -. A Se p a r c v h e r 9his process can be terminated b/ pressin Ctrl+C in the console window ,in version !.O.!O and lateror 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 appropriate commandFline switches ,it mi ht be convenient to add a new shortcut with this command line to the #pache 6tart menu folder, if /ou installed it for manual invocation-( C:\Program Files\Apache Group\Apache\Apache.exe -k shutdown :hen #pache is runnin , /ou can invoMe /our :eb serverXs home pa e, with http(DDlocalhost, and /ou should et the default #pache home pa e(

-igure D: )he default "pache homepage

0riting a Shared ?odule


9o create a shared module in *elphi I, choose N | O F , e i then choose A W . pIn the :eb 6erver #pplication wizard, choose A S M h o and p a r a e d c e h press O . 9his creates a *;;Fbased :eb)roMer application, 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 versions to tar et, which affects the #pache support unit used in the pro8ect source file. 9he default content of the pro8ect file looMs liMe(

library Project ! uses "e#$roker% ApacheApp% //or ApacheTwoApp

&nit {$R

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

.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/ file called #pache9est.dll. 9o Meep thin s consistent with the modules supplied with #pache, I added the compiler directives below to the pro8ect file to chan e the output name 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 na$e with $od# (ote: /ou can also use the -%%lication pa e of the pro8ect options dialo to chan e the e0tension and prefi0. 9he other chan e here was to update the default e0ported module record name from , P r o resultin in(

library Apache+est! uses "e#$roker% ApacheApp% //or ApacheTwoApp Apache+est& 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

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

procedure +"e#,odule ."e#,odule "e#Action(tem Action*1ender: +0#ject! .e2uest: +"e#.e2uest! .esponse: +"e#.esponse! var 3andled: $oolean-! begin .esponse.Content :4 '/0110ello World//011' 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 to use it. In the pro8ect options dialo , the Directories/1onditionals pa e specifies where the 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(\Pro ram >iles\#pache Group\#pache\modules. <ow compile the pro8ect ,C t r l and + F the shared module will taMe its place alon side all the default ones. 9he final step is to modif/ the confi uration file. &ne of the menu items in the 5onfi ure #pache 6erver roup will brin up the confi uration file in <otepad. 6croll down to the commented section entitled Dynamic Shared Object 8DSO: Su%%ort. In this section, /ou will see a number of commented ;oad1odule directives to which we need to add another. :e also need to add a ;ocation directive to identif/ which ER;s will invoMe the shared module. >or e0ample, /ou ma/ wish all requested ER;s that start with / to d e l be handled b/ /our shared module. 9his is the eneric template for what needs to o in the confi file(

5oad,odule module'record'name li#rar6'name 75ocation 8&.59 1et3andler content't6pe 785ocation9 9he bits /ou customise are( m o is the s/mbol e0ported b/ the pro8ect file and is caseFsensitive. In ;istin A /ou can see this is ApacheTest_modul e l i is taMen from the M o variable ,from the #pache#pp unit- and defaults to the name of the shared module binar/ file, with an/ relative path needed to access it. In m/ e0ample, this will be modules/mod_ApacheTe s t.so U R is the caseFsensitive ER; portion that identifies what ER;s should be serviced b/ the shared module. >or the e0ample, this will be / d e l c o is taMen from the caseFinsensitive C o variable and defaults to a lowercase strin that includes the module name without the e0tension, with appended. In m/ e0ample, this is m h o a n d l e r

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

5oad,odule Apache+est'module modules8mod'Apache+est.so 75ocation 8delphi9 1et3andler mod'apachetest-handler 785ocation9 #dd these LoadModule and L directives o c a to the confi uration file and then save it. (ote: 8ust before restartin #pache /ou should be aware of the Clear,odule5ist directive. If this is present in the confi uration file /ou should ensure it occurs before /our 5oad,odule directives, as it unloads both staticall/ linMed modules and also d/namicall/ loaded modules ,shared modules-. <ow /ou can restart #pache ,as described earlier- and /ou will be able to browse to http(DDlocalhostDdelphi. 9he :eb server application will respond accordin l/ with the simple N91; strin (

-igure H: " shared module in action (ote: since the ER; portion of the L directive o c a is caseFsensitive, browsin to http(DDlocalhostD*elphi will ive an error LWL, pa e not found error.

/ebugging Shared ?odules


In order to debu a shared module, /ou must ensure #pache is not runnin . If #pache is installed as a service, stop its e0ecution with the appropriate menu item. If #pache was installed for manual invocation, maMe sure it is not runnin in an/ console windows. 6ince /our shared module is loaded b/ #pache when it starts, /ou must tell *elphi about this host application. In the Run dialo | Parameters... , enter the full path to #pache in the H field( o A s t pp

-igure K: )elling /elphi how to debug your shared module <ow o to the debu er options dialo ,T D | e o b u and o enable the D s p p r checMbo0. e a b w n ug e d

<ow /ou can set breaMpoints in /our shared module code as /ou would in an/ normal application ,althou h to be honest, I could onl/ et this operational under :indows AWWW+ m/ :indows VS tests proved unsuccessful-. :hen /ou press the Run button ,or F *elphi launches #pache, which -, 9 then loads up the shared module allowin it to be debu ed. :hen /ou are finished debu in , remember to terminate #pache in the correct manner, as described earlier. In other words, do not simpl/ reset the debu ed process ,C t r l as #pache ma/ not shut down properl/. Either use the S menu t a r item ,if available- or the correspondin commandFline or, if #pache is runnin in a console window, press C in t r l + Cthat window.

"bout 1rian Gong


)rian ;on used to worM at )orland E., performin a number of duties includin 9echnical 6upport on all the pro rammin tools. 6ince leavin in !VV", )rian has been providin trainin and consultanc/ services to the *elphi and 5^^)uilder communities, and the newl/ formin ./li0 communit/. If /ou need trainin in these products, or need solutions to problems /ou have with them, please et in touch, or visit )rianXs :eb site. 6ince leavin )orland in !VV" )rian has been providin trainin and consultanc/ services to the *elphi and 5^^)uilder communities. )esides authorin a )orland Pascal problemFsolvin booM published in !VVL, )rian is now a re ular columnist in 9he *elphi 1a azine and has had numerous articles published in 5omputin , *elphi *eveloperXs 3ournal, ;inu0 >ormat, *evelopers Review and EJE 1a azine. In his spare time ,and waitin for his 5^^ pro rams to compile- )rian has learnt the art of 8u lin and maMin inflatable ori ami paper fro s.

Do,nload %ee0hart Pro 7 for Intra,e# components. 8(49B: Intra,e# v.6.( Kor Delphi DL
*ownload

Intra,e# v.6./ Kor Delphi DL


*ownload

Do,nload %ee0hart Pro 6 for Intra,e# components. 8;9B: Intra,e# v.6./ Kor Delphi DL *ownload Kor Delphi XL Kor Delphi C and otherL *ownload Intra,e# v.4.6./ Kor Delphi XL *ownload Kor Delphi C and otherL

*ownload

*ownload

Run ;ive demo U 9ree9ree and Intraweb

Intra:eb 9utorial F Implementin a ZNello :orldZ application


#uthor( #tozed 6oftware Nomepa e( 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

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

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

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 Delphi application 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:

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

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 for debugging 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:

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

*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. Download the fully functional evaluation edition and look at the demos.

Intra:eb 9utorial F Eser Input


#uthor( #tozed 6oftware Nomepa e( http(DDwww.atozedsoftware.com

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

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:

Testing the Application Run the application as we did in the previous demo, and press F9 again after the debug window appears 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 !

Special Notes
Netscape Users Please see "Why when debugging using the IDE and Netscape 4 is the application is slow on the development machine and the task manager shows 100%?" in the FAQ. Internet Explorer Users Please see "When when using Internet Explorer is there a delay when I first click on a button?" in the FAQ. Farmers Please see "Why did the chicken cross the road?" in the FAQ.

Code Examination
Wow! That was pretty cool eh? Yes, but the really cool part was that it was done purely with standard Delphi code. We still have not written a single line of HTML or Javascript, and this is exactly how IntraWeb works. Let's take a look again at the code we wrote to do this and examine it line by line.

/ T h t b c w d a O E o s W h l i a n O u e t n t i f o e l s d W ! d t c i r o n

/ o e n f

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

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

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

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:

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:

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:

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

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

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.IW utton1Clic$*Sender& T#b@ect,var )716% )#pt% )"ome& )tringbegin )716 &A ++)"ome &A +Te)te+)#pt &A +)crollbar)Ano%'idthA.BB%heightA1BB+AddToInit3roc*+"ovaJanelaA'indo'.open*C+D)716D+C% C+ D )"ome D +C%C+ D )#pt D +C,-+,AddToInit3roc*+"ovaJanela.document.'rite*CIntraWebC,-+,AddToInit3roc*+"ovaJanela.document.clo)e*,-+,end6endo a 716 0ue aparece na barra de endereo do navegador& :eb#pplication.Request.Referer

Tutorial de C//L
http(DDwww.wOschools.comDcssD

Alguma) propriedade) do ServerController E App"ame& F o nome da aplicao. E Auth6i)t& fora uma identificao * a0uele dialog do bro')er pedindo u)u2rio e )enha,. E /e)cription& u)ada em v2rio) lugare)% como no regi)tro do )ervio% e>ceGe)% etc. E E>ception/i)plaH(ode& controla como a) men)agen) de e>ceo )ero mo)trada). E ?i)torHEnabled& habilita o boto Ioltar J Avanar% ma) )omente para efeito) de vi)uali5ao. E ?T(6?eader)& pode )er u)ado para in)erir cabealho) e>tra) na )eo K?EA/L do) ar0uivo) ?T(6 gerado) *e>.& colocar um CSS padro,. E InvalidCommand716& o IntraWeb ir2 bu)car p2gina) na 716 0uando uma ao inv2lida for pa))ada. E 3ort& A 3orta 0ue a aplicao ir2 e)cutarE 1e)trictl3)& )M um ou algun) determinado) I3) podero ace))ar *lembre;)e do) pro>ie),. E Se))ionTimeout& tempo em 0ue a )e))o )er2 finali5ada% )e no houver atividade). E Sho'1e)HncWarning& a0uela men)agem de avi)o 0ue aparece 0uando uma p2gina 0ue @2 no F mai) v2lida. E Supported ro')er)& "avegadore) )uportado). E Template/ir& /iretMrio do) Template). E Timeout716& o IntraWeb ir2 bu)car p2gina) na 716 0uando a )e))o tiver e>pirado. 1etornando o 3ath da Aplicao... 1 . "o u)e)% adicione SWSH)tem. !. "o evento onClic$ de um IW utton pro e>emplo e)creva& IWEdit.Te>t &A g)App3ath-

Heran$a isual com IntraWe! e Delphi D


http(DDbdn.borland.comDarticleDW,!L!W,OW!V",WW.html

7)ing vi)ual form inheritance 'ith IntraWeb 8.1 in /elphi =

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

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 a normal +elphi appli"ation, m' first thou)ht &as, *vi)ual, form inheritance -.FI/. So I started happil' pro)rammin) ma$in) a baseform as a parent for all m' other forms( puttin) on it a title bar( and started inheritin) from it. 0nd it &or$ed, I had the title bar on all m' forms1 2ut after I started pro)rammin) reall' fun"tional forms( I soon also &anted to "han)e somethin) about m' baseform( ma$e the la'out a bit ni"er and better fittin) &ith the forms I &as ma$in). 0nd then it happened, I had added somethin) to m' baseform( "ompiled the appli"ation and it *ust )ave an e%"eption, CControl +IW utton1+ ha) no parent 'indo'C. I hadn3t "han)ed an'thin) reall'( e%"ept enhan"in) m' baseform, and there &asn3t even a IW2utton4 on m' baseform( it &as on m' mainform1 Well after a little debu))in)( I loo$ed at the IntraWeb ne&s)roups and it3s &ebsite and soon found the ans&er, IntraWeb doesn3t support vi)ual form inheritan"e. 5ou "an use inherited "ode( but 'ou "an3t inherit the visual la'out...

4inding the problem...


Sin"e I am a stubborn person -I &anted to use visual form inheritan"e1/( and in m' opinion problems are there to be solved( I started di))in) deeper in the problem. With the help of +elphi3s .67 "ode -one of the thin)s I love most about +elphi, 'ou "an al&a's loo$ at the sour"e1/ I soon found out in &hi"h part I had to sear"h for the problem, the SetN#rder3o)ition method of TControl. When 'ou add "ontrols to a form 'ou have inherited from -the baseform/ the orderin) of the "ontrols on 'our des"endant forms -in m' "ase the 8ainform/ "han)es. 5ou "an see this orderin) &hen 'ou loo$ at the dfm file of a des"endant form, 'ou see numbers in bra"$ets 9: after the "ontrols. hese numbers tell +elphi in &hi"h order the "ontrols appear. In this Set;!rder#osition method there is a "all to .alid#arentForm -found in Forms.pas/ that returns the parent form of the "urrent "ontrol if that parent forms is a des"endant of 6ustomForm. 0nd that &as the problem, a IW0ppForm is not a des"endant of 6ustomForm1

...and trHing to fi> it.


Well onl' findin) the problem doesn3t solve it( I needed to find a &a' to fi% it. 8' first thou)ht &as, I &anted that 2orland had made .alid#arentForm a virtual prote"ted method of 6ontrol( so an'one "ould override it( and the )u's from IntraWeb "ould have made a spe"ial version that &or$ed &ith IntraWeb forms. 2ut sin"e that &asn3t the "ase( I had to )o one level up to the Set;!rder#osition method. 0nd found out that that one is private to 6ontrol( so no "han"e of overridin) that. (!.T.W. If that one coul" have be overri""en it woul" have also meant that it ha" to be "one in TIW!ase#ontrol$ an" I woul" not be able to "o that.) So I needed to )o up one level, the "aller of Set;!rder#osition &hi"h &as in this "ase the Set6hild!rder method of Win6ontrol( &here this Win6ontrol &as a"tuall' m' 8ainform. 0nd the ni"e ne&s &as that Set6hild!rder of Win6ontrol "ould be overridden1 <o&ever if I did that there "ould be other problems be"ause Set;!rder#osition &as also "alled b' other methods in 6ontrol and Win6ontrol. 2ut if that happened I &ould find out sooner or later.

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

So if the 6hild is a IW2ase6ontrol 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 IW2ase6ontrol<elper,

To hac$ or not to hac$O


=ntil so far it &as simple. 2ut no& the real "hallen)es appeared, I had to "op' the implementation of Set;!rder#osition( but that implementation used a private field "alled F6ontrols -see the .67 implementation of 6ontrol.Set;!rder#osition in the 6ontrols.pas unit/. So I loo$ed at &hat does the Set;!rder#osition has to do, it has to put itself at a "ertain position in it3s parent list of "ontrols. <o& "an it do that( &ell loo$ at the "ode I produ"ed,

his "ode &as of "ourse inspired b' the ori)inal 6ontrol implementation, but the important part I had to re&rite. What it does is it first "he"$s if it has a parent( then it sear"hes for it3s "urrent position in the parent3s "ontrol list and sees if it3s ne& position is not the same. When it finds out it has to reposition( the ha"$in) be)ins. We "an3t manipulate the parent3s "ontrol list dire"tl'( but &e "an indire"tl' throu)h the parent propert' of all the "ontrols in the "ontrol list. So &hat I do is ma$e a "op' of the "urrent "ontrol list and reposition our self in there. hen I set the parent of all the "ontrols "urrentl' in the list to nil( so the' are removed from the list and after that I add them a)ain -in the "orre"t order/ to the list b' settin) their parent propert' ba"$. So this results in a "orre"tl' ordered list. 2ut this is not all that has to be done in this method1 If it &as &e &ouldn3t have had an' visual form inheritan"e problems( be"ause this part alread' &or$ed in the 6ontrol implementation. he problem lied in the "all to .alid#arentForm in that implementation. First I thou)ht I "ould *ust remove that "all from m' implementation( but I &asn3t reall' sure and sin"e the solution &as not so hard( I made a "all to a ne& fun"tion .alid#arentIWForm. his fun"tion &as simpl' based on the e>uivalent fun"tions in Forms( I "opied them and repla"ed referen"es to 6ustomForm to IW2aseForm,

-I mi)ht be violatin) a little "op'ri)ht of 2orland here( but sin"e this is a"tuall' the most obvious implementation and 'ou "an3t use it if 'ou don3t have +elphi, I hope 2orland allo&s me to publish it./ ?o& onl' one thin) in m' Set;!rder#osition "ode mi)ht need some e%planation. I needed to "all the #allette6han)ed method of the #arentForm( but that is a prote"ted method of 6ontrol( so I used a standard ha"$ to "all a prote"ted method, define a des"endant "lass( and "all the method b' t'pe "astin) to that des"endant "lass,

TrHing it out
0nd no& the e%"itement be)ins, does it all &or$@ So I started runnin) m' &eb appli"ation, and it )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 on m' baseform and mainform b' sele"tin) the "ontrol and ri)htA"li"$( "hoose 6ontrol AB sent to ba"$ 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.4-.2C/ in +elphi D in appli"ation mode. We are usin) it for >uite some time no&( and haven3t run into an' bu)s. 5ou "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 IW2ase.FIForm -in IW2ase.FIForm.pas/ that 'ou "an use to inherited from. !f "ourse 'ou "an also *ust "op' the "ode from that form to 'our o&n base form. Eemember one thin) &hen usin) this solution, the developer of IntraWeb doesn3t support .FI( so I have no idea if it &ill &or$ for other versions of IntraWeb nor if it &ill &or$ &ith pa)emode1 I also haven3t tested this "ode &ith IntraWeb in +elphi 5 or 6( but a >ui"$ s"an of the relevant sour"e "ode of those implementations of 6ontrol doesn3t sho& an' possible problems, so *ust tr' it out.

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


Abstract: This article will explain how to use the %&'!ro er 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 F%press te"hnolo)' that allo&s the "reation of hinA6lients to 8ulti ier appli"ations( based on a Web 2ro&ser. 2' usin) the G872ro$er &e "an "onne"t it to a +ataSet#rovider and e%tra"t information from an appli"ation server in a G87 format( &hi"h is sent to the bro&ser. he data is then updated -"reatin) a lo"al "a"he "alled HdeltaH/ and sent ba"$ to the G872ro$er( &hi"h repasses the updatin) to the o +ataSet#rovider and finall' to database server. he pa)eIs interfa"e -the < 87 "ode/ is produ"ed b' the InetG#a)e#rodu"er -former 8idas#a)e#rodu"er/. he *avaS"ript "odes "arr' out the &or$abilit' of the pa)e( su"h as the manipulation of the G87 data pa"$et -this is basi"all' done b' >mldb.@) and >mldi)p.@) files/. he most interestin) aspe"t of this ar"hite"ture is that the user "an &or$ lo"all' in the re"ords( doin) updates( inserts and deletes( &ithout the need of a ne& re>uisition to the server in ea"h operation. 0ll the updates are sent to the server onl' &hen the user as$s for the 0ppl' "ommand. he IntraWeb offers a similar option( available throu)h the "omponents of the IW 6lient Side palette. he problem is that the data sent to the bro&ser are "urrentl' readAonl'. In this arti"le &e &ill "reate an IntraWeb appli"ation "ombinin) G872ro$er features. What &e &ill basi"all' do is to adapt the "ode )enerated b' the InetG#a)e#rodu"er to the IntraWeb.

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

%he <2"Bro=er architecture ,ith IntraWe#


he follo&in) pi"ture sho&s the G872ro$er ar"hite"ture( usin) IntraWeb as Web server appli"ation.

0reatin' the application and the data#ase connection


Start a ne& IntraWeb Stand 0lone appli"ation &ith a +ata8odule -*ile+,ew+-ther+IntraWeb/. #ut a SJ76onne"tion -from dbF%press/ "omponent in the +ata8odule and "onfi)ure a "onne"tion to the Interbase F8#7!5FF.K+2 database. 0fter that( set its 7o)in#rompt propert' to False. #ut a SJ7+ataSet -from dbF%press/ and set its SJ76onne"tion propert'. 'pe Lsele"t 6=S M?!( 6=S !8FE( 6!? 06 MFIES ( 6!? 06 M70S from 6=S !8FEN in its 6ommand e%t propert'. #ut a +ataSet#rovider -from +ata 0""ess/ "omponent in the +ata8odule and set its +ataSet propert' to SJ7+ataSet4. #ut also a G872ro$er -from InternetF%press/ and set its #rovider?ame propert' to +ataSet#rovider4( and 6onne"ted to rue.

In this e%ample &e &ill not "reate an appli"ation server. So the +ataSet#rovider and G872ro$er &ill remain in the same +ata8odule. If 'ou &ant to use a appli"ation server the steps are basi"all' the same.

0reatin' the main form


Ko to the main form and usin) IW7abels( IWFdits and IW2uttons -from IW Standard/ build 'our user interfa"e( some li$e the pi"ture belo&. <ere &e &ill use onl' the main table fields. +efine the ?ame propert' of the IWFdits "omponents to 6=S ?!( 6=S !8FE( 6!? 06 FIES and 6!? 06 70S respe"tivel'.

<ere is the "ode that 'ou must put in the S"riptFvents propert' -!n6li"$/ of ea"h one of the buttons, 2utton First -OP/ #rior -P/ ?e%t -B/ 7ast -BO/ Insert +elete =ndo #ost 0ppl' S"riptFvents -!n6li"$/ If-%mlMread'/FieldKroup4M+isp.first-/Q If-%mlMread'/FieldKroup4M+isp.up-/Q If-%mlMread'/FieldKroup4M+isp.do&n-/Q If-%mlMread'/FieldKroup4M+isp.last-/Q If-%mlMread'/FieldKroup4M+isp.ne&Eo&-/Q if-%mlMread'/FieldKroup4M+isp.removeEo&-/Q if-%mlMread'/FieldKroup4M+isp.undo-/Q if-%mlMread'/FieldKroup4M+isp.post-/Q do"ument.SubmitForm.elements.IWM0"tion.valueR3IW2= !?93Q if-%mlMread'/G872ro$er4MES.0ppl'-SubmitMG872ro$er4( SubmitMG872ro$er4.postdelta/Q !?9 in this "ase is the name of 0ppl' 2utton

IW2=

Eemember that SavaS"ript is "aseAsensitive1

Settin' the We#2idas >avaScript files


6reate a dire"tor' "alled file) in the dire"tor' &here 'ou saved the pro*e"t files -or &here the stand alone appli"ation &ill be run/. 6op' to this dire"tor' the >mldb.@) and >mldi)p.@) files that are in the dire"tor' T-+F7#<I//Sour"e/Web8idas.

We need to do a little modifi"ation in the >mldb.@) file so that there is not a "onfli"t &ith the fun"tions defined b' the IntraWeb. !pen this file and on line 343 "han)e the de"laration H.alidateH for H+o.alidateH. +o the same on line 409. 0ttention, ?ote that even usin) IntraWeb 'ou are ma$in) use of 8I+0S/+ataSnap te"hnolo)ies. he use of Web8idas te"hnolo)' re>uires a li"ense from +elphi Fnterprise. See the 2orland do"umentation for further information about the developin) &ith 8I+0S/+ataSnap. he ne%t step is to "reate a SavaS"ript file &hi"h defines the )lobal variables used b' Web8idas. 6reate a file "alled defvar).@) in the same dire"tor' -file)/. he "ontent of the file is the follo&in),
var var var var var var :,5$roker '.1! ;ataForm ! FieldGroup '<ames! FieldGroup '(;s! FieldGroup ';isp! 1u#mit':,5$roker !

?ote that here the )lobal variables are *ust defined. We initialiUe the variables in a se"ond file that 'ou must "reate in the same dire"tor' file)( &ith the name initvar).@). <ere is the "ontent of the file,
:,5$roker '.1 4 new xml.ow1et*:,5PAC=>+% null% null-! ;ataForm 4 document./orms?@1u#mitForm@A! FieldGroup '<ames 4 new Arra6*BC&1+'<0B% BC&1+0,>.B% BC0<+AC+'F(.1+B%BC0<+AC+'5A1+B-! FieldGroup '(;s 4 new Arra6*;ataForm .C&1+<0% ;ataForm .C&1+0,>.% ;ataForm .C0<+AC+F(.1+% ;ataForm .C0<+AC+5A1+-! FieldGroup ';isp 4 new xml;ispla6*:,5$roker '.1% FieldGroup '(;s% FieldGroup '<ames% null-! 1u#mit':,5$roker 4 document./orms?@1u#mitForm@A! xml'read64true!

?ddin' the >avaScript files


he ne%t step is to in"lude the Web8idas s"ript files to do"ument and the file that defines the )lobal variables. We "an do this usin) AddScript4ile method of IW0ppForm. In the !n6reate event of main form t'pe this,
procedure +("Form .("AppFormCreate*1ender: +0#ject-! begin Add1criptFile*@8/iles8xmld#.js@-! Add1criptFile*@8/iles8xmldisp.js@-!

Add1criptFile*@8/iles8de/Cars.js@-! end

?ote that &e do not in"lude the initialiUation file of the SavaS"ript -initvar).@)/ variables. his "ode must be added to the initialiUation of the < 87 do"ument( as &e &ill do further on usin) AddToInit3roc.

Initiali1in' the <2" pac=et the and We#2idas varia#les


?o& &e &ill add the the G87 data pa"$et to the do"ument and in"lude in the InitialiUe fun"tion the SavaS"ript "ode that initialiUes the Web8idas variables. In the !nEender event of the main form &rite the follo&in),
procedure +("Form .("AppForm.ender*1ender: +0#ject-! var 15 : +1tring5ist! D : 0leDariant! ( : integer! :,5 : +("3+,5+ag! //declare +W0TM*Ta& in uses begin :,5:4+("3+,5+ag.Create+ag*@:,5@-! try :,5.Add1tringParam*@(;@%@:,5PAC=>+@-! :,5.Contents.Add+ext*;ata,odule .:,5$roker .Get:,5.ecords*( %D%?A--! >xtra3eader.Clear! 88 clear >xtra3eaders >xtra3eader.Add*:,5..ender-! 88 add the :,5 ;ata Packet !inally :,5.Free! end // add initiali2ation 3ariables to the +nitiali2e (unction o( +W docu$ent 15:4+1tring5ist.create! try 15.5oadFromFile*@/iles8initCars.js@-! Add+o(nitProc*15.+ext-! !inally 15.Free! end end

Eemember to de"lare IW?T(6Tag in 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,

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 G872ro$er. When &e &or$ &ith InternetF%press appli"ations( the G872ro$er is automati"all' re)istered as the main "omponent of dispat"h. G872ro$er )et the +elta and repassin) it to the server appli"ation -+ataSet#rovider/( &ithout the need of re>uisition handle. We "an also "reate a event handler for its !nKetEesponse and appl' the "a"he manuall' usin) the method 0ppl'G87=pdates. =sin) G872ro$er &ith IntraWeb &e "an3t to use this auto dispa"th me"hanism o manuall' )et and appl' the delta in the IntraWeb 0ppli"ation( in the !n6li"$ event of IW2utton9 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%(-! // appl' delta

+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 Savas"ript "ode in the !n6li"$ event of this button( to send the delta to the IntraWeb server. his fun"tion submit the form internall'( &ithout the IntraWeb handlin). 0s &e manuall' submit the form( then &e have a problem( the !n6li"$ event in the IntraWeb server never fire. o do this( &e need to set manuall' a <iddenField named IWM0"tion -alread' defined b' IW/ to point to IW2= !?9. We made this in the be)innin) of the arti"le( in !n6li"$ S"riptFvent of IW2utton9( see,
document.1u#mitForm.elements.("'Action.Calue4@("$&++0<E@!

?ote that( in a normal IntraWeb appli"ation( this is made internall' in the Submit6li"$ fun"tion. hen( &hen the form is submited( IntraWeb read this hidden field to map the ri)ht event in the server( in this "ase( !n6li"$ of IW2utton9.

%estin' the application


Eun the appli"ation. In"lude( update and delete some re"ords( and note that there is no "ommuni"ation &ith the Web server. 6li"$ then on the button 0ppl' to send the delta -G87/ to the server that &ill repass the updated data to the G872ro$er. he follo&in) pi"tures sho&s an update in the t&o first re"ords( and after the 0ppl' &e "an see that the o +elta &as applied "orre"tl' in the Interbase database.

Do,nload
+o&nload this e%ample from 6ode6entral 0di"ionando um h'perlin$ a um IWIma)e

#ara "li"ar em uma ima)em( e ser redire"ionado a um site( no evento on6li"$ do seu "omponente IWIma)e es"reva Web0ppli"ation.Ko o=E7-V&&&.intra&.hp)."om.brI/.

3ara habilitar o IoltarJAvanar 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 a propriedade 3ort da unit IWServerController. Ar0uivo) ace))ado) com a 716 )o arma5enado) pelo bro')er. Se voce de)e@a criar ar0uivo) dinSmico) 0ue no )e@am arma5enado)% u)e ..Jfile)ncJKfilenameL% em ve5 de% ..Jfile)JKfilenameL. /e)ta maneira o bro')er )er2 in)truRdo para no arma5en2;lo). Yuando oc% desen ol e uma aplica$"o IntraBe! para o Apache 2, oc% precisa ter certe.a &ue incluiu a unit IWInitApacheTBo na clusula uses. /e oc% criou uma aplica$"o Apache 2 usando o Bi.ard, isto ' feito automticamente. ?!sL 8oc% precisa fa.er as mudan$as apropriadas na 8C2 do Delphi D antes de seus mdulos rodarem com o Apache 2. 3ais detalhes no Dr. Bo!Us Be!site emL
http(DDwww.drbobLA.comD*elphiYD#pacheAWLW.htm