Dynamic Form Controls

I have run across a theme with one of my clients that uses their Rhythmyx CMS to produce properties files: Every new type of properties file ends up being a new content type. I found this an untenable situation and the performance of the server tends to degrade after too many content types are introduced into the system.

In answer to this, I developed a set of controls that essentially allows users to create their own forms with hierarchically structured data using a dynamic, drag-and-drop enabled interface. This allows me to keep the content type count down to only 2 for this category of content item: a form template type (schema) and a form type.

Here’s a screen shot of the Form Template Editor (Schema Builder) control in action:

Here’s a screen shot of the Form (Schema Form) control in action:

I’ve attached a zip file with all the relevant files you need to implement this on your own system. It also contains a sample html file that you can use to view a sample form in the builder in a fully functional and dynamic web page.

Requirements: IE 8 or better. Or a recent version of Chrome, Firefox or Safari, although the system requirements for Rhythmyx kind of preclude using these.

Installation Directions:
[ol][li]unzip the attachment.[/li][li]copy the contents of the css folder into the Rhythmyx/rx_resources/css folder[/li][li]copy the contents of the js folder into Rhythmyx/rx_resources/js[/li][li]replace Rhythmyx/sys_resources/js/jquery/jquery.js with js/jquery.js (upgrades the system jquery install to version 1.4.2)[/li][li]in Rhythmyx/sys_resources/stylesheets/activeEdit.xsl, add the line from activeEdit.additions.txt inside the <head> element[/li][li]add the contents of rx_Templates.additions.txt to the Rhythmyx/rx_resources/stylesheets/rx_Templates.xsl file.[/ol][/li]
Optionally:
Install the schema.pda archive (the will probably be workflow/community errors which you can ignore).

After Installation:
There will be a little additional work required to set up publishing templates and that sort of thing. The JSON Parser for JEXL and Velocity I provided earlier will help with that.

Usage directions for the controls if you choose not to install the pre-built content types and XML App:

atc_SchemaEditor

[INDENT]There are no special settings for this control type. It is used to build a form template definition (schema) and save it in JSON format in the content item field you define in the content type editor.

atc_SchemaForm

This control type has 2 special properties you can set in the field properties window:

loadschemaurl – (required) This is a url from which to load JSON formatted schemas. In the attached schema.pda file, I have this as an XML Application. The URL should be able to respond to a parameter called schemaname in order to load only a single schema instead of all possible schemas.

schemachoices – (optional) You can supply a list of schema names to enforce a subset of selectable form templates. However, specifying this will also enable the user to switch between the choices you list after creating their initial set of data.

BIG NOTE: For some reason, these controls have a hard time when you populate forms with complex child-table data before the initial insert. For this reason, I highly recommend adding a Read-Only rule for “Create Only” to any controls using these types.[/INDENT]

A note to Percussion: I based this interface very very loosely on Apple Xcode and a couple other IDEs I’ve seen. I’d like to see a drag and drop interface similar to this in future versions of Percussion CM, with complex hierarchical data structures and drag-and-drop creation and editing being natively supported.

Please, send me an email or private message on this forum if you choose to use this control. I would love any comments, criticisms or feedback of any kind.