Asual

Summer - Documentation

Technlogy Overview

Summer is a library that utilizes a number of great technologies in order to bring you great development experience and productivity. Here is a list of the most notable ones:

HTML5

HTML5 offers simplicity that Summer takes advantage of while adding extensibility and dynamic functionality thanks to the data-* attributes. Summer promotes the usage of the new set of HTML5 semantic tags and enables them out of the box in browsers like Internet Explorer.

Spring

Spring is the foundation on top of which Summer is built. Spring takes care of the bean management, type conversion and the support for various Java specifications like Persistence API and Bean Validation but most of it provides the MVC implementation that Summer uses.

JavaServer Faces

JSF 2.0 offers a powerful set of templating and composite components capabilities that Summer uses to allow the creation of stateless HTML5 views. In addition the JSF component model enables even more important capabilities like partial rendering and resource relocation.

jQuery

jQuery is an optional but highly recommended addition to Summer which allows simple and quick access to features like AJAX and WebSockets.

Project structure

Summer uses classpath resources and Servlet 3.0 web fragments to allow modularity for applications that target standard servlet containers. Each module can contribute Spring and JSF configurations, properties and resource bundles as well as presentaion views and static files. No extra configuration is needed if the files are placed and named according to the Summer convention. Below is a sample Summer web application project structure:

+---src
    +---main
    ¦   +---java
    ¦   ¦   +---com
    ¦   ¦       +---foo
    ¦   ¦           +---sample
    ¦   +---resources
    ¦   ¦   +---com
    ¦   ¦   ¦   +---foo
    ¦   ¦   ¦       +---sample
    ¦   ¦   ¦           +---resources
    ¦   ¦   +---META-INF
    ¦   ¦       +---pages
    ¦   ¦       +---resources
    ¦   ¦           +---css
    ¦   ¦           +---img
    ¦   ¦           +---js
    ¦   ¦       +---views
    ¦   ¦       +---templates
    ¦   ¦           properties.xml
    ¦   ¦           spring.xml
    ¦   +---webapp
    ¦       +---WEB-INF
    +---test
        +---java
        +---resources
                

File types

Templates

Templates in Summer use JSF 2.0 Facelets markup and allow the creation of reusable layouts. Each template defines a set of tags that wraps the template body. While they are typically used to define the overall layout of the resulting page they can also be utilized for smaller reusable fragments.

Pages and Views

Both pages and views use a standard HTML5 markup and their content gets decorated by the default template. The pages are automatically discovered and served if requested by the end user while the views can only be exposed using a ModelAndView instance.

Static Resources

The typical web static files are placed and handled as classpath resources so that they can be packaged as JAR files and reused in a modular way. Summer offers a set of preconfigured locations for storing images, scripts and styles which are served by a dedicated Spring resource handler.

Properties and Resource Bundles

A flexible support for configuration properties and resource bundles is available out of the box thanks to Spring. Summer requires no additional configuration for files that follow the recommended naming convention. Both properties and messages support prioritization which emulates extensibility.

HTML5 Attribute Reference

Summer uses a number of data-* attributes that enhance the template markup and provide dynamic capabilities.

data-ajax
One or multiple space separated element IDs that should be rendered using Ajax.
Applies to: *
Default value: -

data-ajax-event
Event that should fire an Ajax request and update the elements specified with data-ajax.
Applies to: *[data-ajax=*]
Default value: "click" for a, button, input[type=button], input[type=checkbox], input[type=radio]
                       "blur" for input[type=text], textarea,
                       "change" for input[type=file], select
                       "ready" for div, span

data-ajax-method
The HTTP method of the Ajax request.
Applies to: *[data-ajax=*]
Default value: get

data-ajax-params
A list of extra parameters specified in a query string format.
Applies to: *[data-ajax=*]
Default value: -

data-ajax-url
Custom URL for an Ajax request that should update the elements specified with data-ajax.
Applies to: *[data-ajax=*]
Default value: requestURI

data-ajax-validation
Boolean value that enables instant Ajax validation of form element input.
Applies to: form
Default value: false

data-error
Boolean value that enable the display of error messages for form elements. Generates a DIV wrapper around the tag.
Applies to: input[type=checkbox], input[type=file], input[type=password], input[type=radio], input[type=text], select, textarea
Default value: true

data-label
Text label that will be displayed next to a form element. Generates a DIV wrapper around the tag.
Applies to: input[type=checkbox], input[type=file], input[type=password], input[type=radio], input[type=text], select, textarea
Default value: -

data-pack
Name of a package used for bundling multiple CSS or JavaScript files in a single request.
Applies to: link, script
Default value: -

data-rendered
Boolean value that specifies if an element is rendered.
Applies to: *
Default value: true

data-repeat
Collection of elements or a number value that specifies repeating iteration of the element children.
Applies to: *
Default value: -

data-repeat-begin
Number value that specifies the begin index of the repeating iteration.
Applies to: *[data-repeat=*]
Default value: -

data-repeat-end
Number value that specifies the end index of the repeating iteration.
Applies to: *[data-repeat=*]
Default value: -

data-repeat-step
Number value that specifies the amount of indexes which will be skipped during the repeating iteration.
Applies to: *[data-repeat=*]
Default value: -

data-template
Name of a template that decorates the element and it's children.
Applies to: *
Default value: -

data-template-*
Arbitrary values that specify additional template parameters.
Applies to: *[data-template=*]
Default value: -

data-value
Value of a form element presented in a repeating iteration.
Applies to: *[data-repeat=*], select
Default value: -

data-var
Name of the current variable in a repeating iteration.
Applies to: *[data-repeat=*]
Default value: -

data-var-status
Name of the status variable in a repeating iteration.
Applies to: *[data-repeat=*]
Default value: -

data-websocket
Name of the socket service that feeds the corresponding element.
Applies to: *
Default value: -

Projects

Blog posts

Recommended sites