Store with a Database"

From Documentation
m
Line 1: Line 1:
 
{{ZKEssentialsPageHeader}}
 
{{ZKEssentialsPageHeader}}
  
The easiest way to import a project into Eclipse is to make use of the WAR file, which is provided in the SVN. We can directly import the WAR file using Eclipse’s import mechanism.
+
===Prerequisites===
  
#To start importing, please go to '''File -> Import''' in Eclipse and you will see the following dialog.
+
*You require Maven for ZK Studio/Eclipse, if you do now have it you can follow this tutorial on [http://m2eclipse.sonatype.org/installing-m2eclipse.html installing it]
#:[[File:ZKEss_import.png]]
 
#Type WAR into the filter text and then select the storewithdb WAR file you just downloaded. Then, press '''Next'''.
 
#:[[File:ZKEss_war_import.png]]
 
#Download the WAR file from https://zkbooks.googlecode.com/svn/trunk/zkessentials/storewithdb/storewithdb.war and place it into an accessible folder
 
#In the WAR import screen, browse for the WAR file and select it. The rest of the fields should be filled out automatically.
 
#:[[File:ZKEss_war_import_final.png]]
 
#Click '''Next''' and the WAR file will be imported.
 
#You should now have a clean project imported with no errors. At this point you can run the index.zul page on your server.
 
#:NOTE: When importing, if eclipse is showing a lot of errors, please see the section below the '''Dealing with Errors''' label.
 
#:[[File:ZKEss_imported.png]]
 
  
===Dealing with Errors===
+
===Set-up the ZK Essentials sample===
 
+
#For this section we will assume you download the application first rather than do a git checkout from Maven
You may encounter a lot of errors, just like the screen below.
+
#Therefore [https://github.com/zkbooks/ZK-Essentials/zipball/withdb click here] to download the store without a database, and unzip to any folder you want
 
+
#In ZK Studio go to New -> Import, and type "Existing Maven Projects", highlight the option and click next
[[File:ZKEss_many_problems.png]]
+
#:[[File:ZKEssentials_Existing_Maven_Projects.png]]
 
+
#Click browse and locate the extracted zkessentials directory and press OK
If you see errors stating that annotations are only available in Java 1.5, please right click on one of the errors and click '''Quick Fix''':
+
#:[[File:ZKEssentials_Click_Browse.png]]
 
+
#Check the checkbox next to the POM and press finish
[[File:ZKEss_annotations_1.5.png]]
+
#:[[File:ZKEssentials_check_the_POM.png]]
 
+
#The ZK Essentials project will now be in your workspace ready to run after maven downloads all the appropriate files
In the following screen, please make sure '''change project compliance to JRE 1.5''' is selected and click '''Finish''':
 
 
 
[[File:ZKEss_project_compliance.png]]
 
 
 
Once it's done, we should have about one item left in the problems list, stating that Java compiler level does not match the version of the installed Java project facet:
 
 
 
[[File:ZKEss_facet_error.png]]
 
 
 
 
 
Right click on the error and click quick fix as before. Then in the following screen select the item '''Change Java project facet version to Java 5.0''' and press '''Finish'''.
 
 
 
[[File:ZKEss_change_facet.png]]
 
 
 
All the errors should be fixed now and you can continue to run the application.
 
  
 
{{ZKEssentialsPageFooter}}
 
{{ZKEssentialsPageFooter}}

Revision as of 01:29, 14 February 2012

Stop.png This article is out of date, please refer to http://books.zkoss.org/zkessentials-book/master/ for more up to date information.


Prerequisites

  • You require Maven for ZK Studio/Eclipse, if you do now have it you can follow this tutorial on installing it

Set-up the ZK Essentials sample

  1. For this section we will assume you download the application first rather than do a git checkout from Maven
  2. Therefore click here to download the store without a database, and unzip to any folder you want
  3. In ZK Studio go to New -> Import, and type "Existing Maven Projects", highlight the option and click next
    ZKEssentials Existing Maven Projects.png
  4. Click browse and locate the extracted zkessentials directory and press OK
    ZKEssentials Click Browse.png
  5. Check the checkbox next to the POM and press finish
    ZKEssentials check the POM.png
  6. The ZK Essentials project will now be in your workspace ready to run after maven downloads all the appropriate files



Last Update : 2012/02/14

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.