<body> | |
<p> | |
Click Extras provides a library of additional controls and components which are outside | |
of the core Click framework. | |
</p> | |
<p> | |
Click Extras are packaged as a separated JAR which | |
you can deploy with your application. Extra packages include: | |
<ul style="margin-top:0.75em;"> | |
<li><a href="net/sf/click/extras/cayenne/package-summary.html">Cayenne</a> | |
- provides Cayenne data aware controls</li> | |
<li><a href="net/sf/click/extras/control/package-summary.html">Control</a> | |
- provides extra controls</li> | |
<li><a href="net/sf/click/extras/filter/package-summary.html">Filter</a> | |
- provides GZIP compression Filter</li> | |
<li><a href="net/sf/click/extras/graph/package-summary.html">Graphics</a> | |
- provides graphic controls</li> | |
<li><a href="net/sf/click/extras/hibernate/package-summary.html">Hibernate</a> | |
- provides Hibernate data aware controls</li> | |
<li><a href="net/sf/click/extras/panel/package-summary.html">Panel</a> | |
- provides Page Panel containers</li> | |
<li><a href="net/sf/click/extras/spring/package-summary.html">Spring</a> | |
- provides Spring integration SpringClickServlet</li> | |
</ul> | |
</p> | |
<h2>Contributing</h2> | |
Click Extras provides a place for people to contribute their own code to the | |
Click project and have it package with the standard distribution. Contributed | |
code will be subject to review and may require modifications before it is | |
included in the Click distribution. | |
<p/> | |
<h3>Design</h3> | |
One of the overriding design principles with Click is to keep it simple, this | |
makes to code easier to understand and more reliable. | |
<p/> | |
Another guiding principle is YAGNI (You Ain't Going to Need It), or don't build | |
it until you really really need it. Click is trying to provide an 80/20 rule framework | |
where 80% of peoples needs are meet by a framework which is only 20% in size. | |
<p/> | |
When developing Click Extras contributions please follow these principles. | |
<h3>Dependencies</h3> | |
Components and controls should have minimal dependencies. This is to support easy | |
deployment of the click-examples and keeps the click build process simple. | |
See <a href="../building.html#extras-dependencies">Extras Dependencies</a> for | |
details. | |
<p/> | |
Please Note the Cayenne and Spring dependencies are only required if you use these particular features. | |
For example if you are using Hibernate for your persistence framework, the | |
<a href="net/sf/click/extras/cayenne/CayenneForm.html">CayenneForm</a> | |
control will not cause any issues as this class would never be loaded by your application. | |
<h3>Auto File Deployment</h3> | |
The Click framework uses the Velocity Tools <tt>WebappLoader</tt> for loading templates. | |
This avoids issues associate with using the Velocity <tt>ClasspathResourceLoader</tt> and | |
<tt>FileResourceLoader</tt> on JEE application servers. | |
<p/> | |
To make preconfigured resources (templates, stylesheets, etc.) available to web applications | |
Click automatically deploys configured classpath resources to the <tt class="blue">/click</tt> | |
directory at startup (existing files will not be overwritten). | |
<p/> | |
To enable your controls to deploy resources on startup it should use the Control | |
<a href="../click-api/net/sf/click/Control.html#on-deploy">onDeploy()</a> method. | |
Click extra controls which use this method should be registered in Click Extras | |
JAR <tt>extras-controls.xml</tt> file. | |
<h3>Coding Style and Practices</h3> | |
Click follows the Sun conversions for Java code style. Other style convertions | |
and practices include: | |
<ul style="margin-top:0.75em;margin-bottom:0.75em;"> | |
<li>indents are 4 spaces wide and no tabs are used</li> | |
<li>public and protected visibility members require Javadoc</li> | |
<li>private and package visiblity members do not require Javadoc</li> | |
<li>favour the use of unchecked <tt>RuntimeException</tt> and avoid creating new Exception classes</li> | |
<li>check method parametes and throw <tt>IllegalArguementException</tt> if parameters are null or invalid</li> | |
<li>avoid creating any more classes than you need to get the job done</li> | |
<li>localize control messages in the classe's <tt>properties</tt> files</li> | |
<li>use the <tt>Context.getLocale()</tt> method to obtain a users locale</li> | |
<li>before checking in code run the Ant task: <tt>ant format-java</tt> | |
</ul> | |
</body> | |