HW08 - Ajax "floating glossary"

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

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. 

You may install your own XWiki for development/testing purposes. Also you may contact your teacher for assistance or providing development/testing environment.


  1. The Apache Velocity Project
  2. Creating XWiki Plugins
  3. See also homework Popup Glossary with GWT
Created by Alina Vasiljeva on 2009-11-26 12:15
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4 - Documentation