Dataface 0.7 comes with loads of new features. This tutorial provides a glance at these features and some instructions on how to use them.
Overview
A succinct list of the new features in Xataface 0.7 and brief descriptions of what they are for.
Xataface 0.7 comes with a pile of new features that extends the flexibility, stability, and extensibility of Xataface applications.
A bird's eye view:
Update Set / Update Selected Records
It is common to want to update the values in a whole set of records to the same value. For example, if you want to change the value of the status field in a set of records to "Approved", you probably don't want to have to click on each record and set the value individually. With Xataface 0.7, you can do a find for the records you want to change, then use the Update Set action to update all of the records in one shot.
Copy Set / Copy Selected Records
The Copy action is identical to the Update action, except, the selected records are copied to new records.
Comprehensive Surrogate View support (Requires MySQL 4.1 or higher)
Xataface 0.6 allowed developers to add a __sql__ value to their fields.ini file to specify an SQL query that can be used to fetch the records in a table. This allowed developers to append calculated or additional fields to the table that would appear in the list and details views of the application. Though useful, this feature was very limited since it would provide the same query for all users. Xataface 0.7 adds an optional __sql__() method to the delegate class that serves the same purpose and can override the __sql__ value in the fields.ini file. The benefit of defining this query in PHP is that you can conditionally return different queries in different contexts (particularly for different users). When coupled with security filters, this is an extremely powerful feature and allows developers to introduce seamless user spaces into their application.
Output Caching
Rendering a page can involve quite a lot of work. All used table definitions need to be loaded, permissions need to be checked, and templates need to be rendered. High-traffic sites could cause large server loads. Xataface 0.7 has an optional output cache that can improve performance dramatically. When the output cache is enabled, Xataface only works hard the first time a page is requested by a user. It caches the finished product in the database so that the next time that page is requested, the page will be delivered directly from cache. If the database has been updated since the page was cached, it render the page again, so you don't have to worry about the cache preventing changes to the site from becoming public. The output cache also supports GZIP compression for compliant browsers so that download performance can also be improved.
Themes
Xataface has always provided a very flexible templating system that allows you to override any template with your own template. It goes a step further in 0.7 by adding theme support. You can now develop themes for your database that can be distributed and used on other databases. Themes can be enabled with a single switch in the conf.ini file, and multiple themes can also be stacked so that more than one theme can be combined to achieve a desired effect. A theme is generally distributed as a folder with templates, images, stylesheets and javascripts.
Modules
Xataface now has a comprehensive module API that allows developers to create modules that can be distributed and used on multiple applications. Modules can contain templates, actions, language definitions, delegate methods, and more.
Overrideable Actions
Xataface 0.7 now allows you to override individual properties of actions in the core. For example, if you want to change the template for the list action, or change the permission on the view action, or change the order of different actions, you can do this easily in your application's INI files. Since tables can have their own actions.ini files, you can also override actions on a table-by-table basis.
New Improved View tab
The View tab in Xataface has undergone major changes to become more useful out of the box. In previous versions of Xataface the view tab was so basic that most developers would just override it with a custom table-specific implementation of their own. Now the view tab should be good enough and flexible enough to use as in live applications.
Alternative list summary view
Xataface's list view has always been a table reflecting the rows and columns of the current result set. Some applications work better with a summary view (not tabular) where the rows don't necessarily have columns, they are more free-format. Xataface 0.7 allows you to use an alternate summary list view for your applications or only for specific tables.
Custom Cell Rendering for List view
Many have been asking about ways to customize the output for fields in list view. Xataface 0.7 provides the %fieldname%__renderCell() method to allow you to customize this on a table-by-table basis.
APC (Alternate PHP Cache) Optimization
Alternate PHP Cache is a PECL extension that allows PHP source to be cached as byte-code, which can improve performance by 10 to 50 times the normal performance. This extension can also be used to cache configuration information so that it doesn't need to be loaded each time a page is requested. Xataface 0.7 incorporates some optimizations so that the INI files will be cached as byte code if APC is installed. This can also improve performance dramatically. If you have APC installed, Xataface automatically uses it.
German & French Translations
Thanks to Daniel Siefert and Jean Carfantan for translating Xataface into German and French respectively. Xataface 0.7 is fully internationalized and can be translated into any language by simply copying the english language file and translating it.
More Delegate Methods
Xataface 0.7 offers much more control for the developer of the way the application looks and works by way of delegate class methods.
More documentation on these new features to come....