Simple Groupware Extension Development
To start with an own extension, it's recommended to check the latest example module available here. All the other extensions can be downloaded without the extension manager here. An extension can include several modules based on sgsML, differential schemas, images, readme files, installation and un-installation procedures, folder structures, etc.
Most of the functionality of a module is built with sgsML. All relevant manuals about sgsML can be found here. Documentation about the extension manager can be found here.
To test and develop a module, it's recommended to put all files under "<sgs-dir>/custom/" and create the "tar.gz" archive from there.
An example folder structure of an extension can look like this:
tar -ztf SimpleGroupware_Example_0.2.tar.gz example/ example/folders.xml example/install.php example/modules.txt example/package.xml example/readme.txt example/uninstall.php example/update.php modules/schema/example.xml
The description of a package is defined in the file package.xml, for example:
<package> <name>example</name> <filename>SimpleGroupware_Example_0.2.tar.gz</filename> <require_version>0.640</require_version> <title>Example 0.2</title> <php_version>5.1</php_version> <size>10240</size> <description> Example is a demonstration module for handling bookmarks. It is similar to the normal bookmarks module, but does not contain categories. A new folder "Example" is created under "/Workspace/Extensions/". <![CDATA[ License: <a target="_blank" href="docs/licenses/gpl_license.txt"> GNU GPL v2</a> Author: Copyright (C) 2010 by Example Author ]]> </description> </package>
The tags are described as follows:
- "name" contains a unique name of the module which is also used for the main folder of a module.
- "filename" sets the filename of the package, finally available on
"http://sourceforge.net/projects/simplgroup/files/simplegroupware_modules/<name>/<filename>". - "size" should be the size of the uncompressed "tar" file of the package in bytes.
- "require_version" describes the minimum version of Simple Groupware that is required to run the module.
- "php_version" has the minimum PHP version which is required to run the module.
- "title" will be displayed in the list of packages in the extension manager.
- "description" holds a multi-line description about the package, it's license and the copyright.
Other important files in the main folder of the module (optional):
- install.php: gets executed during installation
- uninstall.php: gets executed during un-installation
- update.php: gets executed during update
- modules.txt: extends list of modules, used to create or rename folders
(one line per entry, syntax: <module name>|<module displayname>) - sys_modules.txt: extends list of administrative modules, used to create or rename folders
- folders.xml: creates folders automatically during the installation (see folder templates)
- readme.txt: is displayed during the installation
Translations
All files of an extension are translated automatically during the installation. To get strings translated, just use the normal translation blocks, e.g. "{t}Name{/t}". If possible, all extensions should be coded in English. Modules in other languages can be also published, but may be less interesting for the world-wide community. Translation files are not included directly in an extension. They are available within a separate extension containing all translations for all modules.
Release management
Similar to other application stores, all extensions get reviewed before being published. That way, people without programming skills can install extensions without fearing security or stability problems. To build a release, create an archive and upload it to the patch tracker. After the review, the module gets uploaded to the sourceforge repository and is available for everyone through the extension manager.
Interesting extensions