Technik, Gothic und Anderes

Technik ist Spiel, Gothic ist ernst und Zeit hat man zuviel

Archiv für 'Learninmanagement Systeme (lms)' Kategorie


PHP-UWA Widget Library

Geschrieben von skaldrom am 26. November 2007

Widgets and Web 2.0

Universal Widget ArchitectureWidgets are little miniapplications which show data in a clearly arranged way or perform a more or less simple task for the user. Widgets are present on Windows Vista, Mac, iPhone and also in a webbased form for iGoogle, Yahoo!, Netvibes and many other portals. To give a boost to widget development, Netvibes presented a new framework which shall facilate the coding of widgets. The child is called Universal Widget Architecture. Widgets coded with the help of this framework should work on all the mentioned plattforms.

UWA Standard

A widged, coded with UWA is basically a XML-Dokument. It contains metadata, settings and the active part, written in Javascript. Especially the Preferences are of interest, because they are dynamic and allow widgetspecific settings. There are also some convenience-functions in the UWA-library.

The UWA specification has its own homepage and is very well documented. There are examples, a code-skeleton with explanations, a step-by-step tutorial, a forum and even a cheat-sheet. The start is very easy with such a lot of documentation.

Widget Repository

Finished and released widgets can be made available for the public and published in the Widget Repository (Ecosystem). Widgets ion this website can be added to the different platforms with a single (or double) click). There are some widgets in the repository which are coded in the deprecated Mini-API standard, but these will dissappear soon (hopefully).

Implementations

That sounded fascinating and must have a use somewhere… I will implement some widgets later, I needed to make these widgets usable in our own projects first. So I wrote a little PHP-class which I called pretentious PHP-UWA Widget Library.Handling widged should be easy, using this class. A little bit more ambitious is the handling of widget dependend preferences.

A minimal example is included in the download-package and can also be checked online.

PHP-UWA Widget Library Example

Displaying a widget should be straight forward:

<?php
require_once('uwawidget.php');
$uwawidget=new uwawidget('http://www.netvibes.com/api/uwa/examples/digg.xhtml');
echo $uwawidget->getWidgetHTML();
?>

There are two classmembers which can give more information about the widget:

getMetaData()
Metadaten like author, keywörds, description, … See the docu.
getAdditionalData()
Additional info like icons, stylesheets, …

Basically, there are the following sections for settings:

general
The widgets URL.
configuration
Displayparameters, which described in the docs.
preferences
Widget dependent preferences, also mentioned in the docs

For all these settings, there are the following classmembers:

Setters and Getters
setModuleUrl(), setConfiguration(), setPreferences()
getModuleUrl(), getConfiguration(), getPreferences()
getSettingsFormData($section)
Returns the settings in a friendly array, from which a form can be generated. $section can be “general”, “configuration” or “preferences”
getSettingsHTML($section)
Returns the settings in an array with the format “Label” => “HTML”. $section can be “general”, “configuration” or “preferences”

For a test, I coded a Moodle block, which allows to use UWA Widgets inside the LMS. Heyo, Wordpress, Xoops, etc-Coderz, how about an integration of the Widgets in your system???

Examples from the Moodle block:

Moodle UWA Calculator Moodle UWA Converter Moodle UWA Translator
Moodle UWA Google Notes Moodle UWA Spider Moodle UWA ToDo
The configuration in Moodle:
Widget settings in Moodle

Uh, almost…

…I was almost faster than the german computer magazine c’t which has a short bit good introduction into UWA-Widgets.

Teile und geniesse:
  • Technorati
  • del.icio.us
  • MisterWong
  • Digg
  • StumbleUpon
  • blogmarks
  • Furl
  • Simpy
  • Spurl
  • YahooMyWeb

Ähnliche Artikel

Eingeordnet in Learninmanagement Systeme (lms), Web | 4 Komentare »

SVN und Moodleintegration: Einen Schritt weiter

Geschrieben von skaldrom am 16. May 2007

In einem älteren Posting habe ich schon beschrieben, dass wir das LMS Moodle mit SVN integrieren. Um die Integration voranzutreiben habe ich einen Block gecoded, von welchem aus man direkt die Dateien aktualisieren kann:

Moodle SVN Block

Den Code zu posten macht nicht viel Sinn, da es sehr installationsabhängig ist. Auf Anfrage hin rücke ich aber gerne was raus :) ….

Teile und geniesse:
  • Technorati
  • del.icio.us
  • MisterWong
  • Digg
  • StumbleUpon
  • blogmarks
  • Furl
  • Simpy
  • Spurl
  • YahooMyWeb

Ähnliche Artikel

Eingeordnet in Learninmanagement Systeme (lms) | Keine Kommentare »

SVN mit Moodle integrieren

Geschrieben von skaldrom am 21. September 2006

Moodle eignet sich sehr gut um Dokumente für Lernende bereitzuhalten und zu publizieren. SVN eignet sich, um Dokumente abzulegen wenn mehrere Leute zusammenarbeiten. Was liegt also näher als die beiden Dinge zu kombinieren?

Vorteile:

  • Es sind immer aktuelle Dokumente auf dem Moodle
  • Das lästige Hochladen entfällt
  • Es ist mächtig 1337!

Soweit die Theorie, doch wie läuft das in der Praxis?

Grundsätzlich werden auf dem Moodleserver die SVN-Verzeichnisse ausgecheckt. Jede Nacht läuft ein Cronjob, der diese Arbeitsverzeichnisse aktualisiert und noch nicht vorhandene an diesen Ort auscheckt. Im Moodle “data” Verzeichnis werden in den Kursen symbolische Links auf diese Arbeitsverzeichnisse gesetzt, die dann in Moodle selber wie normale Verzeichnisse behandelt werden können.

Um diese Arbeitsverzeichnisse auszuchecken habe ich ein Bash-Script geschrieben, für das Setzen der Links gibt es ein ganz hässliches Webinterface. Beide Quellcodes stelle ich gerne zur Verfügung, hierhin passense nicht….

Probleme:

  • Die Berechtigungen der Arbeitsverzeichnisse müssen so gesetzt werden, dass normale Benutzer über Moodle keine Dateien verändern oder löschen können.
  • Da es ein Link ist und kein echtes Verzeichnis, lässt Moodle keine “Verzeichnis Ressourcentypen” zu. Korrigiert werden kann dies in lib/moodlelib.php, Funktion get_directory_list:
    if (!is_dir($rootdir)  && !is_link($rootdir)) {          // Must be a directory

    und:

    if (filetype($fullfile) == 'dir'  || filetype($fullfile) == "link") {
  • Die SVN-Arbeitsverzeichnisse sollen ja nicht migebackupt werden, da man gescheiter die Repositories sichert. Darum in backup/backuplib.php, Funktion backup_copy_course_files anpassen:
    if ($dir !== $name_moddata and $dir !== $name_backupdata and !is_link($rootdir."/".$dir)) {
Teile und geniesse:
  • Technorati
  • del.icio.us
  • MisterWong
  • Digg
  • StumbleUpon
  • blogmarks
  • Furl
  • Simpy
  • Spurl
  • YahooMyWeb

Ähnliche Artikel

Eingeordnet in Learninmanagement Systeme (lms) | 1 Kommentar »