[Gllug] Automatic CMS Generation: Ideas/Experience?

Walter Stanish walter.stanish at saffrondigital.com
Fri Aug 21 10:35:21 UTC 2009


Hi all,

This is an admittedly ambitious and error prone task, and will never
provide a 'silver bullet' solution, but does anyone have experience
or ideas around automatically generating web based content management
systems (CMS) from existing, prepopulated databases?

Basically I'm sick of writing/tweaking custom DB CMSs over time, so
I'm attempting to build a tool to automate the process.  I've already
got a proof of concept going, which works alright but now needs some
extra work (deep thinking! database driver abstraction! etc...)

My approach is to generate a default UI using detected database 
characteristics (foreign key relationships, various key types, 
column types, etc.) with support for add/remove/edit/sort and
some degree of 'prettification' (icons, capitalisation, etc.).

The default UI can then be reconfigured by storing preferences
against that particular database, for example to hide particular
tables or columns, or to provide dependent records as part of a
parent record (think 'articles' and 'article_names' tables,
the latter becomes a set of fields against each record of the
former).

A proof of concept is now working.

Just to second-guess possible responses, I am aware of the 'agile 
frameworks' of late (RoR, CakePHP, etc.) but this type of tool is not
really appropriate for two reasons...

 1. I'm not much of a fan of code generation, preferring to work
    at a more abstract level (eg: in domain-specific languages) rather
    than deal with large volumes of 'stupid' code.  I find this
    approach more efficient (more done in less time, and easier to 
    maintain).
 
 2. Frequently I have to write or rewrite CMSs against established
    databases rather than developing a DB+CMS from scratch.  (Though
    some 'agile frameworks' have some degree of DB reverse engineering
    support, they still wind up generating loads of code.  See #1)

Now that the initial version is running (implemented against MySQL /
InnoDB with proper foreign key relationships only), I'm working on
extending the design to add some nice features.  The general idea is:

                 "CMS generator"
         _________________________________
        |                                 |
[users]-|-[ui generator]-[db abstraction]-|-[existing database]
        |       |                         |
        | [internal datastore]            |
        |_________________________________|

The 'ui generator' is the bulk of the codebase.  The 'internal
datastore' stores a list of available databases to render UIs
for, related authentication credentials, plus a separate set of
authentication credentials for authenticating end users to the
CMS, UI customisation preferences against each database, etc...
 
Features I'm looking to add:
 - Database abstraction (could work with any SQL implementation, or
    possibly any other datastore that can map its contents to a
    generic '(dbs)+tables+columns'-style interface.  The current
    proof of concept only works with MySQL/InnoDB w/foreign keys)
 - Flexible authentication models (CMS enforced)
 - Proper per-database UI customisation preferences (hide a table,
    subsume dependent records in to parent table UI, etc.)
 - Framework/database type detection.  (Some kind of database
    structure fingerprint could be matched, then a preconfigured
    set of UI customisation preferences could be automatically
    deployed, removing the need for everyone on a particular
    framework to perform their own configuration)
 - Better filesystem integration (handle filenames stored in
    databases elegantly, perhaps provide options for upload/etc.) 

After scouring the web for information I've been unable to locate any
projects along this line (maybe I used the wrong search terms?), so
I'd like to ask for input/ideas from this group.  Has anyone seen
other projects along this line?  Would anyone else find such a project
useful?  Any recommendations on relevant texts to do with general
database / database UI theory would also be great (I'm in one of
those abstract-thinking modes right now).

Cheers.

- Walter

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list