<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog de desenvolvimento da Milfont Consulting, Client e Server-side &#187; Ajax</title>
	<atom:link href="http://www.milfont.org/tech/category/web-development/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.milfont.org/tech</link>
	<description>Blog da Comunidade Milfont Consulting, uma empresa especializada em desenvolvimento Web, principalmente Javascript, node.js e muito Javascript.</description>
	<lastBuildDate>Thu, 26 Jan 2012 11:30:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Imersão ExtJS 4</title>
		<link>http://www.milfont.org/tech/2012/01/10/imersao-extjs-4/</link>
		<comments>http://www.milfont.org/tech/2012/01/10/imersao-extjs-4/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 11:46:50 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cursos]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[sencha]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[curso]]></category>
		<category><![CDATA[egenial]]></category>
		<category><![CDATA[ExtJS]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=1552</guid>
		<description><![CDATA[Olá, é com grande satisfação que gostaríamos de compartilhar com você nosso novo curso curso online, o Imersão ExtJS 4 que será ministrado pelo Christiano Milfont que irá tratar sobre as melhores práticas para desenvolver WebApps com riqueza de usabilidade usando ExtJS 4. O Framework Javascript de propósito geral ExtJS possui Widgets [componentes] que fascinam e [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.milfont.org/tech/2012/01/10/imersao-extjs-4/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>Olá, é com grande satisfação que gostaríamos de compartilhar com você nosso novo curso curso online, o <a title="Imersão ExtJS 4" href="http://www.egenial.pro/pt/extjs">Imersão ExtJS 4</a> que será ministrado pelo <a href="http://www.milfont.org/tech/about/">Christiano Milfont</a> que irá tratar sobre as melhores práticas para desenvolver WebApps com riqueza de usabilidade usando <a href="http://www.sencha.com/products/extjs/">ExtJS 4</a>.</p>
<p>O Framework Javascript de propósito geral ExtJS possui Widgets [componentes] que fascinam e agilizam o desenvolvimento principalmente de aplicações comerciais que são migradas do Desktop.</p>
<p>Existem <a href="http://www.loiane.com/2011/12/capitulo-gratuito-do-meu-livro-extjs-4-first-look/">bons livros já publicados</a>, como o da brasileira <a href="http://www.loiane.com/">Loiane Groner</a>, que também está publicando um curso gratuito no <a href="http://www.loiane.com/2011/11/curso-de-extjs-4-gratuito/">formato de Screencasts</a> cobrindo o básico do ExtJS e aprofundando com muitos exemplos. O próprio Framework contém uma <a href="http://docs.sencha.com/ext-js/4-0/">excelente documentação</a>, uma gama <a href="http://www.sencha.com/products/extjs/examples/">enorme de exemplos</a>, abrangendo inúmeras situações.</p>
<p><a href="http://www.amazon.com/gp/product/1849516669/ref=as_li_ss_il?ie=UTF8&amp;tag=milftech-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1849516669"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL110_&amp;ASIN=1849516669&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=milftech-20&amp;ServiceVersion=20070822" alt="" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=milftech-20&amp;l=as2&amp;o=1&amp;a=1849516669" alt="" width="1" height="1" border="0" /></p>
<h2 dir="ltr">Bootstrapping</h2>
<p>Uma grande dificuldade para desenvolver WebApps, principalmente para desenvolvedores especializados no Backend, é a aridez de desenhar a interface com CSS e trabalhar o comportamento da visão com Javascript.</p>
<p>Enquanto os sistemas operacionais fornecem um conjunto de componentes de Interface por meio de API e Look&#8217;n'Feel padronizado para você simplesmente construir a aplicação, na Web o trabalho é bastante artesanal, inclusive com a necessidade de trabalhar com ferramentas especializadas de design como GIMP ou Photoshop.</p>
<p>Não é à toa que o <a href="http://twitter.github.com/bootstrap/">Toolkit Bootstrap</a> disponibilizado pelo Twitter faz tanto sucesso, inclusive com o mesmo nome da técnica de construir um modelo de layout com componentes padronizados para facilitar a construção de aplicações web.</p>
<p>O ExtJS já fornece embutido no seu Framework todo um conjunto de templates e elementos gráficos para utilizar com seus componentes, além da abertura para customização caso seja necessário. Além disso existem diversos templates distribuídos por terceiros.</p>
<h2 dir="ltr">Diferencial do Curso</h2>
<p>Como já mencionado, existe uma infinidade de materiais disponíveis na Web onde você pode aprender por conta própria.</p>
<p>O diferencial do nosso curso não é simplesmente aprender sobre os Widgets e montar telas ricas, é a experiência de <a href="http://www.milfont.org/tech/2009/06/29/introducao-ao-ext/">quem desenvolve</a> com o Framework desde que ele era uma extensão do <a href="http://developer.yahoo.com/yui/">YUI</a> [Framework do Yahoo].</p>
<p>Iremos demonstrar as melhores práticas de como construir aplicações verdadeiramente ricas que são proibitivas de serem construídas num processo artesanal por meio de JS e CSS por dar muito trabalho.</p>
<p>Vamos tratar sobre assuntos espinhosos, como extender componentes, modificar o comportamento natural de elementos do próprio HTML, como navegação por meio de eventos que não existem e ainda vamos dar uma palhinha de como construir uma aplicação que se adapte a dispositivos móveis usando o SenchaTouch com o mínimo de esforço dentro do possível.</p>
<p>Matricule-se já e <a href="http://www.egenial.pro/pt/extjs">garanta sua vaga</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2012/01/10/imersao-extjs-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problema de Entity Body incluso em HTTP DELETE Request</title>
		<link>http://www.milfont.org/tech/2011/04/04/problema-de-entity-body-incluso-em-http-delete-request/</link>
		<comments>http://www.milfont.org/tech/2011/04/04/problema-de-entity-body-incluso-em-http-delete-request/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 14:34:26 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=1218</guid>
		<description><![CDATA[Problema que detectei em algumas applicações que estamos desenvolvendo com Extjs+Jquery: Na máquina de entrega o request do tipo DELETE funcionava tranquilamente, na máquina de produção hospedada no Rackspace quebrava. Como a máquina de entrega estava dentro da nossa rede, suspeitei logo da conexão, firewall e essas coisas. O @rponte me deu a dica desse [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.milfont.org/tech/2011/04/04/problema-de-entity-body-incluso-em-http-delete-request/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>Problema que detectei em algumas applicações que estamos desenvolvendo com Extjs+Jquery: Na máquina de entrega o request do tipo DELETE funcionava tranquilamente, na máquina de produção hospedada no <a href="http://www.rackspace.com/index.php">Rackspace</a> quebrava. Como a máquina de entrega estava dentro da nossa rede, suspeitei logo da conexão, firewall e essas coisas.</p>
<p>O <a href="http://twitter.com/#!/rponte">@rponte</a> me deu a <a href="http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request">dica desse post</a> que ele encontrou com o mesmo tipo de problema. Nunca tinha percebido que a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">spec HTTP nem proibe e nem recomenda</a> corpo em DELETE. Não faz muito sentido enviar corpo realmente em DELETE, mas até aí tudo bem.</p>
<p>Para completar, o Extjs já previa esse problema e o <a href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonWriter">JsonWriter</a> possui uma propriedade chamada &#8220;encodeDelete&#8221; para você explicitamente definir que não quer corpo em DELETE, por default já vem assim.</p>
<p>No console do firebug eu utilizava o <a href="http://api.jquery.com/jQuery.ajax/">$.ajax</a> e o <a href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Ajax">Ext.Ajax</a> diretamente com a mesma url para enviar DELETE e funcionava, mas na aplicação não funcionava. Conversando com o pessoal da rede eles me disseram que trocaram o firewall recentemente e observando o log a chamada sequer passava por lá, ou seja, provavelmente ele já rejeita qualquer conexão DELETE com body.</p>
<p>Fui analizar o código do Extjs e ele enviava um body, a diferença é que era vazio, mas ia. Fiz um hack para destruir qualquer parametro quando a conexão fosse para o DELETE e consertou, como pode ver no código abaixo:</p>
<p><script src="https://gist.github.com/885190.js"> </script><br />
<a href="https://gist.github.com/raw/885190/c742a8aa8c1b7d1afce4a8a17ea888f22b9171fb/hack.httpproxy.extjs.3x.js">Link caso não consiga ver no seu reader.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2011/04/04/problema-de-entity-body-incluso-em-http-delete-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BrazilJS 2011</title>
		<link>http://www.milfont.org/tech/2011/03/19/braziljs2011/</link>
		<comments>http://www.milfont.org/tech/2011/03/19/braziljs2011/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 18:01:05 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[braziljs]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=1196</guid>
		<description><![CDATA[Fortaleza sediará a primeira conferência brasileira de Javascript nos dias 13 e 14 de Maio no teatro da Faculdade Sete de Setembro,  FA7. Submeta um trabalho para o evento @braziljs. Caravanas, Hotéis, Informações, etc O pessoal do Piauí, a #caravanapi está organizando a primeira caravana que temos notícia. Caso tenha uma caravana, nos comunique, fazemos [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.milfont.org/tech/2011/03/19/braziljs2011/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p><a href="http://braziljs.com.br/2011/"><img title="banner maior" src="http://braziljs.com.br/2011/images/banner-496.jpg" alt="" width="496" height="214" /></a></p>
<p>Fortaleza sediará a primeira <a href="http://braziljs.com.br/2011">conferência brasileira de Javascript</a> nos dias <a href="http://www.agendatech.com.br/eventos/tecnologia/2011/brazil-js">13 e 14 de Maio</a> no teatro da <a href="http://braziljs.com.br/2011/#!/local">Faculdade Sete de Setembro,  FA7</a>. <a href="http://call4paperz.com/events/13">Submeta</a> um trabalho para o evento <a href="http://twitter.com/#!/braziljs">@braziljs</a>.</p>
<h2>Caravanas, Hotéis, Informações, etc</h2>
<p>O pessoal do Piauí, a <a href="http://jump2.me/6vZ">#caravanapi</a> está organizando a primeira caravana que temos notícia. Caso tenha uma caravana, nos comunique, fazemos questão de ajudar com o que pudermos. Enviamos algumas opções de hotéis que já visitamos.</p>
<h2>Inscrições</h2>
<p>Corra <a href="http://braziljs.com.br/2011/#!/inscricoes">para se inscrever</a> porque o valor nesse momento custa somente 60 reais, praticamente um valor simbólico para um evento desse porte. Esse valor será mantido até o dia 31 de Março.</p>
<h2>Patrocinadores</h2>
<p>Até o momento, temos como patrocinadores [esse post será atualizado de acordo com a página do evento]:</p>
<h1>Diamante</h1>
<p><a href="http://www.unum.com.br/"><img src="http://braziljs.com.br/2011/images/unum.png" alt="" /></a></p>
<h1>Ouro</h1>
<p><a href="http://www.triadworks.com.br/"><img src="http://braziljs.com.br/2011/images/triadworks2.png" alt="" /></a></p>
<h1>Prata</h1>
<p><a href="http://www.caelum.com.br/"><img src="http://braziljs.com.br/2011/images/caelum_logo_transparent.png" alt="" /></a></p>
<h1>Bronze</h1>
<p><a href="http://www.github.com/"><img src="http://braziljs.com.br/2011/images/github.png" alt="" /></a></p>
<h2>Banner para blogs</h2>
<p>Disponibilizamos algumas imagens para quem quiser apoiar o evento</p>
<p><a href="http://braziljs.com.br/2011/images/banner-240.jpg"><img class="alignnone" title="banner pequeno" src="http://braziljs.com.br/2011/images/banner-240.jpg" alt="" width="240" height="104" /></a></p>
<p><a href="http://braziljs.com.br/2011/images/banner-496.jpg"><img class="alignnone" title="banner maior" src="http://braziljs.com.br/2011/images/banner-496.jpg" alt="" width="496" height="214" /></a></p>
<h2>Agenda</h2>
<div id="agendaSexta">
<div>
<h2>Sexta 13/05/11</h2>
<table id="programacao">
<tbody>
<tr>
<td>Horário</td>
<td>Palestras &#8211; Palestrantes</td>
</tr>
<tr>
<td>07h00</td>
<td>Credenciamento e Café da Manhã</td>
</tr>
<tr>
<td>07h50</td>
<td>Abertura</td>
</tr>
<tr>
<td>08h00</td>
<td>Tema a confirmar &#8211; Keynote a confirmar</td>
</tr>
<tr>
<td>09h00</td>
<td>Tema a confirmar &#8211; Keynote a confirmar</td>
</tr>
<tr>
<td>10h00</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>10h30</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/mauriciolinhares.png" alt="" /> </a> Maurício Linhares<br />
HTTP: Esse ilustre desconhecido</td>
</tr>
<tr>
<td>11h15</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/loiane.jpg" alt="" /> </a> Loiane Groner<br />
Aprimorando sua aplicação Java com ExtJS</td>
</tr>
<tr>
<td>12h00</td>
<td>Almoço (não incluso)</td>
</tr>
<tr>
<td>13h00</td>
<td>Lightning Talks &#8211; 10min &#8211; Escolhidas por votação<br />
<a href="http://call4paperz.com/events/13">Submeta enquanto há tempo</a></p>
<table id="programacao">
<tbody>
<tr>
<td>13h00</td>
<td>Bruno PorKaria<br />
Webapp, já posso investir nisso ?<br />
Votos válidos: 53</td>
</tr>
<tr>
<td>13h15</td>
<td>Leonardo Balter<br />
Padrões Javascript e JSHint<br />
Votos válidos: 37</td>
</tr>
<tr>
<td>13h30</td>
<td>Ricardo Coelho<br />
Criando Plugins jQuery<br />
Votos válidos: 35</td>
</tr>
<tr>
<td>13h45</td>
<td>Abraão Alves<br />
Javascript me Odeia?!  Fazendo as pazes com javaScript.<br />
Votos válidos: 34</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>14h00</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/gc.jpg" alt="" /> </a> Guilherme Chapiewski<br />
Aplicações para iOS com JavaScript e Titanium Mobile</td>
</tr>
<tr>
<td>14h40</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>15h00</td>
<td>Palestrante a confirmar</td>
</tr>
<tr>
<td>15h45</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/fnando.jpg" alt="" /> </a> Nando Vieira<br />
Usando Node.js na prática; ou como fiz o Presentta</td>
</tr>
<tr>
<td>16h30</td>
<td>Palestrante a confirmar</td>
</tr>
<tr>
<td>17h15</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>17h45</td>
<td>Palestrante a confirmar</td>
</tr>
<tr>
<td>18h30</td>
<td>Palestrante a confirmar</td>
</tr>
<tr>
<td>20h00</td>
<td>Hora Extra</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Sábado 14/05/11</h2>
<table id="programacao">
<tbody>
<tr>
<td>Horário</td>
<td>Palestras &#8211; Palestrantes</td>
</tr>
<tr>
<td>07h00</td>
<td>Credenciamento e Café da Manhã</td>
</tr>
<tr>
<td>07h50</td>
<td>Abertura</td>
</tr>
<tr>
<td>08h00</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/maujor-twitter.jpg" alt="" /> </a> Keynote Maurício Samy Silva (maujor)</td>
</tr>
<tr>
<td>09h00</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/rworth.jpg" alt="" /> </a> Keynote Richard Worth</td>
</tr>
<tr>
<td>10h00</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>10h30</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/emerson.jpg" alt="" /> </a> Emerson Leite<br />
Realtime Web Applications with Node.JS</td>
</tr>
<tr>
<td>11h15</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/bruno.jpg" alt="" /> </a> Bruno Oliveira<br />
Desenvolvimento indolor com JQuery Mobile</td>
</tr>
<tr>
<td>12h00</td>
<td>Almoço (não incluso)</td>
</tr>
<tr>
<td>13h00</td>
<td>Lightning Talks &#8211; 10min &#8211; Escolhidas por votação<br />
<a href="http://call4paperz.com/events/13">Submeta enquanto há tempo</a></p>
<table id="programacao">
<tbody>
<tr>
<td>13h00</td>
<td>jlbfalcao<br />
Testes em Javascript na prática<br />
Votos válidos: 26</td>
</tr>
<tr>
<td>13h15</td>
<td>Henrique Gogó<br />
Descobrindo o CouchDB<br />
Votos válidos: 23</td>
</tr>
<tr>
<td>13h30</td>
<td>Christiano Milfont<br />
Sua WebApp funcionando totalmente offline com Sencha.<br />
Votos válidos: 22</td>
</tr>
<tr>
<td>13h45</td>
<td>Estevão<br />
NodeJS &#8211; Javascript no Servidor<br />
Votos válidos: 21</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>14h00</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/brunocarvalho.jpg" alt="" /> </a> Bruno Mentges de Carvalho<br />
Global é do mal e o temido escopo local &#8211; Entendendo como funciona e trabalhando para evitar conflitos mantendo a testabilidade.</td>
</tr>
<tr>
<td>14h40</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>15h00</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/douglas.jpg" alt="" /> </a> Douglas Campos<br />
ECMAScript na JVM &#8211; unindo o poder da plataforma Java com a Flexibilidade do ECMAScript</td>
</tr>
<tr>
<td>15h45</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/andrei.jpg" alt="" /> </a> Andrei Formiga<br />
Programação Funcional: Novas Fronteiras e Expansão da Mente</td>
</tr>
<tr>
<td>16h30</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/ferreira.jpg" alt="" /> </a> Rafael Ferreira<br />
Capability Based Security: repensando a segurança com ajuda da linguagem</td>
</tr>
<tr>
<td>17h15</td>
<td>Coffee Break</td>
</tr>
<tr>
<td>17h45</td>
<td><a href="http://braziljs.com.br/2011/#"> <img src="http://braziljs.com.br/2011/images/danielpassos.png" alt="" /> </a> Daniel Passos<br />
Programando em JS no Android</td>
</tr>
<tr>
<td>18h30</td>
<td>Palestrante a confirmar</td>
</tr>
<tr>
<td>20h00</td>
<td>Hora Extra</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2011/03/19/braziljs2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extjs e DWR</title>
		<link>http://www.milfont.org/tech/2009/07/02/extjs-e-dwr/</link>
		<comments>http://www.milfont.org/tech/2009/07/02/extjs-e-dwr/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 19:11:42 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[DWR]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JEE]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Model 3]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=705</guid>
		<description><![CDATA[Nesse artigo eu pretendo trabalhar dois conceitos principais de uso do Extjs, extensão/customização de componentes e acesso a dados server-side com base em experiência recente em um projeto que desenvolvemos. Esse projeto em questão é um ERP que tinha a necessidade de manter a usabilidade similar a sua versão antiga, feita em Delphi, para o [...]]]></description>
			<content:encoded><![CDATA[<p>Nesse artigo eu pretendo trabalhar dois conceitos principais de uso do <a href="http://www.milfont.org/tech/tag/extjs/">Extjs</a>, extensão/customização de componentes e acesso a dados server-side com base em experiência recente em um projeto que desenvolvemos. Esse projeto em questão é um ERP que tinha a necessidade de manter a usabilidade similar a sua versão antiga, feita em Delphi, para o desktop.</p>
<p>Para suprir essa necessidade de usabilidade tivemos que adotar alguns conceitos, como ser totalmente stateless e modificar a arquitetura MVC2 para o <a href="http://www.milfont.org/tech/2008/09/08/mvc-model-3-e-camadas/">MVC3</a>. No server-side trabalhamos com um domain model baseado em Hibernate, Spring e Facades e Services com DWR. Nada de frameworks MVC2, não nos preocupamos com renderização e sim com a API. No lado cliente usamos Extjs com algumas modificações que fiz para integrar de forma suave com o DWR.</p>
<p>Primeiro precisamos entender como o Extjs trabalha com herança. Basicamente há um método no objeto Ext que faz esse trabalho de extensão dos componentes, funciona da seguinte maneira:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Formato:</span>
<span style="color: #003366; font-weight: bold;">var</span> NovoComponente <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>velhoComponente<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> 
          <span style="color: #009966; font-style: italic;">/* metodos e propriedades que serão reescritas */</span> 
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Exemplo:</span>
<span style="color: #003366; font-weight: bold;">var</span> MilfontGridPanel <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//novo construtor</span>
        constructor<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// Seu preprocessamento vai aqui</span>
        	MilfontGridPanel.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">// Seu pos-processamento vai aqui</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
        NovoMethod<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// algum novo método que você queira criar para o novo componente</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para esse projeto, criei um Ext.data.DataProxy (<a href="http://www.milfont.org/tech/2009/06/29/introducao-ao-ext/">como visto no artigo passado</a>) especialista para o DWR, criativamente denominado DWRProxy. A idéia é modificar o comportamento de buscar os dados para usar um <a href="http://www.milfont.org/tech/tag/dwr/">Creator do DWR</a>.</p>
<p>Definimos primeiro o objeto e suas propriedades necessárias:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">ux</span>.<span style="color: #660066;">data</span>.<span style="color: #660066;">DWRProxy</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>dwr_facade<span style="color: #339933;">,</span> dwr_filter<span style="color: #339933;">,</span> dwr_errorHandler<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    Ext.<span style="color: #660066;">ux</span>.<span style="color: #660066;">data</span>.<span style="color: #660066;">DWRProxy</span>.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009966; font-style: italic;">/* Propriedade que receberá a classe Java configurada como Creator */</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">data</span> <span style="color: #339933;">=</span> dwr_facade<span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">/*
	 * Propriedade que receberá uma classe java configurada como converter
	 * que servirá como filtro de busca
	 */</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_filter</span> <span style="color: #339933;">=</span> dwr_filter<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">/**
	 *
	 * Propriedade para fazer paginação, indica que deve cachear a consulta de
	 * total de elementos o controlador [fachada] deve implementar a logica de
	 * negocios adequada, quando for false consulta o total, quando for true
	 * consulta apenas a listagem e repete o total
	 */</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_total_cache</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_errorHandler</span> <span style="color: #339933;">=</span> dwr_errorHandler<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Após isso extendemos do Ext.data.DataProxy :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">ux</span>.<span style="color: #660066;">data</span>.<span style="color: #660066;">DWRProxy</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">DataProxy</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">/**
     * Método Load do Ext.data.DataProxy overrided
     */</span>
&nbsp;
    load <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>params<span style="color: #339933;">,</span> reader<span style="color: #339933;">,</span> callback<span style="color: #339933;">,</span> scope<span style="color: #339933;">,</span> arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">/**
	 * Escopo &quot;this&quot; mapeado para a variável &quot;s&quot; porque dentro do callback do
	 * DWR o escopo &quot;this&quot; não pertence ao objeto Ext.ux.data.DWRProxy.
	 */</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
&nbsp;
        params <span style="color: #339933;">=</span> params <span style="color: #339933;">||</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>params.<span style="color: #660066;">cache</span> <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_total_cache</span> <span style="color: #339933;">=</span> params.<span style="color: #660066;">cache</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>params.<span style="color: #660066;">filter</span> <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_filter</span> <span style="color: #339933;">=</span> params.<span style="color: #660066;">filter</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> result<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_filter</span><span style="color: #339933;">,</span> params.<span style="color: #660066;">start</span><span style="color: #339933;">,</span> params.<span style="color: #660066;">limit</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_total_cache</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
			callback<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                <span style="color: #006600; font-style: italic;">//aqui passamos o retorno do DWR </span>
                               <span style="color: #006600; font-style: italic;">// que chamei de response,  para o extjs</span>
				result <span style="color: #339933;">=</span> reader.<span style="color: #660066;">readRecords</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				callback.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>scope<span style="color: #339933;">,</span> result<span style="color: #339933;">,</span> arg<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			errorHandler<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				scope.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loadexception&quot;</span><span style="color: #339933;">,</span> s<span style="color: #339933;">,</span> arg<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				s.<span style="color: #660066;">dwr_errorHandler</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			timeout<span style="color: #339933;">:</span><span style="color: #CC0000;">100000</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dwr_total_cache</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loadexception&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arg<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            callback.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>scope<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> arg<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A fachada DWR é uma classe comum, segue um exemplo de uso com Hibernate:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//classe para satisfazer o transporte para o Extjs</span>
<span style="color: #003366; font-weight: bold;">public</span> final <span style="color: #003366; font-weight: bold;">class</span> DataTransferObject <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">private</span> int total<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">private</span> List<span style="color: #339933;">&lt;?</span> <span style="color: #003366; font-weight: bold;">extends</span> Object<span style="color: #339933;">&gt;</span> results<span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">//sets e gets</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">class</span> AjaxFacade <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//injeta um repositorio, whatever</span>
    <span style="color: #003366; font-weight: bold;">private</span> Repository repository <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">public</span> DataTransferObject find<span style="color: #009900;">&#40;</span>Object filter<span style="color: #339933;">,</span> int start<span style="color: #339933;">,</span> int limit<span style="color: #339933;">,</span> boolean cache<span style="color: #339933;">,</span> HttpSession session<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        DataTransferObject dto <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> DataTransferObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//verifica se o Proxy está passando true </span>
        <span style="color: #006600; font-style: italic;">// indicando que está paginando</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cache<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Integer total <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Integer<span style="color: #009900;">&#41;</span> session.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;totalObject&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            dto.<span style="color: #660066;">setTotal</span><span style="color: #009900;">&#40;</span>total<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            session.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;totalObject&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Integer total <span style="color: #339933;">=</span> repository.<span style="color: #660066;">count</span><span style="color: #009900;">&#40;</span>filter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            dto.<span style="color: #660066;">setTotal</span><span style="color: #009900;">&#40;</span>total<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            session.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;totalObject&quot;</span><span style="color: #339933;">,</span> total<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        List<span style="color: #339933;">&lt;</span>Object<span style="color: #339933;">&gt;</span> retorno <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>Object<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span> repository.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span>filter<span style="color: #339933;">,</span> start<span style="color: #339933;">,</span> limit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        dto.<span style="color: #660066;">setResults</span><span style="color: #009900;">&#40;</span>retorno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> dto<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Para o Grid visto no artigo passado, basta instanciar assim no javscript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    proxy<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">ux</span>.<span style="color: #660066;">data</span>.<span style="color: #660066;">DWRProxy</span><span style="color: #009900;">&#40;</span>
        AjaxFacade.<span style="color: #660066;">find</span><span style="color: #339933;">,</span> 
        <span style="color: #009900;">&#123;</span>$dwrClassName<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Project&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
        errorHandler
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            root<span style="color: #339933;">:</span> <span style="color: #3366CC;">'results'</span><span style="color: #339933;">,</span>totalProperty<span style="color: #339933;">:</span> <span style="color: #3366CC;">'total'</span><span style="color: #339933;">,</span>id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'id'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
        <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'manager.name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'manager.address.country'</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para entender o<em> {$dwrClassName:&#8221;Project&#8221;}</em> <a href="http://www.milfont.org/tech/2008/12/24/dwr-3-release-candidate-1/">visite esse post</a>.</p>
<p>Dessa forma o DWR se torna um proxy para todos os componentes do Extjs.</p>
<p>Código fonte da modificação do javascript eu <a href="http://github.com/cmilfont/MilfontExtjs/tree/master">coloquei aqui no github</a> e uma <a href="https://github.com/cmilfont/example-dwr-extjs/tree">aplicação demo aqui</a>. No próximo vou integrar o DWR com o Rails, aguardem que sai logo&#8230; ou não.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2009/07/02/extjs-e-dwr/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Introdução ao Ext</title>
		<link>http://www.milfont.org/tech/2009/06/29/introducao-ao-ext/</link>
		<comments>http://www.milfont.org/tech/2009/06/29/introducao-ao-ext/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 13:38:32 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>
		<category><![CDATA[ECMAScript]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Orientação a Objetos]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=24</guid>
		<description><![CDATA[Eu trabalho com Extjs desde que ele era uma extensão para o YUI, ainda hoje há aplicação no ar usando essa antiga tecnologia [por problema causado por algum idiota, você provavelmente será redirecionado para outro site do governo, dá uma olhada no canto esquerdo superior e clique em "IR PARA A SEPLAG"]. Para ver o [...]]]></description>
			<content:encoded><![CDATA[<p>Eu trabalho com <a href="http://www.extjs.com/products/extjs/">Extjs</a> desde que ele era uma extensão para o <a href="http://developer.yahoo.com/yui/">YUI</a>, ainda hoje <a href="http://www.seplag.ce.gov.br/seplag/categoria2/diario-oficial">há aplicação no ar</a> usando essa antiga tecnologia [por problema <a href="http://www.milfont.org/tech/2009/03/25/como-simular-trabalho-no-estado/">causado por algum idiota</a>, você provavelmente será redirecionado para outro site do governo, dá uma olhada no canto esquerdo superior e clique em "<strong>IR PARA A SEPLAG</strong>"]. Para ver o Extjs no tempo que ele se chamava ext-yui, vá no link de pesquisa avançada, preencha o input descrição em &#8220;dados da matéria&#8221; com &#8220;secretaria de cultura&#8221; por exemplo e clique no botão pesquisar.</p>
<p>Esse tutorial tem o objetivo de preparar o conhecimento para outros posts que estou escrevendo e achei necessário uma introdução apenas nos conceitos do Extjs para não confundir com as tecnologias que uso em conjunto como <a href="http://www.milfont.org/tech/tag/dwr/">DWR</a> ou no modelo <a href="http://www.milfont.org/tech/tag/rest/">REST</a> com o <a href="http://www.milfont.org/tech/tag/rails/">RubyOnRails</a>.</p>
<p>O Extjs é um <a href="http://www.milfont.org/tech/2007/10/11/frameworks-ajax/">framework javascript de propósito geral</a>, ou seja, tem um conjunto de funcionalidades que tratam <a href="http://www.milfont.org/tech/tag/ajax/">Ajax</a>, um conjunto de Widgets bem elaborados [componentes visuais como Grid e TabPanel], manipulação de DOM [Document Object Model] e BOM [Browser Object Model], tratamento de eventos, animações como Fade In e Fade Out, parser de <a href="http://www.milfont.org/tech/2007/11/04/o-que-e-json/">JSON</a>, entre outras coisas. Seus componentes são construídos com técnicas modernas de<a href="http://www.milfont.org/tech/2008/01/05/heranca-no-javascript/"> orientação</a> a <a href="http://www.milfont.org/tech/2007/10/01/overloading-e-overriding-no-javascript/">objetos</a> no javascript e manipulação de <a href="http://www.milfont.org/tech/2007/10/08/script-tag/">Scripttag</a> para recursos remotos que não suportam Ajax.</p>
<h2>Preparação</h2>
<p>Após <a href="http://www.extjs.com/products/extjs/download.php">baixar e descompactar</a> o framework [estou trabalhando na versão 2.x que é estável nessa data], recomendo que deixa a disposição das pastas conforme se encontra e coloque no seu projeto de forma que seja acessível via web, já vem com documentação e exemplos que você deve e vai usar durante o desenvolvimento. Temos a <a href="http://www.extjs.com/products/extjs/build/">opção de montar o Extjs</a> [marcando a opção "<em>Make build available via CacheFly</em>" ] no <a href="http://cachefly.com/">CacheFly</a> como um servidor <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">CDN</a> para <a href="http://www.milfont.org/tech/2007/10/10/otimizando-wordpress-com-yslow/">otimizar o tráfego</a> de sua aplicação principalmente se ela será disponibilizada na internet e não apenas na intranet.</p>
<p>É necessário importar o CSS global, o adapter e o Javascript global conforme mostrado abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/javascripts/ext-2.2.1/resources/css/ext-all.css&quot; /&gt;
&lt;script src=&quot;/javascripts/ext-2.2.1/adapter/ext/ext-base.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/javascripts/ext-2.2.1/ext-all.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Pode usar outros temas para o Extjs, estarão na pasta &#8220;<em>resources/css</em>&#8220;, assim como podemos internacionalizar os componentes com arquivos que se encontram em &#8220;<em>build/locale</em>&#8220;. Exemplo com o tema &#8220;Gray&#8221; e <a href="http://en.wikipedia.org/wiki/Internationalization_and_localization">i18n</a> em português do Brasil:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/javascripts/ext-2.2.1/resources/css/ext-all.css&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/javascripts/ext-2.2.1/resources/css/xtheme-gray.css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/ext-2.2.1/adapter/ext/ext-base.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/ext-2.2.1/ext-all.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/ext-2.2.1/build/locale/ext-lang-pt_BR-min.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Internacionalização é algo pensado no Extjs de forma a facilitar a criação de arquivos de linguagem aproveitando a estrutura da linguagem [dinâmica e fracamente tipada], todas as propriedades de mensagens e textos são públicas para facilitar a reescrita como mostrado abaixo na i18n do componente de DataPicker:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">DatePicker</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">DatePicker</span>.<span style="color: #660066;">prototype</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
      todayText         <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Hoje&quot;</span><span style="color: #339933;">,</span>
      minText           <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Esta data &amp;eacute; anterior a menor data&quot;</span><span style="color: #339933;">,</span>
      maxText           <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Esta data &amp;eacute; posterior a maior data&quot;</span><span style="color: #339933;">,</span>
      disabledDaysText  <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span>
      disabledDatesText <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span>
      monthNames        <span style="color: #339933;">:</span> Date.<span style="color: #660066;">monthNames</span><span style="color: #339933;">,</span>
      dayNames          <span style="color: #339933;">:</span> Date.<span style="color: #660066;">dayNames</span><span style="color: #339933;">,</span>
      nextText          <span style="color: #339933;">:</span> <span style="color: #3366CC;">'Pr&amp;oacute;ximo M&amp;ecirc;s (Control+Direita)'</span><span style="color: #339933;">,</span>
      prevText          <span style="color: #339933;">:</span> <span style="color: #3366CC;">'M&amp;ecirc;s Anterior (Control+Esquerda)'</span><span style="color: #339933;">,</span>
      monthYearText     <span style="color: #339933;">:</span> <span style="color: #3366CC;">'Escolha um M&amp;ecirc;s (Control+Cima/Baixo para mover entre os anos)'</span><span style="color: #339933;">,</span>
      todayTip          <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;{0} (Espa&amp;ccedil;o)&quot;</span><span style="color: #339933;">,</span>
      format            <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;d/m/Y&quot;</span><span style="color: #339933;">,</span>
      okText            <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&amp;#160;OK&amp;#160;&quot;</span><span style="color: #339933;">,</span>
      cancelText        <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Cancelar&quot;</span><span style="color: #339933;">,</span>
      startDay          <span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Se você usar o CacheFly gerado pela página do Extjs, ele incluir o adapter e o global em um mesmo arquivo, vai ser algo como:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://extjs.cachefly.net/ext-2.2.1/resources/css/xtheme-gray.css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://extjs.cachefly.net/builds/ext-cdn-771.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<h2>Adapter</h2>
<p>Quando o Extjs passou a ser um framework independente do YUI, passou a adotar outros frameworks como base para funções básicas de manipulação de DOM e Ajax, hoje suporta trabalhar em conjunto com YUI, JQuery, Prototype e totalmente independente. Se o projeto já tem Jquery ou outro framework que trabalha com o Extjs, a utilização dos dois é muito fácil e indicada, principalmente para usar os widgets que são provavelmente os mais poderosos hoje em dia em um framework opensource.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">//Exemplos de adapters permitidos
&lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/ext-2.2.1/adapter/ext/ext-base.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/ext-2.2.1/adapter/jquery/ext-jquery-adapter.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<h2>Widgets</h2>
<p>O principal apelo do Extjs que conquista os desenvolvedores é o layout bem trabalhado dos componentes visuais que são de fácil parametrização. Basicamente todos os componentes funcionam da mesma forma, você o instancia passando um <a href="http://www.milfont.org/tech/2007/11/04/o-que-e-json/">objeto literal</a> de configuração com mostrado abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Exemplo do grid</span>
<span style="color: #003366; font-weight: bold;">var</span> grid  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span> <span style="color: #006600; font-style: italic;">//mais parametros </span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//Exemplo de uma Window</span>
<span style="color: #003366; font-weight: bold;">var</span> window <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Window</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span> <span style="color: #006600; font-style: italic;">//mais parametros </span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//Exemplo de um Painel</span>
<span style="color: #003366; font-weight: bold;">var</span> panel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Panel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span> <span style="color: #006600; font-style: italic;">//mais parametros </span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Vamos usar o GRID para exemplificar como trabalhamos com o Extjs, o mesmo comportamente se repete em todos os componentes.<br />
A <a href="http://www.extjs.com/deploy/dev/docs/">documentação do Extjs</a> é muito bem feita e praticamente vai ser a única coisa que você vai precisar depois de entender como os componentes são formados, afinal não vale a pena decorar todas as propriedades de todos os componentes, concentre-se apenas em entender os conceitos.</p>
<p>A GRID é o Widget mais famoso desse framework e é formado basicamente por um objeto &#8220;<strong>Ext.data.Store</strong>&#8221; [que é a fonte de dados da GRID] e um objeto &#8220;<strong>Ext.grid.ColumnModel</strong>&#8221; [que é a definição das colunas], como mostrado abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> grid  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//parametros de configuração de layout</span>
    cm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">/*configuração*/</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    store<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//Ou especialização de um Store</span>
    sm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">RowSelectionModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>singleSelect<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//ou outra especialização de um AbstractSelectionModel</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>O objeto ColumnModel é a definição de colunas do Grid, possui propriedades para definição de layout como largura e altura, título da coluna como vai ser exibida e formatação do texto:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> colModel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
    <span style="color: #009900;">&#123;</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Ticker&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">60</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Company Name&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Market Cap.&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$ Sales&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> renderer<span style="color: #339933;">:</span> money<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Employees&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> resizable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A propriedade cm [ColumnModel] pode ser também substituída pela propriedade &#8220;columns&#8221; que funciona como um &#8220;alias&#8221;, dessa forma o Grid cria automaticamente um objeto ColumnModel:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> grid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Nome&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">120</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Caso haja necessidade de formatar o conteúdo da célula, você pode usar uma função como &#8220;renderer&#8221; para tratar esse conteúdo:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> grid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Nome&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">120</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Criado em&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">135</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> renderer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000066; font-weight: bold;">return</span> Date.<span style="color: #660066;">parseDate</span><span style="color: #009900;">&#40;</span>value<span style="color: #339933;">,</span> <span style="color: #3366CC;">'Y-m-d<span style="color: #000099; font-weight: bold;">\\</span>TH:i:s<span style="color: #000099; font-weight: bold;">\\</span>Z'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">format</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d/m/Y H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">//2009-06-14T12:51:07Z</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A propriedade &#8220;<strong>store</strong>&#8221; da GRID é uma especialização do componente &#8220;<strong>Ext.data.Store</strong>&#8221; que é formado basicamente por um &#8220;<strong>proxy</strong>&#8221; e um &#8220;<strong>reader</strong>&#8220;:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    proxy<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">DataProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//ou uma especialização</span>
    reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">DataReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//ou uma especialização</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>O &#8220;<strong>proxy</strong>&#8221; é o componente que obterá os dados e o &#8220;<strong>reader</strong>&#8221; o componente que fará a leitura desses dados para um formato comum a todos os componentes do Extjs na forma de um objeto denominado &#8220;<strong>Ext.data.Record</strong>&#8220;. O objeto &#8220;Record&#8221; representa um registro de dados e é usado seja para GRID, para um Form ou qualquer componente que trabalhe com dados editáveis.</p>
<p>Dessa forma podemos usar uma combinação de Proxy e Reader como HttpProxy e JsonReader:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    proxy<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">HttpProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'projects.json'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        totalProperty<span style="color: #339933;">:</span><span style="color: #3366CC;">'total'</span><span style="color: #339933;">,</span>
        root<span style="color: #339933;">:</span><span style="color: #3366CC;">'results'</span><span style="color: #339933;">,</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Record</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Devido o costume do uso do HttpProxy, o componente Store possui uma propriedade chamada &#8220;url&#8221; que estando presente cria um HttpProxy automaticamente como mostrado abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'projects.json'</span><span style="color: #339933;">,</span>
    reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        totalProperty<span style="color: #339933;">:</span><span style="color: #3366CC;">'total'</span><span style="color: #339933;">,</span>
        root<span style="color: #339933;">:</span><span style="color: #3366CC;">'results'</span><span style="color: #339933;">,</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Record</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>O objeto &#8220;<strong>Reader</strong>&#8221; é o único que foge um pouco a regra de instanciação por receber dois parâmetros, um similar aos outros com um objeto literal de configuração e outro com o mapeamento dos dados. O objeto de configuração tem duas propriedades de que representam o total e a lista de dados. O objeto de mapeamento usa um método &#8220;estático&#8221; do objeto Record para criar um link entre a propriedade do json [com a propriedade "mapping"] e o índice interno do Record [pela propriedade "name"].</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        totalProperty<span style="color: #339933;">:</span><span style="color: #3366CC;">'total'</span><span style="color: #339933;">,</span>
        root<span style="color: #339933;">:</span><span style="color: #3366CC;">'results'</span><span style="color: #339933;">,</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Record</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Dessa forma você tem um link entre o ColumnName pela propriedade dataIndex e o Store por meio do Reader, como abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Record</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
         <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'nome_linkado'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #006600; font-style: italic;">//</span>
 columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Nome&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">120</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'nome_linkado'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span></pre></div></div>

<p>Para melhorar a navegação da GRID, você pode também acrescentar um componente de Toolbar no header ou no footer:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> grid  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//parametros de configuração de layout</span>
    cm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">/*configuração*/</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    store<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//Ou especialização de um Store</span>
    sm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">RowSelectionModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>singleSelect<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    bbar<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Toolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//Bottom Toolbar</span>
    tbar<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Toolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//Top Toolbar</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A Toolbar mais usada é sua especialização com paginação, a Ext.PagingToolbar que necessita ser linkada com o Store:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">PagingToolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    pageSize<span style="color: #339933;">:</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//propriedade opcional, default é 20</span>
    store<span style="color: #339933;">:</span> store
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>A PagingToolbar é I18n, mas se as mensagens não agradarem você pode mudá-las [eu sempre faço]:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">PagingToolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    pageSize<span style="color: #339933;">:</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>store<span style="color: #339933;">:</span> store<span style="color: #339933;">,</span>
    displayInfo<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>	
    displayMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Exibindo o resultado: {0} a {1} de {2} registros'</span><span style="color: #339933;">,</span>
    emptyMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sem resultados a exibir&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Uma coisa bacana nesse componente é que você pode agrupar botões [já que é uma Toolbar] e até padronizar o layout:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">PagingToolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    pageSize<span style="color: #339933;">:</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>store<span style="color: #339933;">:</span> store<span style="color: #339933;">,</span>
    displayInfo<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>	
    displayMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Exibindo o resultado: {0} a {1} de {2} registros'</span><span style="color: #339933;">,</span>
    emptyMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sem resultados a exibir&quot;</span><span style="color: #339933;">,</span>
    items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        pressed<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>enableToggle<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Alterar'</span><span style="color: #339933;">,</span>
        toggleHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        pressed<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>enableToggle<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Excluir'</span><span style="color: #339933;">,</span>
        toggleHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Código da GRID inteira:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    proxy<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">HttpProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'projects.json'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        totalProperty<span style="color: #339933;">:</span><span style="color: #3366CC;">'total'</span><span style="color: #339933;">,</span>
        root<span style="color: #339933;">:</span><span style="color: #3366CC;">'results'</span><span style="color: #339933;">,</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Record</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #339933;">,</span> mapping<span style="color: #339933;">:</span><span style="color: #3366CC;">'updated_at'</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> colModel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>
    <span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Nome&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">120</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Criado em&quot;</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">135</span><span style="color: #339933;">,</span> sortable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> 
        renderer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> Date.<span style="color: #660066;">parseDate</span><span style="color: #009900;">&#40;</span>value<span style="color: #339933;">,</span> <span style="color: #3366CC;">'Y-m-d<span style="color: #000099; font-weight: bold;">\\</span>TH:i:s<span style="color: #000099; font-weight: bold;">\\</span>Z'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">format</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d/m/Y H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'created_at'</span><span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> pagingToolbar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">PagingToolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    pageSize<span style="color: #339933;">:</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>store<span style="color: #339933;">:</span> store<span style="color: #339933;">,</span>
    displayInfo<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>	
    displayMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Exibindo o resultado: {0} a {1} de {2} registros'</span><span style="color: #339933;">,</span>
    emptyMsg<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Sem resultados a exibir&quot;</span><span style="color: #339933;">,</span>
    items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        pressed<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>enableToggle<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Alterar'</span><span style="color: #339933;">,</span>
        toggleHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        pressed<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>enableToggle<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Excluir'</span><span style="color: #339933;">,</span>
        toggleHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> grid  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    autoShow<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span><span style="color: #CC0000;">750</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">250</span><span style="color: #339933;">,</span>
    cm<span style="color: #339933;">:</span> colModel<span style="color: #339933;">,</span>
    store<span style="color: #339933;">:</span> store<span style="color: #339933;">,</span>
    sm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">RowSelectionModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>singleSelect<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    bbar<span style="color: #339933;">:</span> pagingToolbar
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Como eu falei, todos os componentes possuem o mesmo comportamento, notaram que dá para aproveitar esse código semelhante e reaproveitar em todos os CRUDs?<br />
Vou falando de um por um de acordo com os posts que forem saindo, aguardem que o próximo sai logo&#8230; ou não.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2009/06/29/introducao-ao-ext/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Introdução ao DWR</title>
		<link>http://www.milfont.org/tech/2009/03/20/introducao-ao-dwr/</link>
		<comments>http://www.milfont.org/tech/2009/03/20/introducao-ao-dwr/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 10:24:04 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[DWR]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=23</guid>
		<description><![CDATA[Material básico que eu usava nos cursos em 2007 para configuração do DWR em uma aplicação web em java, principalmente a partir da página 10. O DWR tem uma vantagem, desde 2005 &#8211; em suas primeiras versões &#8211; que praticamente é a mesma configuração, com mudanças poucos significativas. Esse material continua válido em sua plenitude. [...]]]></description>
			<content:encoded><![CDATA[<p>Material básico que eu usava nos cursos em 2007 para configuração do DWR em uma aplicação web em java, principalmente a partir da página 10.</p>
<p>O DWR tem uma vantagem, desde 2005 &#8211; em suas primeiras versões &#8211; que praticamente é a mesma configuração, com mudanças poucos significativas. Esse material continua válido em sua plenitude.</p>
<div id="__ss_1172050" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Tw Dwr 2007 Ap01" href="http://www.slideshare.net/cmilfont/tw-dwr-2007-ap01?type=powerpoint">Tw Dwr 2007 Ap01</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=twdwr2007ap01-090319212458-phpapp01&amp;stripped_title=tw-dwr-2007-ap01" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=twdwr2007ap01-090319212458-phpapp01&amp;stripped_title=tw-dwr-2007-ap01" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/cmilfont">Christiano Milfont</a>.</div>
</div>
<p><img src="http://www.milfont.org/tech/wp-content/upload/dwrworks.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2009/03/20/introducao-ao-dwr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DWR 3 Release Candidate 1</title>
		<link>http://www.milfont.org/tech/2008/12/24/dwr-3-release-candidate-1/</link>
		<comments>http://www.milfont.org/tech/2008/12/24/dwr-3-release-candidate-1/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 15:33:43 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[DWR]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Joe Walker]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=481</guid>
		<description><![CDATA[Joe Walker anunciou que saiu a RC1 do DWR3 com pequeno atraso com novidades interessantes como suporte a Varargs, Method Overloading, entre outras coisas. Mas destaco algo que deveria ter há tempos e sentíamos falta para construções repetitivas como CRUD (principalmente) que é o que chamou de &#8220;Lightweight typed parameters&#8220;. Até a versão 2 temos [...]]]></description>
			<content:encoded><![CDATA[<p>Joe Walker <a href="http://directwebremoting.org/blog/joe/2008/12/16/dwr_version_3_0_release_candidate_1.html">anunciou</a> que saiu a <a href="http://directwebremoting.org/dwr/download">RC1</a> do <a href="http://directwebremoting.org/dwr">DWR3</a> com <a href="http://www.milfont.org/tech/2008/03/11/dwr-3-em-junho/">pequeno atraso</a> com novidades interessantes como suporte a Varargs, Method Overloading, entre outras coisas. Mas destaco algo que deveria ter há tempos e sentíamos falta para construções repetitivas como CRUD (principalmente) que é o que chamou de &#8220;<strong>Lightweight typed parameters</strong>&#8220;.</p>
<p>Até a versão 2 temos que construir métodos no <a href="http://directwebremoting.org/dwr/server/dwrxml/creators">Creator</a> com implementação nos argumentos devido ao DWR não ter como fazer o binding entre o Javascript e o Java sem saber quem é o objeto. Algo assim:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AjaxFacade <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> User teste<span style="color: #009900;">&#40;</span>User param<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		param.<span style="color: #006633;">setDescription</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Teste funcionou&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> param<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>No javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">AjaxFacade.<span style="color: #660066;">teste</span><span style="color: #009900;">&#40;</span>
	<span style="color: #009900;">&#123;</span>
		id<span style="color: #339933;">:</span><span style="color: #CC0000;">42</span> <span style="color: #006600; font-style: italic;">//JSON que representa o objeto User</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
	<span style="color: #009900;">&#123;</span>
		callback<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>retorno<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>retorno.<span style="color: #660066;">toSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		errorHandler<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>error<span style="color: #339933;">,</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		timeout<span style="color: #339933;">:</span><span style="color: #CC0000;">5000</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Agora foi adicionado a propriedade <strong><em>$dwrClassName</em></strong> no <a href="http://directwebremoting.org/dwr/server/dwrxml/converters">Converter</a> onde você pode trabalhar com a interface ao invés da implementação. Vejamos com o Object como argumento no mesmo método:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AjaxFacade <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> teste<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> param<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//puramente ilustrativo não peça fundamentação lógica :)</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>param <span style="color: #000000; font-weight: bold;">instanceof</span> User<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
			<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>User<span style="color: #009900;">&#41;</span> param<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setDescription</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Teste funcionou&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> param<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>No javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">AjaxFacade.<span style="color: #660066;">teste</span><span style="color: #009900;">&#40;</span>
	<span style="color: #009900;">&#123;</span>
		id<span style="color: #339933;">:</span><span style="color: #CC0000;">42</span> <span style="color: #006600; font-style: italic;">//JSON que representa o objeto User,</span>
		$dwrClassName<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;User&quot;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
	<span style="color: #009900;">&#123;</span>
		callback<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>retorno<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>retorno.<span style="color: #660066;">toSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		errorHandler<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>error<span style="color: #339933;">,</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		timeout<span style="color: #339933;">:</span><span style="color: #CC0000;">5000</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Agora aquelas centenas de classes que fazem a mesma coisa [CRUDzão velho de guerra] podem ser resumidas em uma única Facade que faz suas validações e aciona um Repository ou sua estrutura de persistência.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AjaxFacade <span style="color: #009900;">&#123;</span>
	@Autowired <span style="color: #003399;">Repository</span> repository<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> persistir<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> param<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>param <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> ...
		<span style="color: #006633;">repository</span>.<span style="color: #006633;">persist</span><span style="color: #009900;">&#40;</span>param<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> param<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Agora não tem como não termos um Feliz Natal!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2008/12/24/dwr-3-release-candidate-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Minificação de Javascript com Ant Task</title>
		<link>http://www.milfont.org/tech/2008/12/16/minificacao-de-javascript-com-ant-task/</link>
		<comments>http://www.milfont.org/tech/2008/12/16/minificacao-de-javascript-com-ant-task/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 20:06:34 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Engenharia de Software]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[High Performance]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Melhores práticas]]></category>
		<category><![CDATA[Otimização]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ant task]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[minificação]]></category>
		<category><![CDATA[minified]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=459</guid>
		<description><![CDATA[Em um post passado eu falei da importância de unir e minificar arquivos js em determinados casos e discuti &#8220;quando&#8221; fazer isso, vou mostrar &#8220;como&#8221; minificar usando o YUI Compressor com tasks do Apache Ant montados por Viktor Lieskovsky do Javaflight. Esse pequeno tutorial-guia faz parte do material dos meus cursos de Javascript e Ajax [...]]]></description>
			<content:encoded><![CDATA[<p>Em um <a href="http://www.milfont.org/tech/2008/02/10/javascript-inline-e-external/">post passado</a> eu falei da importância de unir e minificar arquivos js em determinados casos e discuti &#8220;quando&#8221; fazer isso, vou mostrar &#8220;como&#8221; minificar usando o <a href="http://developer.yahoo.com/yui/compressor/">YUI Compressor</a> com tasks do <a href="http://ant.apache.org/">Apache Ant</a> <a href="http://code.google.com/p/javaflight-code/">montados por Viktor Lieskovsky</a> do <a href="http://javaflight.blogspot.com/">Javaflight</a>.</p>
<p>Esse pequeno tutorial-guia faz parte do material dos meus cursos de Javascript e Ajax e serve para deixar um histórico acessível aos alunos e fácil para leitores que por ventura precisem.</p>
<p>Preparei um ambiente de execução com todas as dependências no <a href="http://www.milfont.org/tech/projetos/">projeto</a> <a href="http://code.google.com/p/remendux/">Remendux</a> onde vocês podem fazer <a href="http://code.google.com/p/remendux/source/checkout">checkout</a> e rodar o build ant localmente como um projeto do eclipse &#8211; estou usando o plugin para o <a href="http://subclipse.tigris.org/">SVN Subclipse</a>.</p>
<p>Montei um script ant padrão bem simples de ser entendido por iniciantes:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jsmin&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Propriedades para definir nomes de pastas que usaremos --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;js&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;lib&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;lib&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;output&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Propriedades para definir nomes os arquivos necessários --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor.jar&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${lib}/yuicompressor-2.4.2.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor-ant-task.jar&quot;</span> </span>
<span style="color: #009900;">		<span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${lib}/yui-compressor-ant-task-0.3.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Incluir as libs necessárias no classpath --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;task.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${yui-compressor.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${yui-compressor-ant-task.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Definição da task para o Ant reconhecer --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;task.classpath&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Tag do Ant para concatenar arquivos </span>
<span style="color: #808080; font-style: italic;">		[ http://ant.apache.org/manual/CoreTasks/concat.html] </span>
<span style="color: #808080; font-style: italic;">		os arquivos são unidos na sequência de definição </span>
<span style="color: #808080; font-style: italic;">		no fileset</span>
<span style="color: #808080; font-style: italic;">		--&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${output}/remendux.js&quot;</span> <span style="color: #000066;">force</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${js}/util.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${js}/remendux.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Task do yui-compressor --&gt;</span>
		 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;yui-compressor</span> <span style="color: #000066;">warn</span>=<span style="color: #ff0000;">&quot;false&quot;</span>  <span style="color: #000066;">munge</span>=<span style="color: #ff0000;">&quot;true&quot;</span>  </span>
<span style="color: #009900;">				<span style="color: #000066;">preserveallsemicolons</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">fromdir</span>=<span style="color: #ff0000;">&quot;${output}&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${build}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/yui-compressor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Após a importação, para executar o script &#8211; que chamei de build-yui.xml &#8211; basta apenas executar com o ant pelo eclipse &#8211; vide imagem abaixo &#8211; ou em linha de comando. Estou usando o Ant 7.1 com java 6u10 e Eclipse 3.4, portanto caso haja um erro atente para a versão das ferramentas usadas.</p>
<p><img src="http://www.milfont.org/tech/wp-content/uploads/2008/12/build.jpg" alt="" title="build"  class="aligncenter size-medium wp-image-464" /></p>
<p>Após executar, observe a redução de tamanho na versão minificada [../build/remendux-min.js] para a versão concatenada [../output/remendux.js ]. A versão final ficou com 30% do tamanho com documentação e identação.</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;">Buildfile<span style="color: #808080;">:</span> C<span style="color: #808080;">:</span>\workspace\remendux\build<span style="color: #808080;">-</span>yui<span style="color: #808080;">.</span>xml
     <span style="color: #808080;">&#91;</span>echo<span style="color: #808080;">&#93;</span> Building <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">output</span>
clean<span style="color: #808080;">:</span>
    <span style="color: #808080;">&#91;</span>mkdir<span style="color: #808080;">&#93;</span> Created dir<span style="color: #808080;">:</span> C<span style="color: #808080;">:</span>\workspace\remendux\build
    <span style="color: #808080;">&#91;</span>mkdir<span style="color: #808080;">&#93;</span> Created dir<span style="color: #808080;">:</span> C<span style="color: #808080;">:</span>\workspace\remendux\<span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">output</span>
main<span style="color: #808080;">:</span>
<span style="color: #808080;">&#91;</span>yui<span style="color: #808080;">-</span>compressor<span style="color: #808080;">&#93;</span>
 <span style="color: #808080;">&#91;</span><span style="color: #3399ff;">30</span><span style="color: #808080;">%</span><span style="color: #808080;">&#93;</span> remendux<span style="color: #808080;">.</span>js <span style="color: #808080;">&#91;</span><span style="color: #3399ff;">5775</span><span style="color: #808080;">&#93;</span> <span style="color: #808080;">---&gt;</span> <span style="color: #202020;">remendux</span><span style="color: #808080;">-</span><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">min</span><span style="color: #808080;">.</span>js <span style="color: #808080;">&#91;</span><span style="color: #3399ff;">1734</span><span style="color: #808080;">&#93;</span>
<span style="color: #808080;">&#91;</span>yui<span style="color: #808080;">-</span>compressor<span style="color: #808080;">&#93;</span>
 <span style="color: #808080;">&#91;</span>JavaScript<span style="color: #808080;">&#93;</span> Compressed <span style="color: #3399ff;">1</span> files <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">to</span> <span style="color: #3399ff;">30</span><span style="color: #808080;">%</span> <span style="color: #808080;">&#40;</span>5KB <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">to</span> 1KB<span style="color: #808080;">,</span> saving 4KB<span style="color: #808080;">&#41;</span>
<span style="color: #808080;">&#91;</span>yui<span style="color: #808080;">-</span>compressor<span style="color: #808080;">&#93;</span>
 <span style="color: #808080;">&#91;</span>CSS<span style="color: #808080;">&#93;</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">No</span> files <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">to</span> compress<span style="color: #808080;">,</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">or</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">all</span> files already <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">up to</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">date</span>
<span style="color: #808080;">&#91;</span>yui<span style="color: #808080;">-</span>compressor<span style="color: #808080;">&#93;</span>
 Compressed <span style="color: #3399ff;">1</span> files <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">to</span> <span style="color: #3399ff;">30</span><span style="color: #808080;">%</span> <span style="color: #808080;">&#40;</span>5KB <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">to</span> 1KB<span style="color: #808080;">,</span> saving 4KB<span style="color: #808080;">&#41;</span>
BUILD SUCCESSFUL
Total <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">time</span><span style="color: #808080;">:</span> <span style="color: #3399ff;">12</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">seconds</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2008/12/16/minificacao-de-javascript-com-ant-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encontro em Iguatu</title>
		<link>http://www.milfont.org/tech/2008/11/04/encontro-em-iguatu/</link>
		<comments>http://www.milfont.org/tech/2008/11/04/encontro-em-iguatu/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 12:19:34 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cejug]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DWR]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[palestras]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=365</guid>
		<description><![CDATA[O evento em Iguatu foi excelente, tivemos uma tarde muito agradável no encontro das comunidades PHP e Java no dia 1/11/2008. Fernando Chucre iniciou o evento palestrando pelo CEPUG sobre PHP Orientado a objetos. Logo em seguida foi a vez do Jefferson [organizador do evento] palestrar sobre Debug no PHP. Pelo CEJUG o Silveira Neto [...]]]></description>
			<content:encoded><![CDATA[<p>O evento em Iguatu foi excelente, tivemos uma tarde muito agradável no <a href="http://www.milfont.org/tech/2008/10/24/encontro-java-e-php-em-iguatu-ce/">encontro das comunidades PHP e Java</a> no dia 1/11/2008.</p>
<p><a href="http://horizontesdigitais.com/">Fernando Chucre</a> iniciou o evento palestrando pelo <a href="http://cepug.org/2008/11/evento-em-iguatu-foi-um-sucesso-agora-e-fortaleza/">CEPUG</a> sobre PHP Orientado a objetos. Logo em seguida foi a vez do <a href="http://jefferson.eti.br/">Jefferson</a> [organizador do evento] palestrar sobre Debug no PHP.<br />
Pelo <a href="http://www.cejug.org/display/cejug/Apresentando+o+CEJUG+e+o+poder+do+Java+e+Frameworks+AJAX+em+Iguatu+-+01.11.08">CEJUG</a> o <a href="http://silveiraneto.net/2008/11/03/1%c2%ba-encontro-cejugcepug-em-iguatu/">Silveira Neto</a> apresentou uma palestra sobre a comunidade e o poder do Java, seguido por mim sobre Frameworks Ajax focado em Java com utilização de DWR e ExtJS.</p>
<p>O detalhe mais importante foi constatar a maturidade de duas comunidades tão distintas que compartilharam o mesmo evento sem nenhum problema, egocentrismo ou picuinha. Eu já estou cansando de ir em eventos onde o pessoal só fala de outra tecnologia, como eventos de linguagem onde falam mal de Java o evento inteiro. Cada um apresentou sua palestra sem desmerecer nenhuma tecnologia ou ninguém.</p>
<h2>Material</h2>
<div id="__ss_719498" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Frameworks Ajax" href="http://www.slideshare.net/cmilfont/frameworks-ajax-presentation?type=powerpoint">Frameworks Ajax</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=frameworksajax-1225798962914024-9&amp;stripped_title=frameworks-ajax-presentation" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=frameworksajax-1225798962914024-9&amp;stripped_title=frameworks-ajax-presentation" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View SlideShare <a style="text-decoration:underline;" title="View Frameworks Ajax on SlideShare" href="http://www.slideshare.net/cmilfont/frameworks-ajax-presentation?type=powerpoint">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/ajax">ajax</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/iguatu">iguatu</a>)</div>
</div>
<h2>Fotos</h2>
<p><a href="http://picasaweb.google.com.br/cmilfont/Iguatu1112008">Picasa do CMilfont</a><br />
<a href="http://www.flickr.com/photos/silveiraneto/sets/72157608607361149/">Flcikr do Silveira</a></p>
<p><img src="http://lh5.ggpht.com/_Mm7CP-3dJvI/SQ7tkg3kpLI/AAAAAAAAAvc/woXXELjYiJg/s400/IMG_2173.JPG" alt="iguatu" /></p>
<p><img src="http://farm4.static.flickr.com/3163/2997081263_b20482857b.jpg?v=0" alt="minha apresentacao" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2008/11/04/encontro-em-iguatu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Encontro Java e PHP em Iguatu-CE</title>
		<link>http://www.milfont.org/tech/2008/10/24/encontro-java-e-php-em-iguatu-ce/</link>
		<comments>http://www.milfont.org/tech/2008/10/24/encontro-java-e-php-em-iguatu-ce/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 14:34:06 +0000</pubDate>
		<dc:creator>cmilfont</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cejug]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[palestras]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[palestra]]></category>

		<guid isPermaLink="false">http://www.milfont.org/tech/?p=341</guid>
		<description><![CDATA[Caros, vou palestrar dia 01/11/2008 em Iguatu-CE no encontro Java e PHP realizado na parceria do CEJUG e CEPUG. Minha palestra será a mesma realizada no CCT de Agosto.  Data, Horário e Local 01/11/2008 13:00 as 17:20 SENAC - Iguatu Endereço: Praça Airton Jucá de Carvalho, 46 &#8211; Centro Programação Horário Palestrante Tema  15:20 &#8211; 16:20 Silveira Neto [...]]]></description>
			<content:encoded><![CDATA[<p>Caros, vou palestrar dia 01/11/2008 em Iguatu-CE no encontro Java e PHP realizado na parceria do <a href="http://www.cejug.org/display/cejug/Apresentando+o+CEJUG+e+o+poder+do+Java+e+Frameworks+AJAX+em+Iguatu">CEJUG</a> e <a href="http://cepug.org/2008/10/encontro-cepug-e-cejug-java-php-em-iguatu/">CEPUG</a>.</p>
<p style="text-align: center;"><a href="http://cepug.org/wp-content/uploads/2008/10/cartaz-php-java.jpg"><img class="aligncenter" title="Evento no iguatu" src="http://cepug.org/wp-content/uploads/2008/10/cartaz-php-java-212x300.jpg" alt="" width="212" height="300" /></a></p>
<p>Minha palestra será a mesma realizada no <a href="http://www.cejug.org/pages/viewpage.action?pageId=30900290">CCT</a> de Agosto. </p>
<h3><strong>Data, Horário e Local</strong></h3>
<ul>
<li>01/11/2008</li>
<li>13:00 as 17:20</li>
<li><span class="nobr"><a href="http://maps.google.com/maps/ms?ie=UTF8&amp;hl=pt-BR&amp;msa=0&amp;ll=-6.361796,-39.299689&amp;spn=0.002452,0.004828&amp;t=h&amp;z=18&amp;msid=115392776271716192991.000459d69a1f12e108fee">SENAC<sup><img class="rendericon" src="http://www.cejug.org/images/icons/linkext7.gif" border="0" alt="" width="7" height="7" align="absmiddle" /></sup></a></span> - Iguatu <strong>Endereço: </strong>Praça Airton Jucá de Carvalho, 46 &#8211; Centro</li>
</ul>
<h3><a name="ApresentandooCEJUGeopoderdoJavaeFrameworksAJAXemIguatu-Programa%C3%A7%C3%A3o"></a><strong>Programação</strong></h3>
<table class="confluenceTable" border="0">
<tbody>
<tr>
<th class="confluenceTh">Horário</th>
<th class="confluenceTh">Palestrante</th>
<th class="confluenceTh">Tema </th>
</tr>
<tr>
<td class="confluenceTd"><span style="color: #000000;">15:20 &#8211; 16:20</span></td>
<td class="confluenceTd">Silveira Neto</td>
<td class="confluenceTd"><span style="color: #3300ff;"><strong>Apresentando o CEJUG e o poder do Java</strong></span></td>
</tr>
<tr>
<td class="confluenceTd"><span style="color: #000000;">16:20</span> -  <span style="color: #000000;">17:20</span></td>
<td class="confluenceTd">Christiano Milfont </td>
<td class="confluenceTd"><span style="color: #cc0000;"><strong>Frameworks AJAX</strong></span></td>
</tr>
</tbody>
</table>
<h3><a name="ApresentandooCEJUGeopoderdoJavaeFrameworksAJAXemIguatu-Inscri%C3%A7%C3%B5es"></a><strong>Inscrições</strong></h3>
<ul>
<li>Inscrições: <span class="nobr"><a href="http://jugevents.jugpadova.it/jugevents/event/show.html?id=10671">http://jugevents.jugpadova.it/jugevents/event/show.html?id=10671<sup><img class="rendericon" src="http://www.cejug.org/images/icons/linkext7.gif" border="0" alt="" width="7" height="7" align="absmiddle" /></sup></a></span></li>
<li>1 kg de alimento não perecível</li>
</ul>
<div><span><strong><strong><strong>Programação completa</strong></strong></strong></span><br />
<strong></strong><br />
<strong>13:00 – Palestra 1 – PHP Orientado a Objetos (Fernando Chucre)<br />
14:00 – Palestra 2 – Depurando Aplicações PHP com XDebug e FirePHP (Jefferson Girão)<br />
15:00 – Coffee Break<br />
15:20 – Palestra 3 – Apresentando o CEJUG e o poder do Java (Silveira Neto)<br />
16:20 – Palestra 4 – Frameworks AJAX (Christiano Milfont)<br />
17:20 – Encerramento + Sorteio de Brindes</strong></div>
]]></content:encoded>
			<wfw:commentRss>http://www.milfont.org/tech/2008/10/24/encontro-java-e-php-em-iguatu-ce/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

