info.bliki.wiki.model
Class WikiModel

java.lang.Object
  extended by info.bliki.wiki.model.AbstractWikiModel
      extended by info.bliki.wiki.model.WikiModel
All Implemented Interfaces:
IConfiguration, IWikiModel
Direct Known Subclasses:
BBCodeModel

public class WikiModel
extends AbstractWikiModel

Standard model implementation


Constructor Summary
WikiModel(Configuration configuration, java.util.Locale locale, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
           
WikiModel(Configuration configuration, java.util.ResourceBundle resourceBundle, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
           
WikiModel(Configuration configuration, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
           
WikiModel(java.lang.String imageBaseURL, java.lang.String linkBaseURL)
           
 
Method Summary
 void addCategory(java.lang.String categoryName, java.lang.String sortKey)
          When an article contains a token indicating that the article belongs to a specific category this method should be called to add that category to the output metadata.
 void addLink(java.lang.String topicName)
          When a document contains a token indicating that the document links to another Wiki topic this method should be called to add that topic link to the output metadata.
 boolean addSemanticAttribute(java.lang.String attribute, java.lang.String attributeValue)
           
 boolean addSemanticRelation(java.lang.String relation, java.lang.String relationValue)
           
 void addTemplate(java.lang.String template)
          When a document contains a token indicating that the document includes a Wiki template this method should be called to add that template to the output metadata.
 void appendInternalLink(java.lang.String link, java.lang.String hashSection, java.lang.String linkText)
          Append an internal wikilink as described in Help Links
 java.util.Set<java.lang.String> getCategories()
          Get the set of Wikipedia category names used in this text
 java.util.Set<java.lang.String> getLinks()
          Get the set of Wikipedia links used in this text
 java.util.List<SemanticAttribute> getSemanticAttributes()
          Get the list of SemanticAttributes
 java.util.List<SemanticRelation> getSemanticRelations()
          Get the list of SemanticRelations.
 java.util.Set<java.lang.String> getTemplates()
           
 void parseInternalImageLink(java.lang.String imageNamespace, java.lang.String name)
          Append this internal wiki image link
 boolean replaceColon()
          Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates)
 void setUp()
          Prepare or initialize the wiki model before rendering the wikipedia text
 
Methods inherited from class info.bliki.wiki.model.AbstractWikiModel
addCodeFormatter, addInterwikiLink, addTemplateFunction, addTokenTag, addToReferences, append, appendExternalImageLink, appendExternalLink, appendInternalImageLink, appendInterWikiLink, appendISBNLink, appendMailtoLink, appendRedirectLink, appendStack, buildEditLinkUrl, decrementRecursionLevel, get2ndCategoryNamespace, get2ndImageNamespace, get2ndTemplateNamespace, getCategoryNamespace, getCodeFormatterMap, getImageNamespace, getInterwikiMap, getNode, getRawWikiContent, getRecursionLevel, getRedirectLink, getReferences, getResourceBundle, getTableOfContentTag, getTemplateFunction, getTemplateMap, getTemplateNamespace, getTokenMap, getWikiListener, incrementRecursionLevel, isCategoryNamespace, isImageNamespace, isInterWiki, isNamespace, isSemanticWebActive, isTemplateNamespace, isTemplateTopic, parseBBCodes, parseEvents, parseTemplates, peekNode, popNode, pushNode, render, render, renderLaTeX, renderPDF, setSemanticWebActive, showSyntax, stackSize, swapStack, tearDown, toNodeList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiModel

public WikiModel(java.lang.String imageBaseURL,
                 java.lang.String linkBaseURL)

WikiModel

public WikiModel(Configuration configuration,
                 java.lang.String imageBaseURL,
                 java.lang.String linkBaseURL)

WikiModel

public WikiModel(Configuration configuration,
                 java.util.Locale locale,
                 java.lang.String imageBaseURL,
                 java.lang.String linkBaseURL)

WikiModel

public WikiModel(Configuration configuration,
                 java.util.ResourceBundle resourceBundle,
                 java.lang.String imageBaseURL,
                 java.lang.String linkBaseURL)
Method Detail

addCategory

public void addCategory(java.lang.String categoryName,
                        java.lang.String sortKey)
Description copied from interface: IWikiModel
When an article contains a token indicating that the article belongs to a specific category this method should be called to add that category to the output metadata.

Specified by:
addCategory in interface IWikiModel
Overrides:
addCategory in class AbstractWikiModel
Parameters:
categoryName - The name of the category that the document belongs to.
sortKey - The sort key for the category, or null if no sort key has been specified. The sort key determines what order categories are sorted on category index pages, so a category for "John Doe" might be given a sort key of "Doe, John".

addLink

public void addLink(java.lang.String topicName)
Description copied from interface: IWikiModel
When a document contains a token indicating that the document links to another Wiki topic this method should be called to add that topic link to the output metadata.

Specified by:
addLink in interface IWikiModel
Overrides:
addLink in class AbstractWikiModel
Parameters:
topicName - The name of the topic that is linked to.

addSemanticAttribute

public boolean addSemanticAttribute(java.lang.String attribute,
                                    java.lang.String attributeValue)
Specified by:
addSemanticAttribute in interface IWikiModel
Overrides:
addSemanticAttribute in class AbstractWikiModel

addSemanticRelation

public boolean addSemanticRelation(java.lang.String relation,
                                   java.lang.String relationValue)
Specified by:
addSemanticRelation in interface IWikiModel
Overrides:
addSemanticRelation in class AbstractWikiModel

addTemplate

public void addTemplate(java.lang.String template)
Description copied from interface: IWikiModel
When a document contains a token indicating that the document includes a Wiki template this method should be called to add that template to the output metadata.

Specified by:
addTemplate in interface IWikiModel
Overrides:
addTemplate in class AbstractWikiModel
Parameters:
template - The name of the template that is being included.

appendInternalLink

public void appendInternalLink(java.lang.String link,
                               java.lang.String hashSection,
                               java.lang.String linkText)
Description copied from interface: IWikiModel
Append an internal wikilink as described in Help Links

Specified by:
appendInternalLink in interface IWikiModel
Overrides:
appendInternalLink in class AbstractWikiModel

getCategories

public java.util.Set<java.lang.String> getCategories()
Get the set of Wikipedia category names used in this text

Returns:
the set of category strings

getLinks

public java.util.Set<java.lang.String> getLinks()
Get the set of Wikipedia links used in this text

Returns:
the set of category strings

getSemanticAttributes

public java.util.List<SemanticAttribute> getSemanticAttributes()
Description copied from interface: IWikiModel
Get the list of SemanticAttributes

Specified by:
getSemanticAttributes in interface IWikiModel
Overrides:
getSemanticAttributes in class AbstractWikiModel
Returns:
the list of SemanticAttributes or null if no SemanticAttribute exists

getSemanticRelations

public java.util.List<SemanticRelation> getSemanticRelations()
Description copied from interface: IWikiModel
Get the list of SemanticRelations. See Semantic MediaWiki for more information.

Specified by:
getSemanticRelations in interface IWikiModel
Overrides:
getSemanticRelations in class AbstractWikiModel
Returns:
the list of SemanticRelations or null if no SemanticRelation exists

getTemplates

public java.util.Set<java.lang.String> getTemplates()

parseInternalImageLink

public void parseInternalImageLink(java.lang.String imageNamespace,
                                   java.lang.String name)
Description copied from interface: IWikiModel
Append this internal wiki image link

Parameters:
imageNamespace - the image namespace

replaceColon

public boolean replaceColon()
Description copied from interface: IWikiModel
Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates)

Specified by:
replaceColon in interface IWikiModel
Overrides:
replaceColon in class AbstractWikiModel
Returns:

setUp

public void setUp()
Description copied from interface: IWikiModel
Prepare or initialize the wiki model before rendering the wikipedia text

Specified by:
setUp in interface IWikiModel
Overrides:
setUp in class AbstractWikiModel