Mlam main page

SourceForge Logo

Little note from the redactor, my natural language is french, so i apologize for the probable incoherences in this text
What's inside mlam ?

Ok, now let's describe more precisely the benefits of mlam :)

Overall presentation
First of all, after defining a structure (calling optional sub structures), 3 lines are necessary to create a php page handling an infinite number of data from a database. These data are presented in a table generated automatically. This php page handles the creation and the update of all these data. Moreover, mlam does its best to ensure that the data entered match the specification of the database. When data are submitted, mlam makes sure that each data matches the row property in mysql. In case of trouble, mlam shows the current screen with all the data submitted (allowing to correct them), and shows a warning message explaining what went wrong. Mlam may talk with the user in his own language, provided the translation of all the message is present. Mlam uses a specific file containing all the messages for the user. It is very easy to make a translation of this file and tell mlam to use it. Mlam allows the developpers to define precisely the visual presentation of the tables generated (thanks to a css file with specific tags). Mlam allows the developper to add what he wants in the php page (this is some kind of an opened tool), and lastly mlam offers many different way to handle the same type of data (is a bigint representing a true number or an id of another data in another table for instance?). Mlam allows also different ways to handle the data in a creation or update process. If you begin to think that the definition of the structure may be difficult, you're completely right. That's why mlam comes with a specific tool to create and edit all your structures without to edit this file! And because this kind of tool is generally limited only to a few people, there's an internal locking process forcing the identification of the user to access any page using mlam. I hope it's a little more clear now :)

What options for datatypes?
Note : the following datatypes are the types in mysql
int - tinyint - smallint - float - double - real - decimal - numeric
The options are : size of this box and max number of characters allowed.
(1) : default appearance
(2) : size limited to 3 characters
(3) : number of editable characters limited at 3
The options can be combined.
The verification routines work, with some exceptions for some floating point
types with very big values. All the internal details of the types definition like int(11)
are implemented for value verifications.
Various ways to handle this type.

bigint - mediumint - integer
If this data is indeed a number, it is handled just like an integer (or equivalent) type. That means the options (1), (2) and (3).
But it may also be used as a foreign key (the values contained in this data are primary keys value in another table). I'll try to be clear, so we will consider here 2 tables (named table_a and table_b), and more specifically a row in table_a (row_a). Each value in row_a represents a data in table_b (so it is the value of the id of this data in table_b). Mlam provides various ways to handle this case, mainly because there are a lot of possibilities, presented for each option.

Various ways to handle this type.
(4) : list of the available data
This option presents all the elements available in table_b. Mlam offers the possibility to choose the row shown in this listing (one of the row in table_b), and offers also the option to specify the row used to order the data. It may be the same one (show the row name from table_b ordered by this row), but another one (show the row name ordered from a row date).
(5) : Direct external insertion and link
In option, mlam allows the user to enter a new data. When submitting this value, a new data will be created in table_b, ant it will be linked in the current data in table_a. This option works only for one row in the table.
Note : This option is good unless there are a lot of data to show.

option : entering new value (5)
(6) : hierarchical list of the available data
The main concept is the same as (4), but the data shown have a father-son architecture. That means that table_b contains one specific row (for instance father_row) which represents the "father" of the current row. If this value is not present, the data is considered as a main father, and all the sons are presented below their father (with a sign '+' preceding their value). To use this option, you have just to specify to mlam what is father_row.

(7) : searching tool
If the numbers of values in table_b is too high to show all of them in a list, the only way to allow the linkage of one data of table_b is to look for it. So mlam provides an integrated search tool.
The search is done of any number of rows you want in table_b. You only have to select the fields in which you want to search, and give the indications you want to see for each field (for instance 'look for names'). Mlam automatically provides correct search options, depending of the type of the fields (see the difference between a number field and text fields for instance).
The user has the possibility to give one or more data to look for. Of he gives more than one data, the search engine tries to find results matching all the data. The result page is also configurable. There's no limit in the number and order of the rows shown (except the number of rows in table_b). There's also a limit in the number of results shown in the page, with the classic links to see the following (and preceding) results. Each result offers a checkbox to indicate that this is the value to link in table_a.
Mlam has here another possibility : allowing the creation of a new data in table_b, and then automatic link to the previous data in table_a. This is done simply by providing mlam a structure defining how to handle the data in table_b. It will be used to edit the data in table_b.
So with only one php page (and 3 php lines), you have the possibility to edit one table, search for data in another table, and edit a new data in this other table, to finally link it in the original table!

search for values in field 1 :
search numbers :
> <
search for values in field 2 : (7)
(8) : radio button
This presentation is meant to be used when table_b contain only a few number of elements. All the elements of the table are presented here, showing the values from a selected row, ordered eventually from this row or another one (see (4)).
(9) : complete list
Once again, this is better to use this option where the number of elements in table_b is low. The options are almost the same as (8), but mlam must know how many elements to show to use this option (this is in html the same as (4) with a fixed number of selections).

option 1
option 2(8)
option 3
(10) : picture selection
This method is useful when the data in table_b are representing pictures (typically one of the rows is the name of the file, and other rows may represent the width and height...). To make it easier to select a correct picture, mlam provides this special listing. All the pictures are listed with the usual options (selection of the row to show and an optional row to order the list). When the user selects an element in the list, the corresponding picture is loaded to be shown just below the list. It helps considerably to verify the picture to be linked.

visualisation of the picture selected(10)

date - datetime - timestamp
The options are basically the same as for the integers. So mlam offers the possibility to deal with the size of the input box. Mlam verifies that the data submitted are valid (mysql doesn't seem to verify anything, it just set NULL if the value is incorrect). Mlam offers also to save the current date when the data are submitted. It is very useful if you want to keep the creation and last update dates of your data.
char - varchar - tinyblob - tinytext
If the data consists really of just text, the options remain the same as for the integers (personalizing the size and the maximum of characters allowed for the input box). But this data can also be used to represent data files or even more precisely pictures files. Mlam verifies that the number of characters entered isn't superior to the row property before saving the data.
Very important note : when using this type of option, don't forget to add encode="multipart/form-data" in your form definition
1 : generic files
Mlam needs to know the directory where it will upload the files and the url matching this directory. With these informations, mlam handles the value in the current row as the name of the file. When a new file is uploaded, the previous one is deleted from the server.
2 : picture files
These files can also be treated just like the generic files, but some useful functions are provided if ImageMagick (or gd) is installed on your system. Don't hesitate to take a look at ImageMagick's homepage if the following options seem to match your needs, because the result is much better than with Gd library
With ImageMagick installed, mlam must know where remains the utility convert to allow you to create thumbnails of all the picture uploaded with your administration tool. With php compiled with gd, it will directly use the gd functions. For each picture uploaded, you can manage as many thumbnails as you want. Mlam doesn't change the original picture (saved in the indicated directory for upload). Mlam can reduce the size of each uploaded picture to save also the reduced picture in a subdirectory. For each thumbnail, mlam must know the name of the subdirectory and the biggest size allowed for the height and the width of the pictures (in pixel). Each picture uploaded is resized (conserving the original ratio) and is saved in the specific subdirectory conserving the original filename. When showing the current picture, mlam offers the possibility to select what thumbnail to show if desired, and it provides the accurate links to all the other formats.
blob - text - tinyblob - tinytext
This type of data contains more than 256 characters. It is handled by mlam just like (1). Mlam allows to define the size of this input, by providing the number of rows and the number of cols of this structure.
For the user using internet explorer 5 and above, mlam integrates a direct html edition. This a special activex working only with internet explorer 5. You may see an sample of the capabilities of this feature at this microsoft msdn page. The functions implemented in mlam are : bold, italic, underline, html link. Optionally, by providing a directory and the matching url for this directory, mlam provides mechanism to insert (by drag and drop) pictures in the text edited.

multi link tables
I don't remember exactly the correct term, so I will first explain what I'm talking about with a little example. We consider here one table named project, and another table named developper. Each table contains their own rows (name_project, type_project, name_developper...). The idea is to link one project to the developper(s) working on this project. There's no limitation in the number of developpers working on a project, so we won't create specific rows in the table project for linking the developpers, as it was done in (4) for instance. The only accurate way is to create a specific table which will be used to link a project and a developper. Let's call this table link_project_developper (I know, this was mind consuming to find this name). Mlam is able to handle this kind of link, but the following properties must be found :
- the link table (here link_project_developper) must have a primary key (with auto increment)
- the link table (here link_project_developper) must have two rows considered as external key (that means bigint, mediumint or integer types).
Mlam handles this link table like (11). The element to provide to mlam are :
1: the name of the table linking the data with its primary ID
2: the name of the table linked with with its primary ID
3: the row shown from the table linked (this row is presented ordered)
All these manipulations are simplified thanks to the administration tool. Mlam shows the list of all the available data, minus the already linked data. Then comes the data linked, with the possibility to unlink them (without deleting them).
Moreover, if the link table contains an integer field, this field can be use to sort the data linked (as you can see on the sample). You just have to specify this field in the administration tool to make it available.
Picture option
If the table linked is used to represent pictures (for instance photos of our developpers), they will be shown when selected. Mlam must know the directory containing the pictures, and the matching url to this directory. Once again, this is easier to give these details while using the administration tool.

select the element to supress
developper 3  
developper 5  (11)
You have also the possibility to use a search engine to look for data to link (see 12). It works exactly like the search engine for the "simple" external keys, but here it deals with the link table.
select the element to supress
developper 3  
developper 5  (12)
Search for names

enum - set
These types are not supported by mlam (yet).