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

<channel>
	<title>jotadeveloper blog</title>
	<atom:link href="http://blog.jotadeveloper.es/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jotadeveloper.es</link>
	<description>my old blog</description>
	<lastBuildDate>Thu, 16 May 2013 23:13:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Nuevo sitio de Encuestame</title>
		<link>http://blog.jotadeveloper.es/2012/03/03/nuevo-sitio-de-encuestame/</link>
		<comments>http://blog.jotadeveloper.es/2012/03/03/nuevo-sitio-de-encuestame/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 02:43:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Encuestame]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3394</guid>
		<description><![CDATA[Uno de los motivos por las que casi no escribo en mi blog es porque estoy 100% sumergido en el proyecto open source Encuestame, hace unos dias creamos un nuevo portal y la verdad quedó bastante chulo, aqui les dejo un screenshot, estamos tambien trabajando en una version mobile. También me gustaria destacar que estamos [...]]]></description>
				<content:encoded><![CDATA[<p>Uno de los motivos por las que casi no escribo en mi blog es porque estoy 100% sumergido en el proyecto open source <a href="http://www.encuestame.org" target="_blank">Encuestame</a>, hace unos dias creamos un nuevo portal y la verdad quedó bastante chulo, aqui les dejo un screenshot, estamos tambien <a href="https://twitter.com/encuestame/status/175484146653736960">trabajando en una version mobile</a>.</p>
<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2012/03/Captura-de-pantalla-2012-03-03-a-las-03.43.381.png"><img class="alignnone size-large wp-image-3396" title="Encuestame Site" src="http://blog.jotadeveloper.com/wp-content/uploads/2012/03/Captura-de-pantalla-2012-03-03-a-las-03.43.381-1024x641.png" alt="" width="550" height="344" /></a></p>
<p>También me gustaria destacar que estamos recibiendo ayuda para la traducción del sitio a varios idiomas como, Alemán, Italiano, Francés, Portugués, Inglés y Arabe. Gracias a los colaboradores <img src='http://blog.jotadeveloper.es/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2012/03/03/nuevo-sitio-de-encuestame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The &#8220;Java Life&#8221;</title>
		<link>http://blog.jotadeveloper.es/2011/10/22/the-java-life/</link>
		<comments>http://blog.jotadeveloper.es/2011/10/22/the-java-life/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 21:41:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3367</guid>
		<description><![CDATA[The &#8220;Java Life&#8221; SPOKEN: In the cubicles representin’ for my JAVA homies… In by nine, out when the deadlines are met, check it. CHORUS: We code hard in these cubicles My style’s nerd-chic, I’m a programmin’ freak We code hard in these cubicles Only two hours to your deadline? Don’t sweat my technique. Sippin’ morning [...]]]></description>
				<content:encoded><![CDATA[<p><iframe src="http://www.youtube.com/embed/b-Cr0EWwaTk" frameborder="0" width="560" height="315"></iframe></p>
<p><strong>The &#8220;Java Life&#8221;</strong></p>
<p>SPOKEN:<br />
In the cubicles representin’ for my JAVA homies…<br />
In by nine, out when the deadlines are met, check it.</p>
<p>CHORUS:<br />
We code hard in these cubicles<br />
My style’s nerd-chic, I’m a programmin’ freak<br />
We code hard in these cubicles<br />
Only two hours to your deadline? Don’t sweat my technique.</p>
<p>Sippin’ morning coffee with that JAVA swirl.<br />
Born to code; my first words were “Hello World”<br />
Since 95, been JAVA codin’ stayin’ proud<br />
Started on floppy disks, now we take it to the cloud.</p>
<p>On my desktop, JAVA’s what’s bobbin’ and weavin’<br />
We got another winning app before I get to OddEven.<br />
Blazin’ code like a forest fire, climbin’ a tree<br />
Setting standards like I Triple E….</p>
<p>Boot it on up, I use the force like Luke,<br />
Got so much love for my homeboy Duke.<br />
GNU Public Licensed, it’s open source,<br />
Stop by my desk when you need a crash course</p>
<p>Written once and my script runs anywhere,<br />
Straight thuggin’, mean muggin’ in my Aeron chair.<br />
All the best lines of code, you know I wrote ‘em<br />
I’ll run you out of town on your dial-up modem.</p>
<p>CHORUS:<br />
‘Cause…<br />
We code hard in these cubicles<br />
Me and my crew code hyphy hardcore<br />
We code hard in these cubicles<br />
It’s been more than 10 years since I’ve seen the 404.</p>
<p>Inheriting a project can make me go beeee-serk<br />
Ain’t got four hours to transfer their Framework.<br />
The cleaners killed the lights, Man, that ain’t nice,<br />
Gonna knock this program out, just like Kimbo Slice</p>
<p>I program all night, just like a champ,<br />
Look alive under this IKEA lamp.<br />
I code HARDER in the midnight hour,<br />
E7 on the vending machine fuels my power.</p>
<p>Ps3 to Smartphones, our code use never ends,<br />
JAVA’s there when I beat you in “Words with Friends”.<br />
My developing skills are so fresh please discuss,<br />
You better step your game up on that C++.</p>
<p>We know better than to use Dot N-E-T,<br />
Even Dan Brown can’t code as hard as me.<br />
You know JAVA’s gettin’ bigger, that’s a promise not a threat,<br />
Let me code it on your brain</p>
<p>WHISPERED:<br />
so you’ll never forget.</p>
<p>CHORUS:<br />
We code hard in these cubicles,<br />
it’s the core component…of what we implement.<br />
We code hard in these cubicles,<br />
Straight to your JAVA Runtime Environment.</p>
<p>We code hard in these cubicles,<br />
Keep the syntax light and the algorithm tight.<br />
We code hard in these cubicles,<br />
Gotta use JAVA if it’s gonna run right.</p>
<p>We code hard in these cubicles<br />
JAVA keeps adapting, you know it’s built to last.<br />
We code hard in these cubicles,<br />
Robust and secure, so our swag’s on blast</p>
<p>CODE HARD</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2011/10/22/the-java-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Mobile y Spring Social, dos proyectos a tener en cuenta</title>
		<link>http://blog.jotadeveloper.es/2010/09/11/spring-mobile-y-spring-social-dos-proyectos-a-tener-en-cuenta/</link>
		<comments>http://blog.jotadeveloper.es/2010/09/11/spring-mobile-y-spring-social-dos-proyectos-a-tener-en-cuenta/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 04:46:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring mobile]]></category>
		<category><![CDATA[spring social]]></category>
		<category><![CDATA[twitter4j]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3088</guid>
		<description><![CDATA[El dia de hoy revisando los proyectos de Spring Source, detecte dos interesantes proyectos que apenas tienen 1 mes desde el primer commit, los proyectos son, Spring Mobile y Spring Social. Aún no están en la lista oficial de proyectos de Spring Source. Pero puedes descargar el código , estan en un repositorio GIT,  así que [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-2723" style="margin: 9px;" title="springsource" src="http://blog.jotadeveloper.com/wp-content/uploads/2009/08/springsource1.png" alt="" width="224" height="92" /></p>
<p>El dia de hoy revisando los proyectos de Spring Source, detecte <strong>dos interesantes proyectos</strong> que apenas tienen 1 mes desde el primer commit, los proyectos son, <strong>Spring Mobile y Spring Social.</strong></p>
<p>Aún no están en la <a href="http://www.springsource.org/projects" target="_blank">lista oficial de proyectos</a> de <strong>Spring Source</strong>. Pero puedes descargar el código , estan en un repositorio GIT,  así que tengras que instalar git o usar <a href="http://www.jgit.org/" target="_blank">jGIT</a> con eclipse.</p>
<p><strong>Spring Mobile</strong>: <a href="https://jira.springframework.org/browse/MOBILE">https://jira.springframework.org/browse/MOBILE</a></p>
<p><strong>Spring Social</strong>: <a href="https://jira.springframework.org/browse/SOCIAL">https://jira.springframework.org/browse/SOCIAL</a></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">// Spring Social</span>
 git clone git<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//git.springsource.org/spring-social/spring-social.git</span>
 <span style="color: #666666; font-style: italic;">// Spring Mobile</span>
 git clone git<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//git.springsource.org/spring-mobile/spring-mobile.git</span></pre></td></tr></table></div>

<p>Brevemente, podemos describir que <strong>Spring Social</strong> esta orientado a crear un framework para la <strong>integracion de un sistema con Twitter, Facebook y otras comunidades sociales/</strong>, utilizando <a href="http://blog.jotadeveloper.com/2010/09/06/autentificacion-oauth-con-twitter4j/">OAuth (con Spring Securitu OAuth) como metodo de autentificación</a> y tratando de remplazar a Twitter4j.</p>
<p>Por el otro lado<strong> Spring Mobile</strong> por el poco código que veo en el repositorio, indica que será un <strong>una libreria para detectar dispositivos mobiles en las peticiones</strong>, un producto interesante ya con los SmartPhones en auge diariamente.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/09/11/spring-mobile-y-spring-social-dos-proyectos-a-tener-en-cuenta/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Autentificación OAuth con Twitter4j</title>
		<link>http://blog.jotadeveloper.es/2010/09/06/autentificacion-oauth-con-twitter4j/</link>
		<comments>http://blog.jotadeveloper.es/2010/09/06/autentificacion-oauth-con-twitter4j/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 06:42:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[twitter4j]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3076</guid>
		<description><![CDATA[El 31 de Agosto de este año (2010) twitter dejo de proveer seguridad por medio de contraseña y usuario como venia siendo habitual en muchos clientes de Twitter. Asi que nos hemos vistos muchos, como en mi caso, obligados a migrar OAuth, al principio cuesta un poco entender como funciona, pero es realmente muy sencillo [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2010/09/Twitter-OAuth.png"><img class="alignleft size-medium wp-image-3077" style="margin: 7px;" title="Twitter-OAuth" src="http://blog.jotadeveloper.com/wp-content/uploads/2010/09/Twitter-OAuth-300x187.png" alt="" width="147" height="92" /></a>El 31 de Agosto de este año (2010) twitter <a href="http://blog.segu-info.com.ar/2010/09/twitter-impone-oauth-bravo-por-la.html?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed:+NoticiasSeguridadInformatica+(Noticias+de+Seguridad+Inform%C3%A1tica)" target="_blank">dejo de proveer seguridad por medio de contraseña y usuario</a> como venia siendo habitual en muchos clientes de Twitter.</p>
<p>Asi que nos hemos vistos muchos, como en mi caso, <strong>obligados a migrar OAuth</strong>, al principio cuesta un poco entender como funciona, pero <strong>es realmente muy sencillo </strong>y no comprometemos las contraseñas de nuestros usuarios.</p>
<p>Si quieres <strong>aprender algo mas sobre el protocolo de autorizacion OAuth</strong>, <a href="http://oauth.net/" target="_blank">por aquí.</a>. No quiero entrar a explicar como registrar una aplicacion en twitter, porque eso lo hacen muy bien en <a href="http://kodegeek.com/blog/2009/07/05/como-enviar-tweets-desde-java-usando-twitter4j/" target="_blank">KodeGeek</a> con Twitter4j.</p>
<p>En mi caso, no es una aplicación de escritorio, es web y con Java Server Faces, no usaré servlets porque mi intencion es almacenar la información en la base de datos, y no sera una sola cuenta, podran ser muchas cuentas. Dejo este tipico ejemplo que es el mas <a href="http://consultingblogs.emc.com/nileeshabojjawar/archive/2010/03/18/twitter4j-oauth-generating-the-access-token.aspx" target="_blank">común de encontrar</a> y con el que vamos a empezar a aclarar un poco lo que he leido en varios blogs.</p>
<p>Solo <strong>presentaré extractos de código, lo mas importante para entender como registrar las autentificaciones válidas con OAuth en Twitter</strong> y poder usarlas posteriormente.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Creamos una instancia de Twitter, usemos el TwitterFactory , trabajamos con la version de Twitter4j 2.3.1</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">twitter</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TwitterFactory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Las 2 llaves que nos da Twitter al registrar la aplicacion, estas son fundamentales las</span>
<span style="color: #666666; font-style: italic;">// usaremos mucho, se deben almacenar en la base de datos</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">twitter</span>.<span style="color: #006633;">setOAuthConsumer</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;consumer_key&quot;</span>, <span style="color: #0000ff;">&quot;consumer_secret&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Solicitamos un REQUEST TOKEN, este objeto solo se debe crear una sola vez.</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">requestToken</span> <span style="color: #339933;">=</span> twitter.<span style="color: #006633;">getOAuthRequestToken</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Obtenemos el URL, este url lo podemos presentar en JSF con un link y nos enviara a la página</span>
<span style="color: #666666; font-style: italic;">// de twitter, daremos permiso a nuestra aplicacion</span>
<span style="color: #666666; font-style: italic;">// y obtendremos el pin que usaremos a continuacion.</span>
<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> url <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">requestToken</span>.<span style="color: #006633;">getAuthorizationURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Hasta aquí todo bien,<strong> tenemos nuestro RequestToken</strong>, deberian usarlo en su clase como una propiedad de la clase, lo usaremos en otro metodo, <strong>tambien el objeto Twitter lo reutilizaremos, por eso los this.</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//El objeto AccessToken, este objeto lo usaremos constantemente, cada vez que querramos </span>
<span style="color: #666666; font-style: italic;">//comunicarnos con Twitter, en este caso para validar nuestro</span>
<span style="color: #666666; font-style: italic;">// RequesToken y obtener 2 llaves mas, que son las definitivas y las que nos permitiran </span>
<span style="color: #666666; font-style: italic;">//publicar, hasta el momento no hemos terminado</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">accessToken</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">twitter</span>.<span style="color: #006633;">getOAuthAccessToken</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">requestToken</span>, <span style="color: #0000ff;">&quot;PIN&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Si despues de esto todo sale bien (sin TwitterExceptions) tendremos ya acceso a los TOKENS, </span>
<span style="color: #666666; font-style: italic;">// son 2 cadenas que almacenaremos en nuestra base de datos</span>
<span style="color: #666666; font-style: italic;">// y usaremos posteriormente para publicar nuestros tweets o obtener algo de informacion de nuestra cuenta.</span>
<span style="color: #666666; font-style: italic;">//El token</span>
log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New Token {&quot;</span><span style="color: #339933;">+</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">accessToken</span>.<span style="color: #006633;">getToken</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//El Token Secret</span>
log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New Secret Token {&quot;</span><span style="color: #339933;">+</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">accessToken</span>.<span style="color: #006633;">getTokenSecret</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//Testing send twitter, WORKS !!</span>
<span style="color: #666666; font-style: italic;">//Si queremos probar que todo funciona, seteamos el ACCESS TOKEN que validamos anteriormente con el objeto Twitter.</span>
 <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">twitter</span>.<span style="color: #006633;">setOAuthAccessToken</span><span style="color: #009900;">&#40;</span>accessToken<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Publicamos algo para comprobar.</span>
 <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">twitter</span>.<span style="color: #006633;">updateStatus</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test accessToken&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Guardamos los dos tokens en la base de datos.</span></pre></td></tr></table></div>

<p>Ahora tenemos 4 codigos en nuestra tabla, los 2 codigos consumer y los 2 codigos Token, con estos 4 codigos podremos postear mientras no revoquemos nuestros permisos en nuestro perfil de Twitter.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Para poder acceder a nuestra cuenta, postear o obtener algo de info, recuperamos nuestros</span>
<span style="color: #666666; font-style: italic;">// 4 datos principales, creamos un ACCESSTOKEN seteando en el // constructor el Token y el Secret Token validos</span>
<span style="color: #000000; font-weight: bold;">final</span> AccessToken accessToken <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessToken<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Token&quot;</span>, <span style="color: #0000ff;">&quot;Secret Token&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Creamos una nueva instancia de Twitter y creamos una nueva instancia de autorizacion </span>
<span style="color: #666666; font-style: italic;">// con nuestras otras 2 llaves Consumer y el objeto creado </span>
<span style="color: #666666; font-style: italic;">// anteriormente ACCESS TOKEN </span>
Twitter twitter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TwitterFactory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getOAuthAuthorizedInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Consumer Key&quot;</span>, <span style="color: #0000ff;">&quot;Consumer Secret&quot;</span>, accessToken<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Una vez echo esto, ya tenemos el objeto Twitter cargado y listo para ser usado, podemos probar las credenciales.</span>
twitter.<span style="color: #006633;">verifyCredentials</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>En <strong>otros blogs podrás encontrar muchas maneras de hacer esto</strong>, pero muchos se basan en aplicaciones de escritorio o basados en servlets, de esta forma<strong> podemos almacenar nuestras multiples cuentas de Twitter con OAuth</strong> y utilizarlas segun nuestras necesidades.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/09/06/autentificacion-oauth-con-twitter4j/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Crea tus Feed con RSS o Atom con Spring 3.0 y REST</title>
		<link>http://blog.jotadeveloper.es/2010/07/09/crea-tus-feed-con-rss-o-atom-con-spring-3-0-y-rest/</link>
		<comments>http://blog.jotadeveloper.es/2010/07/09/crea-tus-feed-con-rss-o-atom-con-spring-3-0-y-rest/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 02:55:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3050</guid>
		<description><![CDATA[Hola Gente, regreso a las andadas varios meses después con una serie de artículos sobre Spring 3.0. El primero de ellos sera de unas clases nuevas que nos ofrece Spring MVC 3.0 para crear nuestros propios Feed con 2 formatos diferentes, RSS 2.0 o Atom. Primero vamos a conocer las 2 clases abstractas disponibles desde [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2010/07/banner-rss1.jpg"><img class="size-medium wp-image-3060" title="banner-rss" src="http://blog.jotadeveloper.com/wp-content/uploads/2010/07/banner-rss-300x57.jpg" alt="" width="300" height="57" /></a></p>
<p>Hola Gente, <strong>regreso a las andadas varios meses después</strong> con una serie de artículos sobre <strong>Spring 3.0</strong>. El primero de ellos sera de unas clases nuevas que nos ofrece Spring MVC 3.0 para crear nuestros propios Feed con 2 formatos diferentes, <strong>RSS 2.0 o Atom</strong>.</p>
<p>Primero vamos a conocer las 2 clases abstractas <strong>disponibles desde Spring 3.0</strong> que vamos a usar</p>
<h2>AbstractRssFeedView</h2>
<p><a href="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/view/feed/AbstractFeedView.html">AbstractFeedView</a> es la clase para crear  nuestra vista principal de RSS y esta a su vez se extiende de <a href="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/view/AbstractView.html" target="_blank">AbstractView</a> nos ofrece metodos para crear los encabezados de nuestro RSS.</p>
<h2>AbstractAtomFeedView</h2>
<p>Esta clase abstracta extiende de <a href="http://static.springsource.org/spring/docs/3.0.2.RELEASE/javadoc-api/org/springframework/web/servlet/view/feed/AbstractAtomFeedView.html">AbstractAtomFeedView</a> y esta tambien se extiende de <a href="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/view/AbstractView.html" target="_blank">AbstractView</a>.</p>
<p><strong>No es posible crear una sola clase para manejar los dos formatos</strong>, asi que trabajaremos solamente con RSS, el proceso para ATOM es practicamente el mismo.</p>
<p>Extendemos <strong>AbstractRssFeedView</strong> y creamos la siguiente vista. Se <strong>deben implementar 2 metodos obligatoriamente</strong>, el primero es para crear el encabezado del RSS (ojo, <strong>si no lo llenas bien recibiras una bonita excepcion</strong>) y el otro metodo es para setear todo el cuerpo del RSS.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> MyViewFeedRssView <span style="color: #000000; font-weight: bold;">extends</span> AbstractRssFeedView <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * En el caso de los RSS debemos crear el Channel, parece la gente de Spring se olvido de hacerlo por nosotros, ojo
     * con llenar bien el Channel.
     */</span>
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> Channel newFeed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">final</span> Channel channel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Channel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;rss_2.0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setPubDate</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setDescription</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;RSS Description&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TITLE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setLink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setCopyright</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2010&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        channel.<span style="color: #006633;">setPubDate</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span>  channel<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Build Feed Entries.
     */</span>
    @SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #003399;">List</span> buildFeedEntries<span style="color: #009900;">&#40;</span><span style="color: #003399;">Map</span> model, HttpServletRequest request,
            HttpServletResponse response<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #666666; font-style: italic;">// Obtenemos las entradas que vienen en el modelo desde el Controller</span>
        <span style="color: #003399;">List</span> contentList <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">List</span><span style="color: #009900;">&#41;</span> model.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;entries&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// Creamos una lista de clase de Item, el objeto de ROME que refleja cada elemento del RSS</span>
        <span style="color: #003399;">List</span> entries <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span>contentList.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// Iteramos nuestras entradas del blog</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>EntriesBlog content <span style="color: #339933;">:</span> contentList<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                   <span style="color: #000000; font-weight: bold;">final</span> Item item <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Item<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> date <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%1$tY-%1$tm-%1$td&quot;</span>, content.<span style="color: #006633;">getPublicationDateTweet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            item.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;On %s, %s publish&quot;</span>, date, content.<span style="color: #006633;">getQuestionBean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getQuestionName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            item.<span style="color: #006633;">setPubDate</span><span style="color: #009900;">&#40;</span>content.<span style="color: #006633;">getPublicationDateTweet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            item.<span style="color: #006633;">setLink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.encuestame.org&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            entries.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>entry<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> entries<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Para que esta vista<strong> pueda ser interpretada por el MVC de Spring, debemos definir un RESOLVER</strong> para que pueda encontrar nuestra vista de RSS, yo siempre le doy un orden prioritario, por si tuvieramos otros RESOLVERS definidos en nuestro MVC.<br />
<strong>Tambien agregamos como un Bean nuestra nueva vista</strong> y recordemos el ID que pronto lo usaremos.</p>
<p>Ahora vamos con el Controller, que es el encargado de recibir la peticion del <a href="http://static.springsource.org/spring/docs/3.0.3.RELEASE/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html">Dispacher Servlet</a> , usaremos Anotaciones y mapeo con <strong>REST</strong> porque somos muuuuu modernos <img src='http://blog.jotadeveloper.es/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  Yo extendi de una clase abstracta, que no tiene nada pero no es necesario para nuestro ejemplo.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">@Controller
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RSSFeedController <span style="color: #000000; font-weight: bold;">extends</span> AbstractFeedController <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Build Feed Body.
     */</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> buildTweetPollFeedBody<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username, Model model, HttpServletRequest request, User user<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         model.<span style="color: #006633;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;username&quot;</span>, username<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         model.<span style="color: #006633;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;feedTitle&quot;</span>, <span style="color: #003399;">String</span>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>TWEET_POLL_FEED_TITLE, username<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         model.<span style="color: #006633;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;url&quot;</span>, buildDomainWithRequest<span style="color: #009900;">&#40;</span>request<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #666666; font-style: italic;">//buscamos nuestras entradas de nuestro blog, por poner un ejemplo</span>
         <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">List</span> entries <span style="color: #339933;">=</span> getEntries<span style="color: #009900;">&#40;</span>user.<span style="color: #006633;">getUsername</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">// las guardamos en el modelo que pasaremos a la vista y usaremos mas adelante.</span>
         model.<span style="color: #006633;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;entries&quot;</span>, entries<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Display RSS Feed.
     */</span>
     <span style="color: #666666; font-style: italic;">// Utilizar REST es sencillo, solo debemos definir la variable entre llaves y llamarla con la anotacion @PathVariable</span>
    @RequestMapping<span style="color: #009900;">&#40;</span>value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/feed/{username}/entries.rss&quot;</span>, method <span style="color: #339933;">=</span> RequestMethod.<span style="color: #006633;">GET</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> tweetPollRss<span style="color: #009900;">&#40;</span>@PathVariable <span style="color: #003399;">String</span> username, Model model, HttpServletRequest request<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #666666; font-style: italic;">// Como queremos utilizar el mismo RSS para diferentes usuarios, buscamos nuestro usuario.</span>
        <span style="color: #000000; font-weight: bold;">final</span> User user <span style="color: #339933;">=</span> getByUsername<span style="color: #009900;">&#40;</span>username<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>user <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//TODO: if null do something.</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
             <span style="color: #666666; font-style: italic;">// Como somos muy ordenados creamos otro metodo.</span>
            <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">buildTweetPollFeedBody</span><span style="color: #009900;">&#40;</span>username, model, request, user<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">// Aqui regresaremos una cadena, que no es mas que el ID de nuestra VISTA del Bean RSS.</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;rssFeedView&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Una vez creada toda esta estructura, lo siguiente es pan comido, <strong>simplemente cargar en el url la direccion</strong> de la siguiente manera, sustituyendo la variable {username} por el usuario virtual para que nos regrese los RSS de ese usuario.</p>
<p><strong>http://localhost/feed/bonachon/entries.rss</strong></p>
<p><strong>Preguntas?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/07/09/crea-tus-feed-con-rss-o-atom-con-spring-3-0-y-rest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java 4 Ever</title>
		<link>http://blog.jotadeveloper.es/2010/06/26/java-4-ever/</link>
		<comments>http://blog.jotadeveloper.es/2010/06/26/java-4-ever/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 06:42:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/2010/06/26/java-4-ever/</guid>
		<description><![CDATA[Con un toque made in Hollywood, excelente trailer de una historia de amor por Java, no tiene desperdicio. Lo que mas me gusta es el reparto de actores y atrices. Scala Johansson]]></description>
				<content:encoded><![CDATA[<p>Con un toque made in Hollywood,<strong> excelente trailer de una historia de amor por Java</strong>, no tiene desperdicio. Lo que mas me gusta es el reparto de actores y atrices. Scala Johansson <img src='http://blog.jotadeveloper.es/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/m-zNPQj6UQE&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/m-zNPQj6UQE&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/06/26/java-4-ever/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Analíza la calidad de tu código Java con Sonar 2.0</title>
		<link>http://blog.jotadeveloper.es/2010/04/06/analiza-la-calidad-de-tu-codigo-java-con-sonar-2-0/</link>
		<comments>http://blog.jotadeveloper.es/2010/04/06/analiza-la-calidad-de-tu-codigo-java-con-sonar-2-0/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 05:29:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven2]]></category>
		<category><![CDATA[métricas]]></category>
		<category><![CDATA[sonar]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3026</guid>
		<description><![CDATA[Sonar es un proyecto OpenSource de codehaus.org para analizar la calidad tu código en Java con diferentes tipos de métricas, solo funciona con proyectos construidos con Maven2. Para descargar el proyecto http://sonar.codehaus.org/downloads/ La Instalación es bien sencilla, primero debes descomprimir el ZIP que descargaste y modificar el archivo sonar.properties: #--------------------------------------------------------- # WEB # THESE SETTINGS [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Sonar</strong> es un proyecto OpenSource de codehaus.org para <strong>analizar la calidad tu código en Java</strong> con diferentes tipos de métricas, <strong>solo funciona con proyectos construidos con Maven2</strong>.</p>
<p>Para <strong>descargar</strong> el proyecto <a href="http://sonar.codehaus.org/downloads/">http://sonar.codehaus.org/downloads/</a></p>
<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2010/04/sonar1.png"><img class="alignnone size-full wp-image-3027" title="sonar" src="http://blog.jotadeveloper.com/wp-content/uploads/2010/04/sonar1.png" alt="" width="676" height="455" /></a></p>
<p>La Instalación es <strong>bien sencilla</strong>, primero debes descomprimir el ZIP que descargaste y modificar el archivo <strong>sonar.properties</strong>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">#---------------------------------------------------------
# WEB
# THESE SETTINGS ARE USED ONLY IN STANDALONE MODE. IGNORED WHEN THE WAR IS DEPLOYED ON A JEE SERVER.
#---------------------------------------------------------
# Listen host/port and context path (for example / or /sonar). Default values are 0.0.0.0:9000/
#sonar.web.host:                           0.0.0.0
sonar.web.port:                           8080
#sonar.web.context:                        /</pre></td></tr></table></div>

<p>La primera propiedad se refiere al IP donde tienes instalado el sonar, el segundo el puerto y la tercera propiedad el contexto en tomcat o jboss,<strong> si estamos trabajando con virtualhost no creo que haga falta que pongas un contexto.</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">#----- MySQL 5.x/6.x
# Comment the embedded database and uncomment the following lines to use MySQL
sonar.jdbc.url:                                      jdbc:mysql://localhost:3306/sonar?useUnicode=true<span style="color: #ddbb00;">&amp;characterEncoding=utf8</span>
<span style="color: #ddbb00;">sonar.jdbc.driverClassName:                   com.mysql.jdbc.Driver</span>
<span style="color: #ddbb00;">sonar.jdbc.validationQuery:                     select 1</span>
&nbsp;
<span style="color: #ddbb00;">#----- Global database settings</span>
<span style="color: #ddbb00;">sonar.jdbc.username:                              sonar</span>
<span style="color: #ddbb00;">sonar.jdbc.password:                              sonar</span>
<span style="color: #ddbb00;">sonar.jdbc.maxActive:                             10</span>
<span style="color: #ddbb00;">sonar.jdbc.maxIdle:                                 5</span>
<span style="color: #ddbb00;">sonar.jdbc.minIdle:                                  2</span>
<span style="color: #ddbb00;">sonar.jdbc.maxWait:                                5000</span>
<span style="color: #ddbb00;">sonar.jdbc.minEvictableIdleTimeMillis:        600000</span>
<span style="color: #ddbb00;">sonar.jdbc.timeBetweenEvictionRunsMillis:   30000</span></pre></td></tr></table></div>

<p>En mi caso decidi conectarlo con MySQL <strong>aunque por defecto unsa una base de datos local en Derby</strong>, debes comentar las lineas de derby y descomentar la base de datos que tu eligas, hay buen menú donde elegir, y tal vez modificar datos como el usuario y la contraseña de conexión a la bd.</p>
<p>Llega la hora de crear el <strong>war</strong>, en la carpeta war, <strong>corres el comando build-war.sh</strong> y publicas en tu contenedor web para java el proyecto.</p>
<p>El tercer paso y mas importante es <strong>la configuracion en settings.xml en Maven2</strong>, en tu repositorio local.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>sonar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activeByDefault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activeByDefault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sonar.jdbc.url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jdbc:mysql://localhost:3306/sonar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sonar.jdbc.url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sonar.jdbc.driver<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.mysql.jdbc.Driver<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sonar.jdbc.driver<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sonar.jdbc.username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>sonar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sonar.jdbc.username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sonar.jdbc.password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>password<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sonar.jdbc.password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sonar.host.url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://tudominio:8080<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sonar.host.url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Esta sección<strong> se agrega en la parte de PROFILES en settings.xml </strong>en Maven2. Con esto lograremos que nuestro proyecto pueda publicarse en Sonar.</p>
<p>Ahora, la parte mas sencilla, navegas al path de tu proyecto y corres el comando siguiente,</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">         mvn sonar<span style="color: #339933;">:</span>sonar</pre></td></tr></table></div>

<p> y el resto es pan comido, <strong>en este proceso Sonar analizara tu código y creará las métricas en el portal</strong>. Algo como lo siguiente.<br />
<a href="http://nemo.sonarsource.org/">http://nemo.sonarsource.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/04/06/analiza-la-calidad-de-tu-codigo-java-con-sonar-2-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Problemas entre Spring 3.0 y Spring Web Flow 2.0.8</title>
		<link>http://blog.jotadeveloper.es/2010/04/06/problemas-entre-spring-3-0-y-spring-web-flow-2-0-8/</link>
		<comments>http://blog.jotadeveloper.es/2010/04/06/problemas-entre-spring-3-0-y-spring-web-flow-2-0-8/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 04:45:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring security]]></category>
		<category><![CDATA[spring web flow]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3019</guid>
		<description><![CDATA[Hace unos dias intentando integrar Spring Security 3.0 con Spring Web Flow en su última version 2.0.9 al día de hoy, como en el ejemplo siguiente. &#60;bean id=&#34;securityFlowExecutionListener&#34; class=&#34;org.springframework.webflow.security.SecurityFlowExecutionListener&#34; /&#62; &#160; &#60;webflow:flow-executor id=&#34;flowExecutor&#34; flow-registry=&#34;flowRegistry&#34;&#62; &#60;webflow:flow-execution-listeners&#62; &#60;webflow:listener ref=&#34;securityFlowExecutionListener&#34; /&#62; &#60;/webflow:flow-execution-listeners&#62; &#60;/webflow:flow-executor&#62; Esta configuracion en Web Flow basicamente lo que hace es que podamos restringir ciertas vistas [...]]]></description>
				<content:encoded><![CDATA[<p>Hace unos dias <strong>intentando integrar Spring Security 3.0 con Spring Web Flow en su última version 2.0.9 al día de hoy</strong>, como en el ejemplo siguiente.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">   <span style="color: #339933;">&lt;</span>bean id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;securityFlowExecutionListener&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;org.springframework.webflow.security.SecurityFlowExecutionListener&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
   <span style="color: #339933;">&lt;</span>webflow<span style="color: #339933;">:</span>flow<span style="color: #339933;">-</span>executor id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;flowExecutor&quot;</span> flow<span style="color: #339933;">-</span>registry<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;flowRegistry&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>webflow<span style="color: #339933;">:</span>flow<span style="color: #339933;">-</span>execution<span style="color: #339933;">-</span>listeners<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>webflow<span style="color: #339933;">:</span>listener ref<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;securityFlowExecutionListener&quot;</span> <span style="color: #339933;">/&gt;</span>
        <span style="color: #339933;">&lt;/</span>webflow<span style="color: #339933;">:</span>flow<span style="color: #339933;">-</span>execution<span style="color: #339933;">-</span>listeners<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>webflow<span style="color: #339933;">:</span>flow<span style="color: #339933;">-</span>executor<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Esta configuracion en Web Flow <strong>basicamente lo que hace es que podamos restringir ciertas vistas o flujos enteros en base a Roles con Spring Security</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;secured</span> <span style="color: #000066;">attributes</span>=<span style="color: #ff0000;">&quot;ROLE_USER&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;view-state</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;main&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;on-render<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;render</span> <span style="color: #000066;">fragments</span>=<span style="color: #ff0000;">&quot;zona3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/on-render<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;transition</span> <span style="color: #000066;">on</span>=<span style="color: #ff0000;">&quot;paso1&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;reviewHotels&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;secured</span> <span style="color: #000066;">attributes</span>=<span style="color: #ff0000;">&quot;ROLE_EDITOR&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;evaluate</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;bean.metodo1()&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;render</span> <span style="color: #000066;">fragments</span>=<span style="color: #ff0000;">&quot;zona1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/transition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;transition</span> <span style="color: #000066;">on</span>=<span style="color: #ff0000;">&quot;paso2&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;secured</span> <span style="color: #000066;">attributes</span>=<span style="color: #ff0000;">&quot;ROLE_ADMIN&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;evaluate</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;bean.metodo2() /&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;render</span> <span style="color: #000066;">fragments</span>=<span style="color: #ff0000;">&quot;zona1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/transition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/view-state<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>y obtenia este error al compilar.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">Caused by: java.lang.ClassNotFoundException: org.springframework.security.vote.AffirmativeBased
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
... 65 more</pre></td></tr></table></div>

<p>Pero parece no tener solución por ahora salvo que tu apliques el <a href="https://jira.springsource.org/browse/SWF-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel">parche publicado en JIRA </a>hace unos dias.</p>
<p>Aunque hoy mismo publicaron que el parche saldria <strong>hasta la versión Spring Web Flow 2.1</strong> y no en la 2.0.9 como hace 48 horas estaba publicado.</p>
<p><a href="https://jira.springsource.org/browse/SWF/fixforversion/11441">https://jira.springsource.org/browse/SWF/fixforversion/11441</a></p>
<p>En pocas palabras, <strong>a esperar.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/04/06/problemas-entre-spring-3-0-y-spring-web-flow-2-0-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configurando Spring Security 3.0 y actualizando con Maven</title>
		<link>http://blog.jotadeveloper.es/2010/04/06/configurando-spring-security-3-0-y-actualizando-con-maven/</link>
		<comments>http://blog.jotadeveloper.es/2010/04/06/configurando-spring-security-3-0-y-actualizando-con-maven/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 02:25:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[spring security]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3010</guid>
		<description><![CDATA[Vamos con algo sencillo el día de hoy. Ante la llegada hace unos meses ya de Spring Security 3.0 y con estupendas novedades y sus cambios. Si ya has migrado te habrás dado cuenta que muchos de los nombres de los paquetes han cambiado. import org.springframework.security.Authentication; import org.springframework.security.context.SecurityContext; import org.springframework.security.context.SecurityContextHolder; import org.springframework.security.context.SecurityContextImpl; import org.springframework.security.providers.openid.OpenIDAuthenticationStatus; import [...]]]></description>
				<content:encoded><![CDATA[<p>Vamos con algo sencillo el día de hoy. Ante la llegada hace unos meses ya de <strong>Spring Security 3.0</strong> y con estupendas novedades y sus cambios.</p>
<p>Si ya has migrado te <strong>habrás dado cuenta que muchos de los nombres de los paquetes han cambiado</strong>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.Authentication</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.context.SecurityContext</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.context.SecurityContextHolder</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.context.SecurityContextImpl</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.providers.openid.OpenIDAuthenticationStatus</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.providers.openid.OpenIDAuthenticationToken</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.userdetails.UserDetails</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.userdetails.UserDetailsService</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>antes se llamaban</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.Authentication</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.context.SecurityContext</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.context.SecurityContextHolder</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.context.SecurityContextImpl</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.userdetails.UserDetails</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.core.userdetails.UserDetailsService</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.openid.OpenIDAuthenticationStatus</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.security.openid.OpenIDAuthenticationToken</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>No solo estas clases han cambiado</strong>, en mi migración de hace unos dias me encontre que con el 70% de las clases que usaba habian sido cambiadas, fue todo un dolor de cabeza al principio.</p>
<p>Nota: no <strong>te olvides de agregar los filtros en el web.xml</strong> eso no ha cambiado para nada en la 3.0.</p>
<h3> Actualizando con Maven </h3>
<p>Yo ahora mismo estoy trabajando con la versión <strong>3.0.2.RELEASE</strong> y es bastante estable aunque<a href="http://blog.jotadeveloper.com/2010/04/06/problemas-entre-spring-3-0-y-spring-web-flow-2-0-8/"> tiene un bug con la integración en Spring Web Flow.</a></p>
<p>El uso de propiedades en Maven es muy recomendable, si mañana quieres actualizar a otra versión es mucho mas comodo cambiar en un solo lugar,<strong> existen muchos otros JAR disponibles en Spring Security como (CAS, ASL o Spring Web)</strong> que tambien puedes agregar como dependencia, segun tus necesidades.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spring.security.version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3.0.2.RELEASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spring.security.version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-config<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-core<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclusions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclusion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>commons-logging<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>commons-logging<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exclusion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exclusions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-ldap<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-openid<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-taglibs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-web<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${spring.security.version}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Otra cosa que debes modificar o agregar si es una nueva configuración <strong>es en los namespaces</strong>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:security</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/security&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans</span>
<span style="color: #009900;">          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd</span>
<span style="color: #009900;">          http://www.springframework.org/schema/security</span>
<span style="color: #009900;">          http://www.springframework.org/schema/security/spring-security-3.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<h3> Configuración Mínima </h3>
<p>Spring Security 3.0 <strong>nos permite desde una configuración sencilla hasta las mas completas</strong>, según la documentacion esto es lo mínimo que necesitas.<br />
En este caso se podria llamar una versión amateur de la configuración real con beans en Spring Security, ellos nos ofrecen este <strong><http></strong> una <strong>version resumida </strong>de la configuracion, siendo la mínima lo siguiente</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http</span> <span style="color: #000066;">auto-config</span>=<span style="color: #ff0000;">'true'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/**&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ROLE_USER&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/http<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Y pudiendose extender a <strong>algo mas complejo</strong> (complejo dentro de la sencille) como:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:http</span> <span style="color: #000066;">auto-config</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">entry-point-ref</span>=<span style="color: #ff0000;">&quot;authenticationEntryPoint&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">access-decision-manager-ref</span>=<span style="color: #ff0000;">&quot;voteAccessDecisionManager&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/**&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ENCUESTAME_ANONYMOUS&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/admon/**/*&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ENCUESTAME_ADMIN&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/tweet/&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ENCUESTAME_ANONYMOUS&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ENCUESTAME_ANONYMOUS&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/**/*.xhtml&quot;</span> <span style="color: #000066;">filters</span>=<span style="color: #ff0000;">&quot;none&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/**/*.css&quot;</span>  <span style="color: #000066;">filters</span>=<span style="color: #ff0000;">&quot;none&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/images/**&quot;</span> <span style="color: #000066;">filters</span>=<span style="color: #ff0000;">&quot;none&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/js/**&quot;</span> <span style="color: #000066;">filters</span>=<span style="color: #ff0000;">&quot;none&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:remember-me</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;12345&quot;</span> <span style="color: #000066;">services-alias</span>=<span style="color: #ff0000;">&quot;_rememberMeServices&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:anonymous</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;12345&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:logout</span> <span style="color: #000066;">logout-success-url</span>=<span style="color: #ff0000;">&quot;/index.html&quot;</span> <span style="color: #000066;">logout-url</span>=<span style="color: #ff0000;">&quot;/logout&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:custom-filter</span> <span style="color: #000066;">position</span>=<span style="color: #ff0000;">&quot;FORM_LOGIN_FILTER&quot;</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;authenticationFilter&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:custom-filter</span> <span style="color: #000066;">position</span>=<span style="color: #ff0000;">&quot;ANONYMOUS_FILTER&quot;</span>  <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;anonymousAuthFilter&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security:http<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Para <a href="http://blog.jotadeveloper.com/tag/spring-security/">aprender algo más sobre los multiples filtros</a> que ofrece Spring Security en versiones anteriores, en este mismo blog postee algunos artículos.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/04/06/configurando-spring-security-3-0-y-actualizando-con-maven/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Estadísticas para repositorios GIT</title>
		<link>http://blog.jotadeveloper.es/2010/01/20/estadisticas-para-repositorios-git/</link>
		<comments>http://blog.jotadeveloper.es/2010/01/20/estadisticas-para-repositorios-git/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 09:28:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[repositorio]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=3004</guid>
		<description><![CDATA[Git es un repositorio de datos que esta ganándole mucho terreno a SVN, existe una comunidad (GIT HUB) donde se podrán encontrar muchos proyectos en Git para practicar lo que vamos hablar a continuación. Para descargar un proyecto solo debes clonarlo de la siguiente manera. git clone git://github.com/jquery/jquery.git Gitstats Gitstats es un proyecto de Heikki [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://es.wikipedia.org/wiki/Git"><strong>Git</strong></a> es un repositorio de datos que esta ganándole mucho terreno a SVN, existe una comunidad (<a href="http://github.com">GIT HUB</a>) donde se podrán encontrar muchos proyectos en <strong>Git</strong> para practicar lo que vamos hablar a continuación.</p>
<p>Para descargar un proyecto solo debes <strong>clonarlo</strong> de la siguiente manera.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">git clone git://github.com/jquery/jquery.git</pre></td></tr></table></div>

<h2>Gitstats</h2>
<p>Gitstats es un proyecto de <strong>Heikki Hokkanen </strong>que podrás encontrar en <a href="http://gitstats.sourceforge.net/">http://gitstats.sourceforge.net/</a> , este proyecto esta desarrollado en <strong>Python</strong> y es muy sencillo de usar, necesitas tener instalado Git y Gnuplot para poder generar los gráficos como el de abajo.</p>
<p>Para generar las estadisticas solo debes ejecutar lo siguiente:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">./gitstats /pathToGitRepo/ pathToGenerateHTMLStats/</pre></td></tr></table></div>

<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2010/01/gitstas1.png"><img class="alignnone size-full wp-image-3006" title="gitstas" src="http://blog.jotadeveloper.com/wp-content/uploads/2010/01/gitstas1.png" alt="" width="595" height="510" /></a></p>
<h2>Gitstat</h2>
<p>Un proyecto parecido al anterior, pero en este caso es algo diferente, esta desarrollado en <strong>PHP y Perl </strong>y lo puedes encontrar en <a href="http://sourceforge.net/projects/gitstat/">http://sourceforge.net/projects/gitstat/</a>, solo debes crear una base de datos y preparar el archivo de configuracion<strong> config.pl</strong> que luego deberás poner en un Cron para que el actualice periódicamente las estadísticas, el almacena los cambios en la base de datos. Lo <strong>curioso</strong> de este proyectos es que esta alojado en un repositorio CVS, como dice el refran, <em>en casa de herrero, cuchillo de palo.</em></p>
<p><a href="http://blog.jotadeveloper.com/wp-content/uploads/2010/01/screenshot1.jpg"><img class="alignnone size-full wp-image-3005" title="screenshot" src="http://blog.jotadeveloper.com/wp-content/uploads/2010/01/screenshot1.jpg" alt="" width="600" height="480" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.es/2010/01/20/estadisticas-para-repositorios-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
