<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7911116656321773765</id><updated>2015-02-26T20:12:22.978+01:00</updated><category term="Liferay"/><category term="Cloud"/><category term="Spring Framework"/><category term="JSF"/><category term="Primefaces"/><category term="ServiceBuilder"/><category term="portlet"/><category term="Ajax"/><category term="BackSolver"/><category term="GWT"/><category term="Solr"/><category term="google"/><category term="server push"/><category term="AWS"/><category term="Android"/><category term="Boostrap"/><category term="CI"/><category term="Gradle"/><category term="JavaEE"/><category term="Mobile"/><category term="Project Management"/><category term="continuous intgration"/><category term="noi"/><category term="wikigenerator"/><title type='text'>Development Blog</title><subtitle type='html'>by &lt;img src=&quot;https://lh6.googleusercontent.com/-ciublxV4o8A/UrAZdUwq34I/AAAAAAAABEw/HR5aSMYcS7c/w200-h45-no/Logo_MI-200_no+payoff.png&quot; alt=&quot;Miriade&quot; title=&quot;Miriade&quot;&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default?max-results=8&amp;redirect=false'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default?start-index=9&amp;max-results=8&amp;redirect=false'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>8</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-4309289496810507725</id><published>2014-01-06T11:00:00.000+01:00</published><updated>2014-01-06T11:00:08.734+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="server push"/><title type='text'>Discovering.... Server Push! #2</title><content type='html'>&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;line-height: 18px; white-space: pre-wrap;&quot;&gt;&lt;i&gt;Seconda puntata dedicata ai concetti di push e Comet nello sviluppo web. &lt;a href=&quot;http://blogdev.miriade.it/2013/12/discoveringserver-push-1.html&quot; target=&quot;_blank&quot;&gt;Nella scorsa puntata &lt;/a&gt;abbiamo parlato di long polling e HTTP streaming. Continuiamo l&#39;excursus, parlandovi di Server-Sent events e web sockets.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;a href=&quot;http://www.stream-hub.com/images/comethttppush.png&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.stream-hub.com/images/comethttppush.png&quot; height=&quot;175&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Fonte:&amp;nbsp;&lt;a href=&quot;http://www.stream-hub.com/&quot;&gt;www.stream-hub.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal; line-height: 1.15; text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Server-Sent Events&lt;/span&gt;&lt;/b&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Questa è una delle due tecniche di push effettivo rese disponibili dall’HTML 5. Il client, tramite la nuova interfaccia javascript &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;EventSource&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; apre una connessione verso un url e rimane in ascolto di eventi generati dal server:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;var eventSource = new EventSource(&quot;www.mioserver.com/miapagina&quot;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;A questo punto il client può rimanere in ascolto di eventi nel seguente modo:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;eventSource.onMessage = function(e) { /* codice... */ };&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;O nel seguente modo, registrando un listener per uno specifico evento:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fc04-3f11-5271-86f817657340&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;eventSource.addEventListener(&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;“nome_evento”, function(e) { /* codice… */ }, false);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Questa tecnica, a differenza dei web socket, crea un canale di comunicazione dal server al client, quindi unidirezionale. Un vantaggio però è che i SSEs utilizzano il protocollo HTTP tradizionale, quindi non richiedono delle particolari configurazioni sul server per funzionare.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Web Sockets&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Veniamo infine alla tecnica più potente, i web socket. L’utilizzo lato client è molto simile ai SSEs (l’interfaccia qui si chiama&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;WebSocket&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, con due differenze però.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;La prima è che la comunicazione stabilita tra client e server è bidirezionale. E’ quindi possibile mandare dei messaggi dal client al server, nel seguente modo:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;webSocket.send(“Hi server!”);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Per quanto riguarda la comunicazione dal server al client, invece, non ci sono grosse differenze con i SSEs, se non per il fatto che con i web socket non è possibile diversificare i tipi di messaggio (niente &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;addEventListener&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;quindi).&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Questa tecnica non utilizza il protocollo HTTP, ma un suo protocollo specifico. Questo significa che il server (oltre che il browser) deve essere predisposto per supportarlo.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Conclusioni&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Le tecniche, come mostrato, sono molte, e la loro disponibilità dipende sia dall’application server utilizzato che dal browser. Conviene decisamente astrarre. Sia lato client che lato server esistono librerie e framework per alleggerire il lavoro: citando le prime due cose che mi vengono in mente, jQuery ha varie utilities per comunicare in JSONP e SpringMVC rende snello operare con le servlet asincrone.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Ma il livello massimo di astrazione lo si ha utilizzando &lt;/span&gt;&lt;a href=&quot;https://github.com/Atmosphere/atmosphere&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Atmosphere&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Lo scopo di questo framework è lasciare che sia lui a scoprire la tecnica più adatta per l’environment corrente (AS e browser). Atmosphere è già integrato in molti framework: esiste, ad esempio, il modulo per Spring.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Vi lascio con un utile &lt;/span&gt;&lt;a href=&quot;https://github.com/Atmosphere/atmosphere/wiki/Supported-WebServers-and-Browsers&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;link&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, preso dal wiki di Atmosphere, che mostra cosa supportano attualmente server e browser. Alla prossima!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Marco Zarantonello&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;mailto:m.zarantonello@miriade.it&quot; style=&quot;text-decoration: none;&quot;&gt;m.zarantonello@miriade.it&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/4309289496810507725/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2014/01/discovering-server-push-2.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/4309289496810507725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/4309289496810507725'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2014/01/discovering-server-push-2.html' title='Discovering.... Server Push! #2'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-3029195661123142804</id><published>2013-12-30T11:00:00.000+01:00</published><updated>2013-12-30T11:00:06.086+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="Solr"/><title type='text'>Liferay: integrazione con Apache Solr. II puntatata</title><content type='html'>&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a7c-b43d-2f7c-22f52b68f142&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a7c-b43d-2f7c-22f52b68f142&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;i&gt;Riprendiamo la seria dedicata a Liferay, e in particolare all&#39;integrazione tra il portale e Apache Solr. &lt;a href=&quot;http://blogdev.miriade.it/2013/11/liferay-integrazione-con-apache-solr-i.html&quot;&gt;Nella scorsa puntata&lt;/a&gt;, abbiamo visto le basi, come l&#39;installazione di Solr e avevamo visto come sistemare la compatibilità con le librerie httpclient e httpcore..e da qui riprendiamo.&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a7c-b43d-2f7c-22f52b68f142&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a7c-b43d-2f7c-22f52b68f142&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Abbiamo quindi implementato una versione custom di HttpClient che nativamente supportasse la basicauth preemptive:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;@ThreadSafe&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;public class PreemptiveHttpClient extends DefaultHttpClient {&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private Credentials credentials = null;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;protected BasicHttpProcessor createHttpProcessor() {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BasicHttpProcessor processor = super.createHttpProcessor();&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;processor.addInterceptor(new RemoveHttpHeadersInterceptor(), 0);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;processor.addInterceptor(new PreemptiveAuthInterceptor(), 1);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return processor;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public PreemptiveHttpClient(){&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;super();&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public PreemptiveHttpClient(org.apache.http.conn.ClientConnectionManager connManager){&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;super(connManager);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void setCredentials(Credentials cred){&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;setCredentials(AuthScope.ANY, cred);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void setCredentials(AuthScope scope, Credentials cred){&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;getCredentialsProvider().setCredentials(scope, cred);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;credentials = cred;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private class PreemptiveAuthInterceptor implements HttpRequestInterceptor {&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;@SuppressWarnings(&quot;deprecation&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// If no auth scheme avaialble yet, try to initialize it preemptively&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (authState.getAuthScheme() == null) {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(ClientContext.CREDS_PROVIDER);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Credentials creds = credsProvider.getCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()));&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (creds == null &amp;amp;&amp;amp; PreemptiveHttpClient.this.credentials == null)&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new HttpException(&quot;No credentials for preemptive authentication&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;authState.setAuthScheme(new BasicScheme());&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;authState.setCredentials(creds != null ? creds : credentials);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static class RemoveHttpHeadersInterceptor implements HttpRequestInterceptor {&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (request instanceof HttpEntityEnclosingRequest) {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (request.containsHeader(HTTP.TRANSFER_ENCODING)) {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.removeHeaders(HTTP.TRANSFER_ENCODING);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (request.containsHeader(HTTP.CONTENT_LEN)) {&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;request.removeHeaders(HTTP.CONTENT_LEN);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Una volta fatto ciò basterà istanziare la nuova classe all’interno del BasicAuthSolrServer, ed il gioco è fatto!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Gli ultimi due step, ampiamente documentati nelle guide online, sono di inserire l’indirizzo dell’applicazione web solr installata all’interno del file META-INF/solr-spring.xml:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;lt;bean id=&quot;com.liferay.portal.search.solr.server.BasicAuthSolrServer&quot; class=&quot;com.liferay.portal.search.solr.server.BasicAuthSolrServer&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;constructor-arg type=&quot;java.lang.String&quot; value=&quot;http://YOURSOLRSERVER:PORT/solr&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;e di copiare il file /WEB-INF/conf/schema.xml all’interno della nostra installazione di solr.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Impacchettate il vostro war, deployate il plugin aggiornato e godetevi il vostro nuovo sistema di indicizzazione!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;Emanuele Righetto&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/3029195661123142804/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/12/liferay-integrazione-con-apache-solr-ii.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/3029195661123142804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/3029195661123142804'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/12/liferay-integrazione-con-apache-solr-ii.html' title='Liferay: integrazione con Apache Solr. II puntatata'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-7829138179375967574</id><published>2013-12-16T16:26:00.003+01:00</published><updated>2013-12-19T10:24:15.631+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="server push"/><title type='text'>Discovering.....Server Push! #1</title><content type='html'>&lt;b id=&quot;docs-internal-guid-71cc9d42-fbf9-983d-66bd-bdaedfe14601&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71cc9d42-fbf9-983d-66bd-bdaedfe14601&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-style: italic; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Nello sviluppo web si sente spesso parlare di push e di Comet. Andiamo nel dettaglio a capire di cosa si tratta.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;a href=&quot;http://www.stream-hub.com/images/comethttppush.png&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.stream-hub.com/images/comethttppush.png&quot; height=&quot;175&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.stream-hub.com/&quot;&gt;www.stream-hub.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;display: inline !important; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Il server push è un tipo di comunicazione web per cui una richiesta ha origine dal server ed è diretta al client. Stiamo parlando di web, quindi con server intendiamo l’application server che ospita un’applicazione e come client intendiamo il browser con il quale si fruisce l’applicazione stessa.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Per spiegare brevemente il push basti pensare al comportamento di un client web di posta evoluto, come gmail. Non appena viene ricevuta una mail essa appare subito nell’inbox, senza ricaricare la pagina. E’ evidente che la richiesta HTTP non è (almeno formalmente) partita dal mio browser, ma è il server che mi sta notificando in tempo reale.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Come si ottiene tutto ciò? In questo e nel mio prossimo post andremo ad analizzare le varie tecniche con le quali il push può essere implementato. Scopriremo che molte sono solo dei workaround che ne emulano l’effetto, identificate usualmente con il termine “Comet”. Con i Server-Sent Events e i Websocket, entrambi di recente introduzione, si ha invece il push vero e proprio.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Long-polling&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Prima di parlare di long-polling, capiamo come funziona il polling standard. Una volta caricata una pagina web partono dal browser, ad intervalli regolari, delle richieste AJAX che reperiscono dal server, se presenti, delle informazioni. Un esempio per un client di posta può essere ogni 30 secondi chiedere al server se è arrivata una nuova mail. In caso affermativo tale mail viene mostrata in cima all’inbox.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;L’inefficienza di questa tecnica sta proprio negli intervalli di chiamata. Ottenere un “effetto push” con il polling standard significherebbe fare, ad esempio, una richiesta al secondo, cosa ovviamente da evitare.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Il long-polling non soffre di questo problema perchè non funziona ad intervalli regolari. Con questa tecnica il server risponde al client solamente quando ha effettivamente qualcosa da ritornare (es. è arrivata una nuova mail), o scade un timeout prefissato. Non appena una chiamata ritorna al client, ne parte subito un’altra.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Long-polling with JSONP&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;A causa della “same-origin policy”, una pagina web fornita da uno specifico server non può comunicare con un server diverso dallo stesso, per ragioni di sicurezza. Esiste però uno stratagemma per ovviare a questo: i tag&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;inseriti in una pagina possono caricare del javascript proveniente da un altro server. La tecnica del JSONP sfrutta questo per leggere dati (potenzialmente in long polling) da un server qualsiasi.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Supponiamo che l’url a cui la pagina fa una richiesta tramite tag &amp;lt;script&amp;gt; ritorni dati in formato JSON. Tali dati non rappresentano un javascript corretto; per diventarlo dovrebbero essere assegnati a una variabile oppure passati come parametro a una chiamata di funzione. E qui entra in gioco JSONP, ossia “JSON with Padding”: aggiungendo all’url chiamato il parametro &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;callback&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; è possibile specificare il nome di una funzione javascript locale che verrà chiamata con l’oggetto JSON passato come argomento. Il payload della chiamata a questo punto diventa codice javascript formalmente corretto che verrà eseguito quando la risposta viene ricevuta dal server (che potrebbe operare in long-polling).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Mi ri-spiego con del codice. Supponiamo che l’indirizzo www.mioserver.com/miapagina risponda in formato JSON. Inserendo in una pagina web lo script&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;script type=”application/javascript”&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;src=”www.mioserver.com/miapagina?callback=handleResponse” /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;, tale script ritornerebbe ed eseguirebbe il seguente javascript:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;handleResponse(&amp;lt;oggetto JSON ritornato&amp;gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La funzione&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;handleResponse&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; è una funzione javascript locale, la quale effettuerà qualche operazione con i dati ritornati e, supponendo si operi in long-polling, aggiungerà un nuovo tag &amp;lt;script&amp;gt; al DOM della pagina (e così via…).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;HTTP Streaming&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;L’HTTP Streaming è il passo successivo al long-polling. In sostanza il client apre una e una sola connessione verso il server. Questo la mantiene sempre aperta, ritornando al client delle risposte parziali quando i dati sono disponibili (utilizzando il cosiddetto “chunked transfer encoding”).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La tecnica può essere utilizzata sia con le chiamate AJAX XHR, sia tramite lo stratagemma del “forever frame”. In sostanza la pagina ospita un&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;iframe&amp;gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; nascosto, il quale carica il suo contenuto (dei tag &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;ad esempio) in modalità chunked.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Implementare risposte parziali lato server è ora semplice con le Servlet API 3.0. E’ stato introdotto infatti il concetto di servlet asincrona, che, delegando il lavoro ad un altro thread, può aggiungere dati alla risposta di tanto in tanto e chiudere la richiesta in un secondo momento.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Siamo molto vicini al concetto di push vero e proprio, attenzione però al carico di memoria nel browser (la chiamata HTTP è una sola e le risposte parziali vanno ad accumularsi). &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Aggiungo anche che il server deve essere predisposto a supportare delle connessioni long-running. Nel caso di Tomcat si può abilitare il connettore NIO, che utilizza un threading model ottimizzato: con questo connettore si evita che rimangano thread occupati a lungo per servire una sola richiesta.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;E questo è tutto per quanto riguarda le tecniche Comet. Sintonizzatevi sulla prossima puntata dove vedremo le succose novità per il push rese disponibili dall’HTML 5.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Marco Zarantonello&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;mailto:m.zarantonello@miriade.it&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;m.zarantonello@miriade.it&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/7829138179375967574/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/12/discoveringserver-push-1.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/7829138179375967574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/7829138179375967574'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/12/discoveringserver-push-1.html' title='Discovering.....Server Push! #1'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-4467129376173446551</id><published>2013-12-02T11:00:00.000+01:00</published><updated>2013-12-04T15:40:38.487+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="continuous intgration"/><category scheme="http://www.blogger.com/atom/ns#" term="Gradle"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaEE"/><title type='text'>Continuous Integration - part 1</title><content type='html'>&lt;span id=&quot;docs-internal-guid-6e8f54dc-b277-0f75-4412-94ae240d656b&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;i&gt;A quick tutorial to put down an entire CI system for a JavaEE web application. Stay tuned! &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;PART 1&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Hi all, here you find a very quick and easy guide to put down an entire CI system for a JavaEE web application using a lot of useful software in the shortest time possible. To achieve this not trivial target, I’ll need to skip a complete description of all steps. If something is not explained deeply enough it means: just google it and you’ll find what you need.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;First we start immediatly with the backbone of the building system: Gradle. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Gradle is an amazing building tool and because this guide want to be really quick I will not explain here what this wonderful tool is, you could find all documentation you need at &lt;/span&gt;&lt;a href=&quot;http://www.gradle.org/documentation&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.gradle.org/documentation&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;As best practices says: “use the wrapper” and so we do. Create a file build.gradle in the project home and the add this lines&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;task wrapper(type: Wrapper) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;gradleVersion =&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;1.9&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;then call&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;user@domain:~$ gradle wrapper&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;this will install gradle locally so you do not need to setup your system.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;One you have done this, we could add some lines that adds some useful plugins.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;631&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;java&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;maven&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;war&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;jacoco&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;idea&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;eclipse-wtp&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;apply plugin: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;findbugs&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;all of this plugins help offering useful tasks that we will use to compile the code, check dependencies and a lot of interesting stuff that would be very boring if we must do them manually. Obviously ‘idea’ and ‘eclipse-wtp’ plugins are needed only if you use theese IDE, remove them otherwise.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you have a multi-module project would be better if you check some best practices contained on gradle user guide and checking for a real life example the build.gradle file of the springframework project on &lt;/span&gt;&lt;a href=&quot;https://github.com/spring-projects/spring-framework&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;git-hub&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Now we’ll add our project dependencies. Theese could be local jars, entire projects or artifacts. Let’s assume that we only need a maven repository to download our jars.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;In the gradle user guide you’ll find a way to add dependencies to other projects, with Ivy or custom maven repository, or just local jars.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;dependencies {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;javax.servlet:servlet-api:2.5&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;com.amazonaws:aws-java-sdk:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;org.hibernate:hibernate-core:4.2.5.Final&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&#39;org.springframework:spring-context:3.2.5.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&#39;org.springframework:spring-context-support:3.2.5.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;org.springframework:spring-test:3.2.5.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&#39;org.springframework.security:spring-security-web:3.1.4.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&#39;org.springframework.security:spring-security-config:3.1.4.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;org.springframework.hateoas:spring-hateoas:0.7.0.RELEASE&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;org.quartz-scheduler:quartz:2.2.1&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&#39;org.apache.commons:commons-lang3:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;log4j:log4j:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;compile &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&#39;org.codehaus.jackson:jackson-mapper-asl:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;testCompile &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;junit:junit:4.+&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;testCompile &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;org.hamcrest:hamcrest-all:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;testCompile&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;org.mockito:mockito-all:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;testCompile &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;com.jayway.jsonpath:json-path:latest.integration&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Then we define a new sourceSet for integration tests, in this way the java plugin will compile it.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;sourceSets&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;integrationTest&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;java.srcDir file(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;src/integTest/java&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resources.srcDir file(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;src/integTest/resources&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compile.ext[&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;classpath&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;] = sourceSets.main.output + configurations.testRuntime&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;runtimeClasspath = output + compileClasspath&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;So we define a new task that add our integration tests to the test step of the build.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #efefef; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; integrationTest(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;: Test) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;description =&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;Run all the integration tests&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;group =&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;verification&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;testClassesDir = sourceSets.integrationTest.output.classesDir&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;classpath = sourceSets.integrationTest.runtimeClasspath&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;reports.junitXml.destination = file(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;$reports.junitXml.destination/integration&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;After this beacuse we want to add Jacoco and Findbugs report that we will use with Jenkins we need to add a little bit of further configurations&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #efefef; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;findbugs {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;toolVersion = &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;2.0.1&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceSets = [sourceSets.main]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ignoreFailures = &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;reportsDir = file(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;${buildDir}/reports/findbugs&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;effort =&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &quot;max&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;reportLevel = &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;high&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;jacocoTestReport {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;reports {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xml.enabled &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;csv.enabled &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;html.destination &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;${buildDir}/reports/jacoco&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;// adding integrationTest and Jacoco report to the check step &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;check {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;dependsOn integrationTest&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;dependsOn jacocoTestReport&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;At this point we need to define a custom versioning policy for the artifacts that we want to build. So just create a new file called versioning.gradle under $PROJECT_HOME/gradle and fill it with this&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #efefef; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ext.buildTimestamp = new Date().format(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;yyyy-MM-dd HH:mm:ss&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;version = new &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ProjectVersion&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;${version_major}&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &quot;${version_minor}&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as &amp;nbsp;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.env.BUILD_NUMBER)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; ProjectVersion {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; major&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; minor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; build&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ProjectVersion(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; major, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; minor, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; build) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.build = build&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.major = major&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.minor = minor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; java.lang.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; toString() {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; fullVersion = &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;$major.$minor&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(build) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fullVersion += &quot;.$build&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; fullVersion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;We now add a bunch of lines that will create the buildInfo file, used for artifact informations &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; createBuildInfoFile &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;def buildInfoFile = new File(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;$buildDir/build-info.properties&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; props = new &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;props.setProperty(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;version&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, project.version.toString())&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;props.setProperty(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;timestamp&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, project.buildTimestamp)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;props.store(buildInfoFile.newWriter(), null)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Now we configure the war plugin that we need to create our artifact. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #efefef; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border: none; width: 631px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #434343; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;war {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;dependsOn createBuildInfoFile&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;baseName = project.name&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;webInf { from&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &#39;WebContent/WEB-INF&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;from(buildDir) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;include &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;build-info.properties&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;into(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #6aa84f; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&#39;WEB-INF/classes&#39;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #d9d9d9; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This is all you need to setup Gradle for building. You could find the &lt;a href=&quot;https://docs.google.com/a/miriade.it/file/d/0BwZTQOj9AVKZeGpuRElFMkh1WGc/edit&quot; target=&quot;_blank&quot;&gt;complete build.gradlefile here&lt;/a&gt;. In the coming posts we’ll setup Jenkins and Artifactory to complete the puzzle. See ya =)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/4467129376173446551/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/12/continuous-integration-part-1.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/4467129376173446551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/4467129376173446551'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/12/continuous-integration-part-1.html' title='Continuous Integration - part 1'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-5388725829179160312</id><published>2013-11-18T11:00:00.000+01:00</published><updated>2013-11-18T11:00:09.635+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="Solr"/><title type='text'>Liferay: integrazione con Apache Solr. I puntata</title><content type='html'>&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: normal; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;display: inline !important; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;display: inline !important; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Questa settimana riprendiamo un topic che di cui avevamo già parlato tempo fa, ma che per diversi mesi avevamo lasciato in sospeso: Liferay. In due post, vi racconteremo l&#39;integrazione tra il portale e Apache Solr, ovviamente partendo da un caso aziendale. Buona lettura!&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: normal; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;display: inline !important; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Per chi non lo conoscesse &lt;/span&gt;Solr è un’enterprise open-source search platform, sviluppato da Apache e basato sulle librerie Lucene, largamento utilizzate proprio per l’indicizzazione e la ricerca di contenuti&lt;span style=&quot;font-weight: normal;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: normal; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b id=&quot;docs-internal-guid-20bdb0ae-6a75-1e7f-f04f-de4e53bff56d&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;L’applicativo, sviluppato in Java, richiede solamente l’utilizzo di un servlet container (come jetty o tomcat) per funzionare.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;E qui, ad essere sinceri, c’è una piccola grande delusione.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Abbastanza semplice, ma questo trucco non funziona con la versione di Solr appena installata. Il motivo? Dalla versione 4 Solr utilizza al suo interno le librerie httpclient e httpcore aggiornate a loro volta alla versione 4.x, che introducono diverse novità, ma purtroppo non sono retrocompatibili.&lt;/span&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Questa possibilità ci è preclusa con le nuove librerie.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Ma andiamo per ordine..&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Ad agosto Liferay ha rilasciato la versione 6.1.3 (6.1 GA3) del suo portale, introducendo come sempre molte novità. Una queste, come preannunciato già dalla versione 6.1, è stata la rimozione del supporto a Lucene come motore di indizzazione per le configurazioni cluster.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Niente di nuovo, l’utilizzo di questa libreria era già deprecato da tempo e le guide ufficiali consigliavano fortemente il passaggio ad un nuovo strumento di indicizzazione.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;L’aggiornamento a questa release, presso uno dei clienti più importanti, ci ha dato l’opportunità di implementare l’integrazione tra i due strumenti.&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;I primi passi sono stati molto semplici: rimuovere la configurazione lucene dai settings di Liferay ed installare Solr in un server linux (centos) dedicato.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Abbiamo scelto di scaricare ed installare l’ultima release disponibile, la 4.4, che dispone anche di un installare automatico. In pochissimi minuti solr sarà attivo e funzionante, e la nuova versione dispone anche di una pratica e funzionale interfaccia web che permette di verificare lo stato del sistema e di eseguire query sui contenuti già indicizzati.&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Lo step successivo è quello di scaricare, direttamente dal pannello di controllo di Liferay (“Marketplace”), il plugin per la connessione appunto a Solr.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Il plugin è “ufficialmente” compatibile con la versione 1.4 di Solr (avete letto bene, 1.4!).&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Ufficiosamente invece molti post, alcuni su forum ufficiali, suggeriscono che in realtà il plugin funziona correttamente anche con le versioni 3.x di Solr, con la piccola accortezza di sostituire due jar (solr-core.jar e solr-solr.jar) all’interno del plugin. &lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Conflitto di librerie quindi, un problema che fa veramente inc***are ogni programmatore.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;La soluzione inevitabile è stata quella di aprire i codici sorgente (fortunatamente presenti nel war del plugin) e fixare a mano questi problemi.&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Una volta sostituite le librerie all’interno del progetto diverse classi presenteranno errori di compilazione.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Per la maggior parte di esse il problema è dovuto all’utilizzo della classe &lt;/span&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MultiThreadedHttpConnectionManager&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, non più supportata e del tutto rimossa dalla libreria.&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-family: inherit; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Al suo posto sarà necessario utilizzare la nuova &amp;nbsp;più performante &lt;/span&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PoolingClientConnectionManager&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Il problema principale è rappresentato dalla classe &lt;/span&gt;&lt;span style=&quot;font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;BasicAuthSolrServer&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, che utilizza il vecchio HttpClient che supportava facilmente l’autenticazione basic auth preemptive, come evidenziato nelle righe dalla 60 alla 70:&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;HttpState httpState = httpClient.getState();&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;httpState.setCredentials(authScope,&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;new UsernamePasswordCredentials(_username, _password));&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;HttpClientParams httpClientParams = httpClient.getParams();&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;httpClientParams.setAuthenticationPreemptive(true);&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-family: inherit; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; line-height: 1.15;&quot;&gt;Purtroppo, questa possibilità ci è preclusa con le nuove librerie. Nel prossimo post, impareremo come supportare la basicauth preemptiv&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; line-height: 17px;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;. Ci vediamo il 26 Dicembre!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Emanuele Righetto&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/5388725829179160312/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/11/liferay-integrazione-con-apache-solr-i.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/5388725829179160312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/5388725829179160312'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/11/liferay-integrazione-con-apache-solr-i.html' title='Liferay: integrazione con Apache Solr. I puntata'/><author><name>Miriade</name><uri>http://www.blogger.com/profile/10590762065069802941</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-295955209191304051</id><published>2013-10-21T09:00:00.000+02:00</published><updated>2013-10-21T09:00:19.354+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><category scheme="http://www.blogger.com/atom/ns#" term="Primefaces"/><title type='text'>Primefaces 4.0: finalmente disponibile l&#39;ultimo nato in casa Prime Technology</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Dal 3 ottobre è possibile scaricare la release ufficiale di Primefaces 4.0: l’abbiamo provata per voi.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b id=&quot;docs-internal-guid-71f3d9b4-cc38-a09a-0079-59092c491aa8&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Dopo i miei due post di introduzione al framework (&lt;/span&gt;&lt;a href=&quot;http://blogdev.miriade.it/2013/07/primefaces-la-libreria-definitiva-per.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;qui&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; e &lt;/span&gt;&lt;a href=&quot;http://blogdev.miriade.it/2013/08/primefaces-le-conclusioni.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;qui&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;), ritorno sul tema per andare ad analizzare le novità dell’ultima release stabile, uscita a inizio mese.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;SUPPORTO JSF 2.2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La libreria è ora JSF 2.2 compliant. Sono quindi ora supportate features come:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;pass through attributes: attributi che vengono renderizzati tali e quali a come vengono scritti, senza essere processati;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;reset values: un attributo che va a risolvere il noto problema dei componenti di una form che rimangono “corrotti” dopo un errore di validazione;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;API per il file upload come da specifica Servlet 3.x; il componente Primefaces per il file upload è stato riscritto da zero.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;CLIENT SIDE VALIDATION&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Qui le cose si fanno interessanti. Semplicemente aggiungendo validateClient=&quot;true&quot; al command button o al tag ajax si sposta tutto il processo di validazione dei campi della form dal server al client (!!!). Questo viene out-of-the-box per le validazioni semplici (come il required, il minimo/massimo di un numero, le regex, ecc.), mentre per validazioni più complesse occorre scrivere del javascript per implementarle.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;DIALOG FRAMEWORK&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Con il nuovissimo dialog framework è possibile, dal RequestContext java, dire al client di aprire una specifica facelet all’interno di una dialog (eventualmente modale, ridimensionabile e/o trascinabile). Tale facelet può poi comunicare con lo scope principale ritornando dei valori, sempre tramite il RequestContext. Per leggere tali valori è disponibile il nuovo evento ajax “dialogReturn”. Questo framework permette quindi di rendere il codice più modulare, disaccoppiando effettivamente la logica sia lato facelet che lato backing bean.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;SEARCH EXPRESSIONS&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Di questo vi avevo già accennato qualcosa nelle precedenti puntate. In sostanza Primefaces incrementa ulteriormente il set di keyword utilizzabili negli attributi process e update per andare a referenziare i componenti della pagina. Sono disponibili i nuovi @composite, @namingcontainer (il composite component / naming container circostante), oltre che @child(n) (l’ennesimo figlio del componente corrente) e @widgetVar(...) (risoluzione del componente tramite la variabile javascript associata). E la cosa veramente utile è che queste keyword si possono concatenare, creando espressioni come @this:@parent:@child(1).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;DEFERRED LOADING&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Il componente outputPanel, finora utilizzato principalmente per la possibilità di auto-update, è ora dotato di deferred loading. Questo significa che dei frammenti della pagina possono essere richiesti al server e renderizzati in un secondo momento: dopo il caricamento della pagina stessa oppure quando, tramite scroll, si arriva al punto in cui devono essere visualizzati.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;NUOVI COMPONENTI E IMPROVEMENTS SU ESISTENTI&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Vari nuovi componenti sono stati aggiunti. Ve ne cito due che ho trovato molto utili: la confirm dialog generica, soluzione molto elegante che va ad alleggerire di molto il codice (o almeno il mio codice, che era pieno di dialog di conferma custom -_-), e lo sticky: semplicemente agganciando il tag p:sticky a un componente lo si rende sempre visibile nella pagina, anche dopo lo scroll (utilissimo per le toolbar). Oltre a nuovi componenti, nuovi attributi sono disponibili per molti componenti già esistenti.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Ovviamente è già disponibile tutta la documentazione relativa alla nuova release (Primefaces in questo, bisogna dirlo, eccelle).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Il framework è scaricabile dalla pagina &lt;/span&gt;&lt;a href=&quot;http://www.primefaces.org/downloads.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.primefaces.org/downloads.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Vi lascio con un video, rilasciato da Prime Technology per presentare Primefaces 4.0: &lt;/span&gt;&lt;a href=&quot;http://vimeo.com/73010469&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://vimeo.com/73010469.&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Buona visione :)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Marco Zarantonello&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;m.zarantonello@miriade.it&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/295955209191304051/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/10/primefaces-40-finalmente-disponibile.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/295955209191304051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/295955209191304051'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/10/primefaces-40-finalmente-disponibile.html' title='Primefaces 4.0: finalmente disponibile l&#39;ultimo nato in casa Prime Technology'/><author><name>Miriade Devs</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-1937974744108957549</id><published>2013-10-07T08:30:00.000+02:00</published><updated>2013-10-07T08:30:00.612+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Boostrap"/><category scheme="http://www.blogger.com/atom/ns#" term="Mobile"/><title type='text'>Bootstrap 3 RC1: come cambia il toolkit di Twitter</title><content type='html'>&lt;span id=&quot;docs-internal-guid-395a0b47-3677-2fcc-1cb8-258011409a38&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;A fine Luglio, in occasione del suo secondo anniversario, Bootstrap rende disponibile il download della release 3.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-i588QxdXocA/UjsAY_esMNI/AAAAAAAAATo/P-C9CsVzhGs/s1600/bootstrap-3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;http://1.bp.blogspot.com/-i588QxdXocA/UjsAY_esMNI/AAAAAAAAATo/P-C9CsVzhGs/s400/bootstrap-3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; text-align: justify; white-space: pre-wrap;&quot;&gt;Come annunciato sul &lt;/span&gt;&lt;a href=&quot;http://blog.getbootstrap.com/2013/08/19/bootstrap-3-released/&quot; style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; text-align: justify; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;post di lancio&lt;/a&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; text-align: justify; white-space: pre-wrap;&quot;&gt;, molto è cambiato dalla versione precedente. &lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; text-align: justify; white-space: pre-wrap;&quot;&gt;Il lavoro di nove mesi tra design e sviluppo ha richiesto infatti oltre 2700 commit (da parte di 319 utenti) e la modifica di 379 file, corrispondenti a 84k righe aggiunte o eliminate.&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Andiamo a vedere in dettaglio le features introdotte con l&#39;ultima release.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;/div&gt;&lt;ul style=&quot;line-height: 1.15;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Mobile first.&lt;/b&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; Si è partiti dallo sviluppare il framework prima di tutto per i mobile devices, aggiungendo via via le direttive css compatibili con tablet e desktop. Il risultato è una responsive web experience che si adatta agilemente a schermi di dimensioni variabili. Gli stili per il mobile si trovano sparsi su tutta la libreria, anzichè su un file separato.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;line-height: 1.15;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Flat Design&lt;/b&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;. Boostrap 3 si è rivolto verso una grafica completamente flat, ma è stato aggiunto anche un optional visual theme simile al design precedente: non dovrebbe così mancare il look and feel di Boostrap 2.x.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;line-height: 1.15;&quot;&gt;&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Grid System&lt;/b&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;. Le precedenti versioni di Bootstrap erano caratterizzate da una grid system minimale (il già noto paradigma a 12 colonne), ora è invece possibile avere pieno controllo della CSS layout grid. Sostanzialmente è cambiato il modo con cui vengono creati gli spazi che contengono gli elementi della pagina web. &lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;La correzione più consistente sta nella dichiarazione delle colonne. Il vecchio .spanX è sostituito dalle classi .col-lg-X per i desktop, .col-sm-X per i tablet e .col-X per i mobile. Il sistema diventa così più versatile, così da poter avere piena padronanza di come sarà visualizzata la pagina nei tre tipi di dispositivi (ancora una volta il workflow di sviluppo è stato adattato al mobile).&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;line-height: 1.15;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Browsers&lt;/b&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;. E&#39; stato rimosso il supporto a Internet Explorer 7 e Firefox 3.6. Su Internet Explorer 8 è necessario inserire il JavaScript Respond.js per far funzionare correttamente le varie media query.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Sul sito del framework è disponibile una &lt;/span&gt;&lt;a href=&quot;http://getbootstrap.com/getting-started/#migration&quot; style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;sezione&lt;/a&gt;&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; per migrare da Bootstrap 2.x a Boostrap 3.&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Altra valida traccia si può trovare &lt;a href=&quot;http://bassjobsen.weblogs.fm/migrate-your-templates-from-twitter-bootstrap-2-x-to-twitter-bootstrap-3/&quot; target=&quot;_blank&quot;&gt;qui&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Il maintaining e il supporting della versione 2.3.2 non sarà più garantito.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Il punto più importante rimane però l&#39;1% di siti web che utilizzano questo framework: in pochissimo tempo infatti Boostrap è riuscito a guadagnarsi una grossa fetta di mercato proprio per la sua rapida costruzione di interfacce di siti e web applications.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px; white-space: pre-wrap;&quot;&gt;Federica&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;mailto:f.sgarbossa@miriade.it&quot;&gt;f.sgarbossa@miriade.it&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/1937974744108957549/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/10/bootstrap-3-rc1-come-cambia-il-toolkit.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/1937974744108957549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/1937974744108957549'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/10/bootstrap-3-rc1-come-cambia-il-toolkit.html' title='Bootstrap 3 RC1: come cambia il toolkit di Twitter'/><author><name>Miriade Devs</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-i588QxdXocA/UjsAY_esMNI/AAAAAAAAATo/P-C9CsVzhGs/s72-c/bootstrap-3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7911116656321773765.post-5629127623870253193</id><published>2013-09-23T09:00:00.000+02:00</published><updated>2013-09-23T09:00:19.141+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spring Framework"/><title type='text'>Spring Security Tips: Custom Security Tags</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;Dopo aver visto come creare espressioni personalizzate da usare all’interno di SpringSecurity, aumentiamo ancora il livello di personalizzazione, andando a creare un tag jsp personalizzato che faciliti ulteriormente la gestione della sicurezza nelle nostre pagine web.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Abbiamo già visto come usare espressioni personalizzate all’interno di tag e annotation di Spring Security. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Ma gli sviluppatori, si sa, sono pigri e hanno scarsa memoria, per cui anche solo ricordarsi tutte le nuove espressioni è noioso e faticoso.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La soluzione? Introdurre nuovi tag che semplicemente si ricordino per noi le espressioni che possiamo utilizzare!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La procedura è abbastanza semplice, e possiamo riassumerla in pochi punti:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;creare un file tld che definisca il nostro nuovo tag (o i nostri tag, se ne vogliamo più di uno);&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;informare il nostro application server che esiste una taglib nostra, segnalandone l’esistanza nel file web.xml;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;includere la taglib appena creata nei file jsp in cui intendiamo usarla;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;scrivere la classe che si occuperà di realizzare effettivamente i check di sicurezza;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;iniziare ad utilizzare il nostro nuovo tag nelle pagine.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Ma andiamo per ordine.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Per definire la nostra taglib possiamo ovviamente prendere spunto da quello che già offre Spring Security. Un buon inizio è il file security.tld che si trova all’interno di spring-security-taglibs-3.1.3.RELEASE.jar.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Sarà necessario indicare una classe (che implementeremo al punto 4) e definire una serie di tag &amp;lt;attribute&amp;gt;. Ognuno di questi sarà un attributo del tag che stiamo realizzando e il nostro editor sarà in grado di proporci la serie degli attributi disponibili, così come accade per gli altri tag html o jsp che già utilizziamo.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Nella nostra concezione iniziale di questo tag, ogni attributo equivarrà ad una possibile espressione che dovrà essere valutata per autorizzare l’accesso al contenuto del tag.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;In questa ottica, il tag potrà essere utilizzato senza attributi (nessun controllo di accesso) o con una combinazione arbitraria degli attributi disponibli.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Una volta definita la struttura e gli attributi del nostro tag, indicheremo all’application server questa nuova taglib, all’interno del file web.xml:  &lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;background: none repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; text-align: left; width: 99%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;jsp-config&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;taglib&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;taglib-uri&amp;gt;http://www.springframework.org/security/actions&amp;lt;/taglib-uri&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;taglib-location&amp;gt;/WEB-INF/actions.tld&amp;lt;/taglib-location&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/taglib&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/jsp-config&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;In alternativa è possibile inserire questo file (assieme possibilmente alle classi necessarie al suo utilizzo) in un jar da includere nel classpath dell’applicazione.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;La taglib è ora (quasi) pronta per essere inserita nelle nostre pagine:&lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;background: none repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; text-align: left; width: 99%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;%@ taglib prefix=&quot;actions&quot; uri=&quot;http://www.springframework.org/security/actions&quot;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Resta da implementare la classe che conterrà la logica del nostro tag, che dovrà necessariamente implementare l’interfaccia javax.servlet.jsp.tagext.Tag. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Un buon punto di partenza per scrivere tale classe potrebbe essere JspAuthorizeTag, che si occupa della gestione del tag &amp;lt;sec:autorize&amp;gt;, sicuramente già noto a chiunque abbia usato SpringSecurity.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Il metodo principale di tale classe dovrà gioco forza essere &lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;background: none repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; text-align: left; width: 99%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&lt;br /&gt;&amp;nbsp;public boolean authorize() throws IOException{...}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;che dovrebbe occuparsi di verificare l’uso dei vari attributi per quella particolare istanza del tag e controllare se l’utente abbia o meno i requisiti necessari (dettati appunto dagli attributi) per accedere al contenuto del tag.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Come da tradizione accademica, lasciamo al lettore come esercizio l’implementazione di questa classe, partendo appunto dal codice di JspAuthorizeTag che è facilmente consultabile dal repository Github di Spring.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Un esempio dell’utilizzo di un tag personalizzato realizzato per l’applicazione “Bot” da Miriade:&lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;background: none repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; text-align: left; width: 99%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;sec:resource hasAnyPage=&quot;Reports&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;li class=&quot;nav-header&quot;&amp;gt;Reports&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;c:url value=&quot;/reports&quot;/&amp;gt;&quot;&amp;gt;Generic Reports&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sec:resource hasAnyPageResources=&quot;Reports:hr,admin&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;c:url value=&quot;/admin-reports&quot;/&amp;gt;&quot;&amp;gt;Admin Reports&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/sec:resource&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/sec:resource&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Come già anticipato all’inizio, l’uso di questi tag è solamente uno “shortcut” per evitare di ricordarsi tutte le nuove espressioni definite nella puntata precedente e può essere benissimo evitato usando il tag:   &lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;background: none repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; text-align: left; width: 99%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;sec:authorize access=”customExpression..() and customExpression2(..)”&amp;gt;...&amp;lt;/sec:authorize&amp;gt;.&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Flessibilità o comodità? Ai posteri l’ardua sentenza.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Emanuele Righetto&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;mailto:e.righetto@miriade.it&quot;&gt;e.righetto@miriade.it&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdev.miriade.it/feeds/5629127623870253193/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://blogdev.miriade.it/2013/09/spring-security-tips-custom-security.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/5629127623870253193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7911116656321773765/posts/default/5629127623870253193'/><link rel='alternate' type='text/html' href='http://blogdev.miriade.it/2013/09/spring-security-tips-custom-security.html' title='Spring Security Tips: Custom Security Tags'/><author><name>Miriade Devs</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>