Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 3 min read

Support

Motivation

You want to create a form that captures the specifications of an application that manages data saved from a form.

Method

Many times the resources needed to create an application are very similar. Many applications need basic operations such as:

  • Create a New Record
  • Read (view) a Record
  • Update a Record
  • Delete a Record
  • Search for Records

These applications (sometimes referred to as a CRUD application for Create, Read, Update, Delete) are created over and over and frequently a pattern emerges. This pattern can be used as the basis for a specification and we can then build an XForms application to capture that specification.

This example assumes that the user wants to do these operations on a simple form and guides the user through a series of questions. A series of defaults is assumed but the user is allowed to override these defaults when the requirements differ from the standard.

The phrase "convention over configuration" is frequently used to describe a series of built-in assumptions about the default behavior of an application. If the developer of the application knows these conventions a highly functional initial application can quickly be created.

This form starts asking a series of questions, some of which are input fields, some check boxes and some text descriptions. Some input fields are referenced later in the application using binding rules. These binding rules are the conventional behavior of the application.

After the application specification is complete a "Generate Application" function can be executed. This will take the application specification file and execute a series of scripts on the server. Here are a sample of some actions that can be taken by these server-side build scripts. In this example we are using terminology from native XML data stores with XQuery REST interfaces but there are similar actions for RDBMS stores

  • Create Default Collections
    data collection for XForms instance data
  • edit collection for XForms editors (any forms that lock resources
  • views collection for storing read-only views
  • search collection for searching form instance data
  • schemas collection for XML Schemas
  • Create Application Template Files

edit.xq - XForms editor for new records and updating records (generated form the XML Schema)

  • new-instance.xml - default data for a new record
  • search-fomn.xq - Generates an XForms application for searching
  • search.xq - XQuery for searching records - return an HTML results page
  • list-items.xq - A one-line summary of each XForms instance
  • view-item.xq - A one-line summary of each XForms instance

As you can see the actions are the creation of server-side collections and files that are parameterized by the form instance.

Similarities to Ant Build Scripts

The application builder server-side script is similar to Apache build scripts in several ways. With Ant a series of folders and files are created when a build script is executed.

Screen Image

Application Builder (Image: The original uploader was Dmccreary at English Wikibooks ., CC BY-SA 3.0)

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Get each new page of

XForms

Following means one email when a page is added, nothing when a page changes.

Following means one email when a page is added, nothing when a page changes.

Comments

Spinner Logo

Next in XForms

CC BY-SA 4.0
In our example a dashboard may have up to 36 portlets, but best practices usually contain 7 portlets plus or minus one or two. ## Application Design Our dashboard layout will be one of three types: - row oriented where all portlets in a row have the same height - column oriented where all portlets i
CC BY-SA 4.0
XForms, Web Service Tester
CC BY-SA 4.0
These tools are frequently used during the process of creating an enterprise-wide controlled vocabulary. These vocabularies are used for identifying data elements or expressing business rules in a consistent way across multiple organizations. ## Method In this program we will have once instance that
CC BY-SA 4.0
At the end the line items are totaled and an indication made to see if the invoice was paid or not. 123 2008-10-10 Acme Services 123 Main St. Anytown, MN 12345 Acme Consumer 123 Main St. Anytown, MN 12345 Widget 123 100.00 Widget 456 200.00 Widget 789 300.00 net-30 false ## XForms User Interface The
CC BY-SA 4.0
One of the classic examples of a web application program is a calculator. ## Program <html xmlns=" xmlns:xf=" xmlns:ev=" <head> <title>Calculator Sample</title> <xf:model> <xf:instance> <equation xmlns=""> <display>0</display> <displaybuffer>0</displaybuffer> <first>0</first> <second>0</second> <mem
CC BY-SA 4.0
id="xforms_cntrl_source_presumed"> appearance="full" ref="instance('taskoutput')/ fe:source_presumed"> undefined undefined_value id="xforms_cntrl_source_information"> appearance="full" ref="instance('taskoutput')/ fe:source_information"> undefined undefined_value id="xforms_cntrl_defendant_reputatio