jacquard 1.10.0 by The Web Engineering Factory and Toolworks

See:
          Description

Packages
uk.co.weft.alert Alert is a Java language package for sending automated emails constructed by substituting values for tokens in templates.
uk.co.weft.configurator Configurator is a Java language package for configuring and delivering web application archives (WAR files).
uk.co.weft.dbutil A data source abstraction package implementing pooled connections to (primarily SQL) data sources.
uk.co.weft.domutil A DOM-aware replacement for the HTForm package.
uk.co.weft.event A simple on-line events diary; not really part of Jacquard, but included with it to demonstrate how Jacquard can be used.
uk.co.weft.htform A simple, lightweight infrastructure package to support writing servlets, especially servlets which access and update database tables.
uk.co.weft.xhtmlgen A utility package to assist in the generation of XHTML documents.

 

Jacquard is a Java language toolkit for the rapid development of data-driven web enabled applications. It comprises two major packages, htform and dbutil, and one which will eventually replace htform, domutil.

  • Status
  • What's new
  • Dependencies
  • Learning to use Jacquard
  • TODO
  • License
  • Status

    Jacquard is and will probably always be a work in progress; this release represents a snapshot in that process. It has been developed to support the Web Engineering Factory and Toolworks's work on projects for customers, and it will continue to develop driven by the needs of the particular projects we are working on. Generally we have marked as deprecated interfaces which we think we are likely to change; you should use these with caution. However this does not necessarily mean that other interfaces will not change.

    The current stable release is 1.10.0

    The current unstable release is 1.11.0

    What's new

    What's new in 1.10

    Real database logins

    JDBC does not provide any unified or portable way to deal with adding, modifying and deleting user accounts, but in an application its often important that a user should be able to change their password. Jacquard 1.10 includes JDBCUserKluge, an attempt to provide a consistent, database independent API for creating, modifying and deleting database-layer user accounts. Obviously, it depends on the currently logged in user having authority to do these things. The per-database-type syntax for carrying out the operations is loaded from a repository as an XML document. A list of repositories is searched with the hard-wired last fallback being one at www.weft.co.uk which I will maintain. As new syntaxes are added to this repository they will automatically become available to all Jacquard applications out there in netland, even if they were not available when the application was compiled.

    The Configurator

    One of the most difficult things about deploying webapps is getting them corectly configured for the context they're to drop into. The configurator package provides a mechanism to create customised webapps at server-side prior to their delivery to their deployment machine.

    Watchers

    Watchers (e.g. FileWatcher, JDBCWatcher) are small agents which sit around watching for events and then send alerts when they occur. You will find them in the alert package.

    Many user interface improvements.

    What's new in 1.8

    The generator chain

    All the domutil servlets (DocPage, CachedPage, TransformPage etc) now accept a configuration variable generator_chain, which is a space separated list of fully-qualified names of classes conforming to the DocumentGenerator interface. At generate time the context is offered to each of these generators in turn, until one returns a document. A DocumentGenerator can indicate that it doesn't want to accept the context simply by returning null from generate( Context). Note that it will rarely be appropriate to use a generator chain with CachedPage!

    A start to i18n

    htform.Servlet and htform.Widget both implement a new interface, ResourceConsumer. Resources are stored in a file htform.properties which (if needed) should be stored in webapps/yourwebapp/WEB-INF/classes. Resources are generally accessed through a method grs which if it fails to find the resource returns the key. For English, therefore, the htform.properties is empty. To find the keys to transate into another language (or to over-ride the default strings) do a grep 'grs' on the htform source. Because the keys contain spaces and other punctuation you will need to escape this with backslashes in the htform.properties file.

    Note that the locale selected will be that specified in the web.xml. Jacquard 1 cannot and probably will not ever support providing alternate language strings for different users visiting the same webapp.

    New package: Alert

    A new utility package, alert, which generates email messages from templates, has been added. It is a sort-of semi-detached package, like maybeupload, and may ultimately be packaged separately.

    New package: xhtmlgen

    A new package, xhtmlgen, has been added to the toolkit to assist in the generation of XHTML documents.

    What's new in 1.6.7

    Important new functionality: uk.co.weft.htform.Page (and all servlets inheriting from Page) now has a new configuration parameter, head_include_url. This allows a URL to be specified from which a fragment of HTML can be loaded to be spliced into the start of the body of the page. Why is this significant? Preciously the only quick, easy and convenient way to build navigation for an HTForm based site was to use frames, and frames are ugly. This allows navigation to be spliced into HTForm forms easily, allowing much more flexible HTForm sites to be build. Of course the real answer is to stop using HTForm, as I've been saying for at least two years... but in the meantime (while Jacquard 2 is still being invented) it's the quickest and easiest technology for building input forms and editing suites.

    What's new in 1.6.6

    IMPORTANT! ContextElement is DEPRECATED in favour of ContextElementGenerator. This is because many current DOM implementations refuse to handle nodes they didn't originate; consequently anything which uses ContextElement is very likely to break.

    Jacquard is also now tested for XML engine portability, and works with Saxon/Crimson as well as with Xalan/Xerces

    What's new in 1.6.3

    Changes to abstract out references to specific XML parsers, DOM implementations, and XSL-T transformation engines. While Jacquard 1.6.3 is built and tested against Xalan 2.2.0 and Xerces 1.4.4, it should now work with any parser any transformer conforming to the JAXP 1.1 APIs.

    What's new in 1.6.2

    Changes to ElementGenerator in line with 1.4.12.

    What's new in 1.6

    Changed from Xalan-J 1.x (now no longer supported by Apache) to Xalan-J 2.X. This has important consequences! Jacquard 1.4.X requires Xalan-J 1.X and will work with Tomcat 3.X but is not known to work with Tomcat 4.X; Jacquard 1.6.X requires Xalan-J 2.X and will work with Tomcat 4.X. Jacquard 1.6.X is not yet tested with any other Servlet engine than Tomcat 4.X.

    1.6.0 is otherwise identical to 1.4.10a.

    What's new in 1.4.10

    Fix to obscure bug in CharacterColumnDescriptor.

    1.4.10a is likely to be the last 1.4 release of Jacquard. It will continue to be supported for some time in that bugs will be fixed, and it's possible that some changes from the 1.6 tree will be rolled back into the 1.4 tree, but from here on in new development will take place in 1.6. 1.4 is still supported only because it is not yet known whether 1.6 will work with all the Servlet engines we'd like to support.

    What's new in 1.4.6

    Support for HTTPS (Secure Sockets Layer) has been added, but will only be active if you are running Java 1.4, or have installed JSSE in your runtime classpath.

    What's new in 1.4

    File Upload

    The primary new feature in 1.4 is integration with our maybeupload package, and the provision of two new widgets, FileMaybeUploadWidget and ImageFileMaybeUploadWidget.

    Not backwards compatible!

    We found in writing maybeupload that it was impossible to support both Servlet 2.0 spec and Servlet 2.2 spec, and consequently maybeupload supports Servlet 2.2 spec only. Jacuard 1.4, inheriting from maybeupload, also supports 2.2 spec only, so that Apache JServ will no longer work with Jacquard 1.4. Jacquard 1.2 will remain available for download, but will probably not get much further work.

    Also, there's a small API change in our own stuff, which means that you'll probably need to do some source-code editing before you can compile existing applications agains Jacquard 1.4. This relates to initialisation of forms.

    We've deprecated

    public void uk.co.weft.htform.Servlet.init( ServletConfig config) throws ServletException

    in favour of

    public void uk.co.weft.htform.Servlet.init( Context config) throws InitialisationException

    This is because Forms now work both as Servlets and as DocumentGenerators, and ServletConfig is not available if a DocumentGenerator is used by an application rather than by a Servlet. This change in itself isn't a problem, because the deprecated form continues to work. However, it meant that anything downstream of Servlet initialisation could not depend on javax.servlet packages either, and consequently we've replaced

    protected Widget uk.co.weft.htform.Form.addWidget( Widget w) throws ServletException

    with

    protected Widget uk.co.weft.htform.Form.addWidget( Widget w) throws InitialisationException

    This means that if you are using anything specialised from Form, AuthenticatedForm or TableWrapperForm you must rewrite your init method to the new prototype and replace all calls to

    config.getInitParameter( String name)

    with

    config.getValueAsString( String name)

    We apologise for this. We'll try to make this the last non-backwards-compatible change before Jacquard 2.0.

    Dependencies

    General

    Jacquard is written to the Java 1.2 specification. Jacquard versions up to and including Jaquard 1.2.X are written to the Servlet 2.0 specification, but are forward compatible with Servlet 2.2 specification servlet engines. Jacquard 1.3.0 and subsequent are written to the Servlet 2.2 specification and are not backwards compatible with 2.0.

    MaybeUpload

    Jacquard versions 1.3.0 and subsequent are dependent on our MaybeUpload package. In fact MaybeUpload was written to support Jacquard, and the only reason it isn't formally a part of Jacquard is that we felt it would be of value to a wider community of Servlet programmers.

    Third-party packages

    Jacquard is dependent on the following packages from the Apache Foundation:

    RegExp
    The regular expression parser
    An XSL processor such as Apache Xalan
    The XSL processor
    An XML Parser such as Apache Xerces
    The XML parser

    Dynamic graphics

    Jacquard can construct dynamic graphics based on computed data; useful examples are DrillThruGraph and DrillThruPie. To do this it currently uses image encoders by Jef Poskanzer, also avialable under BSD-style license. These encoders are not part of Jacquard, but can be downloaded from his site. To learn how to do dynamic graphics in Jacquard see ExampleMappedImageServlet.

    Note that the dynamic graphics functionality has not been teted since Jacquard 1.4, and is not really supported any more (although it probably still works).

    Supported Servlet Engines

    Jacquard is regularly tested against the Apache Tomcat and BEA Weblogic Servlet engines, and we support it (for our paying customers) for these engines. It is expected to work with all of

    Servlet Engine License Last tested: Notes
    Engine version Jacquard version Date
    Apache Tomcat open source (Apache) 3.2.1 1.2.4 25th Jan 2001
    Apache Tomcat open source (Apache) 4.0.x, 4.1.x 1.4.x, 1.6.x, 1.8.0 7th July 2003
    Sun Java Web Server Commercial Never tested
    ATG Dynamo Commercial Never tested
    BEA Weblogic Commercial 5.1 1.4.0pre1 20th Feb 2001
    W3C Jigsaw open source (BSD style) 2.0.5 1.2.0 18th Sep 2000 Servlet 2.0 specification only at present; consequently not expected to work with Jacquard 1.3 or greater.
    iPlanet Web Server Enterprise Edition Commercial Never tested
    Gefion LiteWebServer Commercial Never tested
    ServerTec iServer Commercial Never tested
    Allaire JRun Commercial 3.0 1.2.0 Nov 2000
    Jetty open source (Artistic) Never tested
    GNU Paperclips open source (GPL) Never tested
    jo! Commercial Never tested
    NGASI Commercial Never tested
    vqServer free, not open source Never tested
    Orion Commercial Never tested
    Caucho Commercial, with 'Developer Source License' Never tested

    but we do not carry out regular testing against all of these engines.

    Learning to use Jacquard

    Jacquard has extensive API documentation but does not really have any effective tutorial documentation yet. Partly to make up this deficit we are including the event package in the distribution. It is not strictly part of the toolkit but is a simple package which uses the toolkit; it has useful examples of typical Jacquard servlets.

    TODO - major unresolved issues in the current codebase

    Writing directly to the servlet output stream

    Although the whole of the htform package is predicated on the idea of writing directly to the output stream, we no longer view this as a good idea. In Jacquard 2 it will no longer be possible to write directly to the output stream. Instead we will create DOM nodes which will be assembled into a Document which may be transformed using XSL before it is printed. The less code you write which prints directly to the output stream, the easier it will be for you to follow this move with your own code.

    Internationalisation

    The Internationalisation code in Jacquard is (as of 1.9.0) still experimental and needs thought. Essentially some messages need to be internationalised for the locale of the server (i.e. in the system administrator's preferred language) and some to the locale of the client (i.e. in the user's preferred language).

    At present messages are internationalised using a method grs( String key, Context context). This is defined in an interface ResourceConsumer in htform, which is implemented by Servlet and Widget and will in future be implemented be ElementGenerator and DocumentGeneratorImpl. The default resource bundle name is presently just jacquard, but may change to uk.co.weft.jacquard.jacquard. To get a resource local to the server, pass the context as null; to get a resource local to the client, pass the context of the service.

    Obviously, you want to do your internationalisation as close to rendering time as possible. Things should generally not be internationalised at initialisation time. Error messages which are too technical to be useful to users should be internationalised with a null context.

    Other minor items

    A number of more minor points are marked with TODO comments in the existing code. These include:

    Context
    ensure that all the not-really-objects that hang around in Java can be put into a context; rewrite Context.load();
    ConnectionFish
    Make time to live configurable
    SuckerFish
    Make sleep time (i.e. between sweeps of the pool) configurable
    Printer
    Handle XLinks properly

    Additionally, many of the strings which are hardwired into the code should be packaged as a ResourceBundle; and some rationalisation of method and variable names would be desirable (for example, what is the difference between a 'put' and a 'set' method?). This work has been started, but by no means copleted, in the 1.8.x series.

    Finally, a tutorial needs to be written!

    Copyright and License

    The following is the whole of your license and warranty to use this package:

    [Note: this is the 'BSD License' as endorsed by OpenSource.org.]

    Copyright (c) 1998,1999,2000 Simon Brooke. All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SIMON BROOKE OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.





    jacquard 1.10.0 by The Web Engineering Factory and Toolworks