jacquard 1.10.0 by The Web Engineering Factory and Toolworks

Package uk.co.weft.domutil

A DOM-aware replacement for the HTForm package.

See:
          Description

Interface Summary
DocumentGenerator a DocumentGenerator is an object which generates DOM documents, usually from something in a database.
NodeGenerator a NodeGenerator is an interface for things which generate [X|HT]ML elements.
Primitive a Primitive is any element which can be added to a Page.
 

Class Summary
AttributeGenerator an AttributeGenerator generates an [X|HT]ML attribute.
CachedPage a CachedPage is a servlet which generates a page which doesn't often change.
ContextElement Deprecated. The use of this class is deprecated because most current DOM implementations won't handle nodes they didn't create.
ContextElementGenerator a ContextElementGenerator generates a DOM elements from contexts.
DateGenerator an ElementGenerator which knows about dates and calendars.
DocPage a DocPage is a servlet which generates a page from a Document.
DocumentGeneratorImpl a simple DocumentGenerator implementation which can be specialised.
DOMStub a stub to hang onto and return a DOM implementation and other global DOM stuff, including a DocumentBuilder.
ElementGenerator an ElementGenerator is an superclass for things which generate [X|HT]ML elements.
JustFetchGenerator a JustFetchGenerator is not really a generator at all so much as a proxy.
LoginGenerator Generate a login box if no connection can be made in this context.
MaybeParseGenerator Abstract superclass for TextNodeGenerator and ElementGenerator, which may want to parse their content.
Printer An object which prettyprints a DOM tree on an output stream
ResultSetGenerator an element generator that gets and wraps around a result set; used by ResultsGenerator but may be more generally useful.
ResultsGenerator a DocumentGenerator which takes an SQL query either in it's configuration or in the generate-time context and runs that query against the database implied by the generate-time context in order to produce a very simple XML document.
TextNodeGenerator an TextNodeGenerator generates an [X|HT]ML textNode.
TransformCache A cache holding precompiled XSL transforms indexed by the URLs from which they were loaded
TransformPage TransformPage is a second cut at a generic servlet to serve XML pages, transforming them on the fly.
TranslatingContextElement Deprecated. The use of this class is deprecated because most current DOM implementations won't handle nodes they didn't create.
 

Exception Summary
GenerationException A general purpose exception thrown when generating a DOM structure; potential superclass for more specific exceptions..
 

Package uk.co.weft.domutil Description

A DOM-aware replacement for the HTForm package.

  • Dependencies
  • Validation and code generation
  • Migration roadmap
  • Copyright and Licence
  • Dependencies

    As of Jacquard 1.6.X, domutil is built against and supported for Apache Xalan-J 2.2.D11 and Apache Xerces 1.4.1. While we hope and expect that later versions of Xalan 2.2 and of Xerces 1.4 will also work we do not by any means guarantee this. If you have problems please roll back to the stated versions.

    Validation and code generation

    domutil does not by default validate the documents which are generated against a DTD; when implementing generate() methods it's the authors responsibility to ensure that the code generated is valid, if this matters. generate() methods provided by Weft as part of domutil will generate valid code. Documents generated by domutil will always be syntactically valid XML

    However, ContextElement provides a mechanism for creating elements from arbitrary Contexts, where the Contexts may often have come from (for example) database queries. The data which comes back from the query may well include embedded markup. If it does so ContextElement will by default try to parse that markup and return a sub-tree representing it.

    If it is important that the markup you generate is valid to some DTD and you are speciallising ContextElement, you should carefully read the documentation for ContextElement.

    Roadmap for migration of Jacquard applications to DOM-aware form

    Jacquard's development predates the development of the Document Object Model (DOM), and consequently the current core of Jacquard, the HTForm package, generates output simply by printing directly onto the output stream. Having worked with the DOM we're now convinced that it provides a better mechanism for creating and manipulating documents; consequently we are setting out to provide a path for the graceful migration of Jacquard applications to a DOM based imlementation. This package, vestigial at the time of the time of Jacquard 1.0 release, is intended eventually to largely replace HTForm.

    It is intended that prior to the release of Jacquard 2.0, all the functionality now provided in htform will be mirrored in domutil. At this point use of the layout() method, used by htform objects to create output, will be deprecated in favour of the generate() method of the equivalent domutil object. Later versions of Jacquard may then extend the functionality of domutil objects without providing that functionality in htform.

    In short, we do not now intend to add further functionality to htform and the print-to-the-output-stream model. Any future changes to htform after Jacquard 1.0 release will simply be bugfixes and maintenance. All new functionality will take place in domutil and the generate-DOM-and-print model.

    In the meantime, you may use either htform or domutil components in any servlet which specialises uk.co.weft.htform.Page; domutil components will gracefully degrade to htform components when used in this context. You may not use htform components in any servlet which specialises uk.co.weft.domutil.Page.

    Dependencies

    domutil presently depends on IBM's DOM implementation distributed with XML4J. This implementation is not strictly Open Source. We intend to replace the IBM DOM implementation with a strictly Open Source DOM implementation as soon as one becomes available. In the meantime users of this package should not depend on any proprietary features of the IBM DOM implementation (if there are any).

    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, 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