Wednesday, October 24, 2012

Pequeño tutorial de ZK Framework, Eclipse, Maven, Tomcat

Bueno, como el dermatologo al grano:

Configurando el entorno de desarrollo:

Eclipse: 


Juno 4.2
http://www.eclipse.org/downloads/

Instalación

unzip

Maven:

Para ejecutar desde linea de comando los ejemplos de ZK
3.0.4
http://maven.apache.org/download.html (decargar los binarios).

Instalación

Seterar las variables M2, M2_HOME, PATH, JAVA_HOME.
Tal cual el tutorial de instalación de maven (donde descargan los ejecutables).

GIT:

Para descargar los ejemplos de ZK


http://git-scm.com/

Instalación

Next>> Next>> Next>> Recordar integrar con el cmd al instalar

Maven en Eclipse:
Para compilar desde eclipse los ejemplos de ZK
http://www.eclipse.org/m2e/download/

Git, para Eclipse con Maven:
Para obtener las fuentes de los ejemplos directo a eclipse.
Buscar en el marketplace, o desde FILE >> IMPORT >> Maven >> Check out from SCR Sources >> Ahí hay un vinculo para ir al m2 marketplace

Jetty para eclipse:(recomendado)
Para usarlo en lugar de tomcat.

Agregar a Help >> Install New Software
http://run-jetty-run.googlecode.com/svn/trunk/updatesite/
Instalar solo una de todas las versiones (no deja todas).

Tomcat para Eclipse:
Descargar e instalar apache tomcat 6 o 7 pueden ser de:
http://tomcat.apache.org/


  1. From menu goto Windows > Preferences...
  2. Select Server > Runtime Environments, then click Add
  3. Select Apache > Apache Tomcat v6.0 and then click Next
  4. Browse to and select the root directory of the Web server installed in your computer
    • For example, the root directory of Apache Tomcat might be C:\Program Files\Apache Software Foundation\Tomcat 6.0
    • For how to install Tomcat, please refer to this section
  5. Click Finish

ZK para Eclipse:

Agregar a Help >> Install New Software
http://studio.zkoss.org/resource/plugins/eclipse_4_2

Ejecutando un ejemplo

Si todo esta configurado:

  1. Select File > Import .
  2. Select "Maven" > "Checkout Maven project from SCM"
  3. Select "git" and use the URL "git://github.com/zkbooks/CADDA.git"
  4. Click Finish to import the Web Project.
  5. ------------------------------------------------------------------------------------------------------------------------------------
  6. IMPORTANTE AQUÍ. (esto no esta en el tutorial de ZK)
  7.  Click derecho en todo >> Properties >> Project Facets >> Habilita Dynamic Web Module
  8. ----------------------------------------------------------------------------------------------------------
  9. Right click on todo project in the explorer and select Run As > Run on Server
  10. Select Apache > Tomcat v6.0 Server in the server type dialog and click Finish
  11. A browser will be activated automatically to explore the todo example.