Skip to content

Instantly share code, notes, and snippets.

View senthilmuthiah's full-sized avatar

senthilmuthiah

View GitHub Profile
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="childwindow" ?>
<?page title="Child Window" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="childwindow" title="Child Window" border="normal"
mode="modal" width="30%" apply="org.com.demo.ChildWindowController">
<label value="Change the first name and Last name and click the button close to return the values"></label>
<separator></separator>
<label value="First Name"></label>
<separator></separator>
<textbox id="firstName" value="@{childwindow$ChildWindowController.firstName}"></textbox>
<?page title="Schools" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="winEditor" title="School Editor" border="normal"
height="350px" width="400px" closable="true"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.com.demo.ChildSchoolsEditVM')">
<vlayout>
<toolbar>
<toolbarbutton id="tbtnSave" label="Save"
onClick="@command('saveSchool')" image="/images/16_save.png" />
@senthilmuthiah
senthilmuthiah / POM File
Created March 25, 2013 10:04
Address Book Using JPA +ZK + Spring.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>AddressBook</groupId>
<artifactId>AddressBook</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<zk.version>6.5.1</zk.version>
<commons-io>1.3.1</commons-io>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
@senthilmuthiah
senthilmuthiah / persistence.xml
Created March 25, 2013 10:10
Address Book Using JPA +ZK + Spring.
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="2.0">
<persistence-unit name="ZKExamples" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
@senthilmuthiah
senthilmuthiah / applicationContext.xml
Created March 25, 2013 10:26
Address Book Using JPA +ZK + Spring.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
@senthilmuthiah
senthilmuthiah / web.xml
Created March 25, 2013 10:28
Address Book Using JPA +ZK + Spring.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description><![CDATA[My ZK Application]]></description>
<display-name>AddressBook</display-name>
<context-param>
@senthilmuthiah
senthilmuthiah / CRUDService.java
Created March 25, 2013 10:37
Address Book Using JPA +ZK + Spring.
package addressbook.service;
import java.util.List;
public interface CRUDService {
<T> List<T> getAll(Class<T> klass);
<T> T save(T t);
<T> void delete(T t);
@senthilmuthiah
senthilmuthiah / CRUDDaoImpl.java
Created March 25, 2013 10:36
Address Book Using JPA +ZK + Spring.
package addressbook.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import org.springframework.stereotype.Repository;
@senthilmuthiah
senthilmuthiah / CRUDDao.java
Created March 25, 2013 10:35
Address Book Using JPA +ZK + Spring.
package addressbook.dao;
import java.util.List;
public interface CRUDDao {
<T> List<T> getAll(Class<T> klass);
<T> T save(T t);
@senthilmuthiah
senthilmuthiah / CRUDServiceImpl.java
Created March 25, 2013 10:38
Address Book Using JPA +ZK + Spring.
package addressbook.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import addressbook.dao.CRUDDao;
@Service