|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.wiki.plugin.query.QueryPlugin
public class QueryPlugin
The QueryPlugin treats the pages and references between them like a database. You can query the pages using a simple syntax (AND, OR, NOT, ...). The matching pages are returned sorted alphabetically in a bulleted list.
The query is done against the ReferenceManager's collection of all pages/links so it's fast. The query results are "cached" for 30 seconds, so viewing pages with a query doesn't load the server too much.
In some sense the ReferringPagesPlugin is a degenerate form of this plugin (pages='(TO [ThisPage]').
| Prefix Operators | IS, TO, FROM (BY), NOT, ALL, ANY | OPERATOR (...) |
| Infix Operators | AND, OR | (... OPERATOR ...) |
This version of QueryPlugin now provides for Java-style regular expressions in the specification of terms, e.g., [Wiki.*] returns all wiki pages whose name begins with "Wiki".
NOTE: The token [.] is NOT treated as a regular expression, rather it is expanded into the current page name.
[{QueryPlugin pages='TO( [Bug] AND [Open]) AND NOT( BY( [PlanningGame] ) )'}]
Alternatively if your jspwiki.properties file contained:
queryPlugin.namedExpression.unplannedOpenBugs=TO( [Bug] AND [Open]) AND NOT( BY( [PlanningGame] ) )
You could use:
[{QueryPlugin named='unplannedOpenBugs'}]
Finally if you don't need or want to specify any other parameters:
[{QueryPlugin TO( [Bug] AND [Open]) AND NOT( BY( [PlanningGame] ) )}]
| Field Summary | |
|---|---|
String |
currentPageName
|
protected static String |
DIV_query
|
protected String |
m_emptyText
|
protected boolean |
m_executionError
|
protected static QueryItemManager |
m_queryManager
|
protected String |
NoPagesFound
|
static String |
PARAM_ECHO
|
static String |
PARAM_EMPTY_TEXT
|
static String |
PARAM_NAMED
|
static String |
PARAM_OUTPUT
The parameter indicating the output format. |
static String |
PARAM_PAGES
|
static String |
PARAM_PARSED_EXPRESSION
|
static String |
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 | |
|---|---|
QueryPlugin()
|
|
| Method Summary | |
|---|---|
protected String |
error(String message)
|
String |
execute(WikiContext context,
Map params)
This expands the this page notation, then calls the actual workhorse of this plugin, execute(WikiEngine,Map). |
String |
execute(WikiEngine engine,
Map params)
Execute a query upon the wiki using the parameters provided. |
WikiContext |
getContext()
Returns the WikiContext, or null it has not been set. |
String |
getExpression()
Return the page expression as processed from the query. |
String |
getOutput(WikiEngine engine)
Return appropriate XHTML markup for the query results, obtained from getResultSet(). |
int |
getOutputFormat()
Return the output format as set by the default or the input parameter. |
protected String |
getQueryExpression(WikiEngine engine,
Map params)
Return the page expression provided the parameter set. |
Set |
getResultSet()
Returns the results of the last query execution. |
protected boolean |
isDebug()
Returns true if in debug mode. |
protected boolean |
isEcho()
Returns true if in echo mode. |
protected void |
setResultSet(Set resultSet)
Sets the output result to the provided Set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PARAM_PAGES
public static final String PARAM_ECHO
public static final String PARAM_EMPTY_TEXT
public static final String PARAM_NAMED
public static final String PARAM_PARSED_EXPRESSION
public static final String PROP_PREFIX_NAMED
public static final String PARAM_OUTPUT
PluginTextUtils
as any of the OUTPUT_* constants.
protected static final String DIV_query
protected static QueryItemManager m_queryManager
protected String NoPagesFound
protected String m_emptyText
protected boolean m_executionError
public String currentPageName
| Constructor Detail |
|---|
public QueryPlugin()
| Method Detail |
|---|
public String execute(WikiContext context,
Map params)
execute(WikiEngine,Map).
execute in interface WikiPluginWikiPlugin.execute(com.ecyrd.jspwiki.WikiContext,java.util.Map)
public String execute(WikiEngine engine,
Map params)
engine - params -
protected boolean isEcho()
protected boolean isDebug()
protected void setResultSet(Set resultSet)
public WikiContext getContext()
protected String getQueryExpression(WikiEngine engine,
Map params)
throws PluginException
PluginExceptionpublic String getExpression()
public int getOutputFormat()
for available constants.public Set getResultSet()
public String getOutput(WikiEngine engine)
getResultSet().
protected String error(String message)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||