2

new Zksample2 app. Spring, -AOP, -Security, Hibernate, Hibernate-Generic-DAO, Jasper

asked 2010-01-17 08:29:28 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2013-03-27 08:56:18 +0800

jimyeh gravatar image jimyeh
2047 1 4
ZK Team

Hi all,

today we have checked in the new Zksample2 application as maven2 projects on sourceforge.net. You can reach the project homepage under the link http://zksample2.sourceforge.net/ here.

You will find there 3 eclipse maven subprojects and the folder for the documentation.

  1. KeyGenZkoss = one-time-password generator
  2. spring-hibernate-backend = backend
  3. zkoss = frontend
  4. zksample2_doc = documentation

The Documentation you can download seperately as a pdf-file from here.

The documentation is a work in progress so be sure to check sometimes for the newest file.

For checkout and evaluate or work with the application please download and read first the documentation.

Mainly changes to the first sample app are: - change project structure as maven2 projects - spring managed frontend - @Secured() for securing methods with own implementation - login statistic - several integration options of ipToCountry - one-time-password sources are opend - Refactoring all Domain/DAO/Service Classes to english names - many many code changes - documentation

We whish all fun with it and hope that it can be usefull for others.

best Stephan and Björn

delete flag offensive retag edit

213 Replies

Sort by » oldest newest

answered 2010-01-26 05:14:19 +0800

danielgoodwin gravatar image danielgoodwin
76 2

Hi
Very excellent example.
Apologies for silly question, I'm working through documentation to setup locally to better understand and got to part where I 'import' from sourceforge site
Its asking me for a user/pass but by existing sourceforge account does not work
Should I be able to Import?

org.tigris.subversion.javahl.ClientException: Authorization failed
svn: MKACTIVITY of '/svnroot/zksample2/!svn/act/3a2355d1-70ae-9743-97ac-64d3347988d0': authorization failed: Could not authenticate to server: rejected Basic challenge (https://zksample2.svn.sourceforge.net)

link publish delete flag offensive edit

answered 2010-01-26 05:50:23 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-01-26 05:53:04 +0800

It's not an 'Import'. It's a checkout from svn.
Seems you have copy a false URL. Please correct it:

https://zksample2.svn.sourceforge.net/svnroot/zksample2

than go to trunk and checkout seperate all projects

link publish delete flag offensive edit

answered 2010-02-05 12:22:52 +0800

erickmelo gravatar image erickmelo
87 2

Hi,
I found a bug in the application:

When I try create a new Security Role (with a duplicated role name, as "ROLE_ADMIN") I get an NullPointException error... Probably for bad constraint

link publish delete flag offensive edit

answered 2010-02-05 13:48:01 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-05 13:48:51 +0800

Hi Erick,

yes you are right. We have changed an interface. So it should be throw DataAccessExceptions.

public interface HibernateOperations

Helper class that simplifies Hibernate data access code. Automatically converts HibernateExceptions into DataAccessExceptions, following the org.springframework.dao exception hierarchy. 

We will have a look on it.

Thanks
Stephan

link publish delete flag offensive edit

answered 2010-02-06 12:01:31 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-06 12:06:06 +0800

Fixed!

Problem was a false Hibernate Dialect (H2 for our Postgres) . Now it's a DataAccessException ConstraintViolation. That's right.

We have a special script that do the deployment of the app on our web server in following way:

a) checkout the project from SF
b) compiles the project
c) replace the file 'customizeApplicationContext.xml' with a modified file that let connect the zksample2 app to
our postgres Database. So the svn Zksample2 sources can run out of the box with the configured H2 Database.
We have now moved the hibernate properties (hibernate.Dialect; hibernate.show_SQL; hibernate.format_SQL) in this file too.
d) copy the .war file to tomcat wepapps directory.

By the way:
For all who are interested in the newest Spring libs.
Björn made at time the Zksample2 sources ready for Spring 3.0 and Spring-Security 3.0x
At time the spring-security pieces of zkspring.jar 1.0 + 1.2 are not all compatible with Spring-Security 3.0x because the spring developers
have renamed some packages.
For us it's no problem because we don't use all of it. The SpringUtils.getBean() method we have cuted and use them.
For method securing with the annotation @Secured() we have an own method that runs all times in the actual Zksample2 codes.

best
Stephan

link publish delete flag offensive edit

answered 2010-02-07 11:45:05 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-07 14:49:35 +0800

Done!

The Zksample2 app is updated to Spring3.

Thanks to Björn.

Best
Stephan

link publish delete flag offensive edit

answered 2010-02-09 15:11:33 +0800

erickmelo gravatar image erickmelo
87 2

Hi,

I'm having problems to run the project... I think some maven dependency is missing:
Exception to start the app:

Error creating bean with name 'serviceTxAdvice': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate3.HibernateTransactionManager] for bean with name 'transactionManager' defined in class path resource [applicationContext-db.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.

link publish delete flag offensive edit

answered 2010-02-09 15:49:10 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-10 18:06:01 +0800

Update the maven dependencies for both projects.
So it's new libs, so maven must download it first to its local repository.

<Eclipse> <zkoss> <right click> <Maven> <Update Dependencies>
<Eclipse> <spring-hibernate-backend> <right click> <Maven> <Update Dependencies>

best
Stephan


Let me hear if it 's OK.

link publish delete flag offensive edit

answered 2010-02-17 07:52:40 +0800

erickmelo gravatar image erickmelo
87 2

Hi Stephan,

Thank you.. The project is working right now!!

I was looking for your code and I think you made a really good job!! Are you considering create a skeleton project? You created a interesting structure for create ZK projects (with CRUD operations). The GUI classes, Util classes, Pagination classes, Menu classes, Security classes and User authentication are common for many projects. I think a skeleton project (without domais classes - just the packages for insert then) would help many developers to create ZK projects based in Spring and Hibernate. It could be a framework for some kinds of ZK projects.

Suggestion for ZK Studio and ZK Grails team: follow this project structure to automatize the creation of CRUD ZK projects...


Best,
Erick

link publish delete flag offensive edit

answered 2010-02-18 16:20:58 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-18 16:21:12 +0800

We said THANKS for the nice words Erick,

We will have a look for it (skeleton project).
1. More important at time is that databinding guys are helping us to make our special pagination classes ready for databinding.
Actually we have a second BranchDialog that runs with databinding. The list is missing because the adaption of the pagination class.
2. Secondly we have problems with our JasperReport (in OrderDialog) to show the data. It runs without error but shows no data.

best
Stephan

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
4 followers

RSS

Stats

Asked: 2010-01-17 08:29:28 +0800

Seen: 29,065 times

Last updated: May 27 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More