0

sturcture zk

asked 2010-04-09 05:43:37 +0800

saad gravatar image saad
207 1 2

hi all
Can anybody let me know the project structure zk
where i put tld field, context.xml and the other filed
thx for help

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2010-04-09 08:31:03 +0800

caclark gravatar image caclark
1753 2 5
http://clarktrips.intltwi...

There are a lot of sample projects in the small talks that you can use as guidelines.
Read this smalltalk first:http://docs.zkoss.org/wiki/QuickStart_Guide#Running_the_sample_application_with_an_IDE

Here are all the smalltalks: http://docs.zkoss.org/wiki/Small_Talks

link publish delete flag offensive edit

answered 2010-04-12 04:33:46 +0800

saad gravatar image saad
207 1 2

i know this simple stucture
but i want a exemple of complexe stucture as i show (addon-language, tld field, etc)
thx for understand

link publish delete flag offensive edit

answered 2010-04-12 05:49:57 +0800

SimonPai gravatar image SimonPai
1696 1

Hi saad,

The correct deployment structure for each feature is documented by each provider of that feature. I'm afraid there's no one-shot guide that covers everything.
You have to search for user guide of each of the things you want to add into your application.

Regards,
Simon

link publish delete flag offensive edit

answered 2010-04-12 06:44:32 +0800

saad gravatar image saad
207 1 2

thx
now i understand
there is not conventionnal structure for a project zk that contain all cases

link publish delete flag offensive edit

answered 2010-04-12 10:17:57 +0800

robertpic71 gravatar image robertpic71
1275 1

If you use Spring/JPA/Hibernate you can create a ZetaForm (new/other/zk/zeta). You'll get a full configured and running project including i.e. zk.xml.
I do not use the zeta-form, but i use it onetime (dummy) to setup my project.

After this, you could simple annotatie (@) your resources and use spring-injects, transactioncontroll....

Note: You need to edit the application-context.xml to add your packages for spring-injections.
i.e.
<zksp-annot:component-scan base-package="org.zkoss.spring.jpa,your.root.package"/>

/Robert

link publish delete flag offensive edit

answered 2010-04-12 11:44:07 +0800

saad gravatar image saad
207 1 2

hi Robert
this is what we call a a excellent answer
but tell me how i can get this ZetaForm
thx againnn

link publish delete flag offensive edit

answered 2010-04-12 15:54:12 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2010-04-12 15:55:12 +0800

Hi,

ZetaForms are a part of the ZK Studio for Eclipse (there is also a tool for Netbeans).

1) Setup Eclipse
Install Java JDK
Install Tomcat
Configure Tomcat inside Eclipse
See this link for details.

2.) Setup ZK Studio
See this link for details.

If you only need a new ZK Project - create new Projekt ZK (but you have to configure Spring yourself).

3.) Prepare your first zetaform
3a) Database
Configure your database inside the "Data Source Explorer" - check this example for MySQL.
Note you need a JDBC-Driver for correct setup.

4.) Execute your first zeta-form
Check this and this.

Now you have an simple CRUD for one table and is Spring/JPA/Hibernate/ZK is ready.

Here some simple Spring examples:

Annotate your controllers like this: (make sure that your package is inside the scan-path from the application-context.xml)

@Repository("mainController") 
@Scope("prototype")
public class Main extends GenericForwardComposer {

and use it in your zul like that:

..
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
...
<window id="win" border="normal" apply="${mainController}" width="970px">

Your controller is now Spring managed, you can scope your resources as singleton (i.e. a list of logged users, configs, ServiceLayer) or session (i.e. userdata after login) or inject JDBC-connections, hibernate session or better JPA transactions.

/Robert

link publish delete flag offensive edit

answered 2010-04-13 03:46:25 +0800

saad gravatar image saad
207 1 2

hi robert
thx so much for your time
i will follow your advice

link publish delete flag offensive edit

answered 2010-04-13 03:53:39 +0800

saad gravatar image saad
207 1 2

hi robert
i want ask there is a tutorial to how i configure spring
thx again

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: 2010-04-09 05:43:37 +0800

Seen: 316 times

Last updated: Apr 13 '10

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