• Skip to navigation (Press Enter).
  • Skip to main content (Press Enter).
  • English Version
  • Blog
  • Topics
  • Activities
  • Publications
  • Talks
  • Contact
  • Search

  • Twitter Updates

    • Categories

      • events (32)
        • CfP (6)
        • conference (18)
        • learntec (1)
        • symposium (7)
      • project (30)
        • agent-dysl (2)
        • mature-ip (16)
        • mirror (1)
        • myui (1)
        • soprano (8)
        • universaal (3)
      • publications (13)
      • tools (2)
        • mediawiki (1)
      • topics (56)
        • aal (10)
        • adaptivity (1)
        • competencies (15)
        • context (10)
        • education (3)
        • elearning (12)
        • hr (11)
        • km (12)
        • maturing (20)
        • microlearning (1)
        • motivation (2)
        • ontology (10)
        • project management (1)
        • workplace learning (17)
    • Archive

      • July 2010
      • May 2010
      • February 2010
      • January 2010
      • November 2009
      • September 2009
      • May 2009
      • March 2009
      • December 2008
      • November 2008
      • October 2008
      • September 2008
      • June 2008
      • May 2008
      • April 2008
      • March 2008
      • February 2008
      • January 2008
      • November 2007
      • October 2007
      • September 2007
      • August 2007
      • June 2007
      • May 2007
      • March 2007
      • February 2007
      • January 2007
      • December 2006
      • October 2006
      • September 2006
      • August 2006
    • RSS My MATURE Project blog

      • Professional Knowledge Management Conference 2011 in Innsbruck - From Knowlegde to Action
      • Knowledge Maturing in Europe - results of a large European study
      • People Tagging demonstrator evaluation - the "simplicity is fabulous"
      • Summary of demonstrators and motivational design approach
      • Successful second MATURE Review
      • Two Portuguese companies join the associate partner network
      • Knowledge Management 3.0 @ Learntec 2010
      • Continuous Competence Development: MATURE @ Professional Training Facts 2009
      • Third MATURE newsletter published
      • Promoting a shared understanding of competencies - position statement at IEEE LTSC WG20 meeting in Stuttgart
    • Tags

      aal competence elearning enterprise20 hr km knowledge_management learning matureip mirror-ip ontology reflection scohrid soprano web20 web30
    « Upcoming Competency Autumn
    HCSIT 2007 / ePortfolio 2007 – Ontologies, employability and e-portfolios »

    Google Gears hack: MediaWiki offline functionality in less than one hour

    Wikis are popular intranet tools in which teams collaboratively develop a shared knowledge base. So far, however, there has often been the problem that wikis were not available (even read-only) offline, e.g., when traveling.

    Google Gears is an interesting new technology to solve the problem of offline web applications in a surprisingly easy way. In order to try out the potential of it, I have recently tried to apply it to the MediaWiki system (actually a Semantic MediaWiki installation).

    What do you have to do?

    • Create a folder gears in your MediaWiki installation directory
    • Download the gears_init.js from the Google Gears web site and place it in the newly created folder
    • Download the gears_offline.js from the Google Gears tutorial
    • Modify the manifest file name in this file to a php script, e.g. manifest.php
    • Create the manifest.php that creates the file list on the fly (based on access to the database):

    {
    “betaManifestVersion”: 1,
    <?php
    $l = mysql_connect(‘localhost’,’user‘,’pass‘);
    mysql_selectdb(‘mediawikidbname‘);
      $q = “SELECT max(rc_timestamp) from recentchanges”
    $r = mysql_query($q);
    $t = mysql_fetch_row($r);
      echo ‘”version”: “‘ . $t[0] . ‘”,’;
    ?>

    “entries”:
    [

    <?php
    $q = "SELECT page_title from page"
    $r = mysql_query($q);
     while ($t = mysql_fetch_row($r))
    {
    echo '{ "url": "
    /index.php/' . $t[0] . ‘” },’;
    }
      echo ‘{ “url”: “/index.php/Main” }’;
    ?>
    ]

    }

    • Modify the MonoBook.php skin file (or any other skin you are using):
      • Include the two javascript files in the header section
      • add “init()” to body onload
      • add a link somewhere on the page (e.g., footer) invoking the javascript function createStore()
      • add a placeholder <span id=’textOut’></span> somewhere for status messages, e.g. in the footer

    Of course, the approach is quite a hack and does not scale for large wikis because there is always a complete replication of online content as soon as some change occurred (this could be made smarter by not leaving everything to Gears, but implementing your own update strategy). Likewise, offline search, editing, and other cool features are not available (this would require much more effort towards AJAXifying MediaWiki). So this simple solution just provides the possibility of offline reading – and this transparently to the user (and within less than one hour :) .

    Technorati tags: MediaWiki, Gears

    This entry was posted on Monday, October 15th, 2007 at 11:10 and is filed under mediawiki. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

    3 Responses to “Google Gears hack: MediaWiki offline functionality in less than one hour”

    1. googlegearsblog.com Says:
      October 15th, 2007 at 10:10
    2. Lee.org » How to Create an HTML dump of Mediawiki Says:
      August 18th, 2008 at 08:08

      [...] If you need to grab pages from a wiki that you aren’t the administrator of, you can try running a web crawler on it or try this Google Gears hack. [...]

    3. Tom Says:
      January 14th, 2009 at 04:01

      There’s actually a more-official extension that does this, less hackish?

      http://wiki.yobi.be/wiki/Mediawiki_LocalServer

    Leave a Reply

    E-mail:  email address Contact information
    Copyright © 2010, Andreas Schmidt.