org.ceryle.wiki.plugin.tag
Interface TagManager

All Known Implementing Classes:
TagManagerImpl

public interface TagManager

The TagManager API manages the setting (via Tag) and querying (via HasTagOf) of user tags.

See Also:
Tag, HasTagOf, TagManager, TagManagerFactory

Field Summary
static String LOGICAL_AND
          The String indicating a logical AND operation.
static String LOGICAL_NOT
          The String indicating a logical NOT operation.
static String LOGICAL_OR
          The String indicating a logical OR operation.
static String TAG_PROPERTY
          The name of the tag property name set as a variable on the wiki page.
 
Method Summary
 void convertToTerms(List terms, String pagename)
          Provided with a List of Strings and Terms, converts any square-bracketed Strings in the List to Terms.
 WikiEngine getEngine()
          Returns the WikiEngine associated with this TagManager.
 List getPagesForTag(String tag)
          Returns the List of wiki page names (as Strings) containing the provided tag, an empty List if no matches exist.
 QueryItem getQueryForExpression(Expression expression)
          Return a QueryItem corresponding to the provided Expression.
 List getTagsForPage(String pagename)
          Returns the List of tags (as Strings) for the provided Page, an empty List if none have been set.
 boolean hasTag(String pagename, String tag)
          Returns true if the wiki page contains the tag, false if it does not contain the tag or the page does not exist.
 boolean isListenerEnabled()
          Returns the enabled state of this TagManager's WikiEventListener.
 Set processQuery(WikiContext context, Map params)
          Processes the parameters as a query, returning the resulting Set of wiki page names.
 void setListenerEnabled(boolean enable)
          Enables or disables this TagManager's WikiEventListener so that it tracks or no longer tracks changes to the wiki.
 void setTagsForPage(String pagename, List terms)
          Sets the List of tags (as Strings) for the provided Page, replacing any previous List.
 

Field Detail

TAG_PROPERTY

static final String TAG_PROPERTY
The name of the tag property name set as a variable on the wiki page. The value is "DC.subject", the Dublin Core 'Subject' term.

See Also:
Constant Field Values

LOGICAL_AND

static final String LOGICAL_AND
The String indicating a logical AND operation.

See Also:
Constant Field Values

LOGICAL_OR

static final String LOGICAL_OR
The String indicating a logical OR operation.

See Also:
Constant Field Values

LOGICAL_NOT

static final String LOGICAL_NOT
The String indicating a logical NOT operation.

See Also:
Constant Field Values
Method Detail

hasTag

boolean hasTag(String pagename,
               String tag)
Returns true if the wiki page contains the tag, false if it does not contain the tag or the page does not exist. Throws a NullPointerException if either argument is null.


getPagesForTag

List getPagesForTag(String tag)
Returns the List of wiki page names (as Strings) containing the provided tag, an empty List if no matches exist.


getTagsForPage

List getTagsForPage(String pagename)
Returns the List of tags (as Strings) for the provided Page, an empty List if none have been set.


setTagsForPage

void setTagsForPage(String pagename,
                    List terms)
Sets the List of tags (as Strings) for the provided Page, replacing any previous List. A null value for the List will remove any record for that page from the registry.


convertToTerms

void convertToTerms(List terms,
                    String pagename)
                    throws PluginException
Provided with a List of Strings and Terms, converts any square-bracketed Strings in the List to Terms. If the pagename parameter is non-null, any instances of "[.]" will be replaced by "[pagename]".

Parameters:
terms - the List of Strings and Terms
pagename - the wiki page name of the plugin's origin
Throws:
PluginException

processQuery

Set processQuery(WikiContext context,
                 Map params)
                 throws QueryException
Processes the parameters as a query, returning the resulting Set of wiki page names.

Throws:
QueryException

getQueryForExpression

QueryItem getQueryForExpression(Expression expression)
Return a QueryItem corresponding to the provided Expression.


getEngine

WikiEngine getEngine()
Returns the WikiEngine associated with this TagManager.


setListenerEnabled

void setListenerEnabled(boolean enable)
Enables or disables this TagManager's WikiEventListener so that it tracks or no longer tracks changes to the wiki.

The listener is created upon class instantiation, and removed from the WikiEventManager and destroyed when this method is called with a parameter value of false.


isListenerEnabled

boolean isListenerEnabled()
Returns the enabled state of this TagManager's WikiEventListener. If the listener is disabled, the internal registry should be considered invalid.



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