Archive for the ‘Fuel Generator’ Category

The green zone is for loading and unloading only !

Friday, March 16th, 2007

A few days ago me and Korny we started developing a .NET version of FuelGenerator. Which later on I will port it to Cocoa# (Mono and Cocoa). So far the project is going quite well and we managed to implement a minimal version just for MySql. Hopefully in a few weeks we will have a beta version of FuelGenerator for Windows. But until then we still have to setup the main website. Basically the application we have the same functionality as the Perl version except a much nicer interface and it will support custom project files. For integrating it with other data sources we will use plug-ins. At the moment we are still working to fit the bits and pieces of the application. Soon I will post some icons for the application and wait for suggestions.

Putting the wheels in motion

Sunday, March 4th, 2007

Recently I re-installed my operating system and of course I had to re-configure my development environment. After installing all the tools I had to go ahead and retrieve the Perl packages for FuelGenerator. This is when I found a nasty bug with DBD::mysql and the Mac OS X Mysql distribution. First there was a problem with the ‘mysql_config’ path but I managed to fix that
by adding a symlink to it in ‘/usr/local/bin’. But after that I get this


Using DBI 1.54 (for perl 5.008006 on darwin-thread-multi-2level) installed in /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Kriterium:/Users/tudor/Desktop/DBD-mysql-4.003 root# make
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -Os -arch i386 -fno-common -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -O3 -DVERSION=\"4.003\" -DXS_VERSION=\"4.003\" "-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function 'mysql_dr_connect':
dbdimp.c:1671: error: 'ulong' undeclared (first use in this function)
dbdimp.c:1671: error: (Each undeclared identifier is reported only once
dbdimp.c:1671: error: for each function it appears in.)
dbdimp.c:1671: error: parse error before numeric constant
make: *** [dbdimp.o] Error 1

For this one you actually have to edit ‘mysql_com.h’ in ‘/usr/local/mysql/includes’ and add:


typedef unsigned long ulong;

this should solve the problem. Although I had to do a little digging on that, I managed to have it working now. And FuelGenerator resumed it’s function.

Code generation

Saturday, February 3rd, 2007

Three weeks ago I finally started working on the Fuel CMS project after an intense (?!) 7 month laziness. So evidently I started by building my code generator application.

FuelGenerator is built in Perl and at the moment connects only to MySql databases to retrieve information for the current database such as table information (columns and indexes), the information is stored in custom data classes that later on are serialized (JSON) and sent to the template file.

FuelGenerator is a pluggable template system and uses the PHP5 CLI or the erb (Ruby) interpreter. Basically the serialized information is sent to a file called “include file”. The “include file” will deserialize the JSON structure and
include the actual template file in which we have references to the deserialized structure.

Example:

1
2
3
4
$table = json_decode('{TABLE}');	
$parameters = json_decode('{PARAMETERS}');
 
{CONTENT}

{TABLE} represents the definition for the current table and is identified with the JSON info structure for it.
{PARAMETERS} is the JSON structure for the additional template parameters.
{CONTENT} is the content for the template.
All these values are replaced at runtime and then excuted with the specified interpreter, after the execution the generated content is saved into a a file.

I will place a copy of this application for download as soon as I finish the POD (Plain Old Documentation) for the Perl files.