org.ceryle.wiki.plugin.query
Class QueryExecutor

java.lang.Object
  extended by org.ceryle.wiki.plugin.query.QueryPlugin
      extended by org.ceryle.wiki.plugin.query.QueryExecutor
All Implemented Interfaces:
WikiPlugin, PluginConstants

public class QueryExecutor
extends QueryPlugin

Subclass of the QueryPlugin so its functionality can be hijacked for non wiki-page display purposes.

Author:
John Volkar (john.volkar at gmail.com)

Field Summary
 
Fields inherited from class org.ceryle.wiki.plugin.query.QueryPlugin
currentPageName, DIV_query, m_emptyText, m_executionError, m_queryManager, NoPagesFound, PARAM_ECHO, PARAM_EMPTY_TEXT, PARAM_NAMED, PARAM_OUTPUT, PARAM_PAGES, PARAM_PARSED_EXPRESSION, PROP_PREFIX_NAMED
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Fields inherited from interface org.ceryle.wiki.plugin.util.PluginConstants
ACL, AOP, APOS_ENT, ASTERISK, BCL, BOP, BR, CAPCL, CAPOP, CLATT, COLON, COMMA, DIV_class, DIV_style, DIVCL, DOT, EQ, EQQUO, EQSQUO, FALSE, FORMCL, FORMOP, GET, ICL, INPUTOP, IOP, LABELCL, LABELFOR, LABELOP, LCURL, LICL, LIOP, LPAR, LSBR, MT, NBSP, NL, OLCL, OLOP, P_class, PCL, PLUGCL, PLUGO, POP, POST, QUO, QUOCL, QUOETCL, RCURL, RPAR, RSBR, SEMI, SP, SPAN_class, SPANCL, SPANOP, SQUO, TABLECL, TABLEOP, TDCL, TDOP, THCL, THOP, TRCL, TROP, TRUE, TTCL, TTOP, ULCL, ULOP, UNDER
 
Constructor Summary
QueryExecutor()
           
 
Method Summary
 Set execute(WikiEngine engine, String query)
          Execute the given query and return the result set.
 String getOutput(WikiEngine engine)
          This duplicates the basic output of the superclass, but if the user specified a unparsable query then the default behaviour of the QueryPlugin is to return a String message even while its result Set returns null.
 Set getResultSet()
          For the purposes of this executor we assure that a null set can never be handed out.
 
Methods inherited from class org.ceryle.wiki.plugin.query.QueryPlugin
error, execute, execute, getContext, getExpression, getOutputFormat, getQueryExpression, isDebug, isEcho, setResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryExecutor

public QueryExecutor()
Method Detail

execute

public Set execute(WikiEngine engine,
                   String query)
            throws QueryException
Execute the given query and return the result set.

Parameters:
engine - Must NOT be null.
query - The query to be executed.
Returns:
Will not be null, may be an empty set.
Throws:
QueryException - if the given query could not be parsed or any other internal error occured.

getResultSet

public Set getResultSet()
For the purposes of this executor we assure that a null set can never be handed out. If not previously executed, returns an empty set, otherwise the results of the last execution are returned.

Overrides:
getResultSet in class QueryPlugin
Returns:
Will never be null, may be the empty set.

getOutput

public String getOutput(WikiEngine engine)
This duplicates the basic output of the superclass, but if the user specified a unparsable query then the default behaviour of the QueryPlugin is to return a String message even while its result Set returns null. This is somewhat of a hack that simply sets the results as an empty Set to alter the output.

Overrides:
getOutput in class QueryPlugin


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.