A (currently branched) version of xsltforms aiming to enable support for certain enterprise features such as subforms, rich widgets, proxy support etc.
This is an experimental version only; we hope to get some / all of these changes merged into the xsltforms core codebase. By all means try it out, but don’t consider it anything approaching stable. It uses horrendously inefficient, uncompressed, full builds of dojo, until such times as we get around to cutting it to a compressed dojo profile, or just pull directly from the dojo CDN. The uncompressed build makes debugging (somewhat) easier. Javascript is also currently stored "raw", until we migrate it back into the agencexml CM format (need to see if they are open to a minor enhancement to the cm format that lets us manage dojo dependencies; then we can produce either an optimised single file or a multi module build, and tie into the javascript compressor apis).
The mainline xsltforms build uses a custom build system written in php, but this can be awkward for new developers to set up, so we have written a maven based version which is portable, and relatively common (particularly in the enterprise). After the initial checkout, you should run:
mvn assembly:single -DdojoBuild=true
Which will download the dojo distribution and unpack it, then build xsltforms
into target/xsltforms-${project.version}.zip
and an equivalent .tar.bz2
file. Note that, as ever with maven, be prepared for the mother of all
bootstraps the first time you run it. Once the initial dojo download / unpack
has been performed, you can simply run:
mvn assembly:single
to perform the build without the dojo steps. To build a local directory (instead of archive files), run:
mvn assembly:single -Ddirectory=true
Which will create a target/xsltforms-${project.version}
folder with the
same contents and structure as the archive files.
Note that mvn:clean
will only remove the downloaded dojo files if
-DdojoBuild=true
.
Aside from offering an alternative way of building xsltforms, the main differences are:
-
Javascript stored in raw form as described above (temporary, hopefully).
-
"Global" javascript objects refactored into instance based approach, allowing multiple forms to co-exist on a single page.
-
Use of dojo xhr framework, allowing support for proxies, true XS-XHR where supported.
-
Support for
urlencoded-post
submission method. -
Forms are now assigned a generated id, or can manually specify an id with a leading
xsltforms-id
processing instruction, for example:<?xsltforms-id formId ?>
to assign an id of formId. Ids must be unique across a given window. -
The
xsltforms-options
processing instruction now accepts anembedded
parameter which, when set toyes
will target generation for embedding. Forms which use this feature should specify a leadingxsltforms-container
processing instruction containing a javascript expression suitable for looking up an XFormEngine instance (i.e. something providing a.getXformEngine()
method). Otherwise the rootXFormEngine
instance, which is tied to theWindow
, is used.
-
Refactor all presentation code into js objects, plugged into the xform elementFactory. This could enable support for new widget types (maps, colour pickers etc.) without requiring changes to the distribution (i.e. via including the required js / user config.xml files).
-
Refactor submission framework to enable user "plugins" to aid embedding.
-
Full cross form submission / subform support.
-
"Compiled" JS assembly: aggregate and compress all js files into a single archive to increase loading times. Remove unused files (e.g. most of dojo) and use dojo minimal distribution.
-
Get js files back into agencexml source format.
Items 1 and 2 are due to start next week. 5 will be based on feedback from Agencexml.