|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bliki.wiki.model.AbstractWikiModel
public abstract class AbstractWikiModel
Standard model implementation
| Constructor Summary | |
|---|---|
AbstractWikiModel()
|
|
AbstractWikiModel(Configuration configuration)
|
|
AbstractWikiModel(Configuration configuration,
java.util.Locale locale)
|
|
AbstractWikiModel(Configuration configuration,
java.util.ResourceBundle resourceBundle)
|
|
| 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. |
SourceCodeFormatter |
addCodeFormatter(java.lang.String key,
SourceCodeFormatter value)
Add a new source code formatter to the configuration |
java.lang.String |
addInterwikiLink(java.lang.String key,
java.lang.String value)
Add a new interwiki link to the configuration |
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. |
ITemplateFunction |
addTemplateFunction(java.lang.String key,
ITemplateFunction value)
Add a new interwiki link to the configuration |
TagToken |
addTokenTag(java.lang.String key,
TagToken value)
Add a new HTML styled tag to the configuration |
java.lang.String[] |
addToReferences(java.lang.String reference,
java.lang.String nameAttribute)
Add a reference (i.e. footnote) to the internal list |
void |
append(BaseToken contentNode)
Append the content as a child on the top node of the internal stack |
void |
appendExternalImageLink(java.lang.String imageSrc,
java.lang.String imageAltText)
Append an external wiki image link (starting with http, https,... and ending with gif, png, jpg, bmp) |
void |
appendExternalLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
Append an external link (starting with http, https, ftp,...) as described in Help Links |
void |
appendInternalImageLink(java.lang.String hrefImageLink,
java.lang.String srcImageLink,
ImageFormat imageFormat)
Append this internal wiki image link |
void |
appendInternalLink(java.lang.String link,
java.lang.String hashSection,
java.lang.String linkText)
Append an internal wikilink as described in Help Links |
void |
appendInterWikiLink(java.lang.String namespace,
java.lang.String title,
java.lang.String linkText)
Append an InterWiki link |
void |
appendISBNLink(java.lang.String isbnPureText)
Append an external ISBN link (starting with ISBN ) as
described in Wikipedia:ISBN
Note: The default implementation in the AbstractWikiModel class creates a link to Amazon.com. |
void |
appendMailtoLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
Append an external link (starting with mailto:...) as described in Help:Wikitext#Links |
boolean |
appendRedirectLink(java.lang.String redirectLink)
Append the redirect link to the model |
void |
appendStack(TagStack stack)
|
void |
buildEditLinkUrl(int section)
Build the link to edit a section of the wikipedia article |
int |
decrementRecursionLevel()
Increment the current recursion level of the parser |
java.lang.String |
get2ndCategoryNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for categories in this wiki |
java.lang.String |
get2ndImageNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for images in this wiki |
java.lang.String |
get2ndTemplateNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for templates in this wiki |
java.lang.String |
getCategoryNamespace()
Get the primary namespace for categories in this wiki |
java.util.Map<java.lang.String,SourceCodeFormatter> |
getCodeFormatterMap()
Get the source code formatter map of built-in source code formatters |
java.lang.String |
getImageNamespace()
Get the primary namespace for images in this wiki |
java.util.Map<java.lang.String,java.lang.String> |
getInterwikiMap()
Get the interwiki links map for converting interwiki links into external URLs. |
TagToken |
getNode(int offset)
Get the node at the given offset on the internal stack |
java.lang.String |
getRawWikiContent(java.lang.String namespace,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.String> templateParameters)
Get the raw wiki text for the given namespace and article name. |
int |
getRecursionLevel()
Get the current recursion level of the parser |
java.lang.String |
getRedirectLink()
Get the redirect link. |
java.util.List<Reference> |
getReferences()
Get the internal list of references (i.e. footnotes) |
java.util.ResourceBundle |
getResourceBundle()
Get the resource bundle associated with this model for I18N support |
java.util.List<SemanticAttribute> |
getSemanticAttributes()
Get the list of SemanticAttributes |
java.util.List<SemanticRelation> |
getSemanticRelations()
Get the list of SemanticRelations. |
TableOfContentTag |
getTableOfContentTag(boolean isTOCIdentifier)
Get the "table of content" placeholder |
ITemplateFunction |
getTemplateFunction(java.lang.String name)
Get a template parser function (i.e. |
java.util.Map<java.lang.String,ITemplateFunction> |
getTemplateMap()
Get the template parser functions map of built-in template functions |
java.lang.String |
getTemplateNamespace()
Get the primary namespace for templates in this wiki |
java.util.Map<java.lang.String,TagToken> |
getTokenMap()
Get the HTML styled tag map for built-in tags |
IEventListener |
getWikiListener()
Get the current defined wiki listener |
int |
incrementRecursionLevel()
Increment the current recursion level of the parser |
boolean |
isCategoryNamespace(java.lang.String namespace)
Check if the given namespace is a category namespace |
boolean |
isImageNamespace(java.lang.String namespace)
Check if the given namespace is a image namespace |
boolean |
isInterWiki(java.lang.String namespace)
Check if the given namespace for an interwiki link |
boolean |
isNamespace(java.lang.String namespace)
Check if the given namespace is a namespace in this model |
boolean |
isSemanticWebActive()
Allow the parsing of semantic mediawiki (SMW) links See Semantic MediaWiki for more information. |
boolean |
isTemplateNamespace(java.lang.String namespace)
Check if the given namespace is a template namespace |
boolean |
isTemplateTopic()
Determine if the currently parsed wiki text is a template. |
boolean |
parseBBCodes()
Parse phpBB like syntax codes in this wiki |
void |
parseEvents(IEventListener listener,
java.lang.String rawWikiText)
Parse the raw Wikipedia text and notify the listener |
java.lang.String |
parseTemplates(java.lang.String rawWikiText)
Parse the templates in a raw wikipedia text into a resulting wikipedia text. |
TagToken |
peekNode()
Get the current TagNode on top of the internal stack |
TagToken |
popNode()
Pop the current TagNode from top of the internal stack |
boolean |
pushNode(TagToken node)
Push the given TagNode on top of the internal stack |
java.lang.String |
render(ITextConverter converter,
java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string |
java.lang.String |
render(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default HTMLConverter |
java.lang.String |
renderLaTeX(java.lang.String rawWikiText)
|
java.lang.String |
renderPDF(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default PDFConverter. |
boolean |
replaceColon()
Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates) |
void |
setSemanticWebActive(boolean semanticWeb)
Activate the parsing of semantic Mediawiki (SMW) links See Semantic MediaWiki for more information. |
void |
setUp()
Prepare or initialize the wiki model before rendering the wikipedia text |
boolean |
showSyntax(java.lang.String tagName)
Show the syntax highlighting of the source code |
int |
stackSize()
The size of the internal stack |
TagStack |
swapStack(TagStack stack)
|
void |
tearDown()
Clean up (i.e. free internal resources) in the wiki model after rendering the wikipedia text, if necessary |
java.util.List<BaseToken> |
toNodeList(java.lang.String rawWikiText)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface info.bliki.wiki.model.IWikiModel |
|---|
getLinks, parseInternalImageLink |
| Constructor Detail |
|---|
public AbstractWikiModel()
public AbstractWikiModel(Configuration configuration)
public AbstractWikiModel(Configuration configuration,
java.util.Locale locale)
public AbstractWikiModel(Configuration configuration,
java.util.ResourceBundle resourceBundle)
| Method Detail |
|---|
public void addCategory(java.lang.String categoryName,
java.lang.String sortKey)
IWikiModel
addCategory in interface IWikiModelcategoryName - 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".
public SourceCodeFormatter addCodeFormatter(java.lang.String key,
SourceCodeFormatter value)
IConfiguration
addCodeFormatter in interface IConfiguration
public java.lang.String addInterwikiLink(java.lang.String key,
java.lang.String value)
IConfiguration
addInterwikiLink in interface IConfigurationkey - the prefix used in the interwiki link (i.e. [[prefix:...]] )value - the external link which should be generated from the interwiki
link
public void addLink(java.lang.String topicName)
IWikiModel
addLink in interface IWikiModeltopicName - The name of the topic that is linked to.
public boolean addSemanticAttribute(java.lang.String attribute,
java.lang.String attributeValue)
addSemanticAttribute in interface IWikiModel
public boolean addSemanticRelation(java.lang.String relation,
java.lang.String relationValue)
addSemanticRelation in interface IWikiModelpublic void addTemplate(java.lang.String template)
IWikiModel
addTemplate in interface IWikiModeltemplate - The name of the template that is being included.
public ITemplateFunction addTemplateFunction(java.lang.String key,
ITemplateFunction value)
IConfiguration
addTemplateFunction in interface IConfiguration
public TagToken addTokenTag(java.lang.String key,
TagToken value)
IConfiguration
addTokenTag in interface IConfiguration
public java.lang.String[] addToReferences(java.lang.String reference,
java.lang.String nameAttribute)
IWikiModel
addToReferences in interface IWikiModelreference - the rendered HTML code of the ref-Tag bodynameAttribute - the value of the name attribute or
null
public void append(BaseToken contentNode)
IWikiModel
append in interface IWikiModel
public void appendExternalImageLink(java.lang.String imageSrc,
java.lang.String imageAltText)
IWikiModel
appendExternalImageLink in interface IWikiModel
public void appendExternalLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
IWikiModel
appendExternalLink in interface IWikiModellink - the external link with http://, https:// or ftp://
prefixlinkName - the link name which is separated from the URL by a spacewithoutSquareBrackets - if true a link with no square brackets around the
link was parsed
public void appendInternalImageLink(java.lang.String hrefImageLink,
java.lang.String srcImageLink,
ImageFormat imageFormat)
IWikiModel
appendInternalImageLink in interface IWikiModel
public void appendInternalLink(java.lang.String link,
java.lang.String hashSection,
java.lang.String linkText)
IWikiModel
appendInternalLink in interface IWikiModel
public void appendInterWikiLink(java.lang.String namespace,
java.lang.String title,
java.lang.String linkText)
IWikiModel
appendInterWikiLink in interface IWikiModelpublic void appendISBNLink(java.lang.String isbnPureText)
IWikiModelISBN ) as
described in Wikipedia:ISBN
AbstractWikiModel class creates a link to Amazon.com.
appendISBNLink in interface IWikiModelisbnPureText - the pure ISBN string which contains the ISBN prefix and optional
dashes in the ISBN number
public void appendMailtoLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
IWikiModel
appendMailtoLink in interface IWikiModellink - the external link with mailto: prefixlinkName - the link name which is separated from the URL by a spacewithoutSquareBrackets - if true a mailto link with no square brackets
around the link was parsedpublic boolean appendRedirectLink(java.lang.String redirectLink)
IWikiModel
appendRedirectLink in interface IWikiModelredirectLink - the raw string between the wikilink tags [[ ]]
true if the the wikitext shouldn't be parsedpublic void appendStack(TagStack stack)
appendStack in interface IWikiModelpublic void buildEditLinkUrl(int section)
IWikiModel
buildEditLinkUrl in interface IWikiModelpublic int decrementRecursionLevel()
IWikiModel
decrementRecursionLevel in interface IWikiModelpublic java.lang.String get2ndCategoryNamespace()
IWikiModel
get2ndCategoryNamespace in interface IWikiModelpublic java.lang.String get2ndImageNamespace()
IWikiModel
get2ndImageNamespace in interface IWikiModelpublic java.lang.String get2ndTemplateNamespace()
IWikiModel
get2ndTemplateNamespace in interface IWikiModelpublic java.lang.String getCategoryNamespace()
IWikiModel
getCategoryNamespace in interface IWikiModelpublic java.util.Map<java.lang.String,SourceCodeFormatter> getCodeFormatterMap()
IConfiguration
getCodeFormatterMap in interface IConfigurationpublic java.lang.String getImageNamespace()
IWikiModel
getImageNamespace in interface IWikiModelpublic java.util.Map<java.lang.String,java.lang.String> getInterwikiMap()
IConfiguration
getInterwikiMap in interface IConfigurationpublic TagToken getNode(int offset)
IWikiModel
getNode in interface IWikiModel
public java.lang.String getRawWikiContent(java.lang.String namespace,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.String> templateParameters)
getRawWikiContent in interface IWikiModelnamespace - the namespace of this articletemplateName - templateParameters - if the namespace is the Template namespace the current
template parameters are stored as Strings in this
map
null if no content was foundpublic int getRecursionLevel()
IWikiModel
getRecursionLevel in interface IWikiModelpublic java.lang.String getRedirectLink()
IWikiModel
getRedirectLink in interface IWikiModel[[ ]] or
null if no redirect existspublic java.util.List<Reference> getReferences()
IWikiModel
getReferences in interface IWikiModelnull if no reference
existsReferencepublic java.util.List<SemanticAttribute> getSemanticAttributes()
IWikiModel
getSemanticAttributes in interface IWikiModelnull if no
SemanticAttribute existspublic java.util.List<SemanticRelation> getSemanticRelations()
IWikiModel
getSemanticRelations in interface IWikiModelnull if no
SemanticRelation existspublic TableOfContentTag getTableOfContentTag(boolean isTOCIdentifier)
IWikiModel
getTableOfContentTag in interface IWikiModelpublic ITemplateFunction getTemplateFunction(java.lang.String name)
IWikiModel{{ #if: ... }} )
implementation.
getTemplateFunction in interface IWikiModelname - the name of the function without the "#" and
":" delimiters
null if no function is
available for the given namepublic java.util.Map<java.lang.String,ITemplateFunction> getTemplateMap()
IConfiguration
getTemplateMap in interface IConfigurationpublic java.lang.String getTemplateNamespace()
IWikiModel
getTemplateNamespace in interface IWikiModelpublic java.util.Map<java.lang.String,TagToken> getTokenMap()
IConfiguration
getTokenMap in interface IConfigurationpublic IEventListener getWikiListener()
IWikiModel
getWikiListener in interface IWikiModelnull if no listener is definedpublic int incrementRecursionLevel()
IWikiModel
incrementRecursionLevel in interface IWikiModelpublic boolean isCategoryNamespace(java.lang.String namespace)
IWikiModel
isCategoryNamespace in interface IWikiModelpublic boolean isImageNamespace(java.lang.String namespace)
IWikiModel
isImageNamespace in interface IWikiModelpublic boolean isInterWiki(java.lang.String namespace)
IWikiModel
isInterWiki in interface IWikiModelpublic boolean isNamespace(java.lang.String namespace)
IWikiModel
isNamespace in interface IWikiModelpublic boolean isSemanticWebActive()
IWikiModel
isSemanticWebActive in interface IWikiModelpublic boolean isTemplateNamespace(java.lang.String namespace)
IWikiModel
isTemplateNamespace in interface IWikiModelpublic boolean isTemplateTopic()
IWikiModel
isTemplateTopic in interface IWikiModeltrue if the currently parsed wiki text is a templatepublic boolean parseBBCodes()
IWikiModel
parseBBCodes in interface IWikiModel
public void parseEvents(IEventListener listener,
java.lang.String rawWikiText)
IWikiModel
parseEvents in interface IWikiModelpublic java.lang.String parseTemplates(java.lang.String rawWikiText)
IWikiModel
parseTemplates in interface IWikiModelpublic TagToken peekNode()
IWikiModel
peekNode in interface IWikiModelpublic TagToken popNode()
IWikiModel
popNode in interface IWikiModelpublic boolean pushNode(TagToken node)
IWikiModel
pushNode in interface IWikiModeltrue if the push on the internal stack was
successful
public java.lang.String render(ITextConverter converter,
java.lang.String rawWikiText)
IWikiModel
render in interface IWikiModelnull if an IOException occurspublic java.lang.String render(java.lang.String rawWikiText)
IWikiModel
render in interface IWikiModelnull if an IOException occurspublic java.lang.String renderLaTeX(java.lang.String rawWikiText)
public java.lang.String renderPDF(java.lang.String rawWikiText)
IWikiModel
renderPDF in interface IWikiModelnull if an IOException occurspublic boolean replaceColon()
IWikiModel
replaceColon in interface IWikiModelpublic void setSemanticWebActive(boolean semanticWeb)
IWikiModel
setSemanticWebActive in interface IWikiModelpublic void setUp()
IWikiModel
setUp in interface IWikiModelpublic boolean showSyntax(java.lang.String tagName)
IWikiModel
showSyntax in interface IWikiModelpublic int stackSize()
IWikiModel
stackSize in interface IWikiModelpublic TagStack swapStack(TagStack stack)
swapStack in interface IWikiModelpublic void tearDown()
IWikiModel
tearDown in interface IWikiModelpublic java.util.List<BaseToken> toNodeList(java.lang.String rawWikiText)
public java.util.ResourceBundle getResourceBundle()
IWikiModel
getResourceBundle in interface IWikiModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||