Current Record: about #36

About Xataface Table of Contents About Xataface Who is Xataface for? Requirements Xataface 1.1.x and below: Xataface 1.2 and higher ...

Current Record: about #36

About Xataface Table of Contents About Xataface Who is Xataface for? Requirements Xataface 1.1.x and below: Xataface 1.2 and higher ...

about

[Permalink]

About Xataface

Xataface is a flexible and shapable skin that sits on top of MySQL, making it accessible to every-day users. It automatically generates the appropriate forms, lists, and menus for a user to interact with the database without having to know any SQL.

It is a full-featured Web application framework, and gives developers the flexibility to customize the features and behavior of their application via configuration files (using the simple INI-file syntax), templates, and plug-ins. A generic application with no customizations is completely functional, but the developer is free to customize things at his leisure.

Who is Xataface for?

Xataface is for web developers and database administrators who would like to build a front-end for their MySQL database. However the resulting applications are targeted at non-technical users such as secretaries.

Requirements

Xataface 1.1.x and below:

  • MySQL 3.23+
  • PHP 4+

Some advanced features require MySQL version 4.1 or higher.

Xataface 1.2 and higher

  • MySQL 3.23+
  • PHP 5+

Some advanced features require MySQL version 5 or higher.

At a Glance: Your first App

  1. Create a directory for your app.
  2. Copy the xataface directory inside your application directory.
  3. Create a configuration file named conf.ini in your application directory with your database settings:
    [_database]
        host=localhost
        name=mydb
        user=me
        password=mypass
    
    [_tables]
        ; A list of tables to include in your application's menu
        ; These tables must already exist in your database
        people=Profiles
        news=News Articles
  4. Create an .htaccess file in your application directory to prevent access to your conf.ini file:
    <FilesMatch "\.ini$">
    Deny from all
    </FilesMatch>
  5. Create a PHP script in your application directory as an access point for your app. We'll call it index.php:
    <?php
    // Include the Xataface API
    require_once 'xataface/dataface-public-api.php';
    
    // Initialize Xataface framework
    df_init(__FILE__, 'xataface');
        // first parameter is always the same (path to the current script)
        // 2nd parameter is relative URL to xataface directory (used for CSS files and javascripts)
    
    // Create a new application
    $app =& Dataface_Application::getInstance();
    
    // Display the application
    $app->display()
  6. You're done. Your app is ready to use!

This is just the beginning, though. There is no limit to the customizations you can make on your application.

Read the Getting Started Tutorial for more information on developing applications with Xataface.

Product Comparison

Xataface fits a niche that is not well covered by existing apps/frameworks. Xataface is NOT:

  • A database administration system like PHPMyAdmin
  • Simply a software library/Framework like PHPCake
  • Simply a content management system like Drupal
  • A code generator

Xataface is a framework, but it is not a typical framework. Most frameworks require a substantial amount of development before you get a usable application. Xataface, on the other hand, provides you with a fully-functional application with as little as 4 lines of PHP code. It doesn't generate any code so it is easy to maintain your application and expand on it later.

As a development framework, Xataface most closely resembles Django, a python framework for building data-driven applications. As an application, Xataface most closely resembles Filemaker, a popular relational database that makes it easy for the end user to create layouts and manage their data.

Features

General

  • Out-of-the-box Database Front-end - With as little as 4 lines of PHP code, you can have a full-featured web application for your database.
  • Simple, Intuitive User interface - Default application is consistent and simple to use. There is a 'tables' menu, to select a table, and each table has "details", "list", and "find" tabs. Very easy to navigate.
  • Powerful configuration options - You can configure your application details (such as widget types) using simple configuration files.
  • Extendible - You can modify your application as you see fit using configuration files and PHP delegate classes.
  • Hooks - By observing simple conventions you can extend Xataface's functionality with hooks, triggers, and events. E.g. add a function that is called after a record is inserted.
  • Permissions - Powerful, pluggable permissions system.
  • Authentication - Provides login/logout ability. You just specify which table your users are stored in.
  • Relationships - Tell Xataface how your tables are related to one another and it will provide you with more logical functionality for managing your data.
  • Themeable - Xataface uses the Smarty template engine as a base, but extends it with some powerful new features such as extendable templates and theming support.
  • Modular - There are several add-on modules available to extend the features of Xataface even further, and a simple API for writing your own modules.

Editing

  • Automatic Form Generation - Automatically generates appropriate web forms to add new records and edit existing records.
  • Widgets - Support for many different widget types including text fields, text areas, checkboxes, select lists, html editors, grids, file uploads, and more.
  • Configurable - Customize forms using configuration files and delegate classes.
  • Personalizable - Show different forms to different users depending on their permissions and preferences.
  • Add Related Records - Insert records and automatically track their relationships to other tables.
  • Editable Data Grid - Manage your data like a spreadsheet using the DataGrid module.
  • Copy - Copy sets of records.
  • Update Found Set - Update multiple records with one swipe.
  • Fine-grained Permissions - Assign editing permission based on table, record, or field.
  • File uploads - Support for file uploads with storage either in a BLOB field or on the file system.
  • Delete - Delete single record or delete the current found set.

Searching

  • Automatic Find Form - The Xataface find form allows you to search a table on any field.
  • Range Searches - Search for records matching values in a certain range (e.g. find all people between the ages of 20 and 30).
  • Exact Matching - Search for exact matches.
  • Partial Matching - Search for fields that contain a keyword phrase.
  • Multi-field search - There is always a simple search field accessible which searches all fields in the current table. E.g. a search for "Tom" would match any record in the current table that contained the phrase "Tom" in any of its columns.
  • Related Record Searches - Find records that contain related records matching a search term. (E.g. find all people who got an 'A' in a particular course).

Browsing

  • Automatic Details View - Each record has user-friendly details page to browse the contents of the record.
  • AJAX Record Tree - Provides optional AJAX record tree to browse the data in your database by relationships.
  • Expand for More - Quickly expand a row in list view to see the full record details.
  • Drag and Drop Reordering - The details view for a record can be broken up into related sections. Users can reorder these sections via drag and drop.

Exporting

  • RSS - Support for RSS 1.0, 2.0 and Atom feeds of any found set.
  • XML - Export any found set as XML so that the data can be interchanged with other products (e.g. desktop publishing suites).
  • CSV - Export any found set to CSV (comma-separated-value) to open in a spreadsheet application like Excel.
  • JSON - Export any found set to JSON. This feature makes Xataface a good choice for serving the next generation of Web 2.0 AJAX applications.

Internationalization

  • String Internationalization - Xataface fully supports internationalizing your application. It provides you with language files to provide translations of all of the strings and labels in your application.
  • Dynamic Data Translation - Xataface even allows you to internationalize your existing database data without having to change your database structure.
  • Templates - Includes a {translate} tag for Smarty templates to easily translate template text.
  • In the background - You can use Xataface to internationalize any PHP/MySQL website without having to make any drastic changes to your existing code. Just include Xataface as a library and use some of its useful internationalization functions to convert your application into multiple languages.
  • Translation Form - If multiple languages are enabled, Xataface provides a simple translation form to translate content between languages.
  • Translation Status Tracking - Track the status of translations to mark whether they need to be retranslated.

Importing

  • Import Filter API - Using delegate classes, it is easy to define an import filter to import any type of data into the database.
  • User Preview - User can preview imported data before confirming that he wants to import it.

History

  • Optional History Support - If history is enabled, all changes made to any data are recorded.
  • Undo/Redo Support - Easily revert to an earlier version of a record.
  • View Snapshot - Browse previous versions of records.
  • View Diffs - View differences/changes between versions of records, similar to a wiki.

Caching

  • Output cache - Supports output cache that caches output of pages to improve performance dramatically for busy sites. Cache is automatically refreshed whenever changes are made to tables that are used to generate the page.
  • APC Support - If APC (Alternate PHP Cache) is installed, Xataface will automatically use it to cache table configuration information. This tends to increase performance by about 20%.

Security

  • Fine-grained permissions - Define permissions to the entire application, a single table, by the record, or by the field. Each feature has an associated permission that can be allowed or disallowed on a per-user basis.
  • Cascading Permissions - You can very restrictive permissions to the application as a whole and then apply more permission permissions to specific tables or fields that you want uses to be able to access. Table permissions override application permissions. Field permissions override field permissions.
  • Role-based permissions - You can define """roles""" which are sets of permissions that can be assigned to users.
  • Extendable Permissions Model - You can easily define your own permissions and roles, extending existing roles, custom for your application.
  • Built-in Authentication - It is easy to set up login/logout features for your application. Just tell Xataface which table you store your user records in, and Xataface will do the rest.
  • Password Encryption - Xataface supports and is compatible with most of the standard password encryptions including MD5, SHA1, and MySQL Password.
  • Pluggable Authentication - Easy to create your own authentication plugins in case you want to implement your own custom authentication.
  • CAS - Module available for the Yale CAS (Central Authentication Service).
  • LDAP - LDAP authentication module available.
  • HTTP - Optional HTTP login support. Standard login uses a web-based login form, but you can also use HTTP headers for authentication.

Relationships

  • Powerful Relationship Model - It is easy to define relationships between your tables using simple configuration files. Syntax is simple, but the results are powerful.
  • Add New Related Record - Create a new record and add it to a parent record's relationship at the same time. (E.g. create a new "course" record and add it to a teacher's list of taught courses).
  • Add Existing Related Record - Add an existing record to a parent record's relationship. (e.g. Add an existing course record to a teacher's list of taught courses).
  • Remove related record - Remove a record from a relationship. (e.g. remove a course record from a teacher's list of taught courses).

API

Xataface includes a powerful API to allow you to more efficiently work with your database.

  • Data Objects - Provides a simple API to work with database records. Searching, loading, saving, editing, and deleting records supported.

Templates

  • Smarty Template Engine - Xataface uses the Smarty template engine as a base, one of the fastest PHP template engines available.
  • Template Inheritance - You can create templates that inherit from other templates, and replace the content in specified "slots" of the original template. This drastically increases template reuse and development productivity.
  • Cascading Support - All system templates are stored in the Dataface/templates directory. Your application can have its own templates directory where you can place templates to override system templates. All parts of the system can be overridden without modifying the original templates themselves.

Themes

Xataface includes a powerful themes API. You can create multiple looks for your application and switch between them with a simple configuration setting.

REST Support

Xataface's intelligent URL protocols make it a powerful platform for REST web services. You can specify a query directly in the URL to obtain the exact found-set that you want. This is also very useful in standard web applications because you can easily create links to desired parts of your application. Or you can use Xataface to provide missing functionality in your existing applications and link only to the parts of your Xataface app that you need.

History

Xataface (formerly Dataface) was originally created by Steve Hannah in 2005 to increase productivity created data-driven applications for Simon Fraser University. He came from faculty that used Filemaker extensively for their databases. As a PHP developer he preferred open technologies like MySQL as they provided fewer "road blocks", but it was hard to deny the benefits of filemaker when it came to providing users with an instant user interface for their databases. It was difficult to justify spending 3 weeks building an administration console for a MySQL application when it could have been done in 3 hours had Filemaker been used.

Xataface was designed to:

  1. Increase developer productivity to the point where MySQL applications could be created as quickly as Filemaker applications without sacrificing usability and functionality.
  2. Add an abstraction over a database to make is accessible to non-technical users. The secretary shouldn't need to know SQL in order to interact with a database.
  3. Test the limits of PHP and MySQL

As it was built with the intention of providing an alternative for Filemaker, many implementation details and concepts have been inspired by Filemaker. For example, Xataface's implementation of relationships is very similar to Filemaker relationships; as are valuelists. In addition the method of searching follows many Filemaker conventions.

The first application built with Xataface was a group content management system for the Faculty of Applied Sciences at Simon Fraser University. This system was used by faculty to manage their research profiles and their research groups. The database itself pre-existed the Xataface implementation. Xataface was used to build a new administrative interface to the system. Since then Xataface has been used to develop many systems for SFU including website content management systems, auctions, event registration systems, research databases, shopping carts, and more.

Where to go from here

blog comments powered by Disqus
Powered by Xataface
(c) 2005-2024 All rights reserved