Archive

Posts Tagged ‘software development’

End of July update on Dokeos development

July 29, 2008 1 comment

I thought I’ll write a short update on what we are doing at Dokeos at the moment, so you don’t think we’re just sleeping through the summer holidays…

Eric and Julian, of the French team, are currently working on a project for a specific hospital management school in France, and on a large and long-time review project before the migration of portals to version 1.8.5 for an important Belgian client. They have a few weeks of holiday here and there, so they’re pretty much busy full-time on these ones when they’re not gone.

The team of university developers (of whom Sven is half working for Dokeos now) is working on the development of Dokeos 2.0. They are expected to provide a first usable product for the Dokeos User’s Day in December, so I they seem to be putting a lot of efforts into this.

Thomas is busy providing course-building training to a few important medical and pharmaceutical clients.

Arnaud, our system administrator and occasionally developer of the videoconference tool, is pretty busy with new installations and the migration of portals from 1.8.4 to 1.8.5.

As for Daniel and Julio, they work under my supervision on several important projects, including a the development of a few new features for the quiz tool for a local (peruvian) client and the development of a new survey type for a belgian client.

I’ve been giving training for Dokeos administrators and teachers over the last three days of last week, and preparing a long development of new extensions to the quiz and learning path tools (with possible little steps towards SCORM 2004 implementation), and the review and finish of the new survey type development. I’ve also been studying web services quite deeply, and on my spare time I reviewed the possibilities of an integration with Drupal 5 or 6 as well as a few ideas for the SCORM 2.0 white papers call.

As you can see, we’re quite busy. We hope you enjoy your holidays though, if any!

Advertisements

Trying out PECL's SCA_SDO package

July 27, 2008 1 comment

In order to start offering Web Services inside Dokeos, I (and Stefaan Vanbillemont) have been testing out the SCA_SDO package from PECL (for PHP), that reportedly offers the possibility to deploy web services from existing functions only by including a common file and adding a bit of documentation “PHPDocumentor style” to the code.

As we are using PHPDocumentor-like comments already, and have a lot of existing functions possibly offering all the services we would like to offer as web services, I thought SCA_SDO was a perfect match.

The SDO-part of the extension will not be used in our context though, so I will focus on a short and early analysis of what we need and what SCA has to offer, then will show a short example of what we can do with a Dokeos + SCA combination.

I will be using information gathered from

http://www.osoa.org/display/PHP/SCA+Documentation

and

http://www.php.net/manual/en/sca.examples.exposing-webservice.php

Apparently, the latter is more up-to-date (so it might cut your research time), but it is less detailed in terms of theory about the SCA_SDO package.

First of all, we need something to re-use the Dokeos code, not write new code, if at all possible. The SCA package offers that. However, it also depends on your code using a class structure, so you can’t just use a functions library. That means we can’t use functions like api_get_version(), just because it is outside of a class.

Second, we need to be able to authenticate (or provide some way to limit the service to only secured sources) the service calls. However, SCA doesn’t implement any kind of security. This is very bad in our context because we don’t want to rewrite all methods just to be able to provide a secured service…

However, if we ignore those two issues, deploying web services with SCA is very easy.

As a test, we could use one of the PHP libraries in the form of a class, like UserManager. However, a series of problems might appear when trying to do that…

  1. the file name needs to be the same as the class name (this will be a major hassle for most existing open-source projects), otherwise you get a blank page when asking for the wsdl.
  2. the @param tags in the PHPDoc of each function need to be defined exactly as @param [type] [$variable] [comment], with the comment being optional, otherwise you get a blank page. The type can be ‘int’ or ‘integer’ (or any other simple type).
  3. you *might* not be able to use complex types
  4. all methods in the file must match the PHPDoc syntax exactly (in terms of @param and @return), otherwise you’ll get a blank page (this is also a hassle).
  5. the class header comments *must* absolutely be a space+star+space+@… form, otherwise you get a blank page.
  6. you cannot use another file to include a class definition file, thus allowing you to rename your file (use UserManager.php to include usermanager.lib.php that defines UserManager class).

Apart from these restrictions, you can:

  1. use a parameter variabe name in the comments which doesn’t match the one in the function parameters
  2. use underscores for the class’ name and the methods’ names
  3. use normal ‘//’ and ‘/** */’ comments between two methods

Thus, we might end up with a system to re-use existing methods, but it wouldn’t be at all that easy to make it work.

An example of completely re-worked and partial usermanager.lib.php, renamed for the occasion as UserManager.php, would be:

<?php
require_once ‘SCA/SCA.php’;
/**
 * This library provides functions for user management.
 * it in your code to use its functionality.
 *
 * @service
 * @binding.soap
 *
 */
class UserManager {

  /**
  * Delete a user from the platform.
  *
  * @param integer $userId The user id.
  * @return bool true if user is succesfully deleted, false otherwise.
  */
  function deleteUser($userId) {
   return true;
  }
}
?>

However, even here there is a fundamental problem, as we still need to require global.inc.php from here (to get access to the database itself and to the database library).

We’re not really having a complete solution here…

%d bloggers like this: