<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>componente &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/componente/</link>
	<description>Feed of posts on WordPress.com tagged "componente"</description>
	<pubDate>Sat, 11 Oct 2008 21:46:05 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Bajar y mostrar carátulas en Foobar automáticamente]]></title>
<link>http://zurcheva.wordpress.com/?p=922</link>
<pubDate>Sun, 05 Oct 2008 22:15:33 +0000</pubDate>
<dc:creator>demonheart</dc:creator>
<guid>http://zurcheva.ro.wordpress.com/2008/10/05/bajar-y-mostrar-caratulas-en-foobar-automaticamente/</guid>
<description><![CDATA[Posiblemente, si sueles utilizar Foobar con algún interfaz que muestre las caratulas de cada disco ]]></description>
<content:encoded><![CDATA[<p>Posiblemente, si sueles utilizar Foobar con algún interfaz que muestre las caratulas de cada disco que escuchas, te hayas dado cuenta ya que a menudo no se nos muestra la portada del disco. Ello se debe a que, para que se muestre, en la misma carpeta debe haber alguna imagen de la portada, preferiblemente guardada con el nombre "folder".</p>
<p style="text-align:center;"><a href="http://zurcheva.files.wordpress.com/2008/10/vistaportadas2.png"><img class="size-large wp-image-926 aligncenter" title="vistaportadas2" src="http://zurcheva.wordpress.com/files/2008/10/vistaportadas2.png?w=450" alt="" width="450" height="322" /></a></p>
<p>Hacer esto de forma manual disco por disco puede ser, sinceramente, una matada. Para ello, me puse a mirar formas para conseguir automatizar el proceso.</p>
<p>A continuación, los pasos para conseguirlo:</p>
<p><strong>1.</strong> <strong>Si tienes instalado el skin FooAva, sáltate este paso. Si prefieres aprovechar para instalar el skin FooAva, <a href="http://zurcheva.wordpress.com/2008/07/30/instalar-skin-foo-ava-v105-para-foobar">aquí </a>tienes el tutorial.</strong></p>
<p><strong> </strong>Baja <a href="http://www.anytag.de/download/foo_run-0.3.4.zip">este archiv</a><a href="http://www.anytag.de/download/foo_run-0.3.4.zip">o</a> (es el componente foo_run) e introduce el archivo .dll que contiene en la carpeta Components de Foobar (por defecto en C:\Archivos de programa\foobar2000\components) . Reinicia Foobar.</p>
<p><strong>2.</strong> <a href="http://sourceforge.net/projects/album-art">Descarga</a> e instala la aplicación Album Art Downloader.</p>
<p><strong>3.</strong> Ves a Foobar y entra en Preferencias (Ctrl+P). Ves a la pestaña Tools, y luego al subapartado Run services. Vamos a crear un nuevo "servicio", que será el que nos servirá para bajar las portadas. Escribimos en Label el nombre del servicio; por ejemplo, "Bajar portada".</p>
<p style="text-align:center;"><a href="http://zurcheva.files.wordpress.com/2008/10/tutorial.png"><img class="size-large wp-image-923 aligncenter" title="tutorial" src="http://zurcheva.wordpress.com/files/2008/10/tutorial.png?w=450" alt="" width="450" height="328" /></a></p>
<p>Debajo, en el cuadrado que tenemos, introducimos (con comillas incluidas) el siguiente código:</p>
<p style="text-align:left;"><em>"C:\Archivos de programa\AlbumArtDownloader\AlbumArt.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)folder.jpg"</em></p>
<p style="text-align:left;">Si has decidido, en el paso previo, instalar Album Art Downloader en otra ruta, deberás sustituir <em>C:\Archivos de programa\AlbumArtDownloader\AlbumArt.exe </em>por la ruta en la que tengas el ejecutable.</p>
<p style="text-align:left;">Para añadir finalmente el servicio, clicamos en Add. Ahora ya podemos cerrar las preferencias.</p>
<p style="text-align:left;"><strong>4. ¡Listo! </strong>Para bajar las carátulas, clica con el botón secundario en cualquier canción, ves a Run, Bajar portada (o el nombre que hayáis puesto). Se abrirá la ventana de Album Art Downloader. Miramos qué portada nos interesa, y pulsamos al icono con forma de disquet para guardarla automáticamente.</p>
<p style="text-align:left;">Posibles problemas: que las canciones no estén bien indexadas. En ese caso, cuando se abra la ventana de Album Art Downloader, procura cambiar los "?" por los datos del disco.</p>
<p style="text-align:left;">Espero que os haya servido de ayuda!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Flip4Mac se actualiza]]></title>
<link>http://macoreo.wordpress.com/?p=527</link>
<pubDate>Sat, 13 Sep 2008 17:39:31 +0000</pubDate>
<dc:creator>JuniHH</dc:creator>
<guid>http://macoreo.ro.wordpress.com/2008/09/13/flip4mac-se-actualiza/</guid>
<description><![CDATA[En Maqueros me acabo de enterar que fue actualizado Flip4Mac, un componente para Quicktime que permi]]></description>
<content:encoded><![CDATA[<p><img class="alignright" style="margin-left:10px;margin-right:10px;" title="Flip4Mac" src="http://farm4.static.flickr.com/3163/2853846452_ea65c44bcc_o.jpg" alt="" width="130" height="138" />En <a href="http://www.maqueros.cl" target="_blank">Maqueros</a> me acabo de enterar que fue actualizado <a href="http://www.flip4mac.com/wmv.htm" target="_blank">Flip4Mac</a>, un componente para <a href="http://www.apple.com/quicktime/" target="_blank">Quicktime</a> que permite ver videos en <a href="http://es.wikipedia.org/wiki/Windows_Media_Video" target="_blank">WMV</a>.</p>
<p>Este componente tiene una version paga que permite hacer edicion y exportacion al formato mencionado, pero la version gratis puede perfectamente reproducirlos.<br />
<!--more--><br />
Recuerden que siempre podemos contar con <a href="http://perian.org/" target="_blank">Perian</a>, otro componente para Quicktime, pero completamente gratis y que permite reproducir ademas de WMV, tambien AVI, WMA, FLV, DivX, 3ivx y muchos formatos mas.</p>
<p>Descargar &#124; <a href="http://www.flip4mac.com/wmv_update_player.htm" target="_blank">Flip4Mac Update v2.2.1</a><br />
Desarrollador &#124; <a href="http://www.flip4mac.com" target="_blank">Flip4Mac</a><br />
Fuente &#124; <a href="http://www.maqueros.cl/2008/09/13/flip4mac-se-actualiza/" target="_blank">Maqueros</a></p>
<p><img src="http://farm2.static.flickr.com/1214/539195086_0270ce604d_m.jpg" alt="Blogalaxia Tags" align="absmiddle" /> <a rel="tag" href="http://www.blogalaxia.com/tags/flip4mac">flip4mac</a>, <a rel="tag" href="http://www.blogalaxia.com/tags/componente">componente</a>, <a rel="tag" href="http://www.blogalaxia.com/tags/quicktime">quicktime</a>, <a rel="tag" href="http://www.blogalaxia.com/tags/avi">avi</a>, <a rel="tag" href="http://www.blogalaxia.com/tags/wmv">wmv</a>, <a rel="tag" href="http://www.blogalaxia.com/tags/wma">wma</a><br />
<img src="http://farm2.static.flickr.com/1154/539195134_dcd1aee8b0_m.jpg" alt="Technorati Tags" align="absmiddle" /> <a rel="tag" href="http://technorati.com/tag/flip4mac">flip4mac</a>, <a rel="tag" href="http://technorati.com/tag/componente">componente</a>, <a rel="tag" href="http://technorati.com/tag/quicktime">quicktime</a>, <a rel="tag" href="http://technorati.com/tag/avi">avi</a>, <a rel="tag" href="http://technorati.com/tag/wmv">wmv</a>, <a rel="tag" href="http://technorati.com/tag/wma">wma</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Instalar componentes y módulos en Joomla]]></title>
<link>http://cmsjoomla.wordpress.com/?p=13</link>
<pubDate>Thu, 04 Sep 2008 11:27:48 +0000</pubDate>
<dc:creator>enramos</dc:creator>
<guid>http://cmsjoomla.ro.wordpress.com/2008/09/04/instalar-componentes-y-modulos-en-joomla/</guid>
<description><![CDATA[Primer videotutorial en el que se instala un componente y sus módulos, se crea una nueva entrada de]]></description>
<content:encoded><![CDATA[<p style="text-align:left;">Primer videotutorial en el que se instala un componente y sus módulos, se crea una nueva entrada de menú de tipo componente y se publican los módulos en la página principal, cambiando la posición en alguno de ellos.</p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/rtrQqd71VSE'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/rtrQqd71VSE&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[TV Tuner extern WinFast TV Pro II ]]></title>
<link>http://magercu.wordpress.com/?p=24</link>
<pubDate>Mon, 25 Aug 2008 08:41:27 +0000</pubDate>
<dc:creator>magercu</dc:creator>
<guid>http://magercu.ro.wordpress.com/2008/08/25/tuner-extern-winfast-tv-pro-ii/</guid>
<description><![CDATA[
Acum cateva zile am vazut la cineva acasa un asa zis televizor care consta din patru piese:

un mon]]></description>
<content:encoded><![CDATA[<p><a href="http://www.leadtek.com.tw/eng/tv_tuner/image/winfast_tv_pro2_p.jpg"><img class="size-medium wp-image-25 alignright" src="http://magercu.wordpress.com/files/2008/08/winfast_tv_pro2_1.jpg?w=300" alt="" width="180" height="117" /></a></p>
<p>Acum cateva zile am vazut la cineva acasa un asa zis televizor care consta din patru piese:</p>
<ul>
<li>un monitor LCD;</li>
<li>un tuner extern <a href="http://www.leadtek.com.tw/eng/tv_tuner/overview.asp?lineid=6&#38;pronameid=282" target="_blank">WinFast TV Pro II</a>;</li>
<li>o telecomanda;</li>
<li>boxe active.</li>
</ul>
<p>Chestia care m-a surprins placut era faptul ca functiona impecabil si receptia era mult superioara unui tuner intern, de care detin si eu. Pe viitor doresc sa imi achizitionez si eu un astfel de Tv tuner.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[¡¡¡Descubrimiento del Oxígeno!!!]]></title>
<link>http://hoysecumplen.wordpress.com/?p=775</link>
<pubDate>Fri, 01 Aug 2008 19:53:39 +0000</pubDate>
<dc:creator>hoysecumplen</dc:creator>
<guid>http://hoysecumplen.wordpress.com/2008/08/01/%c2%a1%c2%a1%c2%a1descubrimiento-del-oxigeno/</guid>
<description><![CDATA[¡¡¡¡ATENCIÓN ATENCIÓN!!!! TENEMOS NUEVA WEB, PARA DEJAR TUS COMENTARIOS DEBERÁS HACERLO CLICK]]></description>
<content:encoded><![CDATA[<p><strong>¡¡¡¡ATENCIÓN ATENCIÓN!!!! TENEMOS NUEVA WEB, PARA DEJAR TUS COMENTARIOS DEBERÁS HACERLO CLICKANDO EN LA SIGUIENTE IMAGEN, CUALQUIER COMENTARIO QUE HAGÁIS EN ESTA WEB SERÁ AUTOMÁTICAMENTE ELIMINADO YA QUE LA WEB ESTÁ INACTIVA, GRACIAS.</strong></p>
<p><strong>                                                      ¡¡¡¡VISITANOS!!!!</strong></p>
<p><strong></strong></p>
<p><a href="http://hoysecumplen.com/?p=283"><img class="aligncenter size-medium wp-image-1087" title="header" src="http://hoysecumplen.wordpress.com/files/2008/10/header.jpg?w=300" alt="" width="300" height="98" /></a> <a href="http://hoysecumplen.wordpress.com/files/2008/10/header.jpg"></a></p>
<p style="text-align:center;">                                                                        <br />
<img class="size-medium wp-image-778 aligncenter" src="http://hoysecumplen.wordpress.com/files/2008/08/oxigeno-wall1.jpg?w=300" alt="Oxigeno a Borbotones" width="300" height="240" /></p>
<p>Pues si Damas y Gérmenes, <strong>hoy se cumplen</strong> teóricamente 234 años del descubrimiento de ese elemento imprescindible para la vida, el <strong>O</strong>. Como habéis podido comprobar <strong>HOYSECUMPLEN no se va de vacaciones </strong>para vuestro deleite...</p>
<p>Además <strong>este mes de agosto </strong>que hoy empezamos <strong>viene cargado de aniversarios de lo más interesantes</strong>, sin ir más lejos mañana mismo realizaré uno que estoy deseando hacer desde que empezase un 11 de febrero de este año mi blog. De momento solo os puedo decir del <strong>aniversario de mañana</strong>, que es de una <strong>famosísima cantante </strong>fallecida hace años, <a href="http://hoysecumplen.files.wordpress.com/2008/08/corazon.gif">todavía a día de hoy estoy enamorado de su voz</a>...</p>
<p>Y ya para no rayaros más, os quiero comentar que <a href="http://www.aquihaytomate.telecinco.es/imgsed/060704aht_yola_1.jpg">si veis cosas raras </a>en el blog de ahora en adelante no os preocupéis porque <strong>estamos intentando mejorar los servicios </strong>que os prestamos a diario, con todo nuestro cariño y aprecio para que disfrutéis el blog al máximo, porque <strong>lo más importante del blog sois vosotros!</strong><strong>!</strong>. De momento no os podemos desvelar las sorpresas que tenemos preparadas en un futuro no muy lejano, pero os aseguro que no os vamos a decepcionar!!</p>
<p>Empezamos y os pido disculpas por haberme enrollado tanto, pero es que disfruto trabajando para vosotros...</p>
<p><strong>Hoy se cumplen </strong>234 años del descubrimiento del elemento <strong>Oxígeno</strong>, descubierto teóricamente por el químico <a href="http://www.general-anaesthesia.com/images/joseph-priestley.jpg">Joseph Priestley</a> (el apellido Priestley se parece mucho al de un famosísimo personaje que pasará por HOYSECUMPLEN durante este mes...). Anteriormente al descubrimiento de Priestley, también se habló mucho de que el químico de orígen sueco, <a href="http://www.chemistryexplained.com/elements/images/chel_0001_0001_0_img0103.jpg">Carl Wilhelm Scheele</a>, fue el auténtico y primer descubridor del elemento base del agua. También se habló y se habla que este mérito podría ser obra de <a href="http://usuarios.lycos.es/motorhidrogen/fotos_TDR/antoine_lavoisier.jpg">Lavoisier</a>, ya que <strong>fue el primero en ponerle nombre </strong>al famoso elemento.</p>
<p>Al calentar monóxido de mercurio, Priestley obtuvo dos vapores: uno se condensó en gotitas, el mercurio, pero ¿qué era el otro? Priestley juntó ese gas en un recipiente e hizo algunos ensayos: si introducía una brasa de madera, ardía; si acercaba ratones vivos, éstos se volvían muy activos. En vista de lo cual, Priestley <a href="http://www.edex.es/Noticias/contenidos/Noticias/esnifandopegamentoo.jpg">inhaló</a> un poco de ese gas y notó que se sentía muy ligero y cómodo. A este gas lo llamó aire desflogistizado (algo así como <a href="http://es.youtube.com/watch?v=s5N5ZL6aAJA">supercalifragilísticoespialidoso</a>), hoy sabemos que era oxígeno. Sin saberlo, Priestley fue la primera persona que usó la mascarilla de oxígeno. Cabe recordar que el Oxígeno ya existía pero sin nombre, si el <strong>O</strong> no hubiese existido en aquella época, Priestley no podría haberlo inventado ya que estaría muerto, él y todos nosotros, ahora diréis que voy de listo...</p>
<p>El <strong>O</strong> respirado por los organismos aerobios, liberado por la plantas mediante la fotosíntesis, participa en la conversión de nutrientes en energía (ATP). Su disminución provoca hipoxemia y la falta total de él anoxia provocando así la muerte del organismo. El oxígeno tiene tres isótopos estables y diez radioactivos. Todos sus isótopos radioactivos tienen un periodo de semidesintegración de menos de tres minutos, casi nada!!.</p>
<p>Y ya para terminar os comento un poco <strong>las características </strong>de este indispensable y magnífico componente;</p>
<p>El Oxígeno es un elemento químico de número atómico 8 y como os dije anteriormente con el símbolo <strong>O</strong>, tal cual. Además representa aproximadamente el 21% en volumen de la composición de la atmósfera, de ahí su extrema importancia. Es un gas incoloro, inodoro e insípido.  Existe una forma molecular formada por tres átomos de oxígeno, O3, que es lo que todos conocemos como <a href="http://www.acuario27.com/wordpress/wp-content/uploads/2007/03/ozono.jpg">ozono</a>, cuya presencia en la atmósfera protege la Tierra de la incidencia de <a href="http://www.teorema.com.mx/images/upload/Dia-internacional-15-09-06.jpg">radiación ultravioleta</a> procedente del Sol. Y por último decir también que como todos sabemos, un átomo de oxígeno combinado con dos de hidrógeno forman una molécula de <a href="http://es.youtube.com/watch?v=hJRBmyzixyU">agua</a>.</p>
<p> </p>
<p><strong><em>Ya sabéis, H<sub>2</sub>O ... AGUA</em></strong></p>
<p> </p>
<p>Aquí os dejo un interesante video con música de Jean Michel Jarre (por cierto, el ídolo de mi colega), en el video se habla, mejor dicho, se oye la música con imágenes de la importancia que tiene el oxígeno en nuestras vidas.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/yzSdxEjo_UQ'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/yzSdxEjo_UQ&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
<p><strong>Interesante web encontrada en la red, sobre todos los tipos de elementos incluyéndose entre ellos el oxígeno (está en inglés),</strong> <a href="http://www.webelements.com/oxygen/">pincha aquí</a></p>
<p> </p>
<p><a href="http://hoysecumplen.com/?p=283">Escribe tu comentario</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Seagate lanseaza primul hard-disk de 1,5TB]]></title>
<link>http://rottyzone.wordpress.com/?p=82</link>
<pubDate>Fri, 11 Jul 2008 14:59:56 +0000</pubDate>
<dc:creator>rottys</dc:creator>
<guid>http://rottyzone.ro.wordpress.com/2008/07/11/seagate-lanseaza-primul-hard-disk-de-15tb/</guid>
<description><![CDATA[La aproape un an de zile de la lansarea hard-diskurilor de 1TB si aceasta dimensiune a devenit insuf]]></description>
<content:encoded><![CDATA[<p>La aproape un an de zile de la lansarea hard-diskurilor de 1TB si aceasta dimensiune a devenit insuficienta pentru unii, drept urmare compania Seagate a lansat pe piata un hard-disk considerabil mai mare, de 1,5TB.</p>
<p><!--more--></p>
<div style="text-align:center;"><img src="http://hit.ro/assets/articole/2008/07/gal_mare_seagate-interior.jpg" border="0" alt="seagate-interior.jpg" width="400" height="539" /></div>
<p>Barracuda 7200.11 1,5TB are o viteza de rotatie de 7200 rpm si va avea patru platane in interior dar nu va veni singur, in acelasi timp cu el au fost lansate si cateva hard-diskuri de notebook, intre care vom regasi modelul de 500Gb, si ca sa fie si mai interesant, acest model va veni cu vitezele de rotatie 7200 rpm sau 5400 rpm, cu 16Mb respectiv 8Mb de memorie cache, in functie de preferintele clientilor.<br />
Seagate planuieste pentru anul 2009 sa produca un hard-disk cu o capacitate de 2,5TB.</p>
<p>Sursa: DailyTech</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[5.6- Manual de Seguridad Informática]]></title>
<link>http://ingwebsu.wordpress.com/?p=99</link>
<pubDate>Thu, 10 Jul 2008 23:41:53 +0000</pubDate>
<dc:creator>ingwebsu</dc:creator>
<guid>http://ingwebsu.ro.wordpress.com/2008/07/10/56-manual-de-seguridad-informatica/</guid>
<description><![CDATA[Es una medida que busca establecer los estándares de seguridad a ser seguidos por todos los involuc]]></description>
<content:encoded><![CDATA[<p>Es una medida que busca establecer los estándares de seguridad a ser seguidos por todos los involucrados con el uso y mantenimiento de los activos.<br />
Es una forma de suministrar un conjunto de normas internas para guiar la acción de las personas en la realización de sus trabajos. Es el primer paso para aumentar la conciencia de la seguridad de las personas, pues está orientada hacia la formación de hábitos, por medio de manuales de instrucción y procedimientos operativos.<br />
Sin embargo, la realización del análisis de riesgos como primer elemento de la acción de seguridad, es un hecho determinante para procesos críticos en que son analizadas todas las amenazas. De esta manera son considerados y analizados todos los activos de la organización, sea por muestreo o en su totalidad, para que estén libres de vulnerabilidades con el propósito de reducir los riesgos. Por esta razón serán abordados en esta unidad todos los elementos necesarios para la realización de un análisis de riesgos como etapa de rastreo de vulnerabilidades de todo el ambiente de un proceso de negocios.<br />
Entre mayor sea la exposición o el daño histórico a los bienes de la empresa, el margen de tiempo tomado para el análisis de riesgos debe ser menor y viceversa.<br />
El Manual es elaborada <strong>considerando el entorno en que se está trabajando</strong> como la tecnología de la seguridad de la información, para que los criterios establecidos estén de acuerdo con las prácticas internas más recomendadas de la organización, con las prácticas de seguridad actualmente adoptadas, para buscar una conformidad mayor con criterios actualizados y reconocidos en todo el mundo.<br />
Un Manual de la Política de Seguridad Informática es un conjunto de directrices, normas, procedimientos e instrucciones que guía las actuaciones de trabajo y define los criterios de seguridad para que sean adoptados a nivel local o institucional,  con el objetivo de establecer, estandardizar y normalizar la seguridad tanto en el ámbito humano como en el tecnológico. A partir de sus principios, es posible hacer de la seguridad de la información un esfuerzo común, en tanto que todos puedan contar con un arsenal informativo documentado y normalizado, dedicado a la estandardización del método de operación de cada uno de los individuos involucrados en la gestión de la seguridad de la información.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2" valign="top"><strong>Áreas de Normalización de la Manual de Seguridad Informática</strong><br />
Es necesario considerar los dos aspectos, tecnológico y humano al momento de definir un Manual de la Política de Seguridad Informática de la información<strong> </strong></td>
</tr>
<tr>
<td valign="top"><strong>Tecnológica</strong> Hay quienes consideran que la seguridad de la información es apenas un problema tecnológico. Pero lo importante es definir los aspectos más técnicos del buen funcionamiento de servidores, estaciones de trabajo, acceso a Internet, etc. Para eso, el apoyo de la cúpula es fundamental, pues sin ella el programa de seguridad quedaría sin inversiones para la adquisición de los recursos necesarios. Sin embargo, no se debe dejar de lado las cuestiones relacionadas con la buena conducta y la ética profesional de los usuarios.</td>
<td valign="top"><strong>Humana </strong>Otras personas ven a la seguridad como un problema únicamente humano. Es importante definir primero la conducta considerada adecuada para el tratamiento de la información y de los recursos utilizados. Por lo tanto, sin el apoyo de la cúpula, el programa de seguridad no consigue dirigir las acciones necesarias para modificar la cultura de seguridad actual. El resultado es un programa de seguridad sin el nivel de cultura deseado y la falta de Retroalimentación más apropiado. Sin embargo, no se debe dejar de lado los temas tecnológicos y su sofisticación.</td>
</tr>
</tbody>
</table>
<h2>Elaboración de el Manual de Seguridad Informática</h2>
<p>El Manual es elaborado tomando como base la cultura de la organización y el conocimiento especializado de seguridad de los profesionales involucrados con su aplicación y comprometimiento.  Es importante considerar que para la elaboración de un Manual de la Política de Seguridad Informática institucional se debe:</p>
<ol>
<li>Integrar el Equipo de Seguridad responsable de definir el Manual de la Política de Seguridad.</li>
<li>Elaborar el documento final.</li>
<li>Hacer oficial el Manual una vez que se tenga definida.</li>
</ol>
<h3>Integrar el Equipo</h3>
<p>Formar un equipo multidisciplinario que represente gran parte de los aspectos culturales y técnicos de la organización y que se reúnan periódicamente dentro de un cronograma establecido por el Comité de Seguridad. Este comité es formado por un grupo definido de personas responsables por actividades referentes a la creación y aprobación de nuevas normas de seguridad en la organización. En las reuniones se definen los criterios de seguridad adoptados en cada área y el esfuerzo común necesario para que la seguridad alcance un nivel más elevado. Se debe tener en mente que los equipos involucrados necesitan tiempo libre para analizar y escribir todas las normas discutidas durante las reuniones.</p>
<h3>Elaborar el Documento Final</h3>
<p>En este documento deben expresarse las preocupaciones de la administración, donde se establecen normas para la gestión. En la elaboración de un Manual de la Política de Seguridad Informática no podemos olvidar el lado humano, los descuidos, falta de capacitación, interés, etc. Se pueden tener problemas de seguridad de la información si no son adecuadamente considerados dentro de la misma política. Un ejemplo común es solicitar a los usuarios el cambio de su contraseña o <em>password </em>constantemente y que ésta deba tener una complejidad adecuada para la información manejada. La parte tecnológica obviamente tampoco puede dejarse de lado, y dentro del Manual de la Política de Seguridad Informática es necesario considerar elementos que pongan las bases mínimas a seguir en materia de configuración y administración de la tecnología. Por ejemplo, establecer que los servidores con información crítica de la empresa no deben prestar servicio de estaciones de trabajo a los empleados. La definición de la propia política, Una declaración de la administración que apoye los principios establecidos y una explicación de las exigencias de conformidad con relación a:</p>
<ul>
<li>Legislación y cláusulas contractuales;</li>
<li>Educación y formación en seguridad de la información;</li>
<li>Prevención contra amenazas (virus, caballos de Troya, hackers, incendio, intemperies, etc.)</li>
</ul>
<p>Debe contener también la atribución de las responsabilidades de las personas involucradas donde queden claros los roles de cada uno, en la gestión de los procesos y de la seguridad. No olvidar de que  toda documentación ya existente sobre cómo realizar las tareas debe ser analizada con relación a los principios de seguridad de la información, para aprovechar al máximo las prácticas actuales, evaluar y agregar seguridad a esas tareas.</p>
<p>Elaborar una política es un proceso que exige tiempo e información. Es necesario conocer cómo se estructura la organización y cómo son dirigidos en la actualidad sus procesos. A partir de este reconocimiento, se evalúa el nivel de seguridad existente para poder después detectar los puntos a analizar para que esté en conformidad con los estándares de seguridad.<br />
El trabajo de producción se compone por distintas etapas, entre otras:</p>
<ol>
<li>Objetivos y ámbito</li>
<li>Entrevistas</li>
<li>Investigación y análisis de documentos</li>
<li>Reunión de política</li>
<li>Glosario de el Manual de la Política de Seguridad</li>
<li>Responsabilidades y penalidades</li>
</ol>
<h4>Objetivos y ámbito</h4>
<p>En este punto debe constar la presentación del tema de la norma con relación a sus propósitos y contenidos, buscando identificar resumidamente cuáles estándares el Manual trata de establecer, además de la amplitud que tendrá en relación a entornos, individuos, áreas y departamentos de la organización involucrados.</p>
<h4>Entrevista</h4>
<p>Las entrevistas tratan de identificar junto a los usuarios y administradores de la organización las preocupaciones que ellos tienen con los activos, los procesos de negocio, áreas o tareas que ejecutan o en la cual participan. Las entrevistas tratan de identificar las necesidades de seguridad existentes en la organización.</p>
<h4>Investigación y Análisis de Documentos</h4>
<p>En esta etapa se identifican y analizan los documentos existentes en la organización y los que tienen alguna relación con el proceso de seguridad en lo referente a la reducción de riesgos, disminución de trabajo repetido y falta de orientación. Entre la documentación existente, se pueden considerar: libros de rutinas, metodologías, políticas de calidad y otras.</p>
<h4>Reuniones</h4>
<p>En las reuniones, realizadas con los equipos involucrados en la elaboración, se levantan y discuten los temas, además se redactan los párrafos para la composición de las normas con base en el levantamiento del objetivo y del ámbito del Manual específica.</p>
<h4>Glosario de el Manual de la Política de Seguridad</h4>
<p>Es importante aclarar cualquier duda conceptual que pueda surgir en el momento de la lectura de el Manual de la Política de Seguridad. Así todos los lectores deben tener el mismo punto de referencia conceptual de términos. Por lo tanto se recomienda que el Manual cuente con un glosario específico donde se especifiquen los términos y conceptos presentes en toda el Manual  de seguridad. </p>
<h4>Responsabilidades y Penalidades</h4>
<p>Es fundamental identificar a los responsables, por la gestión de seguridad de los activos normalizados, con el objetivo de establecer las relaciones de responsabilidad para el cumplimiento de tareas, como las normas de aplicación de sanciones resultantes de casos de inconformidad con el Manual elaborada. De esa manera, se busca el nivel de conciencia necesario para los involucrados, con relación a las penalidades que serán aplicadas en casos de infracción del Manual de la Política de Seguridad Informática.</p>
<p>Si existe ya un estándar de estructura de documentos para políticas dentro de la empresa, éste puede ser adoptado. Sin embargo, a continuación sugerimos un modelo de estructura de política que puede ser desarrollado dentro de su organización.</p>
<p>En este modelo, visualizamos que un Manual de la Política de Seguridad Informática esté formada por tres grandes secciones: las Directrices, las Normas los Procedimientos e Instrucciones de Trabajo.</p>
<p>Su estructura de sustentación está formada por tres grandes aspectos: Recursos, cultura y retroalimentación.</p>
<h5>Directrices Estratégicas</h5>
<p><strong>E</strong>n el contexto de la seguridad, corresponden a todos los valores que deben ser seguidos, para que el principal patrimonio de la empresa, que es la información, tenga el nivel de seguridad exigido. Como la información no está presente en un único entorno (microinformática, por ejemplo) o medio convencional (fax, papel, comunicación de voz, etc.), debe permitir que se aplique a cualquier ambiente existente y no contener términos técnicos de informática. Se compone de un texto, no técnico, con las reglas generales que guían a la elaboración de las normas de seguridad.</p>
<h5>Normas de Seguridad (Táctico)</h5>
<p>Conjunto de reglas generales y específicas de la seguridad de la información que deben ser usadas por todos los segmentos involucrados en los procesos de negocio de la institución, y que pueden ser elaboradas por activo, área, tecnología, proceso de negocio, Audiencia a que se destina, etc. Las normas, por estar en un nivel táctico, pueden ser específicas para el público a que se destina, por ejemplo para técnicos y para usuarios.</p>
<h6>Para Técnicos</h6>
<p>Reglas generales de seguridad de información dirigida para quien cuida de ambientes informatizados (administradores de red, técnicos etc.), basadas en los aspectos más genéricos como periodicidad para cambio de claves, copias de seguridad, acceso físico y otros. Pueden ser ampliamente utilizadas para la configuración y administración de ambientes diversos como Windows NT, Netware, Unix etc.</p>
<h6>Para Usuarios</h6>
<p>Reglas generales de seguridad de la información dirigidas para hacer uso de ambientes informatizados, basadas en aspectos más genéricos como cuidados con claves, cuidados con equipos, inclusión o exclusión de usuarios, y otros. Pueden ser ampliamente utilizadas para todos los usuarios en ambientes diversos, como Windows NT, Netware, Unix, etc.</p>
<h5>Procedimientos (Operacional)</h5>
<p>Conjunto de orientaciones para realizar las actividades operativas de seguridad, que representa las relaciones interpersonales e ínter-departamentales y sus respectivas etapas de trabajo para la implantación o manutención de la seguridad de la información.</p>
<h5>Instrucción de trabajo (Operacional)</h5>
<p>Conjunto de comandos operativos a ser ejecutados en el momento de la realización de un procedimiento de seguridad establecido por una norma, establecido en modelo de paso a paso para los usuarios del activo en cuestión. A continuación presentamos ejemplos de procedimientos e instrucciones de trabajo muy específicas que resultan de beneficio en la operación diaria.</p>
<h3>Hacer Oficial el Manual de la Política de Seguridad</h3>
<p>La oficialización de una política tiene como base la aprobación por parte de la cúpula de la organización. Debe ser publicada y comunicada de manera   adecuada para todos los empleados, socios, terceros y clientes.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Mostrar progresos con BackgroundWorker ]]></title>
<link>http://acollado.wordpress.com/?p=28</link>
<pubDate>Sun, 11 May 2008 20:46:52 +0000</pubDate>
<dc:creator>acollado</dc:creator>
<guid>http://acollado.ro.wordpress.com/2008/05/11/mostrar-progresos-con-backgroundworker/</guid>
<description><![CDATA[Cuando necesitamos realizar tareas de manera asíncrona El .Net Framework nos proporciona varias opc]]></description>
<content:encoded><![CDATA[<div class="Section1">Cuando necesitamos realizar tareas de manera asíncrona El .Net Framework nos proporciona varias opciones;<br />
-Mediante la clase  <strong><span style="font-size:10pt;line-height:115%;">Thread</span></strong><span style="font-size:10pt;line-height:115%;">.<br />
</span>-Mediante <a href="http://acollado.wordpress.com/2008/05/10/delegados-genericos/">delegados</a> asíncronos.<br />
-Mediante el componente BackgroundWorker.<br />
Se me ocurren diversas situaciones en la que cada uno puede ser más apropiado. Pero, si lo que queremos es mostrar el progreso de la tarea, la mejor opción es el componente BackgroundWorker. El componente BackgroundWorker tiene varias características que le hacen interesante; como puede ser la notificación del progreso  y notificación de cancelación.<br />
El ejemplo de código siguiente es un modo sencillo de dar soporte para cancelación y notificación del progreso de una tarea asíncrona.</p>
<table class="MsoTableColorfulGridAccent3" style="border-collapse:collapse;height:18px;" border="0" cellspacing="0" cellpadding="0" width="682">
<tbody>
<tr>
<td style="background:#d6e3bc none repeat scroll 0 50%;width:432.2pt;padding:0 5.4pt;" width="660" valign="top"><span style="color:#339966;">Nota:<br />
Este componente solo está disponible   desde la versión 2.0 del Framework.</span></td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p>Lo primero es arrastrar el componente a nuestra aplicación</p>
<p><img src="http://acollado.wordpress.com/files/2008/05/backgroundworker.jpg" alt="" /></p>
<p>Una vez que los hemos situado en el área de trabajo configuramos las siguientes propiedades:</p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">WorkerReportsProgress = <span style="color:blue;">true<br />
</span>WorkerSupportsCancellation=<span style="color:blue;">true </span></span>(solo en caso de querer dar soporte para cancelación)</p>
<p>Ahora definimos los eventos de cancelación, notificación y trabajo.</p>
<p>DoWork: Este evento es disparado al comienzo de la operación asíncrona y sera donde realicemos las tareas.</p>
<p>ProgressChanged: Este evento será disparado el notificar un progreso al componente.</p>
<p>RunWorkerCompleted: Este evento será disparado al terminar la operación asíncrona.</p>
<table class="MsoTableColorfulGridAccent3" style="border-collapse:collapse;margin-left:5.1pt;margin-right:5.1pt;" border="0" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td style="background:#d6e3bc none repeat scroll 0 50%;width:432.2pt;padding:0 5.4pt;" width="660" valign="top"><span style="color:#339966;">Nota:<br />
Si desea acceder a un control desde la operación que este realizando el componente BackgroundWorker. Por ejemplo,   mostrar el estado de progreso en un control Label, es más que aconsejable   hacerlo desde el evento ProgressChanged, ya que la aplicación podria   comportarse de forma inesperada.</span></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p>Ya podemos escribir el código que sera lanzado con cada evento.</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong>C#</strong><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_DoWork(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">DoWorkEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = 1; i &#60;= 100; i++)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Realiza una tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> System.Threading.<span style="color:#2b91af;">Thread</span>.Sleep(100); </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.ReportProgress(i);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">if</span><span style="font-size:10pt;"> (bwProgress.CancellationPending)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">return</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> }</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_ProgressChanged(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">ProgressChangedEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Notificar el progreso de la tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">progressBar1.Value = e.ProgressPercentage;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> lblInfo.Text = e.ProgressPercentage + <span style="color:#a31515;">"%"</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span><span style="font-size:10pt;line-height:115%;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_RunWorkerCompleted(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">RunWorkerCompletedEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Realizamos las operaciones que haya que realizar al terminar el progreso</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">lblInfo.Text = <span style="color:#a31515;">"Tarea terminada"</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> progressBar1.Value = 0;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> btnIniciar_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Iniciamos el trabajo</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">if</span> (!bwProgress.IsBusy)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.RunWorkerAsync();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> btnCancelar_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Solicitamos la cancelación de la operación</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">bwProgress.CancelAsync();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">VB</span></strong><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_DoWork(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.DoWorkEventArgs) <span style="color:blue;">Handles</span> bwProgress.DoWork</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">For</span> i <span style="color:blue;">As</span> <span style="color:blue;">Integer</span> = 1 <span style="color:blue;">To</span> 100</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">''Realiza una tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> System.Threading.Thread.Sleep(100)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.ReportProgress(i)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">If</span> (bwProgress.CancellationPending) <span style="color:blue;">Then</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">Return</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">If</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">Next</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_ProgressChanged(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.ProgressChangedEventArgs) <span style="color:blue;">Handles</span> bwProgress.ProgressChanged</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">'Notificar el progreso de la tarea</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">progressBar1.Value = e.ProgressPercentage</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> lblInfo.Text = e.ProgressPercentage + <span style="color:#a31515;">"%"</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_RunWorkerCompleted(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.RunWorkerCompletedEventArgs) <span style="color:blue;">Handles</span> bwProgress.RunWorkerCompleted</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">''Realizamos las operaciones que haya que realizar al terminar el progreso</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">lblInfo.Text = <span style="color:#a31515;">"Tarea terminada"</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">False</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">True</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> progressBar1.Value = 0</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> btnIniciar_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.EventArgs) <span style="color:blue;">Handles</span> btnIniciar.Click</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">''Iniciamos el trabajo</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">If</span> (<span style="color:blue;">Not</span> bwProgress.IsBusy) <span style="color:blue;">Then</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.RunWorkerAsync()</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">True</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">False</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">If</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> btnCancelar_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.EventArgs) <span style="color:blue;">Handles</span> btnCancelar.Click</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">'Solicitamos la cancelación de la operación</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.CancelAsync()</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal">
<p><img src="http://acollado.wordpress.com/files/2008/05/backgroundworkerprogress.jpg" alt="" /></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p>Como hemos podido ver, el código es sencillo. Con unas pocas lineas podremos dar soporte estable a nuestras operaciones asíncronas.</p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Timer C#]]></title>
<link>http://patrickespake.wordpress.com/?p=41</link>
<pubDate>Wed, 30 Apr 2008 04:19:54 +0000</pubDate>
<dc:creator>patrickespake</dc:creator>
<guid>http://patrickespake.ro.wordpress.com/2008/04/30/timer-c/</guid>
<description><![CDATA[Hoje vou mostrar como trabalhar com o componente Timer no C#.
O objetivo desse exemplo é gerar Text]]></description>
<content:encoded><![CDATA[<p>Hoje vou mostrar como trabalhar com o componente Timer no C#.</p>
<p>O objetivo desse exemplo é gerar TextBox dinamicamente a cada X segundos. Para isso é usando o componente Timer.</p>
<p>Construa um form como o seguinte:</p>
<p style="text-align:center;"><a href="http://patrickespake.wordpress.com/files/2008/04/form_timer.jpg"><img class="size-medium wp-image-42" src="http://patrickespake.wordpress.com/files/2008/04/form_timer.jpg?w=300" alt="" width="300" height="224" /></a></p>
<p>Você deve construir um form com os componetes exibidos na imagem acima (clique para ampliar a imagem). Os componentes usados nesse form são GroupBox, Label, NumericUpDown e Button. Os nomes em vermelho são a propriedade name que deve ser definida para cada componente.</p>
<p>Quando você clica em cima do componente Timer, ele não aparece dentro do form, fica na parte inferior. Esse tipo de componente não é visível.</p>
<p>A ideia desse form é você informar quantos TextBox deve ser criado e a quantos segundos. Quando você clicar no botão Iniciar começa a criação das TextBox dinamicamente. Quando você clica no botão Parar o Timer será parado e não será mais gerado TextBox. As TextBoxs são criadas dentro do elemento groupBoxTextBox, desta forma implementei o botão limpar para zerar o conteúdo do groupBoxTextBox.</p>
<p>Vamos criar o código para tudo funcionar e depois vemos como a sintaxe funciona.</p>
<p>Dê dois clique no botão Iniciar e digite o seguinte código:</p>
<p>[sourcecode language='csharp']</p>
<p>        private void buttonIniciar_Click(object sender, EventArgs e)<br />
        {<br />
            int segundos = System.Convert.ToInt16(numericUpDownSegundos.Value);<br />
            timerTextBox.Stop();<br />
            timerTextBox.Interval = (int)segundos * 1000;<br />
            timerTextBox.Tick += new EventHandler(timerEvent);<br />
            timerTextBox.Start();<br />
        }</p>
<p>[/sourcecode]</p>
<p>Agora dê dois cliques em cima do botão Parar e digite o código abaixo:</p>
<p>[sourcecode language='csharp']</p>
<p>        private void buttonParar_Click(object sender, EventArgs e)<br />
        {<br />
            timerTextBox.Stop();<br />
        }</p>
<p>[/sourcecode]</p>
<p>Dê dois clique no botão limpar e adicione o código abaixo:</p>
<p>[sourcecode language='csharp']</p>
<p>        private void buttonLimpar_Click(object sender, EventArgs e)<br />
        {<br />
            groupBoxTextBox.Controls.Clear();<br />
        }</p>
<p>[/sourcecode]</p>
<p>Crie um novo método chamado timerEvent logo abaixo do método buttonLimpar_Click, o método timerEvent deve ficar da seguinte forma:</p>
<p>[sourcecode language='csharp']</p>
<p>        private void timerEvent(Object sender, EventArgs e)<br />
        {<br />
            int criar = System.Convert.ToInt16(numericUpDownTextBox.Value);<br />
            for (int i = 0; i < criar; i++)<br />
            {<br />
                TextBox minhaTextBox = new TextBox();<br />
                minhaTextBox.Height = 20;<br />
                minhaTextBox.Width = 250;<br />
                minhaTextBox.Location = new Point(10, 15 + (minhaTextBox.Height * groupBoxTextBox.Controls.Count));<br />
                minhaTextBox.Text = "TextBox #" + groupBoxTextBox.Controls.Count;<br />
                groupBoxTextBox.Controls.Add(minhaTextBox);<br />
            }<br />
        }</p>
<p>[/sourcecode]</p>
<p>Pronto! Agora só pressionar F5 e ver a aplicação funcionado.</p>
<p>Vamos enteder como tudo funciona.</p>
<p>No botão Iniciar temos os seguintes códigos:</p>
<p>[sourcecode language='csharp']</p>
<p>            int segundos = System.Convert.ToInt16(numericUpDownSegundos.Value);<br />
            timerTextBox.Stop();<br />
            timerTextBox.Interval = (int)segundos * 1000;<br />
            timerTextBox.Tick += new EventHandler(timerEvent);<br />
            timerTextBox.Start();</p>
<p>[/sourcecode]</p>
<p>Na ordem, o método System.ConvertToInt16 converte o valor do campo número de segundos para inteiro. Depois executamos timerTextBox.Stop() isso faz que o timerTextBox sempre pare, com o objetivo de parar uma execução atual do Timer. O método Interval define que o Timer deve executar suas funções em tempos em tempos, esse valor é dado em milesegundos. O método Tick chamada uma função a cada intervalo definido, nesse exemplo é chamado o método timerEvent e por fim timerTextBox.Start() coloca o timer para funcionar.</p>
<p>O código do método timerEvent:</p>
<p>[sourcecode language='csharp']</p>
<p>            int criar = System.Convert.ToInt16(numericUpDownTextBox.Value);<br />
            for (int i = 0; i < criar; i++)<br />
            {<br />
                TextBox minhaTextBox = new TextBox();<br />
                minhaTextBox.Height = 20;<br />
                minhaTextBox.Width = 250;<br />
                minhaTextBox.Location = new Point(10, 15 + (minhaTextBox.Height * groupBoxTextBox.Controls.Count));<br />
                minhaTextBox.Text = "TextBox #" + groupBoxTextBox.Controls.Count;<br />
                groupBoxTextBox.Controls.Add(minhaTextBox);<br />
            }</p>
<p>[/sourcecode]</p>
<p>Esse cara obtém quantos elementos deve ser criados no intervalo de segundos definido, nessa parte criamos um TextBox dinamico e colocamos esse elemento dentro do groupBoxTextBox execuntado a sintaxe:</p>
<p>[sourcecode language='csharp']</p>
<p>groupBoxTextBox.Controls.Add(minhaTextBox);</p>
<p>[/sourcecode]</p>
<p>Nesse método é usado:</p>
<p>[sourcecode language='csharp']</p>
<p>groupBoxTextBox.Controls.Count</p>
<p>[/sourcecode]</p>
<p>Essa sintaxe retorna apenas a quantidade de elementos que existe atualmente dentro do groupBoxTextBox, é usado para definir a possíção de exibição das TextBoxs criadas.</p>
<p>Entendendo o código dos botões Parar e Limpar:</p>
<p>[sourcecode language='csharp']</p>
<p>        private void buttonParar_Click(object sender, EventArgs e)<br />
        {<br />
            timerTextBox.Stop();<br />
        }</p>
<p>        private void buttonLimpar_Click(object sender, EventArgs e)<br />
        {<br />
            groupBoxTextBox.Controls.Clear();<br />
        }</p>
<p>[/sourcecode]</p>
<p>A sintaxe timerTextBox.Stop(); para o Timer, assim o Timer não executa mais. A sintaxe groupBoxTextBox.Controls.Clear(); remove tudo que existe dentro do groupBoxTextBox.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cat ai da pentru o carcasa modificata.....]]></title>
<link>http://calculici.wordpress.com/?p=24</link>
<pubDate>Mon, 21 Apr 2008 11:47:33 +0000</pubDate>
<dc:creator>calculici</dc:creator>
<guid>http://calculici.ro.wordpress.com/2008/04/21/cat-ai-da-pentru-o-carcasa-modificata/</guid>
<description><![CDATA[Ma bate gandul de foarte mult timp sa ma apuc de Case Modding. Credeti ca ar merge, cat ati plati pe]]></description>
<content:encoded><![CDATA[<p>Ma bate gandul de foarte mult timp sa ma apuc de Case Modding. Credeti ca ar merge, cat ati plati pentru un asfel de lucru....100RON, 200RON etc..... Astept niste reactii pe mail sau pe blog.</p>
<p>..::Calculici::..</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Limba]]></title>
<link>http://copiez.wordpress.com/?p=6</link>
<pubDate>Sun, 13 Apr 2008 09:25:45 +0000</pubDate>
<dc:creator>Albişi Cornel</dc:creator>
<guid>http://copiez.ro.wordpress.com/2008/04/13/limba/</guid>
<description><![CDATA[Simtul gustului este un simt chimic. Chemoreceptorii din mucoasa limbii, dar si a restului cavitatii]]></description>
<content:encoded><![CDATA[<p>Simtul gustului este un simt chimic. Chemoreceptorii din mucoasa limbii, dar si a restului cavitatii bucale si chiar faringelui, se numesc muguri gustativi. Ei contin celule chemosensibile in forma de fus asociate cu celule de sustinere. La polul apical ele au un cil sensibil la substante dizolvate in saliva. La polul bazal, ele sunt inconjurate de dendritele unor neuroni. Impulsurile nervoase ajung la creier. Cei mai multi muguri gustativi sunt plasati pe niste denivelari ale mucoasei limbii, numite papile gustative. Gustul permite alegerea hranei, evitarea unor subst. daunatoare din hrana, si declansarea unor refrexe digestive.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Criação de componentes Facelets]]></title>
<link>http://ericogr.wordpress.com/?p=3</link>
<pubDate>Wed, 09 Apr 2008 15:49:56 +0000</pubDate>
<dc:creator>ericogr</dc:creator>
<guid>http://ericogr.ro.wordpress.com/2008/04/09/criacao-de-componentes-facelets-receita-do-bolo/</guid>
<description><![CDATA[Este artigo tem como objetivo demonstrar como criar um simples componente facelets que “renderiza]]></description>
<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;">Este artigo tem como objetivo demonstrar como criar um simples componente facelets que “renderiza” uma tag <em>label </em>utilizando recursos deste maravilhoso framework. Depois você poderá criar componentes muito mais complexos. Tentei simplificar ao máximo, criando até um mapa de relacionamento entre os arquivos de configuração e o código Java. Pressuponho que o leitor já tenha conhecimento mínimo sobre java, jsf e facelets. Para mais informações, consulte as referências no final deste documento.</p>
<p class="MsoNormal" style="text-align:justify;"><strong>Versão PDF:</strong> <a href="http://ericogr.wordpress.com/files/2008/04/tutorialparacriarcomponentejsffaceletsv3.pdf">Criação de componentes JSF Facelets</a></p>
<p class="MsoNormal">Como exemplo, vamos criar um componente chamado FirstJsfTest que renderiza um simples <em>label</em> .<br />
Exemplo:</p>
<p class="MsoNormal"><span style="font-size:9pt;line-height:115%;"><em>&#60;label&#62;</em>Teste 123<em>&#60;/label&#62;</em></span></p>
<p class="MsoNormal"><strong>Premissas</strong></p>
<ol>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->JDK 1.5 ou superior</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Biblioteca JSF 1.2 (aqui utilizamos JSF1.2_04)</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Seu projeto já deve estar configurado para utilizar a combinação de JSF + Facelets</li>
</ol>
<p class="MsoNormal"><strong>Criação do componente</strong></p>
<ol>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Criar uma classe que estenda UIComponent</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Programar métodos para salvar e restaurar o estado do componente</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Criar método que retorne a família do componente</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Criar uma classe que estenda UIComponentELTag</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Configurar as propriedades que o componente JSF utilizará</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Programar métodos para retornar o tipo de componente e renderizador utilizado</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Programar um renderizador</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Criar um arquivo .tld (Descritor de biblioteca de tags)</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Registre o componente no faces-config.xml</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Criar um arquivo de configuração de biblioteca facelets e registrá-lo</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Usando o componente</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Relacionamento entre código java e os descritivos XML</li>
<li><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span> </span></span></span><!--[endif]-->Referências</li>
</ol>
<p class="MsoSubtitle"><strong>1.<span> </span>Crie uma classe que estenda UIComponent</strong></p>
<p class="MsoNormal" style="text-align:justify;">Para começar, vamos criar a classe UIFirstJsfComponent que estende a classe UIOutput (que é subclasse de UIComponent) e criaremos também os atributos do componente.</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">[UIFirstJsfComponent.java]</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">package</span></strong><span style="font-size:10pt;"> net.sf.quizOnline.tags;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.component.UIOutput;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.context.FacesContext;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">class</span></strong><span style="font-size:10pt;"> UIFirstJsfComponent </span><strong><span style="font-size:10pt;">extends</span></strong><span style="font-size:10pt;"> UIOutput {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">private</span></strong><span style="font-size:10pt;"> String </span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> UIFirstJsfComponent() {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> String getName() {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> </span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">void</span></strong><span style="font-size:10pt;"> setName(String name) {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;"> = name;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoSubtitle">
<p class="MsoSubtitle"><strong>2. Programar métodos para salvar e restaurar o estado do componente</strong></p>
<p class="MsoNormal">Abaixo está o trecho de código que fica responsável por salvar e restaurar o estado do componente. <span> </span>Salvamos e restauramos os atributo do nosso componente através dos métodos saveState e restoreState da classe UIOutput.</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[UIFirstJsfComponent.java]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">@Override</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> Object   saveState(FacesContext facesContext) {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>Object[] values = </span><strong><span style="font-size:10pt;">new</span></strong><span style="font-size:10pt;"> Object[2];</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>values[0] = </span><strong><span style="font-size:10pt;">super</span></strong><span style="font-size:10pt;">.saveState(facesContext);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>values[1] =   getName();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> (Object)values;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">@Override</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">void</span></strong><span style="font-size:10pt;"> restoreState(FacesContext facesContext,</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>Object state)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>Object[] values =   (Object[])state;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">super</span></strong><span style="font-size:10pt;">.restoreState(facesContext,   values[0]);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>setName((String)values[1]);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>3. Retornar a família do componente</strong></p>
<p class="MsoNormal" style="text-align:justify;">Precisamos do método getFamily() para retornar a família do componente. O retorno deste método será usado posteriormente para registrar o renderizador no arquivo de configuração do Jsf. Podemos retornar <em>COMPONENT_FAMILY</em> que é uma constante com o valor <em>javax.faces.Output</em>.</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[UIFirstJsfComponent.java]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> String getFamily() {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> </span><em><span style="font-size:10pt;">COMPONENT_FAMILY</span></em><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span> </span></p>
<p class="MsoSubtitle"><strong>4. Criar uma classe que estenda UIComponentELTag</strong></p>
<p class="MsoNormal" style="text-align:justify;">Nos passos anteriores, o componente foi criado. Agora precisamos definir a tag (marcação que ficará na página que estamos criando) que fará uma ponte entre o Jsp e o Jsf. No trecho de código abaixo, está também a propriedade <em>name</em> que será utilizada em nossa tag para passar valor ao componente com propriedade de mesmo nome. Depois mapearemos a tag através do arquivo de configuração de extensão .tld (tag library descriptor).</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">[FirstJsfTag.java]</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">package</span></strong><span style="font-size:10pt;"> net.sf.quizOnline.tags;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.webapp.UIComponentELTag;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.component.UIComponent;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">class</span></strong><span style="font-size:10pt;"> FirstJsfTag </span><strong><span style="font-size:10pt;">extends</span></strong><span style="font-size:10pt;"> UIComponentELTag {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">private</span></strong><span style="font-size:10pt;"> String </span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> FirstJsfTag() {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> String getName() {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> </span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">void</span></strong><span style="font-size:10pt;"> setName(String name) {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">this</span></strong><span style="font-size:10pt;">.</span><span style="font-size:10pt;">m_Name</span><span style="font-size:10pt;"> = name;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>5. Configurar as propriedades que o componente JSF utilizará</strong></p>
<p class="MsoNormal" style="text-align:justify;">Vamos armazenar o valor configurado para a tag no componente que criamos como mostra o código abaixo:</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[FirstJsfTag.java]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">@Override</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">protected</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">void</span></strong><span style="font-size:10pt;"> setProperties(UIComponent component) {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">super</span></strong><span style="font-size:10pt;">.setProperties(component);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>((UIFirstJsfComponent)component).setName(getName());</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-top:6pt;">Como podemos ver, component é uma instância da classe <span style="font-size:10pt;line-height:115%;color:black;">UIFirstJsfComponent </span>onde configuramos seus atributos pelos atributos da tag FirstJsfTag.</p>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>6. Programar métodos para retornar o tipo de componente e renderizador utilizado</strong></p>
<p class="MsoNormal">O retorno deste método será utilizado nos arquivos de configuração do Jsf e Facelets.</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[FirstJsfTag.java]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> String getComponentType()   {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> </span><span style="font-size:10pt;">"net.sf.quizOnline.HtmlFirstJsfTag"</span><span style="font-size:10pt;">;<span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> String getRendererType()   {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">return</span></strong><span style="font-size:10pt;"> </span><span style="font-size:10pt;">"net.sf.quizOnline.FirstJsfTag"</span><span style="font-size:10pt;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">...</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>7. Programar um renderizador</strong></p>
<p class="MsoNormal" style="text-align:justify;">O renderizador escreverá a saída, que no nosso caso será codificação em HTML. Esta classe estende Renderer e provê uma série de métodos interessantes que podem ser explorados pelo programador, mas este não será o foco.</p>
<p class="MsoNormal" style="text-align:justify;">Este renderizador apenas escreve na página um label com o valor definido na propriedade name. A saída é esta: <span>&#60;label&#62;valor qualquer&#60;/label&#62;</span></p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">[FirstJsfRenderer.java]</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">package</span></strong><span style="font-size:10pt;"> net.sf.quizOnline.tags;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> java.io.IOException;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.component.UIComponent;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.context.FacesContext;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.context.ResponseWriter;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">import</span></strong><span style="font-size:10pt;"> javax.faces.render.Renderer;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">class</span></strong><span style="font-size:10pt;"> FirstJsfRenderer </span><strong><span style="font-size:10pt;">extends</span></strong><span style="font-size:10pt;"> Renderer {</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">@Override</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><strong><span style="font-size:10pt;">public</span></strong><span style="font-size:10pt;"> </span><strong><span style="font-size:10pt;">void</span></strong><span style="font-size:10pt;"> encodeBegin(FacesContext context,</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">UIComponent component)</span><strong><span style="font-size:10pt;">throws</span></strong><span style="font-size:10pt;"> IOException </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>UIFirstJsfComponent   firstJsfComponent =</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>(UIFirstJsfComponent)   component;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>ResponseWriter writer   = context.getResponseWriter();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>writer.startElement(</span><span style="font-size:10pt;">"label"</span><span style="font-size:10pt;">, component);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>writer.write(firstJsfComponent.getName());</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>writer.endElement(</span><span style="font-size:10pt;">"label"</span><span style="font-size:10pt;">);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>writer.flush();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">}</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>8. Criar um arquivo .tld</strong></p>
<p class="MsoNormal" style="text-align:justify;">Depois de ter criado o componente, temos que criar seu descritor, o arquivo tld (Tag Library Descriptor) chamado firstJsfTag.tld (para este exemplo). Normalmente este arquivo fica na pasta da sua aplicação web em <span>/WEB-INF/taglib.</span><span> </span></p>
<p class="MsoNormal"><span>Exemplo: </span><span>/WEB-INF/taglib/firstJsfTag.tld</span></p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[firstJsfTag.tld]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;?</span><span style="font-size:10pt;">xml </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"1.0" </span><span style="font-size:10pt;">encoding</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"ISO-8859-1" </span><span style="font-size:10pt;">?&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;!</span><span style="font-size:10pt;">DOCTYPE </span><span style="font-size:10pt;">taglib </span><span style="font-size:10pt;">PUBLIC </span><span style="font-size:10pt;">"-//Sun Microsystems, Inc.//DTD JSP Tag Library   1.2//EN" </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd"</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">taglib</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">tlib-version</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">1.0</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">tlib-version</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">jsp-version</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">2.0</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">jsp-version</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">short-name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">firstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">short-name</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">uri</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">http://net.sf.quizOnline/component/test/tags</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">uri</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">description</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">Teste de taglibs jsf</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">description</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">tag</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">firstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">tag-class</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">net.sf.quizOnline.tags.FirstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">tag-class</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">attribute</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">required</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">true</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">required</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">attribute</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">tag</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">taglib</span><span style="font-size:10pt;">&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>9. Registre o componente no faces-config.xml</strong></p>
<p class="MsoNormal" style="text-align:justify;">É necessário registrar o componente no arquivo de configuração do Jsf faces-config.xml. Normalmente este arquivo fica na pasta da sua aplicação web em <span>/WEB-INF.</span><span> Exemplo: </span><span>/WEB-INF/faces-config.xml</span></p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[faces-config.xml]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;?</span><span style="font-size:10pt;">xml </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"1.0" </span><span style="font-size:10pt;">encoding</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"UTF-8"</span><span style="font-size:10pt;">?&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">faces-config </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"1.2" </span><span style="font-size:10pt;">xmlns</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/xml/ns/javaee"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:xsi</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://www.w3.org/2001/XMLSchema-instance"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xsi:schemaLocation</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;!--   Custom Tags --&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;!-- Componente de UI do JSF para   teste --&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component-type</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">net.sf.quizOnline.HtmlFirstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component-class</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>net.sf.quizOnline.tags.UIFirstJsfComponent</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component-class</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">render-kit</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">renderer</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component-family</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">javax.faces.Output</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component-family</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">renderer-type</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">net.sf.quizOnline.FirstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">renderer-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">renderer-class</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>net.sf.quizOnline.tags.FirstJsfRenderer</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">renderer-class</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">renderer</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">render-kit</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>&#60;!-- IMPORTANTE: foram ocultas outras   configuração não relevantes! --&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">faces-config</span><span style="font-size:10pt;">&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>10. Criar um arquivo de configuração de biblioteca facelets e registrá-lo</strong></p>
<p class="MsoNormal" style="text-align:justify;">Agora precisamos configurar o facelets para utilizar o componente Jsf criado. Para criar essa ponte entre os dois, declaramos em um arquivo de configuração o nome do componente, seu tipo e o tipo do renderizador. Normalmente este arquivo fica na pasta da sua aplicação web em <span>/WEB-INF/taglib.</span><span> Exemplo: </span><span>/WEB-INF/taglib/firstJsfTag.taglib.xml</span></p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[firstJsfTag.taglib.xml]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;?</span><span style="font-size:10pt;">xml </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"1.0" </span><span style="font-size:10pt;">encoding</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"UTF-8"</span><span style="font-size:10pt;">?&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;!</span><span style="font-size:10pt;">DOCTYPE </span><span style="font-size:10pt;">facelet-taglib </span><span style="font-size:10pt;">PUBLIC </span><span style="font-size:10pt;">"-//Sun Microsystems, Inc.//DTD Facelet Taglib   1.0//EN" </span><span style="font-size:10pt;">"facelet-taglib_1_0.dtd" </span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">facelet-taglib</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">namespace</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">http://quizOnline.sf.net/firstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">namespace</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">tag</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">tag-name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">firstJsfTag</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">tag-name</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">component-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>net.sf.quizOnline.HtmlFirstJsfTag</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">renderer-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span>net.sf.quizOnline.FirstJsfTag</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">renderer-type</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">component</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">tag</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">facelet-taglib</span><span style="font-size:10pt;">&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-align:justify;">Note que os tipos declarados neste arquivo são os mesmos retornados pelos métodos presentes na classe que estende UIComponentELTag (getComponentType() e getRendererType()).</p>
<p class="MsoNormal" style="text-align:justify;">É preciso também registrar este arquivo como uma biblioteca nos parâmetros de contexto do facelets. Caso exista mais de uma biblioteca, podemos separá-las com “;” ponto e virgula. Normalmente este arquivo fica na pasta da sua aplicação web em <span>/WEB-INF.</span><span> Exemplo: </span><span>/WEB-INF/web.xml</span></p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:498.15pt;padding:0 5.4pt;" width="664" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[web.xml]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;?</span><span style="font-size:10pt;">xml </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"1.0" </span><span style="font-size:10pt;">encoding</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"UTF-8"</span><span style="font-size:10pt;">?&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">web-app </span><span style="font-size:10pt;">version</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"2.4" </span><span style="font-size:10pt;">xmlns</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/xml/ns/j2ee" </span><span style="font-size:10pt;">xmlns:xsi</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://www.w3.org/2001/XMLSchema-instance" </span><span style="font-size:10pt;">xsi:schemaLocation</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">context-param</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">param-name</span><span style="font-size:10pt;">&#62;</span><span style="font-size:10pt;">facelets.LIBRARIES</span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">param-name</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">param-value</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">/WEB-INF/taglib/firstJsfTag.taglib.xml</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">param-value</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">context-param</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">...</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">web-app</span><span style="font-size:10pt;">&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoSubtitle"><strong>11. Usando o componente</strong></p>
<p class="MsoNormal">Agora podemos usar o componente nas páginas xhtml. Abaixo segue o exemplo de uma página usando o componente.</p>
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid #548dd4;background:#dbe5f1 none repeat scroll 0;width:478.8pt;padding:0 5.4pt;" width="638" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span>[teste.xhtml]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;?<span style="color:#3f7f7f;">xml </span><span style="color:#7f007f;">version</span><span style="color:black;">=</span><span style="color:#2a00ff;">'1.0' </span><span style="color:#7f007f;">encoding</span><span style="color:black;">=</span><span style="color:#2a00ff;">'ISO-8859-1' </span><span style="color:teal;">?&#62;</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;!</span><span style="font-size:10pt;">DOCTYPE </span><span style="font-size:10pt;">html </span><span style="font-size:10pt;">PUBLIC </span><span style="font-size:10pt;">"-//W3C//DTD XHTML 1.0 Transitional//EN" </span><span style="font-size:10pt;">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">html </span><span style="font-size:10pt;">xmlns</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://www.w3.org/1999/xhtml"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:ui</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/jsf/facelets"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:h</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/jsf/html"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:f</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/jsf/core"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:c</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://java.sun.com/jstl/core"</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">xmlns:fjt</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"http://quizOnline.sf.net/firstJsfTag"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">ui:composition </span><span style="font-size:10pt;">template</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"/pages/public/template/default.xhtml"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">ui:define </span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"pageTitle"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">h:outputText </span><span style="font-size:10pt;">value</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"Pagina   de teste 3" </span><span style="font-size:10pt;">/&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">ui:define</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">ui:define </span><span style="font-size:10pt;">name</span><span style="font-size:10pt;">=</span><span style="font-size:10pt;">"corpo"</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;</span><span style="font-size:10pt;">f:view</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="background:yellow none repeat scroll 0;font-size:10pt;">&#60;</span><span style="background:yellow none repeat scroll 0;font-size:10pt;">fjt:firstJsfTag </span><span style="background:yellow none repeat scroll 0;font-size:10pt;">name</span><span style="background:yellow none repeat scroll 0;font-size:10pt;">=</span><span style="background:yellow none repeat scroll 0;font-size:10pt;">"teste123"</span><span style="background:yellow none repeat scroll 0;font-size:10pt;">/&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">f:view</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">ui:define</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;"><span> </span></span><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">ui:composition</span><span style="font-size:10pt;">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;">&#60;/</span><span style="font-size:10pt;">html</span><span style="font-size:10pt;">&#62;</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoSubtitle"><span> </span></p>
<p class="MsoSubtitle"><strong>12. Relacionamento entre código Java e os descritivos XML</strong></p>
<p class="MsoNormal">Abaixo temos uma figura que exibe trechos de código e de arquivos XML e como eles se relacionam para a composição do componente desenvolvido. Podemos acompanhar se esquecemos de criar algum arquivo ou configuração.</p>
<p class="MsoNormal" style="text-align:center;" align="center"><span><!--[if gte vml 1]&#38;gt;                     &#38;lt;![endif]--><!--[if !vml]--><!--[endif]--></span><em></em></p>
<p class="MsoNormal" style="text-align:center;" align="center"><a href="http://ericogr.files.wordpress.com/2008/04/relacionamentoarquivoscompfaceletsv2.gif"><img class="aligncenter size-medium wp-image-11" src="http://ericogr.wordpress.com/files/2008/04/relacionamentoarquivoscompfaceletsv2.gif?w=400" alt="Arquivos, configuração xml e código java" width="400" height="303" /></a></p>
<p class="MsoNormal" style="text-align:center;" align="center"><em><span style="font-size:9pt;line-height:115%;">Mapa de referência de arquivos de configuração</span></em></p>
<p class="MsoNormal" style="text-align:justify;">Note que a maioria dos arquivos não estão completos, deixei somente a parte interessante para visualizarmos o relacionamento entre eles. Por exemplo, o arquivo FirstJsfTag.java não tem a definição de pacotes, as importações, a declaração de classes, etc.</p>
<p class="MsoSubtitle"><strong>13. Referências</strong></p>
<p class="MsoNormal">Abaixo estão alguns sites que serviram de referência para montar este documento.</p>
<table class="MsoNormalTable" style="border-collapse:collapse;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:117.9pt;padding:0 5.4pt;" width="157" valign="top">
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">Jdk</p>
<