Blogs : Archives
|< RIFE at JavaWUG video by Emmanuel Okyere||Are single element annotations a disaster waiting to happen? >|
Below are the highlights:
You can read the full changelog for more details.
RIFE now supports an automated method to add meta data to POJO classes without having any additional code nor annotations inside the POJOs themselves.
Consider a class
Constraints are a typical usage for this feature. Any POJO is now able to have constraints attached to it, without violating the purity of the POJO class implementation itself. For convenience, you can extend the
For example, the
As long as RIFE's classloader is active, both will be automatically merged into a new
Note that this is also implicitly available to RIFE/Crud, which means that you can easily generated CRUD web interfaces for existing models, without having to add constraints to their original implementation.
RIFE's traditional template tag syntaxes don't please everyone, therefore two additional variants have been added.
Velocity inspired variant:
These tags should look somewhat familiar to people that are used to Velocity. Sadly they will not become invisible if the template is viewed in a browser:
Regular tags inspired variant:
This version uses custom XHTML tags that look exactly the same as the rest of the layout code and that can easily get validation and auto-completion support in IDEs:
To make it convenient to use the regular tag variant, you can download the following support files:
The DWR team has worked hard to make their project as modular as possible and to abstract it away as much as possible from the Servlet API. While their effort is still in progress and there hasn't been an official DWR release with these features yet, we already integrated a DWR snapshot with RIFE to provide easy Ajax capabilities will all the power of RIFE's element components. To make this work you have to use the DWR jar file that's shipped with the rife-sumo distribution archive.
Standard DWR Ajax element
RIFE ships with a new standard element declaration that can be accessed through the file
That element will by default look for
Customize the configuration
However, you can also specify a specific DWR configuration file for each Ajax element through the
Let's look at the content of this example's
Your element will now expose the methods of the
Enable Ajax in your HTML
The default value of this embedded element tag is a property list, where the
Use Ajax in your layout
The following example calls the
The actual magic happens in the
Normally, embedded elements are processed when the template that contains them is instantiated. In most situations this is exactly what you want, however sometimes it's important to be able to defer the processing to the end of your view handling, ie. when the template is printed. So instead of being processed early, those embedded elements will then be processed late.
You simply do this by prefixing the ID of the embedded element in the value tag with a
For example, these embedded elements:
Will be processed in the following order:
Note that you can of course still process embedded elements explicitly with the
Path info mapping provides a powerful way to easily support structured path info URLs and receive their values as inputs.
By default however, even if none of the mappings matches the provided pathinfo, the element will be executed. No values will have been extracted from the pathinfo and you're responsible for taking the appropriate action yourself. Usually, this is exactly what you want as a fall back. However, sometimes you might want to have elements that will only be processed if at least one of the declared mappings matches the pathinfo. This can be achieve by setting the
Both elements above handle the same pathinfo URL. However, only when the
So these will go to
These will go to
These will however be executed by neither:
Normally you declare flowlinks and datalinks next to each-other and whenever the logic follows a flowlink, the related datalinks are looked up and all the output values will be provided to the target inputs. This can however create problems if you have different flowlinks that go to the same target element, but that should connect different outputs to the same input. You are now able to tie datalinks to a specific flowlink.
In the example above, three flowlinks point to the same
The mail queue executor is now able to connected to authenticated SMTP servers and to use SSL for encryption.
The following task options are now available:
When your element has outputs that link to inputs of the element itself, or if globalvars are present, you are now able to set an output value before generating the submission URL and parameters. After the submission is sent, that output value will be provided to the input of the element. Of course, as before, all other inputs will automatically preserved during submissions.
This feature allows you to continue to rely on inputs to receive data for your element. However, you now don't have to handle changing input values by adding additional parameters to your submission and adapting your logic to them, you can simply set an output and continue to use the data that the input provides.
A collection of bug fixes have been performed to:
2006-02-26 Geert Bevin <gbevin[remove] at uwyn dot com> * RELEASE 1.4 * RIFE-262 : Add full POJO support for constraints declarations. Finalized the implementation by adding support for auto-implementation or modification of the clone() method so that the bean instance and the meta-data instance always stay together and that clones are properly isolated. * Updated changelog and project files. 2006-02-25 Geert Bevin <gbevin[remove] at uwyn dot com> * Added javadocs. * Renamed some methods to prevent them from being seen as bean properties * Updated project files. * Upgraded Groovy * Fixed MetaData bugs. * Made MetaData fully lazy instantiating. * Added ValidatedConstrained interface. * Changed JavaDocs version 1.3.2 into 1.4 2006-02-24 Geert Bevin <gbevin[remove] at uwyn dot com> * Added first working version of pure POJO support with automatic meta data merging * Added DTD for regular tag template syntax. * Added taglib descriptor for making the regular template tag syntax understood by tools. * Updated all DTDs to be in UTF-8 encoding. * Updated all examples to use the Velocity template syntax instead. 2006-02-23 Geert Bevin <gbevin[remove] at uwyn dot com> * Added experimental Ajax DWR support * Added support for the Velocity-inspired tag syntax * Added support for regular html tags for doing RIFE markup in the xhtml, xml, html templates. * Optimized the parsing algorithm to work a lot faster with numerous configs: an initial scan is first performed to detect the syntax variationts that are in use, and only those will remain for the actual parsing. 2006-02-22 Geert Bevin <gbevin[remove] at uwyn dot com> * Explicit embedded element processing bugfix * NPE fix 2006-02-21 Geert Bevin <gbevin[remove] at uwyn dot com> * Updated highlighting of example sources * Friend example update 2006-02-17 Geert Bevin <gbevin[remove] at uwyn dot com> * Minor test suite fixes. * CMF fixes for RAW content storage with Derby and MySQL. * RIFE-244 : Add API for "manually" invoking authentication * RIFE-193 : Add public API for filling bean with submission values (name-value pairs) 2006-02-16 Geert Bevin <gbevin[remove] at uwyn dot com> * RIFE-253 : <site> should not require "file" attribute * Added some convenience methods to the CMF * Added support for dynamic repository names to the ServeContent element. * RIFE-264 : Embedded elements do not received pathinfo inputs : Embedded elements now receive all inputs of the embedding elements as if they were regular request parameters. * Added support for strict pathinfo mapping. * Added support for several elements with the same pathinfo URL. 2006-02-15 Geert Bevin <gbevin[remove] at uwyn dot com> * Reduced memory usage for wordwrap 2006-02-14 Geert Bevin <gbevin[remove] at uwyn dot com> * Added wordWrap method to StringUtils. 2006-02-13 Geert Bevin <gbevin[remove] at uwyn dot com> * Deprecated CmfProperty and CmfValidation, moving all their logic into the base classes. 2006-02-13 Geert Bevin <gbevin[remove] at uwyn dot com> * Refactoring to dissociate Gate completely from the servlet api 2006-02-12 Geert Bevin <gbevin[remove] at uwyn dot com> * Incredibly stupid classloader bugfix. The context classloader was only set in the init() method of the RIFE servlet/filter, but not in the service and destroy methods. 2006-02-10 Geert Bevin <gbevin[remove] at uwyn dot com> * Fixed bug where arrival elements didn't properly rewrite reflective datalinks and flowlinks 2006-02-09 Geert Bevin <gbevin[remove] at uwyn dot com> * Made the type of the template property not mandatory anymore and defaulted it to enginehtml 2006-02-08 Geert Bevin <gbevin[remove] at uwyn dot com> * Added support for flowlink-specific datalinks 2006-02-07 Geert Bevin <gbevin[remove] at uwyn dot com> * Added test for raw content storage of byte arrays 2006-02-06 Geert Bevin <gbevin[remove] at uwyn dot com> * Additional tests for embedded element support in OOC testing framework * Added tests for embedded response support in out-of-container testing framework * Added tests for embedded element priorities * Updated copyright year * Made error reporting templates xhtml compliant and use css for formatting. * Adapted the formatting to correctly display template syntax errors in a pre formatted style. * Made getEmbeddedResponse a bit more user friendly * Implemented embedded element priorities. * Added support for embedded element retrieval in MockResponse. 2006-02-04 Geert Bevin <gbevin[remove] at uwyn dot com> * Added RAW content store support for byte as well as InputStream. 2006-02-03 Geert Bevin <gbevin[remove] at uwyn dot com> * Added getResourceFinder() to Site * Changed order of automatic value replacement in processTemplate to make it possible to use data elements in form building valuesm * Fixed bug where the active element threadlocal is not cleared after an exception and thus template property injection creates a stack overflow exception. * Bugfix related to element property injection that only has to kick in after a valid ElementContext * Added isEmbedded method to ElementSupport * Minor bugfix related to embedded element inside templates that are instantiated through property injection. * Minor bugfix wrt to the order of the validation with a ValidationContect and Callbacks. * Fixed callbacks NPE with Derby 2006-02-02 Geert Bevin <gbevin[remove] at uwyn dot com> * Added Tyler's mail queue ssl + auth support. Had to re-enable the old way of sending the messages without auth, otherwise the socket connection would just stay open and never close in the local test. The ssl and auth should be tested again. * Added blankValue() to Template 2006-02-01 Geert Bevin <gbevin[remove] at uwyn dot com> * Added warning to the log to indicate when auto compilation is not supported. * Made servlet containers that return null for ServletContext.getRealPath("/") not support auto compilation. * Removed TemplateClassLoaderClasspath since Templates have been generated directly to bytecode since quite a while. 2006-01-31 Geert Bevin <gbevin[remove] at uwyn dot com> * Fixed RetroWeaver JDK 1.4 issue. * Renamed alias to catalog in the XML entity resolver. Still need to find an acceptable way to setup current and old versions of the DTD catalog, probably by including the rife_catalog.xml file, parsing it and including all the DTDs of the older versions. * Trial to support ClassPath for XML entity resolving. 2006-01-27 Geert Bevin <gbevin[remove] at uwyn dot com> * Set EOL property to LF 2006-01-26 Geert Bevin <gbevin[remove] at uwyn dot com> * RIFE-265: Add a method for width/height/ratio of a scaled image to be forced via CmfProperty. The behavior of the CMF content attributes has changed. If both width and height are specified, they'll indicate a maximum bounding box and the image will be rescaled by preserving its aspect to fit the bounding box as closely as possible. * Changed template unittests to use to embedded derby instead 2006-01-24 Geert Bevin <gbevin[remove] at uwyn dot com> * Fixed performance issue with UniqueIDGenerator * Upgraded ASM 2.2.1. * Updated continuations engine for new ASM behaviour. 2006-01-20 Geert Bevin <gbevin[remove] at uwyn dot com> * Classloader fixed for integration with other libraries and filters that are loaded through web.xml 2006-01-17 Geert Bevin <gbevin[remove] at uwyn dot com> * Minor bugfix to ensure that identified elements continue to prolongue the authentication session. 2005-12-31 Geert Bevin <gbevin[remove] at uwyn dot com> * Upgraded HttpUnit to 1.6.0 2005-12-30 Geert Bevin <gbevin[remove] at uwyn dot com> * Added support for setting reflexive outputs and globalvars accross submissions. 2005-12-29 Geert Bevin <gbevin[remove] at uwyn dot com> * Fixed GQM install(CreateTable) methods for derby and mysql driver support 2005-12-24 Geert Bevin <gbevin[remove] at uwyn dot com> * Removed dependancy on Sun's JDK in the HTTP tool classes. 2005-12-23 Geert Bevin <gbevin[remove] at uwyn dot com> * RELEASE 1.3.1
|[Delete all selected]|
Add a new comment
|Comments on this blog entry have been closed.|
|< RIFE at JavaWUG video by Emmanuel Okyere||Are single element annotations a disaster waiting to happen? >|