Development Guide

Creating a Service

As written in the architecture chapter, there are two core component types: Services and Modules.
 
Creating a service has much less requirements than creating a module. You just need to add a new directory to the Services directory in ILIAS:

Services/
YourService/
classes/
class.ilYourServiceClass.php
...

You need at least one class in your classes directory that provides any functionality that may used in other components of ILIAS.

Service with Control Flow Entry Point (baseClass)

Sometimes your service wants to provide a top entry point into the control flow. An example in ILIAS for this kind of service is the Personal Desktop service. Then you need two more things:

  • A service.xml file
  • A new base user interface class

<?xml version = "1.0" encoding = "UTF-8"?>
<service xmlns="http://www.w3.org" version="$Id$" id="your_id">
<baseclasses>
<baseclass name="ilYourBaseClassGUI" dir="classes" />
</baseclasses>
</service>

The service.xml file declares a class file as a new base class for $ilCtrl. In this case the class name is ilYourBaseClassGUI located in the file Services/YourService/classes/class.ilYourBaseClassGUI.php. The next chapter shows the implementation of a minimum service called "Hello World".