0

ZK Sample App with Spring / Spring-Security / Hibernate / Jasper / Generic-Hibernate-DAO

asked 2009-08-11 22:27:43 +0800

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

updated 2009-10-12 23:59:47 +0800

Hi all,

Now it's time to give back all what i have learned for the ZKoss framework. Many thanks for the great
zk-team and the community and much more thanks to 'hkn' who helps me with my first steps on zkoss
and gaves me a red line in the right direction with the java-controllers and the famous baseCtrl class for
doing the whole binding/forwarding stuff.

Why today?

The last few days i'm reading about the SpringSource dm Server which is a OSGi appServer build around the tomcat.
My intention for zkoss is to migrate a very big business application that i have written ago 15 years with
Borland Delphi on win32 up to the web for a Saas (Software as a Service). So for me it's not important
to have much client/browser features. The app must run stable and scalable. It's not a fun application it's for
daily working and the customers wants as stable as a tank .
Today the power grows on serverside. So ZKoss is great for this. (So in my business oriented case I'm not
understanding the zk5 intention with the client side orientation ??)

Today i have read that SpringSource is buyed from VMWare for $ 430 Mill. !!!!
Hmmmmmmmmmm, opposing meanings in the papers/forums what the intention of VMWare is. But a few guys
see that their is a virtualising/clouding infrastructure growing. That's a possibility !
Look at the prices for hardware. ServerPower will always be cheaper.
Think about a modularisized zk application :-)

OK. So back to the basic.


The sample application is checked in on google.

It's the sample application you can see under https://62.75.171.30/test/
usr/pwd = admin/admin
Works with a postgreSQL DB 8.2.6.



And yes, it's blocked up at 200.000 records of customers. I have only a small vServer
to deploy the application. From time to time i will delete some customer records that you
can press the all side loved single-comitted-insert 1.000/10.000 records button newly :-)

Hope i can show the paging with about 4-5 Mio. records on a 16 core 64 GB machine some days :-)



- Seperated as frontend and backend project. All as Eclipse 3.4 projects.
- The backend is older and used for other frontend/technic framework testings too.
So sorry for a few not used methods, but it can be interested for hibernate beginners.
- Most comments are in the code. Please have a look on the folder structure and see the red line.
- More comments and a overview follow under the folder /docs in the ...gui project next days/weeks.

frontend project
backend project

- Implemented with following frameworks:
- spring
- spring-security (I'm extending the spring rights management for a so called 'group' and 'group-rights' that holds seperated logical units of rights. All are loaded from database tables. So we and our customers can customizing the access without new tomcat starting while it's not loaded from a configuration file :-) )
- hibernate as ORM
- JasperReports for reporting
- Generic-Hibernate-DAO for creating hql queries from a search-object. Used for all listboxes.
- H2 DB v1.1.15 for a easier demo mode, which is started and filled with demo-data by starting the application on tomcat.

- Localisation for english and german
- All logged in users became their own singleton UserSpace and their own rights arraylist.


Have fun

regards
Stephan

my Blog
PS I: Help to prevent the global warming by writing cool software.
PS II: Hope that other guys are willing to extend this sample

ToDo List:
- check for securing methods with annotations. First try is failed. @Secured("myZkossMethod")
- help for find out what must in the Session Object for a clustering http SessionFailover
- Drag'n Drop sample
- charting
- ...

delete flag offensive retag edit

44 Replies

Sort by » oldest newest

answered 2009-08-12 07:46:41 +0800

ziftech gravatar image ziftech
87 2

Hi Stephan!

Thanks for your openness!

Yakov

link publish delete flag offensive edit

answered 2009-09-10 16:58:18 +0800

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

I have added a simple piechart to the customer dialog.

You must synchronize both projects (frontend and backend).

have fun
Stephan

link publish delete flag offensive edit

answered 2009-09-16 21:58:26 +0800

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

Several new chart typs are added to the cutomer dialog.

You must synchronize the frontend project.

have fun
Stephan

link publish delete flag offensive edit

answered 2009-09-22 17:56:46 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

I've just read this post today, I'm late to this great news.

I'd like to implement the exact same spring-security with groups-actions that you do, any suggestion on where should I look in the code?

Thank you very much Stephan,
Felipe Cypriano

link publish delete flag offensive edit

answered 2009-09-22 20:21:40 +0800

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

updated 2009-10-12 23:36:55 +0800

Hi Felipe,

1. Have a look in the zk_sample_gui\doc\readme.txt

2. Package: zk_sample_gui\src\de\forsthaus\zksample\policy (Spring Controlers)

3. Package: zk_sample_gui\src\de\forsthaus\zksample\webui\security (Security Gui Modules)

regards
Stephan

PS: Help to prevent the global warming by writing cool software

link publish delete flag offensive edit

answered 2009-10-08 07:12:01 +0800

hartyshow gravatar image hartyshow flag of Brazil
18

Hi Stephan,

First of all, congratulations for this work and thank you for sharing.

I will carefully monitor your project for which I will inspire me to manage a medical office for my wife.

Regards,

Harty

link publish delete flag offensive edit

answered 2009-10-12 23:49:29 +0800

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

updated 2009-10-13 00:10:59 +0800

Today i made an update on the sample app:

1. Now you can change the navigation between a TreeMenu or PullDown Menu.
All is working around a xml menu file that describes the menuitems and the depth of the menu.
Out from from this file there are java objects created that describes only a meta menu structur.
With helper classes they create the menu in case of a tree menu or a pullDown menu.
Done by Björn. Documentation of this classes takes a while.
button picture 1
button picture 2


2. Refactoring of all save methods. After a hibernate exception resulting by duplicated key violations now the old
values are restored.

3. Depending on a bug in google chrom 3.0.195.25 the 'click me' button are over painted. Now it's in an own <div> tag.

best
Stephan

PS: Help to prevent the global warming by writing cool software.
PS II: Next release: secure the ZK events with spring-security annotations

PS III: Please do not delete my two main sample customers. Because their are related data behind them. Thanks.
PS IV: Because of PS III the DB are new reloaded by script. Now you can press the Insert Customers buttons :-)

link publish delete flag offensive edit

answered 2009-10-23 21:18:20 +0800

zero5 gravatar image zero5
75

Thanks for your sharing. It helps me to clarify something about Spring Security.

link publish delete flag offensive edit

answered 2009-10-24 10:25:19 +0800

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

updated 2009-10-24 10:26:49 +0800

I use only pieces of spring-security others i have extended!

In fact Spring-Security (formerly Aecegi) is created in first line to work with spring managed applications.
In my case only the backend is spring-managed. So i use the Authentication spring-like and the Authorisation
is fixed coded.

best
Stephan

link publish delete flag offensive edit

answered 2009-10-29 16:11:25 +0800

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

update on the zk libraries to 3.6.3 FL 2009-10-23.

All works as same

best
Stephan

PS: next update i'll reimplementing a one-time password simulation for extra securing a password .

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

RSS

Stats

Asked: 2009-08-11 22:27:43 +0800

Seen: 22,778 times

Last updated: Dec 06 '11

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