|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bliki.wiki.model.AbstractWikiModel
info.bliki.wiki.model.WikiModel
public class WikiModel
Standard model implementation
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
categories
A map for categories and their associated sort keys |
protected java.lang.String |
fExternalImageBaseURL
|
protected java.lang.String |
fExternalWikiBaseURL
|
protected java.util.Set<java.lang.String> |
links
|
protected java.util.List<SemanticAttribute> |
semanticAttributes
|
protected java.util.List<SemanticRelation> |
semanticRelations
|
protected java.util.Set<java.lang.String> |
templates
|
Fields inherited from class info.bliki.wiki.model.AbstractWikiModel |
---|
attributeRenderers, attributes, fNamespace, fPageTitle, fParserRecursionCount, fRecursionLevel, fRedirectLink, fReferenceNames, fReferences, fSectionCounter, fTableOfContent, fTableOfContentTag, fTagStack, fTemplateRecursionCount, fToCSet |
Constructor Summary | |
---|---|
WikiModel(Configuration configuration,
java.util.Locale locale,
java.lang.String imageBaseURL,
java.lang.String linkBaseURL)
|
|
WikiModel(Configuration configuration,
java.util.ResourceBundle resourceBundle,
INamespace namespace,
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)
See Semantic MediaWiki for more information. |
boolean |
addSemanticRelation(java.lang.String relation,
java.lang.String relationValue)
See Semantic MediaWiki for more information. |
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 topic,
java.lang.String hashSection,
java.lang.String topicDescription,
java.lang.String cssClass,
boolean parseRecursive)
Append an internal wikilink as described in Help Links |
java.util.Map<java.lang.String,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 |
INamespace |
getNamespace()
Get the namespace of this model. |
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 rawImageLink)
Append the internal wiki image link to this model. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,java.lang.String> categories
protected java.util.Set<java.lang.String> links
protected java.util.Set<java.lang.String> templates
protected java.util.List<SemanticRelation> semanticRelations
protected java.util.List<SemanticAttribute> semanticAttributes
protected java.lang.String fExternalImageBaseURL
protected java.lang.String fExternalWikiBaseURL
Constructor Detail |
---|
public WikiModel(java.lang.String imageBaseURL, java.lang.String linkBaseURL)
imageBaseURL
- a url string which must contains a "${image}" variable
which will be replaced by the image name, to create links to
images.linkBaseURL
- a url string which must contains a "${title}" variable
which will be replaced by the topic title, to create links to
other wiki topics.public WikiModel(Configuration configuration, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
public WikiModel(Configuration configuration, java.util.Locale locale, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
public WikiModel(Configuration configuration, java.util.ResourceBundle resourceBundle, INamespace namespace, java.lang.String imageBaseURL, java.lang.String linkBaseURL)
Method Detail |
---|
public void addCategory(java.lang.String categoryName, java.lang.String sortKey)
sortKey
see also Wikipedia:Categorization#Category_sorting
addCategory
in interface IWikiModel
addCategory
in class AbstractWikiModel
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".public void addLink(java.lang.String topicName)
addLink
in interface IWikiModel
addLink
in class AbstractWikiModel
topicName
- The name of the topic that is linked to.public boolean addSemanticAttribute(java.lang.String attribute, java.lang.String attributeValue)
addSemanticAttribute
in interface IWikiModel
addSemanticAttribute
in class AbstractWikiModel
public boolean addSemanticRelation(java.lang.String relation, java.lang.String relationValue)
addSemanticRelation
in interface IWikiModel
addSemanticRelation
in class AbstractWikiModel
public void addTemplate(java.lang.String template)
addTemplate
in interface IWikiModel
addTemplate
in class AbstractWikiModel
template
- The name of the template that is being included.public void appendInternalLink(java.lang.String topic, java.lang.String hashSection, java.lang.String topicDescription, java.lang.String cssClass, boolean parseRecursive)
appendInternalLink
in interface IWikiModel
appendInternalLink
in class AbstractWikiModel
cssClass
- the links CSS class styleparseRecursive
- TODOpublic java.util.Map<java.lang.String,java.lang.String> getCategories()
public java.util.Set<java.lang.String> getLinks()
public java.util.List<SemanticAttribute> getSemanticAttributes()
getSemanticAttributes
in interface IWikiModel
getSemanticAttributes
in class AbstractWikiModel
null
if no
SemanticAttribute existspublic java.util.List<SemanticRelation> getSemanticRelations()
getSemanticRelations
in interface IWikiModel
getSemanticRelations
in class AbstractWikiModel
null
if no
SemanticRelation existspublic java.util.Set<java.lang.String> getTemplates()
public void parseInternalImageLink(java.lang.String imageNamespace, java.lang.String rawImageLink)
rawImageLink
into different segments. The first segment is
used as the <image-name>
and typically ends with
extensions like .png
, .gif
, .jpg
or
.jpeg
.
<size>px-<image-name>
, otherwise
it's only the <image-name>
.
imageNamespace
- the image namespacerawImageLink
- the raw image link text without the surrounding
[[...]]
public boolean replaceColon()
replaceColon
in interface IWikiModel
replaceColon
in class AbstractWikiModel
public void setUp()
setUp
in interface IWikiModel
setUp
in class AbstractWikiModel
public INamespace getNamespace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |