Create and Run Your First ZK Spreadsheet Application"

From Documentation
Line 11: Line 11:
  
 
*Create one for example named <span style="color:green">'''myZSS'''</span><ref>You can download sample application myZSS.war described in this document from [http://zkbooks.googlecode.com/files/myZSS.war here]</ref>
 
*Create one for example named <span style="color:green">'''myZSS'''</span><ref>You can download sample application myZSS.war described in this document from [http://zkbooks.googlecode.com/files/myZSS.war here]</ref>
 
+
<blockquote>
 +
----
 +
<references/>
 +
</blockquote>
  
 
===Install ZK Library Distribution===
 
===Install ZK Library Distribution===

Revision as of 04:38, 24 December 2010

DocumentationZK Spreadsheet Quick Start GuideQuick StartCreate and Run Your First ZK Spreadsheet Application
Create and Run Your First ZK Spreadsheet Application



Create Web Application

ZK Web Applications use a standard directory structure defined in the Servlet specification.

When developing ZK web applications, you must follow this structure so that application can be deployed in any J2EE compliant web server.

All you need to do is create a web application directory with related files. J2EEWebApplication.jpg


  • Create one for example named myZSS[1]

  1. You can download sample application myZSS.war described in this document from here

Install ZK Library Distribution

  1. Unzip zk-bin-5.0.5.zip. You should have already downloaded this file as described in previous chapter or download it now from here
  2. Copy JAR files under following list to myZSS/WEB-INF/lib
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib/zkforge

Install ZK Spreadsheet Library Distribution

Download ZK Spreadsheet libraries archive "zk-spreadsheet-bin-2.0.0.zip" from ZK Spreadsheet Download page and save it into a folder.

  1. Unzip zk-spreadsheet-bin-2.0.0.zip
  2. Copy JAR files under following list to myZSS/WEB-INF/lib
    • {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib
    • {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib/ext

Create Deployment Descriptor(Web.xml)

web.xml is called the web application deployment descriptor. This is a XML file that defines servlets, servlet mappings, listeners, filters, welcome files etc.

Deployment descriptor is a heart of any J2EE web application, so every web application must have a web.xml deployment descriptor directly under WEB-INF folder.


Create a sample MS Excel file

  1. Open MS Excel
  2. Create a new Excel spreadsheet
  3. Enter "Hello from ZK Spreadsheet" in the first or any empty cell
  4. Save this file as "HelloZSS.xlsx" into myZSS/WEB-INF location

Create First ZUL file

Create a simple zul file named hello.zul under "myZSS" folder and enter following contents in it.

<?page title="My First ZK Spreadsheet application" contentType="text/html;charset=UTF-8"?>
<zk>
	<window title="My First ZK Spreadsheet Application"
		border="normal">
		<spreadsheet src="HelloZSS.xlsx" maxrows="100" maxcols="100" />
	</window>
</zk>

Pack your project

  1. Compress the myZSS directory(e.g. myZSS.zip)
  2. Rename myZSS.zip to myZSS.war
  3. Done!!

Confirm your ZK Spreadsheet application Web Archive (WAR) file

 myZSS.war
 ¦  helloZSS.zul
 - WEB-INF
     ¦  web.xml
     ¦  HelloZSS.xlsx
     - lib
          *.jar

Deploy and run your first ZK Spreadsheet application

  1. Copy myZSS.war to web server web applications folder. For Tomcat it would be TOMCAT_HOME/webapps folder
  2. Open Browser and visit http://localhost:8080/myZSS/helloZSS.zul


Download sample application

You can download sample application myZSS.war described in this document from here

Version History

Last Update : 2010/12/24


Version Date Content
     



Last Update : 2010/12/24

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