Hub Nexus
Opdateret

ForfatterIngen forfatter endnuOvertag den

Ser du noget at forbedre? Foreslå en ændring.

Støtte

I XForms · side 117 af 137

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.

I disse publikationerXForms

SprogEnglish

Licens: CC BY-SA 4.0 · Bearbejdet efter en.wikibooks.org

1

0

0

0

Spinner Logo

Kommentarer

Spinner Logo
Version: 2CC0 1.0 — public domain
The runaway star that left the Tarantula Nebula
Version: 2CC0 1.0 — public domain
The Blackwell School, where segregation had no law behind it
Version: 2CC0 1.0 — public domain
The Eagle Nebula, seen in the infrared
Version: 2CC0 1.0 — public domain
The house where the Equal Rights Amendment was written
Version: 2CC0 1.0 — public domain
The Aleutians, the forgotten front of the Second World War
Version: 2CC0 1.0 — public domain
The Cosmic Cliffs are not cliffs