Custom topic panel

From WandoraWiki
Revision as of 14:37, 13 February 2008 by Olli (Talk | contribs)

Jump to: navigation, search

Custom topic panel is one of several available topic panels in Wandora. Custom topic panel can be customized to suit the needs a specific topic map.

Query language

Introduction

Wandora does not use any standard query language. Instead queries are done by invoking a method of a Java class implementing a certain interface. The class may then perform anything whatsoever as long as in the end it returns query results in the format specified by the Java interface. Wandora does however include a number of classes designed in a way that makes it possible to build complex queries by combining these simple predefined query directive classes. This somewhat resembles a traditional query language.

The queries are defined using a generic scripting language. Wandora uses Java scripting API so it should be possible to use a number of different languages. Examples in this article use Mozilla Rhino 1.6 language that should be found in most installations.

As an example, the default configuration contains the following query:

importPackage(com.gripstudios.applications.wandora.query);
importPackage(com.gripstudios.applications.wandora.topicmap);
new RecursiveDirective(
    new RolesDirective(
        new IsContextTopicDirective(
            new SelectDirective(XTMPSI.SUPERCLASS_SUBCLASS,
                                XTMPSI.SUPERCLASS,XTMPSI.SUBCLASS),
            XTMPSI.SUBCLASS),
        XTMPSI.SUPERCLASS),
    XTMPSI.SUPERCLASS
);


Directive Description
SelectDirective
IsContextTopicDirective