tag:blogger.com,1999:blog-32001024446698457052024-03-20T09:22:51.711+01:00Developer TroubleAnonymoushttp://www.blogger.com/profile/03527016818112486768noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3200102444669845705.post-67975436244629634222012-02-11T18:02:00.000+01:002012-02-12T01:58:43.484+01:00Generar Imágenes Compuestas con SWT<div style="text-align: justify;">
Siempre había pensado que <b>combinar una imagen</b> a partir de otras dos era una tarea no demasiado complicada, sobretodo cuando la mayoría hemos pasado por <b>Java Swing</b>... no obstante, al ir a hacerlo con <b>SWT </b>me encontré sin la suficiente información como para hacerlo.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Es por ello que he decidido hacer esta entrada sencilla, simplemente para poner un ejemplo de cómo se componen las imágenes en <b>SWT</b>. Para llevarlo a cabo necesitaremos utilizar el <b>Graphics Context </b>de <b>SWT </b>(<b>GC</b>). Y seguiremos los siguientes pasos:</div>
<br />
<ol>
<li>Crearemos una imagen con un tamaño específico con:<blockquote class="tr_bq">
Image compoundImage = new Image(Display.getDefault(), 22,22);</blockquote>
</li>
<li>Utilizaremos el contexto gráfico de la propia imagen para dibujar las imágenes con su offset:</li>
</ol>
<blockquote class="tr_bq">
<blockquote class="tr_bq">
GC gc = new GC(compoundImage );<br />
gc.drawImage(image1, 0, 0);<br />
gc.drawImage(image2, 6, 6);</blockquote>
</blockquote>
Una vez hecho esto ya tendremos la imagen que queremos en <b>compoundImage</b>, que será una composición de las imágenes <b>image1 </b>y <b>image2</b>.<br />
<span style="font-size: large;"><br />Observaciones</span> <br />
<ol style="text-align: justify;">
<li>A partir del <b>gc </b>de la imagen podremos dibujar lo que queramos encima de la imagen, ya sea texto, lineas, figuras...</li>
<li>Una imagen creada, siempre la tendremos que liberar manualmente haciendo un <b>compoundImage.dispose()</b>, para no quedarnos sin <b>handlers </b>en el Sistema Operativo </li>
</ol>
<br />Anonymoushttp://www.blogger.com/profile/03527016818112486768noreply@blogger.com2tag:blogger.com,1999:blog-3200102444669845705.post-23482275469772190022012-02-09T01:51:00.000+01:002012-02-09T01:54:38.134+01:00Generar un producto RCP<div style="text-align: justify;">
Generar un <b>producto RCP</b> es un proceso muy sencillo y didáctico que puede llevarse a cabo a través de las herramientas que nos ofrece Eclipse.</div>
<br />
<span style="font-size: large;">¿Qué es un producto?</span> <br />
<div style="text-align: justify;">
Un producto RCP realmente es un <b>conjunto de plugins</b> agrupados de tal manera que forman una aplicación final de usuario. Esto nos permite, a partir de una aplicación RCP modular, tener distintas versiones de nuestra aplicación según los plugins que lleven integrados.</div>
<div style="text-align: justify;">
<br />
Por otra parte, un producto va a ser la forma de <b>exportar nuestra aplicación</b> a un entorno ejecutable. Dicho de otra manera, a partir de este producto se generarán todos los archivos necesarios para poder ejecutar nuestra aplicación.</div>
<br />
<span style="font-size: large;">¿Cómo generar un producto?</span><br />
Para generar un producto seguiremos los siguientes pasos:<br />
<br />
1. Creación de un nuevo <b>Product Configuration</b><i>(*.product)</i> a partir de Eclipse<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit430bza3IMNfvsg8n_jj_Jhb5qxI9awjuIVCe6u_yIi0YIx_5uJjJE7NZOBBxTqAw0z683gE0sYP2kwkqxXBxSOKP6ZfXcnfV3SAtqSwhFimHj9s5OQPo_-3D6Phsfh5zvBN8pF3F-dsr/s1600/product.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit430bza3IMNfvsg8n_jj_Jhb5qxI9awjuIVCe6u_yIi0YIx_5uJjJE7NZOBBxTqAw0z683gE0sYP2kwkqxXBxSOKP6ZfXcnfV3SAtqSwhFimHj9s5OQPo_-3D6Phsfh5zvBN8pF3F-dsr/s320/product.png" width="320" /></a></div>
<br />
<br />
<div style="text-align: justify;">
2. Si ya teníamos un producto base, podremos generar el nuevo producto a partir de ese, sino crearemos un nuevo fichero de configuración.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDw67GkQlanrf1myKh1VcsqO-eg-MoBwmfEItQr3uUuk5DrnK06Dh0F0PE-qaT2Zq-fyKxOwW3adOzTq9u_NxbSvAzinCrMhtG2zVDiKB0IKfZBEsgTuA_VT6anWb1YQETN5ASBmq3ahPo/s1600/Pantallazo-New+Product+Configuration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDw67GkQlanrf1myKh1VcsqO-eg-MoBwmfEItQr3uUuk5DrnK06Dh0F0PE-qaT2Zq-fyKxOwW3adOzTq9u_NxbSvAzinCrMhtG2zVDiKB0IKfZBEsgTuA_VT6anWb1YQETN5ASBmq3ahPo/s320/Pantallazo-New+Product+Configuration.png" width="281" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibVMcbRSyJXfheeL7I1whf2wh1SdW1aeZy-rRR_Jm_mraZZYC4YF1hHJLKBuu_UL-47_ToFZOFkFnJUCJO9GU461gPkcfRi5McQuY7oV5tcLRVNQIKHTilj1OxrTt2X82eZqpCAlB9uzUi/s1600/Pantallazo-New+Product+Configuration+.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div style="text-align: justify;">
3. Le dotamos de sus atributos principales (<i>id, nombre y versión</i>) en la pestaña <b>Overview</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
4. Le asignamos todos los plugins que hayamos creado para nuestra aplicación en la pestaña <b>Dependencies</b> a través del botón <i>Add...</i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Una vez añadidas las dependencias principales, agregaremos todos los plugins requeridos por éstas a través del botón de<i> Add Required Plugins.</i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvHOGQeM8VlVOYsr-Uo7c3LTTVlPEtyllHD7pPmlOjpodQTNzNuWG8hNyHRRAbQbpSYWuqLr9wp8Txv6L8ZS0HojNX9_Twb3dmFUn-rs2XbgnjQ2XGg2iYgtX3sW1ZoFli22Tv8rfc1kQ/s1600/Pantallazo-Plug-in+Development+-+es.company.app-NewProduct.product+-+Eclipse+.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvHOGQeM8VlVOYsr-Uo7c3LTTVlPEtyllHD7pPmlOjpodQTNzNuWG8hNyHRRAbQbpSYWuqLr9wp8Txv6L8ZS0HojNX9_Twb3dmFUn-rs2XbgnjQ2XGg2iYgtX3sW1ZoFli22Tv8rfc1kQ/s320/Pantallazo-Plug-in+Development+-+es.company.app-NewProduct.product+-+Eclipse+.png" width="320" /></a></div>
<br />
<div style="text-align: justify;">
5. Le indicamos las extensiones <b>org.eclipse.core.runtime.products y org.eclipse.core.runtime.applications</b> que nos indicarán cómo se iniciará nuestra aplicación o producto. Ambas extensiones deberán estar ligadas al <i>plugin.xml</i> de alguno de los plugins ofrecidos por nuestra aplicación.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnl4u9CUBJU-ELTh-sHEEAbHiza3PRVnt_booll5J_8dklbB6tXQskJZ6tflaG4uAKHAtxW3o6ZvxLbfCqCsF-xTZr1LM997F796Xx1kr-PVMyitZAQv6jBzufXbwSOqAmiQiroV_jc-Rf/s1600/Pantallazo-Plug-in+Development+-+es.company.app-NewProduct.product+-+Eclipse+-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnl4u9CUBJU-ELTh-sHEEAbHiza3PRVnt_booll5J_8dklbB6tXQskJZ6tflaG4uAKHAtxW3o6ZvxLbfCqCsF-xTZr1LM997F796Xx1kr-PVMyitZAQv6jBzufXbwSOqAmiQiroV_jc-Rf/s320/Pantallazo-Plug-in+Development+-+es.company.app-NewProduct.product+-+Eclipse+-1.png" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Con todo esto podremos exportar nuestro producto para tener un archivo ejecutable en una plataforma determinada, ya sea <i>Windows, Linux, Mac o Solaris</i>. </div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<span style="font-size: large;">Opciones opcionales</span></div>
<div style="text-align: justify;">
<br />
A través de las diferentes pestañas del editor de configuración de producto, <b>Eclipse</b> nos ofrece una serie de funcionalidades:</div>
<ul style="text-align: justify;">
<li><b>Launching</b>: Nos permite definir los elementos que integrarán nuestro ejecutable, como su icono, el entorno Java necesaria así como también algún parámetro de ejecución de la máquina virtual de Java, todo según la plataforma a la que vaya destinada.</li>
<li><b>Splash</b>: Nos permite crear el splash de nuestra aplicación. Esto lo que hará principalmente es introducirnos una nueva extensión en nuestro plugin principal.</li>
<li><b>Branching</b>: Nos permite crear la <i>"Ventana de Bienvenida</i>" y de "<i>Acerca de"</i> de nuestra aplicación, en caso de no haberla creado anteriormente en el plugin. También nos permite asociar los iconos de la aplicación según la plataforma a la que vaya asignado (Iconos de ventana, de barra de inicio...)</li>
<li><b>Licensing</b>: Nos permite indicar el tipo de licencia de nuestro producto en caso de tener.</li>
</ul>
<span style="font-size: large;">Referencias</span><br />
<ol>
<li> <a href="http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html">http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html</a> </li>
<li><a href="http://www.vogella.de/articles/EclipseRCP/article.html#tutorialexport_productfile">http://www.vogella.de/articles/EclipseRCP/article.html#tutorialexport_productfile</a></li>
</ol>
<br />
<ul style="text-align: justify;">
</ul>Anonymoushttp://www.blogger.com/profile/03527016818112486768noreply@blogger.com0tag:blogger.com,1999:blog-3200102444669845705.post-10981727313638446722012-02-03T01:13:00.000+01:002012-02-09T01:55:35.200+01:00RCP con Java Web Start (JNLP)<div style="text-align: justify;">
<span style="font-size: small;">Las aplicaciones <b>RCP</b> nacieron a partir del IDE Eclipse, una aplicación standalone que parecía no tener nada que ver con Java Web Start. No obstante, muchas veces interesa poder tener una aplicación autoinstalable y autoactualizable desde la red, por lo que la utilización de la tecnología <b>Java Web Start</b> puede parecer ideal.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNYUlEP_bbh8mYLkXaK2-EhYT29OizfQRsUu0iL90WFeAmdThOWJ3hdnc7q9loVh5NS1FeJMw4thVaRzL27jqvCvxsNvHi2FbghDmkDRPlQjwgCnDvzZHO7AbYmxKCtcvCpspOm0n9U_Jq/s1600/java-web-start-application.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNYUlEP_bbh8mYLkXaK2-EhYT29OizfQRsUu0iL90WFeAmdThOWJ3hdnc7q9loVh5NS1FeJMw4thVaRzL27jqvCvxsNvHi2FbghDmkDRPlQjwgCnDvzZHO7AbYmxKCtcvCpspOm0n9U_Jq/s200/java-web-start-application.png" width="200" /></a></div>
<div style="text-align: justify;">
<span style="font-size: small;">Al no ser una de las funcionalidades básicas del entorno <b>PDE</b>, puede resultar un poco difícil entender que se debe hacer para poder exportar aplicaciones RCP a <b>JNLP</b>. En esta entrada del blog os detallaré los pasos a seguir.</span></div>
<span style="font-size: small;"> </span><br />
<span style="font-size: large;">Tener listo nuestro producto (product)</span><br />
<br />
<div style="text-align: justify;">
<span style="font-size: small;">Es importante tener un producto realizado y listo para exportar, lo ideal sería probarlo primero exportándolo como un producto Eclipse (mediante la herramienta <i>"Export..."</i> del IDE Eclipse).</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk25K6D2rX9dGRSJVU_yJmCZRBJECZT4470tfSqkmkW9sBz4lCRA3CnBpjYKG0l-S5cyhcjv8hy3EVclDpFOUezLxTy8X_560X46Fcd5U5UFqMUsPHyINrn1zds76EO8SfKQZ-tOziI8zK/s1600/export.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk25K6D2rX9dGRSJVU_yJmCZRBJECZT4470tfSqkmkW9sBz4lCRA3CnBpjYKG0l-S5cyhcjv8hy3EVclDpFOUezLxTy8X_560X46Fcd5U5UFqMUsPHyINrn1zds76EO8SfKQZ-tOziI8zK/s320/export.png" width="320" /></a></div>
<br />
<div style="text-align: justify;">
<span style="font-size: small;">Una vez generado, deberemos asegurarnos de que todo funciona correctamente, ya que una vez exportado a <b>JNLP</b> puede ser difícil saber con seguridad que es lo que está fallando.</span></div>
<span style="font-size: small;"> </span><br />
<span style="font-size: large;">Crear un wrapper de nuestro producto a través de una Feature</span><br />
<br />
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">Uno de los requisitos fundamentales de Java Web Start es que todas las librerías que se descarguen dentro de un mismo producto deben estar firmadas con la misma clave (<i>keystore</i>). Por ello, Eclipse nos ofrece la posibilidad de firmar todos los plugins de nuestro producto con su herramienta de exportación (la misma que en el apartado anterior).</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">El problema que nos plantea esta herramienta es que necesitamos que nuestro producto sea una <i>feature </i>y no un <i>plugin</i>, por lo que necesitamos una pequeña transformación. Deberemos crear una <i>feature </i>que haga de <i>wrapper </i>de nuestro <i>plugin</i>, cosa que es realmente sencilla. Estos son los pasos a seguir:</span></span></div>
<span style="font-size: large;"><span style="font-size: small;">1. Creamos un nuevo proyecto de eclipse, eligiendo la opción <b>Plug-in Development-->Feature Project.</b></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVVRv4oPc4rGAMmBG2wMZvIXlPqTuSFgHjZpHHxsrIPwX4XT_jDUYxxVh6ZLbFdrVHqBOR7eHoY1qGRazavvBEOsQ9n_hqG4Ueyo7jM5VManjtWgXgFqIGXQ8sQO-y5zlQW2r0rcHPj1d9/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVVRv4oPc4rGAMmBG2wMZvIXlPqTuSFgHjZpHHxsrIPwX4XT_jDUYxxVh6ZLbFdrVHqBOR7eHoY1qGRazavvBEOsQ9n_hqG4Ueyo7jM5VManjtWgXgFqIGXQ8sQO-y5zlQW2r0rcHPj1d9/s320/feature.png" width="320" /></a></div>
<br />
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">2. Rellenamos los atributos del proyecto. (Dicen que es importante rellenar el <b>provider</b>, por lo que que mejor lo rellenamos)</span></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZUvEM8ETXFKkcSM_IOjpLfix60lKdwKc9lQJrokhaWO1wIvRqG7zHqG3E9fT1B4DhK0r8iP9vuYBleCkRFpjKLBvgU4Yr_CpZtjZuIXYQ4syR-rO9MM6RZ-iGn9tyG3DeYxPeTBT2LJnQ/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZUvEM8ETXFKkcSM_IOjpLfix60lKdwKc9lQJrokhaWO1wIvRqG7zHqG3E9fT1B4DhK0r8iP9vuYBleCkRFpjKLBvgU4Yr_CpZtjZuIXYQ4syR-rO9MM6RZ-iGn9tyG3DeYxPeTBT2LJnQ/s320/feature.png" width="289" /></a></div>
<br />
<span style="font-size: large;"><span style="font-size: small;">3. Seleccionamos el <b><a href="http://kasasdev.blogspot.com/2012/02/generar-un-producto-rcp.html" target="_blank">producto</a> </b>anteriormente creado</span></span><br />
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEN0bpITKd0EDBdRp7cdBSkvolHO3ZVNx-u-ti80FOu0EjB_Fe_-IJKHpU4b4V8OIsFalGSLqeELB3dizKt4qfhX73-PgVsJgqo_BZ0KnQduO88kuLFEl9PIFiidbzVB9D4pgWJiC_njz/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEN0bpITKd0EDBdRp7cdBSkvolHO3ZVNx-u-ti80FOu0EjB_Fe_-IJKHpU4b4V8OIsFalGSLqeELB3dizKt4qfhX73-PgVsJgqo_BZ0KnQduO88kuLFEl9PIFiidbzVB9D4pgWJiC_njz/s320/feature.png" width="289" /></a></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">4. Finalizamos la creación del proyecto.</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">5. Una vez hecho esto tendremos que añadirle una sola feature más dentro del apartado <i>Included Features</i> del <i>feature.xml</i> de nuestro wrapper: <b>org.eclipse.rcp</b></span></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiF-fPjTRkGOd2VFn1-vgCIdOZ2aJDSJpFlosWaeGFYR23P8ywyDe3GS4bdS9rTk7deZA410i7I98yuEDjvnDf_POZ2l7K2XraS43_vejjh0uiyL5_PTjoyxsnfp0TM9FRDuYM5IC3tUtu/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiF-fPjTRkGOd2VFn1-vgCIdOZ2aJDSJpFlosWaeGFYR23P8ywyDe3GS4bdS9rTk7deZA410i7I98yuEDjvnDf_POZ2l7K2XraS43_vejjh0uiyL5_PTjoyxsnfp0TM9FRDuYM5IC3tUtu/s320/feature.png" width="320" /></a></div>
<br />
<span style="font-size: large;"><span style="font-size: small;">Con todo esto ya tendremos creado nuestro wrapper.</span></span><br />
<span style="font-size: large;"><span style="font-size: small;"></span></span><br />
<span style="font-size: large;">Exportar wrapper a JNLP</span><br />
<br />
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">Para exportar a JNLP nuestra feature utilizaremos de nueva la herramienta de exportación de Eclipse, seleccionando esta vez la opción de <b>Deployable Features. </b>Esta opción la tenemos disponible en la esquina superior-derecha del editor del <i>feature.xml</i> (lo podemos observar en la imagen anterior).</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;"> Para la exportación tenemos que asegurarnos de seguir los siguientes pasos:</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">1. Seleccionar un directorio de destino donde se situaran los archivos generados.</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">2. Seleccionar en la pestaña de opciones solamente la opción de empaquetar en archivos JAR individuales y si queremos exportarlo a diferentes plataformas (en este último caso necesitaremos el <b>Delta Pack </b>de Eclipse)</span></span></div>
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgB3b2YE22UGzsgdiHbStyGu_PBWn_iWBvX6jtZv8E3CmBdi_9ZYdh5EP9WjUI1GzhU73gGr_uEpB7vQssXgt_N2_lMVAD4AsgLaOzNC_mMTS97agD5xPxb808jMu9waj-IcKixTckyy_6/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgB3b2YE22UGzsgdiHbStyGu_PBWn_iWBvX6jtZv8E3CmBdi_9ZYdh5EP9WjUI1GzhU73gGr_uEpB7vQssXgt_N2_lMVAD4AsgLaOzNC_mMTS97agD5xPxb808jMu9waj-IcKixTckyy_6/s320/feature.png" width="275" /></a></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">4. Introducir el <b>keystore</b> con el que se firmarán todas las librerías generadas.</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">5. Seleccionar la opción de <b>generar los archivos JNLP</b> que nos servirán de enlace con la aplicación y introducir el path desde donde se descargará (es probable que tengamos que editar este path más adelante según la distribución de directorios de nuestro servidor)</span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">Una vez hecho todo esto finalizamos y esperamos a que se generen todos los archivos con un poco paciencia, ya que suele ser un proceso un poco largo.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-size: large;">Generar nuestro JNLP base</span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">Tiene que quedar claro que no es suficiente disponer de los archivos JNLP generados por eclipse para poder lanzar nuestra aplicación. Deberemos <b>generar un archivo JNLP</b> parecido al siguiente que nos sirva para lanzar el jnlp adecuado según el sistema operativo del que se disponga:</span></span></div>
<br />
<blockquote class="tr_bq">
<?xml version="1.0" encoding="UTF-8"?><br />
<jnlp<br />
spec="1.0+"<br />
codebase="http://url" href="ARCHIVO_JNLP_CREADO.jnlp"><br />
<br />
<information><br />
<title> Product </title><br />
<vendor>COMPANY</vendor><br />
<homepage href="http://www.WEBSITE.es" /><br />
<description>DESCRIPTION</description><br />
<offline-allowed/><br />
<br />
<icon href="images/logo.png" kind="default"/><br />
<shortcut online="true"><br />
<desktop/><br />
<menu submenu="menu"><br />
<menu submenu="SUBMENU"/><br />
</menu><br />
</shortcut><br />
<br />
</information><br />
<security><br />
<all-permissions/><br />
</security><br />
<br />
<application-desc main-class="org.eclipse.equinox.launcher.WebStartMain"><br />
<argument>-showsplash</argument><br />
</application-desc><br />
<br />
<resources><br />
<property<br />
name="eclipse.product"<br />
value="es.company.product"/><br />
<jar href="plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar"/><br />
<property name="osgi.instance.area" value="@user.home"/><br />
<property name="osgi.install.area" value="@user.home/osgi"/><br />
<property name="osgi.configuration.area" value="@user.home"/><br />
<property name="osgi.sharedConfiguration.area" value="@user.home/configuration"/><br />
<property name="osgi.splashPath" value="platform:/base/plugins/PLUGIN_DONDE_SE_ENCUENTRA_EL_SPLASH"/><br />
</resources><br />
<resources os="Linux" arch="x86"><br />
<property name="osgi.ws" value="gtk"/><br />
<extension<br />
name="Product"<br />
href="features/product.gtk.x86.jnlp"/><br />
</resources><br />
<br />
<resources os="Linux" arch="x86_64"><br />
<property name="osgi.ws" value="gtk"/><br />
<extension<br />
name="Product"<br />
href="features/product.gtk.x86_64.jnlp"/><br />
</resources> </blockquote>
<blockquote class="tr_bq">
<resources os="Mac" arch="ppc"><br />
<extension<br />
name="Product"<br />
href="features/product.cocoa.ppc.jnlp"/><br />
</resources><br />
</resources><br />
<resources os="Mac" arch="x86"><br />
<extension<br />
name="Product"<br />
href="features/product.cocoa.x86.jnlp"/><br />
</resources><br />
</resources><br />
<br />
<resources os="Mac" arch="x86_64"><br />
<extension<br />
name="Product"<br />
href="features/product.cocoa.x86_64.jnlp"/><br />
</resources><br />
<br />
<resources os="Windows" arch="x86"><br />
<extension<br />
name="Product"<br />
href="features/product.win32.x86.jnlp"/><br />
<property name="osgi.instance.area" value="@user.home/Application Data"/><br />
<property name="osgi.configuration.area" value="@user.home/Application Data"/><br />
</resources><br />
<br />
<resources os="Windows" arch="x86_64"><br />
<extension<br />
name="Product"<br />
href="features/product.win32.x86_64.jnlp"/><br />
<property name="osgi.instance.area" value="@user.home/Application Data"/><br />
<property name="osgi.configuration.area" value="@user.home/Application Data"/><br />
<br />
</resources><br />
<br />
</jnlp></blockquote>
<div style="text-align: justify;">
Este archivo es un ejemplo y no es común para todas las aplicaciones, simplemente os puede ayudar a la hora de generar vuestro script. Para más información sobre cómo generar este tipo de scripts podéis ir <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/index.html" target="_blank">aquí</a>.</div>
<div style="text-align: justify;">
<b>NOTA:</b> Las propiedades introducidas son necesarias para el correcto funcionamiento de las aplicaciones RCP, es probable que si no se pone alguna de ellas, pueda dejar de funcionar<br />
<br />
<span style="font-size: large;">Problemas encontrados al exportar en multiplataforma</span><br />
Existen una serie de problemas exportando a un producto RCP a un <b>jnlp multiplataforma</b>, como mínimo en mi caso particular (exportando con Windows7 y Eclipse Indigo).<br />
<br />
El error tipo es el siguiente:<br />
<div style="text-align: left;">
<blockquote class="tr_bq">
org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)<br />
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)<br />
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)<br />
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)<br />
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)</blockquote>
</div>
<br />
En mi caso particular he observado como dentro de los jnlps para Linux y para Mac Os X se incluían enlaces a librerías de Windows. Es por ello que para solucionarlo deberemos firmar los archivos correctos. Este sería el workaround:<br />
<br />
1. Firmar los <b>plugins del Delta Pack</b> para subirlos a nuestra carpeta plugins del servidor<br />
2. <b>Modificar los archivos JNLP de cada plataforma </b>para que no se enlacen con los plugins nativos de Windows.</div>
<br />
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">Subir los archivos a nuestro servidor de aplicaciones Java</span></span></span></div>
<div style="text-align: justify;">
<span style="font-size: large;"><span style="font-size: small;">Por último, solamente falta subir los archivos al servidor y disfrutar de nuestra aplicación en nuestro sistema operativo preferido. Espero que os haya servido de ayuda.</span></span><br />
<br />
<span style="font-size: large;"><span style="font-size: large;">Referencias </span></span><br />
<span style="font-size: large;"><span style="font-size: small;">1.<a href="http://thomaswabner.wordpress.com/2011/03/28/run-eclipse-rcp-application-via-webstart/%20" target="_blank">http://thomaswabner.wordpress.com/2011/03/28/run-eclipse-rcp-application-via-webstart/ </a></span></span><br />
<span style="font-size: large;"><span style="font-size: small;">2.<a href="http://www.toedter.com/blog/?p=650%20" target="_blank">http://www.toedter.com/blog/?p=650 </a></span></span><br />
<span style="font-size: large;"><span style="font-size: small;">3.<a href="http://www.techjava.de/topics/2010/02/launching-rcp-via-jws/%20" target="_blank">http://www.techjava.de/topics/2010/02/launching-rcp-via-jws/ </a></span> </span></div>Anonymoushttp://www.blogger.com/profile/03527016818112486768noreply@blogger.com0tag:blogger.com,1999:blog-3200102444669845705.post-81575611989707597672012-01-23T21:52:00.000+01:002012-02-03T14:15:44.806+01:00Bienvenidos<div style="text-align: justify;">
Este blog va a intentar ser una referencia para aquellos desarrolladores de <b>Java</b>, <b>RCP</b> y <b>Android</b> que tengan problemas y que no dominen el inglés (sin quitarle trabajo a Google Translate ^^). Básicamente os trasladaré mis experiencias con estas tecnologías, sobre todo aquellas que involucren un trabajo de búsqueda intensa por internet para hallar la solución.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Como creo que para enseñaros qué es cada una de estas tecnologías ya existen sus debidas páginas, con sus tutoriales y explicaciones técnicas, simplemente indicaré mis motivaciones por las tecnologías elegidas. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
RCP es simplemente una tecnología que me apasiona por dotar de modularidad a la plataforma Java. Me parece una forma muy correcta de trabajar, aunque como en todo hay cosas que tienen su aprendizaje hasta que las haces bien.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Por otra parte, como las tecnologías móviles están en auge desde hace ya algunos años, me comencé a interesar por las primeras versiones de la plataforma Android y la he ido siguiendo hasta el día de hoy (de la M0.5 hasta la 4.0, sí existía la M05 ^^). Es por ello que intentaré descubriros cómo solucionar algunos de los problemas comunes con esta plataforma. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Espero ir subiendo cosas a menudo, tendré que aprovechar el tiempo.</div>
<br />
Saludos de bienvenidaAnonymoushttp://www.blogger.com/profile/03527016818112486768noreply@blogger.com0