Last modified by superadmin on 2018-01-12 20:29

HW08 - AJAX "floating glossary"

Goal: Develop a Velocity macro, which can be applied in XWiki context and which generates fragments of DHTML markup, to display glossary term definitions in response to user's "mouse over" events. 

Description: Repetitive and verbose HTML/CSS/JavaScript constructs are sometimes the easiest way to achieve client-side dynamic behavior. To make creation of such effects easy for the template writer, a development of a specialized Velocity macro is suggested. Assume that you have to generate mouse-hover glossary definitions like these: http://www.bkkl.lv/exams.php?page=main&item_id=9&action=details&validated=8&params= (hover the mouse over any of Japanese terms listed in the exam materials and a floating glossary definition will be displayed). Propose an easy way to markup such glossary definitions and suggest a Velocity macro, which can do this. The Velocity macro should generate an AJAX behavior (i.e. drawing a small popup window, which is populated with data that is generated by a small HTTP request, which does not redraw the whole document). The HTTP service supplying the glossary definitions can be simple servlet, which receives one parameter (the glossary term) and returns its definition, if any is available. 

The usage sample could be as follows:

Šajā gadījumā lietosim #glos('subsidiaritātes principu', 'subsidiaritātes princips'). 

In this case "subsidiaritātes principu" is a term, which actually appears in the text (a flexion form of the glossary term). The second argument is the term itself. If they coincide, the second argument to the macro may be ommitted. 


  1. Creating XWiki Plugins
  2. See also Popup Glossary with GWT
Created by Kalvis Apsītis on 2007-10-21 16:37
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4 - Documentation