org.ceryle.wiki.plugin.assertion
Class AssertedPlugin
java.lang.Object
org.ceryle.wiki.plugin.assertion.AssertedPlugin
- All Implemented Interfaces:
- WikiPlugin
- Direct Known Subclasses:
- Asserted, HasAssertedTagOfPlugin
public class AssertedPlugin
- extends Object
- implements WikiPlugin
A plugin that performs a query using methods from the
WikiMapManager
to list the entire set of wiki Assertions, or applies
one or more filters upon that set. The output can either
mimic the original Assertions or be formatted as a bullet
or numbered list, count only, etc.
Parameters
- page = 'pagename'.
An optional parameter, filtering on page name when present.
- subject = 'name'.
An optional parameter, filtering on subject when present.
- predicate = 'name'.
An optional parameter, filtering on predicate when present.
- object = 'name'.
An optional parameter, filtering on object when present.
- raw = 'true' | 'false'.
An optional parameter, if 'true' stops the plugin from doing further command
line parsing. This is only used when this plugin is called by another plugin.
- templates = 'exclude' | 'only' | 'include'.
An optional parameter controlling inclusion of assertion templates:
- 'exclude': exclude assertion templates;
- 'only': include only assertion templates;
- 'include' : include both assertions and assertion templates.
If absent, the default is 'include' (both).
- logic = 'and' | 'or' | 'all'.
An optional parameter controlling the logical combination of sentence parameters:
- 'and': subject and predicate and object are all required;
- 'or': subject or predicate or object are required;
If absent, the default is 'or' (the most lenient).
- output = 'value'.
An optional parameter. One of 'none', 'count', 'list', 'bullet', 'number',
'space', 'comma', or 'table'. The result is a list of wiki page names;
this alters the output presentation (a description of each can be found
at
PluginTextUtils). In the absence
of a parameter value the output will resemble a list of the original
assertions.
If following any parameters an assertion expression is included, it will
override the subject, predicate and object parameters (i.e., all three are
ignored). The wild card "[*]" will match any page. E.g.,
"[*] [*] [*]" will match all pages — the same as providing
no parameters or expression. "[*] [IsA] [Book]" will match all
pages asserted as being a Book.
Example
The first example lists all Assertions, the second applies the specific
filter, returning all wiki pages that have been asserted as instances of
the class "Book".
[{Assertions}]
[{Assertions predicate='IsA' object='[Book]' }]
- Author:
- Murray Altheim
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAM_PAGE
public static final String PARAM_PAGE
- See Also:
- Constant Field Values
PARAM_SUBJECT
public static final String PARAM_SUBJECT
- See Also:
- Constant Field Values
PARAM_PREDICATE
public static final String PARAM_PREDICATE
- See Also:
- Constant Field Values
PARAM_OBJECT
public static final String PARAM_OBJECT
- See Also:
- Constant Field Values
PARAM_OUTPUT
public static final String PARAM_OUTPUT
- See Also:
- Constant Field Values
PARAM_TEMPLATES
public static final String PARAM_TEMPLATES
- See Also:
- Constant Field Values
PARAM_LOGIC
public static final String PARAM_LOGIC
- See Also:
- Constant Field Values
PARAM_RAW
public static final String PARAM_RAW
- See Also:
- Constant Field Values
AssertedPlugin
public AssertedPlugin()
execute
public String execute(WikiContext context,
Map params)
- Specified by:
execute in interface WikiPlugin
printResult
protected void printResult(WikiContext context,
StringBuffer out,
Collection assertions,
int format)
- Generate output from the Collection of assertions according to the
format, writing it to the StringBuffer out. The output
format is as according to
PluginTextUtils.
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.