|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IWikiModel
Interface for rendering a wiki model
| 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. |
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.lang.String |
getImageNamespace()
Get the primary namespace for images in this wiki |
java.util.Set<java.lang.String> |
getLinks()
Get the set of Wikipedia link names |
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.lang.String |
getTemplateNamespace()
Get the primary namespace for templates in this wiki |
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 |
void |
parseInternalImageLink(java.lang.String imageNamespace,
java.lang.String rawImageLink)
Append this internal wiki image link |
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 |
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 |
| Methods inherited from interface info.bliki.wiki.model.IConfiguration |
|---|
addCodeFormatter, addInterwikiLink, addTemplateFunction, addTokenTag, getCodeFormatterMap, getInterwikiMap, getTemplateMap, getTokenMap |
| Method Detail |
|---|
void addCategory(java.lang.String categoryName,
java.lang.String sortKey)
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".void addLink(java.lang.String topicName)
topicName - The name of the topic that is linked to.
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)
template - The name of the template that is being included.
java.lang.String[] addToReferences(java.lang.String reference,
java.lang.String nameAttribute)
reference - the rendered HTML code of the ref-Tag bodynameAttribute - the value of the name attribute or
null
void append(BaseToken contentNode)
contentNode -
void appendExternalImageLink(java.lang.String imageSrc,
java.lang.String imageAltText)
imageSrc - hashSection - imageAltText -
void appendExternalLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
link - 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
void appendInternalImageLink(java.lang.String hrefImageLink,
java.lang.String srcImageLink,
ImageFormat imageFormat)
hrefImageLink - srcImageLink - imageFormat -
void appendInternalLink(java.lang.String link,
java.lang.String hashSection,
java.lang.String linkText)
link - hashSection - linkText -
void appendInterWikiLink(java.lang.String namespace,
java.lang.String title,
java.lang.String linkText)
namespace - title - linkText - void appendISBNLink(java.lang.String isbnPureText)
ISBN ) as
described in Wikipedia:ISBN
AbstractWikiModel class creates a link to Amazon.com.
isbnPureText - the pure ISBN string which contains the ISBN prefix and optional
dashes in the ISBN number
void appendMailtoLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
link - 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 parsedboolean appendRedirectLink(java.lang.String redirectLink)
redirectLink - the raw string between the wikilink tags [[ ]]
true if the the wikitext shouldn't be parsedvoid appendStack(TagStack stack)
void buildEditLinkUrl(int section)
section - int decrementRecursionLevel()
java.lang.String get2ndCategoryNamespace()
java.lang.String get2ndImageNamespace()
java.lang.String get2ndTemplateNamespace()
java.lang.String getCategoryNamespace()
java.lang.String getImageNamespace()
java.util.Set<java.lang.String> getLinks()
TagToken getNode(int offset)
offset -
java.lang.String getRawWikiContent(java.lang.String namespace,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.String> templateParameters)
namespace - the namespace of this articletemplateName - the name of the templatetemplateParameters - if the namespace is the Template namespace the current
template parameters are stored as Strings in this
map
null if no content was foundint getRecursionLevel()
java.lang.String getRedirectLink()
[[ ]] or
null if no redirect existsjava.util.List<Reference> getReferences()
null if no reference
existsReferencejava.util.ResourceBundle getResourceBundle()
java.util.List<SemanticAttribute> getSemanticAttributes()
null if no
SemanticAttribute existsjava.util.List<SemanticRelation> getSemanticRelations()
null if no
SemanticRelation existsTableOfContentTag getTableOfContentTag(boolean isTOCIdentifier)
isTOCIdentifier -
ITemplateFunction getTemplateFunction(java.lang.String name)
{{ #if: ... }} )
implementation.
name - the name of the function without the "#" and
":" delimiters
null if no function is
available for the given namejava.lang.String getTemplateNamespace()
IEventListener getWikiListener()
null if no listener is definedint incrementRecursionLevel()
boolean isCategoryNamespace(java.lang.String namespace)
namespace -
boolean isImageNamespace(java.lang.String namespace)
namespace -
boolean isInterWiki(java.lang.String namespace)
namespace -
boolean isNamespace(java.lang.String namespace)
namespace -
boolean isSemanticWebActive()
namespace -
boolean isTemplateNamespace(java.lang.String namespace)
namespace -
boolean isTemplateTopic()
true if the currently parsed wiki text is a templateboolean parseBBCodes()
void parseEvents(IEventListener listener,
java.lang.String rawWikiText)
rawWikiText -
void parseInternalImageLink(java.lang.String imageNamespace,
java.lang.String rawImageLink)
imageNamespace - the image namespacerawImageLink - java.lang.String parseTemplates(java.lang.String rawWikiText)
rawWikiText -
TagToken peekNode()
TagToken popNode()
boolean pushNode(TagToken node)
true if the push on the internal stack was
successful
java.lang.String render(ITextConverter converter,
java.lang.String rawWikiText)
rawWikiText -
null if an IOException occursjava.lang.String render(java.lang.String rawWikiText)
rawWikiText -
null if an IOException occursjava.lang.String renderPDF(java.lang.String rawWikiText)
rawWikiText -
null if an IOException occursboolean replaceColon()
void setSemanticWebActive(boolean semanticWeb)
void setUp()
boolean showSyntax(java.lang.String tagName)
int stackSize()
TagStack swapStack(TagStack stack)
void tearDown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||