You are on page 1of 3

LINUXUSER

Workspace: Simple Groupware

Building a custom groupware solution with Simple Groupware

WORKSPACE
If you have a need for custom groupware, try rolling your own with the Simple Groupware suite. BY DMITRI POPOV

inding the right groupware solution can be a tricky business. At first sight, any workgroup requires the same set of applications, such as email, a calendar, a project management tool, and a message board. But in reality, each and every workgroup has its own requirements. The special needs for your workgroup could consist of anything from a couple extra fields for project management data to a custom-designed task module. You may be thinking that a user who chooses an Open Source groupware solution should be able to just tweak it as much as they like so the final result fits their needs perfectly. The truth is, however, few users have the knowledge and time to implement the required changes. A group of freelance writers, for instance, probably wont spend their free time programming PHP or writing SQL queries. Most groups must therefore make do with existing groupware solutions and adjust their work habits to the software. But it really doesnt have to be that way. If you are looking for a groupware

suite you can use on your own terms, Simple Groupware [1] might be the answer. The name Simple Groupware doesnt really do this suite justice, since it is much more than a mere collection of groupware applications. Of course, Simple Groupware offers all the standard modules you would expect from a professional groupware solution, but Simple Groupware also has its own sgsML language that glues all the pieces together and offers an easy, yet extremely effective means for creating new groupware applications and customizing existing components.

Getting started with Simple Groupware


Not surprisingly, Simple Groupware is written in PHP and uses MySQL as its backend, so you can install Simple Groupware onto the standard LAMP (Linux, Apache, MySQL, and PHP) stack. The latest version of Simple Groupware also supports the PostgreSQL database. The installation process couldnt be easier; you can find detailed

installation instructions at [2]. Once youve installed Simple Groupware, point your browser to it (e.g., http:// serveraddress/sgs/, assuming youve installed the software into the sgs folder) and log in as administrator. Although Simple Groupware offers a standard set of groupware applications (such as calendar, project manager, contacts, files, etc.), the design is different from other groupware solutions. Each application and module inside Simple Groupware is represented as a folder. A folder can be either, well, a folder or an application. In the latter case, the folder has what is called a mountpoint. For example, the Workspace folder in the default installation is a standard folder containing, among other things, the Email application folder. To add an email account, you have to create a POP3 or IMAP mountpoint. To create a mountpoint, select the Email folder, click on the Mountpoint item, select POP3 or IMAP from the type dropdown list, and fill in the rest of the fields with the requested information. Click OK to save the settings, and the account is added to the Email folder. This folder metaphor may seem a bit unusual in the beginning, but Simple Groupware's folders provide virtually unlimited flexibility. You can create as

78

ISSUE 71 OCTOBER 2006

W W W. L I N U X - M A G A Z I N E . C O M

Workspace: Simple Groupware

LINUXUSER

the users will be able to add, modify, and delete data in the table (enable_ new="true" enable_edit="true" enable_delete="true" enable_empty= "true"). Next, you have to specify a view (<view name="display" displayname="Display" />) and add fields to your application. Besides the mandatory Id field that acts as a primary key, you have to add at least three fields: todo, priority, and description.
<field name="id" U simple_type="id" U displayname="Id" /> <field name="todo" U displayname="Todo" U simple_type="text" U required="true" /> <field name="priority" U displayname="Priority" U simple_type="select" U simple_size="1" U simple_default="Normal"> U <data values=U "Low|Normal|Urgent"/> </field> <field name="description" U displayname="Description" U simple_type="htmlarea" U simple_size="4" />

Figure 1: Each application in Simple Groupware is a folder with a mountpoint.

many folders as you like, each containing different sets of applications.

sgsML
What really makes Simple Groupware truly unique software is its sgsML. This XML-based language allows even nontechnical users to add features and develop groupware applications using simple markup. Better yet, sgsML is so efficient that you can create an application from scratch using just a few line of code. To illustrate how easy sgsML really is, lets build a simple To-do list module. Use your favorite text editor to create a text file. Since all applications in Simple Groupware use a database back-end, the first thing you have to do is to describe the table your To-do module is going to use and how the data is going to be displayed:
<table modulename=U "My To-do list" U default_view="display" U orderby="todo" U order="asc" U limit="20" U enable_new="true" U enable_edit="true" U enable_delete="true" U enable_empty="true"></table>

you define the default view (default_ view="display"). The next three options (orderby="todo" order="asc" limit="20") tell the system that the data in the table should be sorted ascending by the todo field and allowing a maximum of 20 records per page. Want to group your to-do items by priority (assuming you are going to have a priority field in your application)? No problem: add the groupby="priority" option. Finally, you can define whether

Looking at this code, you can easily figure out what it does. For each field, you

Listing 1: To-do Module


01 <table modulename="My To-do list" default_view="display" orderby="todo" order="asc" 02 limit="20" enable_new="true" enable_edit="true" enable_delete="true" enable_empty="true"> 03 <view name="display" displayname="Display" /> 04 <field name="id" simple_type="id" displayname="Id" /> 05 <field name="todo" displayname="Todo" simple_type="text" required="true" /> 06 <field name="priority" displayname="Priority" simple_type="select" simple_size="1" 07 simple_default="Normal"><data values="Low|Normal|Urgent"/> </field> 08 <field name="filedata" displayname="File" simple_type="files" simple_size="3" /> 09 <field name="description" displayname="Description" simple_ type="htmlarea" simple_size="4" /> 10 <field name="contactid" displayname="Contact" simple_type="select" simple_size="1" 11 required="true" is_linked="simple_contacts|details|contactid"> 12 <data function="dbselect|simple_contacts|contactid,concat(lastname; ' ';firstname)||lastname asc|10"/> </field> 13 </table>

Most of this code should be obvious even if youve never used sgsML before. First, you specify the modules name (modulename="My To-do list"), then

W W W. L I N U X - M A G A Z I N E . C O M

ISSUE 71 OCTOBER 2006

79

LINUXUSER

Workspace: Simple Groupware

To create this option of assigning to-do items to contacts, add a Contact value list that pulls data from the Workspace -> Contacts database, which is based on the simple_contacts table:
<field name="contactid" U displayname="Contact" U simple_type="select" U simple_size="1" U required="true" U is_linked="simple_contacts|U details|contactid"> U <data function="dbselect|U simple_contacts|U contactid,concatU (lastname;' ';firstname)|U lastname asc|10"/></field>

Figure 2: Simple Groupware also includes standard applications like a spreadsheet.

specify a type (simple_type="id" simple_type="text" and simple_type= "select"). Besides the standard field types like text, id, and textarea, sgsML also allows you to add more advanced types of fields. In the preceding example, the description field is set to htmlarea, which adds a text formatting toolbar to the field. If you want to attach files to the todo items, you can add a field of type files:
<field name="filedata" U displayname="File" U

simple_type="files" U simple_size="3" />

The simple_size option here specifies how many files you can attach to a to-do item. Using sgsML, you can also link fields in different tables. This allows you to create sophisticated applications that pull data from different sources. In your To-do list module, for example, you can easily add a feature that allows users to assign to-do items to different contacts by simply selecting their names from a drop-down list.

The final code of your To-do module should look something like the code in Listing 1. Save the result as a todo.xml file and move it into the sgs/bin/modules/ schema/ folder. In Simple Groupware, select the Workplace folder (or whatever folder you want to add your new application to), and click on the Options item. In the New folder section, type a name for your application into the Name field and select todo from the Module dropdown list. Press OK, and your first Simple Groupware application is ready to go. When you open the folder for the first time, the system automatically creates the database structure.

Conclusion
If you have tried the other groupware tools and haven't found the perfect combination of features for your environment, Simple Groupware might be the solution you're looking for. The simple example described in this article shows only a fraction of Simple Groupwares capabilities. See the sgsML manual [3] for a more comprehensive overview of the sgsML language.

INFO
[1] Simple Groupware: http://www. simple-groupware.de/cms/ [2] Simple Groupware installation: http:// www.simple-groupware.de/cms/ index.php?n=Main.Installation [3] sgsML manual: http://www. simple-groupware.de/cms/index. php?n=Main.SgsML

Figure 3: The To-do module in action.

80

ISSUE 71 OCTOBER 2006

W W W. L I N U X - M A G A Z I N E . C O M

You might also like