Wiki Application

Foswiki is a structured wiki that acts as an application platform for web-based applications. Specifically it provides database-like manipulation of fields stored on pages, and offers a SQL-like query language to support the embedding reports in wiki pages.

Wiki applications are often called situational applications because they are created ad-hoc by users for very specific needs. For example, users have built Foswiki applications that include call center status boards, to-do lists, inventory systems, employee handbooks, bug trackers, blog applications, discussion forums, status reports with rollups and more.

A fast start:

How to build a WikiApp with DataForms?

This answer assumes you have basic knowledge about Data Forms.

Using the steps below, you will create:
  1. A form definition
  2. A topic creation (HTML) form to automatically attach a data form to a topic
  3. A query search to find topics based on the data fields

Step by step:

Create a data form definition

See Data Form, specifically the section The form table.

As an example we will create the topic "ReadingForm" with these contents:
| *Name*   | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| Title    | text   | 80     |          | Book or article title | |
| Category | select | 1      | ,Interesting,Remarkable,So-so | How you rate this reading material | |
| Author   | text   | 50     |          | Author's last name | |

Enable the form

Add the form in the list of Web forms. This is done by setting the preference WEBFORMS in the Web's WebPreferences (a comma separated list).

If you create a topic, you can always add a form to the topic by choosing "Add form" in the edit screen.

Now we will create an HTML form that does this automatically.

Create an HTML form for easy topic creation

HTML forms have nothing to do with data forms, except that they are a way to create topics with pre-defined values.

Example HTML form:
<form action="%SCRIPTURLPATH{edit}%/%WEB%/" method="post">
Name of the new topic: %BR%
<input type="text" name="topic" class="foswikiInputField" size="32" />

Title of article or book: %BR%
<input type="text" name="Title" class="foswikiInputField" size="32" />

<input type="submit" class="foswikiSubmit" value="Create topic" />
<input type="hidden" name="onlywikiname" value="on" />
<input type="hidden" name="formtemplate" value="ReadingForm" />
<input type="hidden" name="topicparent" value="%TOPIC%" />
Now create a bunch of topics with this form.

Create a query search

To list all topics that have a form named ReadingForm:
 " = 'ReadingForm'"
 format="   * [[$web.$topic][$formfield(Title)]]"

To list all topics where the author name ends in "Auden":
 " = 'ReadingForm' AND Author ~ '*Auden'"
 format="   * [[$web.$topic][$formfield(Title)]]"

VarSEARCH has more information on creating searches.

The develloper documentation may help you to start:

Developer Documentation

Application Developer Topics

Topics for normal users that want to develop Foswiki applications.


Documentation for webmasters, system administrators, project managers, team leaders, and all other users of Foswiki

Background on core functionalities

These scripts are located in the bin and tools directories. This topic describes the interfaces to some of those scripts
Data forms allow you to add structured data to topics. The data stored in the form fields can be used to search and filter topics. The combination of structured data and search queries are the base for building database applications
Foswiki's inline search feature allows flexible formatting of search result. This is a key feature for most Foswiki applications
Description of the format tokens such as $n, $quot, $percent etc used in FormattedSearch and a few other macros.
The %IF% construct gives Foswiki the power to include content in topics based on the value of simple expressions
Include Topics and Web Pages Using %INCLUDE{...}% Macro
Query searches help you search the contents of forms attached to your topics, as well as the values of other meta-data attached to the topic using simple query language
A short introduction to regular expressions
An introduction to searching
Skin templates are used when composing the output from all actions, such as view, edit, and preview. This allows you to change the look and feel of all pages by editing just a few template files. This topic describes the special template directives. Both for Skin developers and for advanced wiki application development.
Template topics are topics that define the default text for new topics. A basic feature is most wiki applications.
A brief introduction to topic template and a list of templates in this web

Extensions, working with extensions

JQueryPlugin enables the use of the jQuery Javascript library in wiki applications and is used by many plugins to create the user interfaces
This plugin enables using special view and edit templates depending on the data form used on the topics
Comment Plugin lets users quickly post comments to a page without an edit/preview/save cycle. The comment forms can be customized and form very advanced user interface for application development
This topic is used by the CommentPlugin as a template file
Edit tables using edit fields, date pickers and drop down boxes
Enables smart Javascript calender for text entry fields. Users can add calendar directly in their own hand-built forms, without having to write any code.
The plain skin is used to get the rendered topic text without any page decoration such as side, top or bottom bars. The text is shown without any markup styles. It can be used to display topic content inside an IFRAME.


List of countries used in the UserForm. Can also be used in Foswiki applications
This is a Foswiki icon library. The graphics can be used in topics and by web applications
Navigation block that displays the current topic, its parent and children (if any). This is intended to be included in other topics, for example in a side navigation bar
List of the plugins currently installed and enabled in this Foswiki site

Example topics and applications

A simple example of a Foswiki application using data forms and a submission page made with an HTML form
An example used in TemplateTopics illustrating how to create a new topic based on a specific template topic
A cookbook with many examples how to use the powerful SEARCH feature in wiki applications. See examples of both regular expression searches, query searches, and the use of formatted output
This topic defines the default left bar in PatternSkin. Each web has its own left bar. If you need to change it please read in PatternSkin how to tailor the bars so they do not get overwritten when you upgrade Foswiki

Core, Skin, and Extensions Developer Topics

Topics for programmers that which to design new skins and develop new extensions for Foswiki.


Documentation for webmasters, system administrators, project managers, team leaders, and all other users of Foswiki
An introduction to developing Plugins
A short introduction to Contribs. Contribs are Extensions to Foswiki that are not plugins
A short introduction to Add-Ons. Add-Ons add functionality with extensions that are not based on the Foswiki scripts
An introduction to skins and skin development

Perl API

The API intended for use by plugin / contrib development, and advanced system integration.
Perl package documentation dynamically generated from perl POD comments. This includes internal classes, in addition to the PublishedAPI.
A ClassMethod is a method that must be called relative to the containing class object
An ObjectMethod is a method that must be called relative to a previous constructed object of the class type
A StaticMethod is a method in a package that can be called without reference to an object of the package type

Background on functionalities

Use internationalised characters within WikiWords and attachment names
Listing of CSS class names emitted from Foswiki core code and standard extensions
Foswiki Javascript support comprises a number of base Javascript files, attached to this topic, that provide support for features in the basic screens, and are used by most skins.
Skin templates are used when composing the output from all actions, such as view, edit, and preview. This allows you to change the look and feel of all pages by editing just a few template files. This topic describes the special template directives. Both for Skin developers and for advanced wiki application development.
Additional data, Foswiki-generated or from forms, may be embedded in the topic text using META: macros


List of the plugins currently installed and enabled in this Foswiki site. Developers can see any code errors in the plugins which is very useful during development
Language selection dropdown. To be included where a language selection is needed, for instance in the top bar or left bar

Skins and extensions

This is the default skin that Foswiki is shipped with. This topic is the entry point for selecting themes and doing tailoring of how your Foswiki installation looks like
This page is a reference for all CSS classes used in PatternSkin.
Cookbook for how to alter the appearance of PatternSkin using CSS. This includes how to change the color scheme, hide the left bar, change the height of the top bar, removing the top bar, etc.
How to customize the apperance of PatternSkin using templates. This includes how to change the site logos, how to change the features of the top and side bars, and how to hide certain user interface elements depending who the user is.
This topic shows the most common elements that you can change in the PatternSkin. Use this topic to see the result of your changes to CSS.
This is a template topic that defines the design and look of the page you use to create a new topic in PatternSkin
The print skin, used for printable pages with a small footer. Other skins, such as PatternSkin, may introduce their own print skin.


This template topic defines the look of the page shown when the user has tried to view a topic that does not exist

More in-depth developer documentation can be found in the supplemental documentation.

Really detailed documentation, includigng how to get started as a core developer, can be found on the Foswiki developer site.

Related Topics

List of documents relevant for the installer and administrator of the Foswiki installation
List of tools available to the Foswiki administrator
List of documents for the everyday user from beginner to advanced user
List of tools the user may need for setting and resetting passwords, changing email address etc.

Você está em RaulHC Projetos TODOWikiApp
Histórico: r1 — última revisão em 26 May 2014, por Aurélio