Monday, May 19, 2008

Click 1.5 Milestone 1 released!

Click 1.5 Milestone 1 has been released yesterday. This is the first installment in the 1.5 development branch and provides a host of new features. Important links:

Highlights for 1.5-M1 include:
  • Container - new interface for building arbitrary complex, hierarchical Controls.
  • Services - Click core has been refactored into pluggable services.
  • Added Freemarker support as an alternative templating engine to Velocity. See FreemarkerTemplateService for configuration details.
  • Mock Test Support - introduces an easy to use package to write Unit and Functional Tests.
  • A new Powered by Click section was added. If you would like to add your own site to this list, please send us a mail to one of our Mailing Lists, or directly to "sabob1 at gmail.com".
  • More examples and documentation.
New Examples:
New documentation:
Issues resolved:
  • Improved performance by rendering from a single non-blocking buffer.
  • Added a Country Select control based on the JDK's own built in Country/Locale support.
  • Added a Virtual Keyboard control using GreyWyvern JavaScript library.
  • Added support for setting Form action URL attribute. This issue was raised by Erdem Gunay [319].
  • Added support for Page HTML imports with a new getHtmlImports() method. This enables Pages to programatically define HTML imports which will be included in a border template using the PageImports object. This issue was raised by David Frizelle [329].
  • Add Page setTemplate(String) method to enable dynamic changing of a page border template. This issue was raised by Huy Do [353].
  • Updated Page.setPath to handle JSP resources. This issue was raised and fixed by Huy Do. [141].
  • Added support for Hibernate AnnocationConfiguration. This issue was fixed by Jean-Francois. [355].
  • Improved FileUpload support. This issue was raised by Ricardo Lecheta [326].
  • Improve File Upload support with new FileUploadService class. [326].
  • Fixed Cayenne PropertySelect which is not reset to original value. This is was raised by Tore Halset [317].
  • Fixed Cayenne 3.0M3 DataObjectUtils issue in CayenneForm when using JDK 1.5. Added CayenneUtils helper class [342].
Enjoy.

The Click team.

Saturday, May 3, 2008

Click 1.4.2 maintenance release is available!

Click 1.4.2 is a minor maintenance release.

This release fixes a problem when using SpringClickServlet and excluded urls. We have also fixed a slight performance degradation since the 1.4 release.

Changes include:
  • Fix a slight performance degradation over the 1.4 release [349].
  • Fixed ExcludePage - should be a public inner class [346].
  • Fixed Maven artifact packaging [348].
  • Fixed PageLink to work with JSP pages [352].
  • Fix DateField and ChartFields to include control.js [354].
  • Fix DateField which could produce duplicate stylesheet head includes [356].
Enjoy.

The Click team.

Tuesday, April 8, 2008

Click supports functional and unit testing!

One of the first features completed for the upcoming 1.5 release, was to revamp the mock package and add functional and unit testing support. There is no need to extend any classes or override methods. Testing works out of the box.

For testing purposes there are two classes of interest: MockContainer and MockContext.
(Since 1.5 has not yet publicly available I will just refer to the actual source code)

Which class to use depends on what you want to test.

If you want to test your pages (functional tests) use the MockContainer which simulates a servlet container such as Tomcat or Jetty. With the container one will be enable to mock page requests, form submissions, file uploads, navigation etc.

In order to use MockContainer you need to specify a web directory where the container can find resources such as javascript, stylesheets and images. The easiest way to achieve this is to point the container to your project's web directory.

Example usage:

public class IntegrationTest extends TestCase {
    public void testFirstPage() {
        // Specify the project web directory for example: 'c:/dev/web'
        MockContainer container = new MockContainer("c:/dev/web");

        // Bootstrap the container
        container.start();

        // Set a request parameter
        container.setParameter("myparam", "Some parameter");

        // Simulate a user requesting the page, FirstPage. FirstPage will forward to SecondPage.
        FirstPage page = (FirstPage) container.testPage(FirstPage.class);

        // Assert that FirstPage does indeed forward to SecondPage
        Assert.assertTrue(container.getForwardPageClass(), SecondPage.class);

        container.stop();
    }
}
MockContext on the other hand is useful for testing custom controls (components).

Note that it is not necessary to specify a web directory when using MockContext.

Example usage:
public class ValidationFieldTest extends TestCase {

    public void testValidationField() {

        // Initialize the context.
        MockContext context = MockContext.initContext();

        int maxLength = 10;
        String fieldName = "name";
        ValidationField field = new ValidationField(fieldName, maxLength);

        // Retrieve the request and set field request parameter.
        MockRequest request = context.getMockRequest();
        request.setParameter(fieldName, "value");

        // onProcess binds the request attribute and field value
        assertTrue(textField.onProcess());

        // Assert that the field is still valid.
        assertTrue(textField.isValid());
    }
}
That is all there is to it.

The API is still evolving and feedback is appreciated. Our mailing lists are available here:

Monday, March 31, 2008

Click 1.4.1 is available!

Click web framework version 1.4.1 is now available. First up the links:

This release fixes a number of important JSP and Ajax related bugs.

Changes include:
  • Added new method Context.isAjaxRequest() which enables conditional checking for Ajax requests.
  • Improved alphanumeric column sorting. This issue was raised by Ben Young. [344]
  • Upgradeded to Scriptaculous 1.8.1 to fix auto form submit. This issue was raised by Andy Key. [336]
  • Fixed sendRedirect to convert .jsp extension to .htm when redirecting to a JSP page. [338]
  • Fixed Form clearValues() to exclude certain HiddenFields from being cleared. [337]
  • Fixed Form action incorrect when using JSP. This issue was raised by Chas Erickson. [334]
  • Fixed Form.onSubmitCheck() to ignore Ajax calls. This issue was raised by Ivan Furdi. [333]
  • Fixed Form and FieldSet column layout bug [331].
For those interested in the latest development release (1.5M1) can view the roadmap below:
Enjoy.

The Click team.

Wednesday, March 5, 2008

ClickIDE 2.0.0 released: now with Cayenne and Spring support

Naoki Takezoe has released the latest version of ClickIDE. This release supports Click Framework 1.4 and Eclipse 3.3/WTP 2.0.
Important links:

There have been a couple of important new features:

New Features:
  • Generates Click project with Cayenne and Spring support.
  • Added new Cayenne mapping project creation wizard.
  • Added Cayenne Modeler launcher.
  • Wizard generates an empty cayenne.xml and launches it with Cayenne Modeler.
  • Added classpath variables "CAYENNE_LIB" and "CAYENNE_NODEPS_LIB". You can add cayenne.jar or cayenne-nodeps.jar to your project classpath using these variables from the project build path settings.
  • Additional Velocity variables configuration for code completion in the project property page.
Enjoy Click!

Tuesday, March 4, 2008

Click 1.4 final released!

Click 1.4 has been released yesterday. A big thanks goes to all users and developers for their contributions in making this release possible. Important links:

Click is a simple and intuitive page and component oriented Java web framework. There are no unnecessary abstractions or complex concepts to learn and understand. Pages and components are developed in Java while layouts are specified in Velocity or JSP. You don't have to repeat component hierarchies in your view as each component knows how to render itself.

Highlights for 1.4 includes:
  • Stateful page support which really make developing complex pages and page flows much easier.
  • New PerformanceFilter which gives your applications Yahoo style performance for very little effort.
  • New AutoCompleteTextField control which gives you Ajax google suggest functionality.
  • New Ant task to build quickly build application templates or scaffolding.
  • Added support for Cayenne versions 2.x and 3.x.
  • ThreadLocal Context support which giving you access to the Context in page constructors.
  • New Control event methods, onInit(), onRender() and onDestroy().
  • Lots more code examples and design patterns on click-examples.
  • Performance improvements.
Since RC3 there have been a couple of important bug fixes:

Fixes:
  • Updated Cayenne controls to support Cayenne version 3.0.
  • Fixed CayenneForm save() method inserting multiple new entries bug. This issue was raised and fixed Tore Halset [307].
  • Fixed Table invalid handling params bug. This issue was raised and fixed by Satoshi Takata [308].
  • Fixed DateField readonly JavaScript bug. This issue was raised by Tore Halset [309].
  • Fixed DateField Dutch Calendar translation. This issue was raised by Harry Wissiak [310].
  • Fixed DateField $imports usage JavaScript bug. This issue was raised by Itou Akihiro [311].
  • Fixed bug where charset encoding being set after request parameters are read. This issue was raised and fixed by Ricardo Lecheta [312].
  • Fixed ThreadLocal Context forwarding bug on Jetty 5.1.*. This issue was raised by Ricardo Lecheta [314].
  • Fixed 'script.aculo.us' Ajax.Autocompleter bug with IE. This issue was raised by Itou Akihiro [322].
  • Fixed CompressionServletResponseWrapper NPE bugs on WebSphere and Jetty. This issue was raised by Ricardo Lecheta [323].
Enjoy.

The Click team.

Wednesday, February 6, 2008

Click 1.4.-RC3 released: now with stateful page support

Click1.4-RC3 has been released today. Below are the related links:

Click is a page and component oriented Java web framework. Pages are mostly developed in Java, while rendering is performed by Velocity or JSP.
A lot of thought went into making Click as simple as possible and developers should be up and running within a day.

Since RC2 there have been a number of new features and important bug fixes.

Improvements:

1. Pages can now be stateful:
public class MyPage extends Page {

public Form form = new Form("myForm");

public MyPage() {
setStateful(true); // Page will be persisted between requests.
form.add(new TextField("search-term");
form.add(new Submit("submit"));
}
...
}

More documentation on stateful pages can be found here.

2. Added a PerformanceFilter to significantly improve the performance of Click applications. The filter is based on Yahoo's Exceptional Performance best practices for speeding up your web site. This filter combined with framework changes enable Click applications to get an Grade A rating with Yahoo's Firefox plugin: YSlow.

Also in this release:
  • Added new AJAX AutoCompleteTextField which provides Google suggest style lookups.
  • Added new Table CSS class styles: blue1, blue2, orange1, orange2
  • Fixed Form.copyFrom() to align with special Map handling of Form.copyTo(). [278].
  • Fixed Form submit check to handle multiple forms per page. [279].
  • Fixed exception when using Form.onSecurtyCheck in a stateful form. This issue was raised by Joel Schmidt [267].
  • Fixed PickList multiple selection bug. This issue was raised by Ricardo Lecheta [280].
  • Fixed Context leak under heavy usage. [282].
  • Fixed Page automapping bug. This issue was raised by Sep and Ricardo Lecheta [277, 294].
  • Fixed Linux ResourceBundle classloading bug. This issue was raised by Victor [293].
  • Fixed Tree encodeURL bug. This issue was identified by Thomas Bernhard [301].
  • Fixed Table memory allocation bug for large paged rowLists. This issue was identified by Naoki Takezoe [305].
For a complete list of changes visit the roadmap and changes.

Enjoy.

The Click team.