System Requirements (for Linux)

  • Install in your local Linux machine the latest Java SE Development Kit (JDK).
  • Install and run the following packages:

    mysql-server-5.0, apache2, php5, php5-mysql and libapache2-mod-php5.

Apache server configuration

For convenience, you can configure your local Apache server so that, when requesting

http://localhost/smartgui/

at your browser, it will directly serve the main page of the generated SmartGUI application. In order to do this, edit the Apache configuration file

/etc/apache2/sites-available/default

as follows:

Alias /smartgui/ PATH/
  <Directory "PATH/">
  AllowOverride None
  Options Indexes FollowSymLinks MultiViews
  Order allow,deny
  allow from all
</Directory>

where PATH is the absolute path to the directory

workspace/imdea.smartgui.project/src/www/

Do not forget to restart your local Apache server to apply the new configuration.

Application requirements

The SmartGUI code generator assumes that your local MySQL server includes a user smartgui, with password imdea, and with (unrestricted) create, delete, update, and select privileges. The following statement, for example, create this user:

mysql> grant create, insert, delete, update, select on *.* to smartgui identified by 'imdea';

The SmartGUI's code generator also assumes that your application's data is stored in a database that has been created using the SmartGUI's database plugin, as well as your application's users' names, logins, roles, and passwords.

The SmartGUI's database plugin

Suppose that NAME_COMPONENTUML_MODEL is the name of the ComponentUML model that models your application's database. The SmartGUI's database plugin automatically creates
  • A database NAME_COMPONENTUML_MODEL.
which includes:
  • for each entity NAME_ENTITY in the model NAME_COMPONENTUML_MODEL, a table NAME_ENTITY which contains:
    • a column pk of type mediumint and properties not null and auto_increment, which is the primary key for the table NAME_ENTITY; and,
  • for each attribute NAME_ATTRIBUTE of the entity NAME_ENTITY in the model NAME_COMPONENTUML_MODEL, a column NAME_ATTRIBUTE with type varchar(50) in the table NAME_ENTITY.
  • a table login, with columns pk (primary key), name, user, password, and role.

Example

Suppose that the application's data is modeled by the following ComponentUML model:

A data-system for storaging employee information
Then, the SmartGUI's database plugin generates a file DB.sql, within the directory imdea.smartgui.project/src/database/, which contains the following SQL script:

CREATE database IF NOT EXISTS Employee;

USE Employee;

CREATE table Person(pk mediumint not null auto_increment, name VARCHAR(50),phone VARCHAR(50),salary VARCHAR(50), primary key (pk));

CREATE table login(pk mediumint not null auto_increment, name varchar(50), user varchar(50), password varchar(50), role varchar(50), primary key (pk));

To execute this script you can use the following command:

mysql> source DB.sql;