Artaengine project administrator

This is an amazing tool for creating and administrating Artaengine projects with an interactive interface.

With this tool you can almost do everything explained in the first tutorials via an GUI interface in just few minutes.

By filling some forms you will have the structure of your project created, your config files factory and model PHP files created, even you will have your database ready with tables, relations and views... everything ready in just a few minutes! just go open the files and write the logics and interface of your application.

However there are few things to keep in mind when using this tool. Note that while it is a great tool for starting a project, editing the project files does not come with any guaranty. You may loose or corrupt the projects PHP file, so edit a project on your own risk.

Installing

Steps to get it running:

  • Artaengine project administrator is included with the Artaengine download package http://www.artaengine.com/downloads . On the download page you can see that the latest version of Artaengine project administrator is also available in a separate download for those who have an older version and only need to download the administrator.
  • By default Artaengine project administrator is inside the Artaengine main directory in a directory named /artaengine/admin.
  • Give write permission to the admin directory. The admin will want to write inside /temp directory, project.ini and user.ini files

    It is recommended to set a virtual host on your web server for the admin.

    If you are not using Apache as your web-server then set rewrite rules which are compatible with the ones in the .htaccess file.

    You need to set your web server to send all requests to: /admin/start.php except the static file requests which go to: /admin/browser/resources/images/, /admin/browser/resources/css/ and /admin/browser/resources/js/.

    If placed in a directory named admin inside the arta-engine directory (by default it is there) no config change is needed but if you put it in another location then edit the start.php and config.ini and change the paths.

  • In the browser put the admin address with build/// e.g: http://localhost/arta/build/// or http://dev.arta/build///.

    If errors happen check if the values inside the start.php and config.ini are set to correct. Check if write permission is allowed inside Artaengine project administrator directory.

  • In the browser put the admin address e.g: http://localhost/arta or http://dev.arta.

    The first time you run Artaengine project administrator you will be asked to enter user data. This user will be the super user for Artaengine project administrator. User data are stored inside admin/users.ini.

Notes

Artaengine project administrator is not created secure! it is a tool made to be used by programmers on their local developing machines. It is not recommended to use this tool on the live servers or make it accessible via the Internet.

Make sure Artaengine project administrator has write permission to it's own directory. Artaengine project administrator will want to write inside admin/temp directory, project.ini and user.ini files.

The first time you run project administrator you will be asked to register an account this will be the root account. To enter the project administrator you would need a user and the root user has access to everything. You can later create users with different access to the admin.

Note: project administrator does not employ a sophisticated user permission system, the user data is stored inside an ini file. Only use project administrator on your local machine.

Why does project administrator ask for an email? When a user creates a new project, project administrator will put this email inside the application configs which can be used by the programmer to send errors or logs to. This is optional thought.

New

To create a new Artaengine project you don't need to create any of the config files and directories manually just got to this menu and create everything in a few minutes with the GUI. Artaengine project administrator will create whatever he can for you.

After entering this menu a form will be displayed which inputs the basic configs of your new project such as the project title, directory, etc. Each item is well commented and self explaining. After submitting this form the project directory and configuration will be created, if the admin cant create directories and files you will see an error otherwise the links listed and explained below will appear and you can setup more project components clicking on them.

Databases

If you want to use databases in your project go to this section, you can define one or more database connections.

The object name is the reference to the defined connection, in the source codes you can access the database by that object name $objName = Database::get('objName'); (see the databases tutorial and API).

Note that adding databases to the configs will not add overheads to your projects, thanks to the factory pattern used, a connection and database object will only be created when you first demand the object in your source codes and once created the same connection and object will be used/returned.

Select the advanced checkbox only if you want to use advanced database functions like create/alter table or meta-data getters.

Note that Artaengine project administrator will not create the database, you have to create the database manually.

The database object/connections you add will be listed in boxes, you can later remove them. You can not edit them thought you have to remove and add a new one. Adding a new item with an object name that already exists will replace the older one.

Each box has a connect link, if you click on it the database will be opened by in the admin and you can browse data or change things in the database...

Models

If you have added a database object, then you can define model groups in this section.

You can define one or more model groups, the main reason for this is if you ever have more than one databases and you want each group to use a different database as it's repo.

The model configs are well described, a group name, database object, etc. Keep the optimized options checked unless later on you see errors and problems.

Like the database section after entering the configs a box will be added which has the model configs, which can be removed but not edited, you have to remove and add a new one. Adding a new item with a group name that already exists will replace the older one.

You can create or edit model PHP files here.

Factory and templates

Adding the configs in this section is essential. Without setting factory configs Artaengine can not route requests to factories (handlers i.e. class methods or functions). Artaengine needs to know the directory in which the factories are placed in.

If you don't want to use a template engine you don't have to select a template engine. But you have to enter a dummy template object name anyway, when a template engine is used you can access the template object by this object name otherwise this will only be there to identify the factory configs.

The objects you add will be listed in boxes, you can later remove them. You can not edit them thought you have to remove and add a new one. Adding a new item with an object name that already exists will replace the older one.

When you define a template engine, the template engine object is only created when you demand it in your source codes or when you use the response to get or show a template.

If you select PHP as the template engine, then no object creating will be involve at all.

You can define routes and map them to factories here and special events here

Sessions

To enable and set session params use this section.

i18n

To use and setup gettext use this section. Beside the gettext configs you must add the locales you want to be available in your project.

After submitting this configs the administrator will create the locales directory with empty po files inside them.

Cache

If you want to use caching in your project go to this section, you can define one or more cache objects, each one can use a different engine i.e. file system, APC, MemCache.

The object name is the reference to the defined cache, in the source codes you can access the object by the name. $objName = Cache::get('objName');

Note that adding objects will not add overheads to your projects, thanks to the factory pattern used, an object will only be created when you first demand it in your source codes and once created the same object will be used/returned.

The objects you add will be listed in boxes, you can later remove them. You can not edit them thought you have to remove and add a new one. Adding a new item with an object name that already exists will replace the older one.

Log

If you want to log stuff in your project go to this section, you can define one or more log objects, each one can use a different engine i.e. text, CSV.

The object name is the reference to the defined logger, in the source codes you can access the object by the name. $logObj = Log::get('logObj');

Note that adding objects will not add overheads to your projects, thanks to the factory pattern used, an object will only be created when you first demand it in your source codes and once created the same object will be used/returned.

The objects you add will be listed in boxes, you can later remove them. You can not edit them thought you have to remove and add a new one. Adding a new item with an object name that already exists will replace the older one.

Autoloads

In this section you can add directory paths to the autoload, also you can set the path to a PHP file which contains your own autoloader inside it.

By default Artaengine library directory and model directories are included to the autoload.

Includes

In this section you can add PHP file paths to be included into the project.

Constants

In this section you can add constants and values to be included into the project.

Globals $_GLOBALS

In this section you can add global variables.

Globals Arta::$globals

In this section you can add key/value sets to Arta::$globals.

Mapping URLs to factories

You can map URLs to factories in this part. first you have to select a Factory/Template config (defined in Factory and template) section. Then you can add the routes.

The filled plus icon will add a new item to the top of the list while the hallow plus icon adds a new item to the end of the list.

When you have a new item you can define the URL route by selecting an item from the yellow combo box. The fixed values can contain ? which means "or" (see URL to factory mapping tutorial).

In the factory section if you click click click on the blue "Factory" label then you will see the factory inputs change and you can define factories in different styles. When you select the Class and Method style if you click on the "Class" or "Method" gray labels and if you have parameter paths defined in the URL part, then you will toggle between defining fixed class/factory names or dynamic names which you can select from a combo list, each list item represents the value of a parameter URL path.

You can set permissions, and other attributes to the map.

If you are sure a mapped factory will not use certain resources (e.g. database, session, cache, etc.) then you can un-check that resource. Artaengine manages the resources as efficient as it can but disabling them when not used can still have a tiny performance benefit. You don't have to this enhancements if you are not sure, at the end of the development you can update this configs.

Special events

To define factories(handlers) for events such as exception.

First you have to select a factory/template configuration which you defined before so that the event factories will obey those rules.

In this section an input for each special event exists, each input is fully described to show when the event happens. Each input has a default value which you can change. Each input is set to a factory as "Class.method" After submitting this form, the factories for this events will be created and later on you have write codes to handle this events.

Factory permissions

To put permissions on factory classes and methods. If a user request reaches for a factory class or method and the user doesn't have the required permissions then the factory will not be called and instead special event "Unauthorized user handler" or "Illegal user handler" will be called.

First you have to select a factory/template configuration which you defined before so that the permission configs will be added to that factory configs file.

Add Factory class name or factory class and method name separated by a dot and enter the permissions required to call this factory in front of it. The permissions are string tokens separated by comas. If a factory only requires the user to be signed into the system leave the permission box empty.

Class permissions

To put permissions on any PHP class. If a user requests demands using a class and the user doesn't have the required permissions then the factory will not be called and instead special event "Unauthorized user handler" or "Illegal user handler" will be called.

First you have to select a factory/template configuration which you defined before so that the permission configs will be added to that factory configs file.

Add class name and enter the permissions required for the class to be usable front of it. The permissions are string tokens separated by comas. If a factory only requires the user to be signed into the system leave the permission box empty.

Resources

In this part you can enter resource directories and map a URL to them. This will make an .htaccess file with apache rewrite rules inside it to send all the requests to one PHP file and the resource files to the directories. If you are using a web-server other than Apache you have to set this things by your self. Also this tool currently can only make very simple rewrite rules and is not able to handle complex situations.

Front-end dictionary

You can create the front-end browser dictionary in this section. There are three parts to define template, JavaScript and CSS files. The hallow plus icon will add a branch and the filled plus icon adds a node which you can enter an alias, file-path and URL path. The file-paths can contain APP_DIR string and the URL paths can contain BASE_URL.

To change branch name click on the name.

Clicking on a branch head or the top level template/JavaScript/CSS head will show/hide the branches and nodes under it.

The access key to each node consists of the branch names and the node alias at the end each separated by a "/".

It is enough to enter only the URL paths for JavaScript and CSS files. Only enter the file path if you want the file to be compressed.

Model manager

In this section you can select a model group then you will have the actions shown below:

  • This link will open forms which you can setup a data model with it, define and add data properties, events and add methods which return lists of data property names or/and method names which return data, this methods can be used when rendering forms and tables. Defining this column lists makes changes and maintenance easy since you will only change the model files. After saving this form a model PHP file will be created.
  • Lists models inside the model group.
  • Click on a model from the list and the create model forms will be displayed, so you can edit model specs, data properties and events.
  • If you already have a database and want to create model PHP files from the database tables use this link. First a list of database tables will be displayed which you can select from then the model class names which will be mapped to the tables will be displayed and you can change them. Then you can press the Create models button which will create the model PHP files. Note that this tool will try it's best to create the most suitable model classes but there are certain things it can not know so after this step you have to edit the created models and add additional data or correct some.
  • Connects to the database which is used by the model group.

Build

In this section you can build the project, if no error happens then the project is ready. You can also select which parts of the project to be built.

Update

A list of Artaengine projects (seen by Artaengine project adminitrator) will be displayed, after selecting a project configs explained in the "New" menu will be exposed and you can edit the configs of each section.

There is no guaranty that Artaengine project administrator will not corrupt the files it is writing on. Editing complex PHP files such as models can be challenging. It is recommended to use a software versioning and revision control system or have backups from your files.

Existing

This menu lets you enter a directory which your projects are located in, after pressing the button labeled "Find" it will search for Artaengine based projects and found items will be listed. You can select projects from the list and press the button labeled "Add" to include them in Artaengine project administrator. By adding projects to the administrator they will appear in the Update and Delete menu so you will be able to edit and manage them.

Remove

This menu will list the included projects, you may select and physically remove them from the disk.

Database

Using this menu you can connect to a database. If you have Artaengine projects registered/created in the project administrator then you will see a list of them, by clicking on a project you it will connected to the project database. Also you can connect to a database by entering connection parameters in a box under the project list. After connecting you will have you will be able to work with the database.

This actions can be done on the database:

  • A black box will appear at the end of the page you can write SQL commands inside it an run them. If you run a query on data the data will be displayed in a table above the black box.
  • There will be a combo containing database tables, by selecting a table the data will be shown, you can browse and sort the data. Also some links will be displayed to perform few actions on the table.
  • There will be a combo containing database views, by selecting a view the data will be shown, you can browse and sort the data.
  • There will be a combo containing database views, by selecting a view the data will be shown, you can browse and sort the data.
  • To insert a new row into the table click on the "Insert new row" link. A form will be displayed and you can enter data. NULLABLE fields will have a check-box next to them, to set NULL to a field check the check-box. If you double click on an input a small box will appear which you can select a function from it to manipulate the value inside the input e.g. SHA1. The INSERT SQL will be put inside the black box. you can just produce the SQL or you can also run it.
  • To update a row click on the row in the data table. The rest is similar to the inserting process.
  • Click on the delete icon beside the rows, the rows will be added to a list under the data table. then you can get the DELETE SQL in the black box or you can execute it.
  • Click on the Drop or Truncate table links and a list of tables will appear select the tables and then you can get the SQL in the black box or you can execute it.
  • Click on the Alter table link and some forms will appear which you can change almost all things in the table with them then you can get the ALTER TABLE SQL in the black box and you can execute it.
  • Click on the Create table link and some forms will appear which you can fill in then you can get the CREATE TABLE SQL in the black box and you can execute it.

This small cozy database manager can be useful to perform some basic actions on your database. Anyway it is not a mature tool and enough tests and thinking has not be done on the functions, so you may get raw errors every now and then.

Users

To create, edit and remove users which have access to Artaengine project administrator use this menu.

A list of users and a form will be displayed. To edit a user click on the user and the user data will be filled into the form, click on "Sign up" button and the user will be updated. In the form if you change the "User name" field a new user will be created because User names do not change. To change a User name manually edit the user.ini file. To delete a user click on the delete icon displayed beside each user. To add a new user fill user data inside the form and click "Sign up".

TOP