A sample interface
A sample interface
The following form has been completely generated by beContent. It is about the management of documents, thus the system is able of uploading files which are stored in the database. Documents consists of
- Title, the title of the document which is requite to be stored
- Authors, the author(s) of the document
- Type, documents can be archived according to different categories, for instance papers, slides, manuals, ecc
- Note, it is a HTML text
- File, the file to be uploaded
- Attachment, it specified the way the document can be downloaded (by opening the helper application or showing whether to save it on the disk or launching the application)
- Position, documents can be ordered according to an arbitrary ordering which is specified by pressing the up and down button.

The code for generating the above application is very compact and has a declarative nature, since it specifies the form elements.
session_start();
require "include/template.inc.php";
require "include/menu.inc.php";
require "include/beContent.inc.php";
require "include/auth.inc.php";
$main = new Template("dtml/frame.html");
$form = new Form("dataEntry",$docEntity);
$form->addSection("Documentation Management");
$form->addText("title", "Title", 60, MANDATORY);
$form->addText("authors", "Authors", 60, MANDATORY);
$form->addSelectFromReference($categoryEntity,"category", "Type", MANDATORY);
$form->addEditor("note", "Note", 15, 60);
$form->addFile("file", "File");
$form->addCheck("Attachment","Yes:attachment:*:CHECKED");
$form->addPosition("position", "Position", "title");
if (!isset($_REQUEST['action'])) {
$_REQUEST['action'] = "edit";
}
switch($_REQUEST['action']) {
case "add":
$main->setContent("body",$form->addItem());
break;
case "edit":
$main->setContent("body",$form->editItem());
break;
}
Menu::setMenu();
$main->close();
?>
[...]
/* DOCUMENTATION CATEGORY */
$categoryEntity = new Entity($database, "categories");
$categoryEntity->setPresentation("name");
$categoryEntity->addField("name", VARCHAR, 100);
$categoryEntity->addField("des", TEXT);
$categoryEntity->connect();
/* DOCUMENTATION */
$docEntity = new Entity($database,"documentation", WITH_OWNER);
$docEntity->setPresentation("title");
$docEntity->addField("title", VARCHAR, 255);
$docEntity->addField("authors", VARCHAR, 255);
$docEntity->addReference($categoryEntity, "category");
$docEntity->addField("note", TEXT);
$docEntity->addField("file", FILE);
$docEntity->addField("attachment", VARCHAR, 1);
$docEntity->addField("position", POSITION);
$docEntity->connect();
/* PLATFORM */
$platformEntity = new Entity($database,"platforms");
$platformEntity->setPresentation("name");
$platformEntity->addField("name", VARCHAR, 100);
$platformEntity->addField("des", TEXT);
$platformEntity->connect();
/* LICENSES */
$licenseEntity = new Entity($database,"licenses");
$licenseEntity->setPresentation("acronym","name");
$licenseEntity->addField("name", VARCHAR, 100);
$licenseEntity->addField("acronym", VARCHAR, 20);
$licenseEntity->addField("version", VARCHAR, 20);
$licenseEntity->addField("des", TEXT);
$licenseEntity->addField("link", VARCHAR, 255);
$licenseEntity->connect();
[...]
/* DOCUMENTATION CATEGORY */
$categoryEntity = new Entity($database, "categories");
$categoryEntity->setPresentation("name");
$categoryEntity->addField("name", VARCHAR, 100);
$categoryEntity->addField("des", TEXT);
$categoryEntity->connect();
/* DOCUMENTATION */
$docEntity = new Entity($database,"documentation", WITH_OWNER);
$docEntity->setPresentation("title");
$docEntity->addField("title", VARCHAR, 255);
$docEntity->addField("authors", VARCHAR, 255);
$docEntity->addReference($categoryEntity, "category");
$docEntity->addField("note", TEXT);
$docEntity->addField("file", FILE);
$docEntity->addField("attachment", VARCHAR, 1);
$docEntity->addField("position", POSITION);
$docEntity->connect();
/* PLATFORM */
$platformEntity = new Entity($database,"platforms");
$platformEntity->setPresentation("name");
$platformEntity->addField("name", VARCHAR, 100);
$platformEntity->addField("des", TEXT);
$platformEntity->connect();
/* LICENSES */
$licenseEntity = new Entity($database,"licenses");
$licenseEntity->setPresentation("acronym","name");
$licenseEntity->addField("name", VARCHAR, 100);
$licenseEntity->addField("acronym", VARCHAR, 20);
$licenseEntity->addField("version", VARCHAR, 20);
$licenseEntity->addField("des", TEXT);
$licenseEntity->addField("link", VARCHAR, 255);
$licenseEntity->connect();
[...]
