Difference between revisions of "Developing"
Line 24: | Line 24: | ||
** [https://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Objects/zeosdbo-6.6.6-stable/ZEOSDBO-6.6.6-stable.zip/download Download] the package and unzip to any directory. | ** [https://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Objects/zeosdbo-6.6.6-stable/ZEOSDBO-6.6.6-stable.zip/download Download] the package and unzip to any directory. | ||
** [http://gestinux.svn.sourceforge.net/viewvc/gestinux/trunk/util/zeos/ZClasses.pas Download a patch for src/core/ZClasses.pas] and replace the file, to work with FPC >= 2.6 (See [http://zeos.firmos.at/viewtopic.php?t=3073 this discussion] - I hope Zeos team will make this patch available) | ** [http://gestinux.svn.sourceforge.net/viewvc/gestinux/trunk/util/zeos/ZClasses.pas Download a patch for src/core/ZClasses.pas] and replace the file, to work with FPC >= 2.6 (See [http://zeos.firmos.at/viewtopic.php?t=3073 this discussion] - I hope Zeos team will make this patch available) | ||
− | ** [http://zeos.firmos.at/download.php?id= | + | ** [http://zeos.firmos.at/download.php?id=662 Download a patch for src/plain/ZPlainMySql5.pas] and replace the file to make installation easier with MySql 5.1 on Linux Ubuntu >= 09.10 (See [http://zeos.firmos.at/viewtopic.php?p=15885 this discussion]) |
** For 64 bits compilers : another patch or ZEOS 7 is requested. | ** For 64 bits compilers : another patch or ZEOS 7 is requested. | ||
** Then, open packages/lazarus/zcomponent.lpk and click Install | ** Then, open packages/lazarus/zcomponent.lpk and click Install |
Revision as of 19:04, 22 August 2012
FrançaisDeveloping Gestinux
You are welcome to help making Gestinux better.
Here are some rules to maintain the project. We can discuss about it in the development forum.
Gestinux is developed with Lazarus and FreePascal.
Get the sources
Sources are managed with subversion. You must use a SVN Client and connect to it as explained by SourceForge.
Version 0.5 with only a small accounting is now stable. Download it only to fix bugs.
Version 1.0 is not finished and currently released as a beta version. The svn branch is "trunk".
Packages used
Releases 0.5 and trunk should compile with the following packages. You can use more recent versions of the packages, but at your own risks !
- Zeos DBO 6.6.6
- Download the package and unzip to any directory.
- Download a patch for src/core/ZClasses.pas and replace the file, to work with FPC >= 2.6 (See this discussion - I hope Zeos team will make this patch available)
- Download a patch for src/plain/ZPlainMySql5.pas and replace the file to make installation easier with MySql 5.1 on Linux Ubuntu >= 09.10 (See this discussion)
- For 64 bits compilers : another patch or ZEOS 7 is requested.
- Then, open packages/lazarus/zcomponent.lpk and click Install
- Power PDF 0.9.7.1
- Download the package and unzip to any directory.
- Open pack_powerpdf.lpk
- Install.
- LazReport 0.9.8
- Open components/lazreport/source/lazreport.lpk
- In Options, IDE integration, select "automatically rebuild as needed"
- Install.
- LazReportPDFExport 0.7
- Open components/lazreport/source/addons/pdfexport/lazreportpdfexport.lpk in Lazarus installed files.
- In Options, IDE integration, select "automatically rebuild as needed"
- Install
- Gestinux_util : package containing components used by gestinux
- Open util/gestinux_util.dpk in the gestinux sources
- Install.
- This will create a Tab named Gestinux in the objects palette.
Rules for development
- Source must be compilable with : Lazarus 0.9.30.4, FPC 2.4.6
- Do not use features available only in Lazarus or other SVN.
- Use only English for variable names, comments and of course outputs.
- Use Jedi Code formater to indent your sources, with default options.
- Read gestinux_util documentation, and do not use component Txxxx when there is a TGxxxx in this package
Ask to be granted a developer profile in SourceForge. Don't forget to lock the files before any change.
What to do
Everyone can help ! If you are a beginner, there are some simple things to do, and this would save time. For gurus, we do need better components.
You can look at Tracker to see what is the most useful to do. But some coordination with the project manager is better before you start anything !
Translation system
Refer to the translation documentation page to learn how you can use it and make translations,
Database
Supported DBMS
MySql 5 and PostgreSQL are supported. My Sql because it is common and administration is simpler. PostgreSql because it is a true free software. In the future, we may try other DBMS, but it requires a larger team to go forward.
In the main sources, avoid SQL statements specific to MySQL or Postgres. When there is no alternative, compatibility procedures should be made. They are all centralized in one unit (unitdatamodule.pas for now).
Table and fields definitions and properties
In Gestinux_util there is a TGTable component used to store metadata of tables used in Gestinux. With this component, there is no need to store table definitions elsewhere, and no sql script is required to initialize or upgrade the database.
The database and tables are created by the main executable, as specified in unitdatamodule.pas properties of TGTable and TFields objects.
Index and constraints are stored in the "properties" property of TGTable, with special processing depending on the DBMS.
To create a new table
This is for a new functionnality in the application, and only in trunk version.
- Create the table and all it's index and constraints with MySql Query Browser or any other MySql client (not PostgreSQL).
- The following types can be used only. If other types are necessary, some development must be made in datamodule.
- Integer Autoinc
- Integer, smallint
- Varchar
- Timestamp
- Date, Datetime
- Blob
- Always start with an Id field, Autoinc and Primary key
- Always end with an UpdateDate field, TimeStamp default current_timestamp on update current_timestamp
- The following types can be used only. If other types are necessary, some development must be made in datamodule.
- Create a TGTable object in Datamodule, with connexion set to open the previous database.
- Create a new computed field AutoInc, correct it's Name (bug), set it Required and set the field to fkData.
- Add all other fields.
- Write the index and constraint instructions in the property Properties of the TGTable.
- In DataModule1.DbAfterConnect event, add to TGTable.Check.
- Test it and check the structure and data created in the query browser !
To add a new field or index or constraint
To add a new data field to an existing table :
- Create the new field using any MySql client, with the required and default properties as expected.
- Add the field in the TGTable object
- If needed add a line in the property Table.Properties to define index and/or constraint.
- After that, on a new database, the missing field will be added by TGTable.Check. Test it with old databases, and check in MySql.
Other changes
Some changes of datatype, required and default properties are possible, if really necessary. They must be compatible with older release.
No field or index deletion is possible.