public class XMLArticle extends AbstractXMLParentArticle implements java.lang.Comparable<Article>
<article id="articleID" desc="article description"> <par> This is a paragraph. </par> <cat id="category" /> </article>This article can be referenced by its ID or its description. These references are all valid:
<ref id="articleID" desc="the description" />
<ref id="article description" desc="the description" />
<ref id="article_description" desc="the description" />
<article desc="article description"> <par> This is a paragraph. </par> <cat id="category" /> </article>This article can be referenced by its description only because it has no ID. These two references are valid:
<ref id="article description" desc="the description" />
<ref id="article_description" desc="the description" />
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
desc
The article description.
|
protected java.lang.String |
id
The article ID.
|
chapters, paragraphs
INDEX, INDEX_LC, TYPE_ARTICLE, TYPE_DISAMB, TYPE_FALLBACK, TYPE_INDEX, TYPE_RAW_HTML, TYPE_REDIRECT, TYPE_TEMPLATE
ARTICLE, CATEGORIES, CATEGORY, DICTIONARY, FOOTER, FULL_TEXT_SEARCH, GLOSSARY, HEADER, IMAGE_DEFINITION, IMAGES_DEFINITION, INFOBOX_DEFINITION, INFOBOX_PROPERTY, MENUS, PACKAGE, RESOURCE_DEFINITION, RESOURCES_DEFINITION, UNDEFINED
Constructor and Description |
---|
XMLArticle(java.lang.String desc,
boolean keepCase)
Constructor.
|
XMLArticle(java.lang.String desc,
boolean keepCase,
boolean isConcurrent)
Constructor.
|
XMLArticle(java.lang.String id,
java.lang.String desc,
boolean keepCase)
Constructor.
|
XMLArticle(java.lang.String id,
java.lang.String desc,
boolean keepCase,
boolean isConcurrent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAlternateTitle(java.lang.String title,
boolean keepCase,
boolean inDictionnary)
Add an alternate title to the article.
|
void |
addAnchor(AnchorElement anchor)
Add an Anchor to the article.
|
void |
addCategory(java.lang.String category)
Add a category on which this article belongs.
|
void |
addChapter(XMLChapter chapter)
Add a chapter to the article.
|
void |
addChapter(XMLChapter chapter,
boolean includeInSearch,
boolean allowIdenticalTitles)
Add a resolved chapter to the article.
|
void |
addComment(XMLComment comment)
Add a comment.
|
void |
addInclude(XMLInclude include)
Add an included article or template.
|
void |
addInfobox(XMLInfobox infobox)
Add an infobox.
|
void |
addMap(XMLMap map)
Add a Map.
|
void |
addMessageBox(XMLMessageBox messageBox)
Add a message box.
|
void |
addNote(NoteContent note)
Add a note.
|
void |
addResolvedChapter(XMLChapter chapter,
boolean allowIdenticalTitles)
Add a resolved chapter to the article.
|
void |
addResolvedTitle(XMLTitle title,
boolean allowIdenticalTitles)
Add a resolved title to the article.
|
void |
addSeeAlsoReference(XMLSeeAlso ref)
Add a SeeAlso reference.
|
void |
addTitle(TitledElement title,
boolean allowIdenticalTitles)
Add a title to the article.
|
void |
addTitle(XMLTitle title,
boolean includeInSearch,
boolean allowIdenticalTitles)
Add a resolved title to the article.
|
void |
addTodo(TodoElement todo)
Add a todo.
|
boolean |
articleNameAlreadyTaken()
Return true if the article name was already taken, and the article was not added in the model.
|
int |
compareTo(Article article) |
int |
countSortableTables()
Return the number of sortable tables in the article.
|
int |
countTitles()
Return the number of titles and chapters currently defined in the Article.
|
boolean |
equals(java.lang.Object obj) |
java.util.Set<java.lang.String> |
getAlternateTitles()
Return the article alternate titles.
|
java.util.Map<java.lang.String,AlternateTitle> |
getAlternateTitlesMap()
Return the article alternate titles to the raw titles Map.
|
AnchorElement |
getAnchor(java.lang.String id)
Return the AnchorElement of a specified id (including the included articles or templates).
|
java.util.Map<java.lang.String,AnchorElement> |
getAnchorElements()
Return all the anchor elements of the articles sorted by their title.
|
java.util.Map<java.lang.String,XMLAnchor> |
getAnchors()
Return all the "anchor" elements of the articles sorted by their title.
|
XMLArticle |
getArticle()
Return itself.
|
ArticleRef |
getArticleRef()
Return the article ref.
|
short |
getArticleType()
Return the article type.
|
java.util.Set<java.lang.String> |
getCategories()
Return the categories on which this article belongs.
|
java.lang.String |
getDescription()
Return the article description.
|
java.lang.String |
getHeader()
Construct the header text for the article.
|
java.lang.String |
getHeader(boolean escaping)
Construct the header text for the article.
|
java.lang.String |
getID()
Return the article ID.
|
java.util.List<XMLInclude> |
getIncludes()
Return the list of included articles or templates.
|
java.util.List<XMLInfobox> |
getInfoboxes()
Return the list of infoboxes.
|
java.io.File |
getInputFile()
Return the article input XML file.
|
char |
getJustification()
Return the justification of the article.
|
java.io.File |
getLinksFromFile()
Return the article links from HTML file.
|
java.util.List<XMLMap> |
getMaps()
Return the list of maps in the article.
|
java.util.Collection<XMLMessageBox> |
getMessageBoxes()
Return the message boxes.
|
java.lang.String |
getMeta()
Return the meta description to be used for the article for the dictionnary or categories.
|
NoteContent |
getNote(java.lang.String id)
Return the note of a specified ID.
|
java.util.List<NoteContent> |
getNotes()
Return the notes.
|
java.util.Map<java.lang.String,NoteContent> |
getNotesByID()
Return the notes sorted by their ID.
|
java.io.File |
getOutputFile()
Return the article output HTML file.
|
java.lang.String |
getPackage()
Return the article package.
|
XMLParent |
getParent()
Return null.
|
java.lang.String |
getRelativePath()
Return the relative path of the article XML file, from the associated root.
|
java.util.List<ReviewElement> |
getReviewElements()
Return the review elements.
|
java.util.Map<java.lang.String,TitledElement> |
getSearchableTitles()
Return the map of Searchable titles.
|
java.util.List<XMLSeeAlso> |
getSeeAlso()
Return the list of SeeAlso references.
|
XMLSeeAlsoHeading |
getSeeAlsoHeading()
Return the SeeAlso in the heading if its exists.
|
int |
getSuffix()
Return the article name suffix (used for articles which have the name of an already existing article).
|
short |
getSyntaxType()
Return the article syntax type.
|
java.util.List<TitledElement> |
getTitledElementsList()
Return the ordered list of titled elements (chapters or titles).
|
java.util.List<TitleOrIncludeElement> |
getTitlesOrIncludes()
Return the list of titles and XMLInclude elements.
|
boolean |
hasAnchor(java.lang.String id)
Return true if the article has an Anchor of a specified title (including the included articles or templates).
|
boolean |
hasAnchorElement(java.lang.String id)
Return true if the article has a titled element of a specified ID.
|
boolean |
hasAnchors()
Return true if the article has anchors.
|
int |
hashCode() |
boolean |
hasID()
Return true if the article has a separate ID.
|
boolean |
hasImageMaps()
Return true if the article has image maps.
|
boolean |
hasIncludes()
Return true if the list of included articles or templates is not empty.
|
boolean |
hasInfoboxes()
Return true if the article has infoboxes.
|
boolean |
hasMaps()
Return true if the article has Maps.
|
boolean |
hasMessageBoxes()
Return true if there are message boxes.
|
boolean |
hasNote(java.lang.String id)
Return true if there is a note for a specified id.
|
boolean |
hasPackage()
Return true if the article has a package.
|
boolean |
hasReviewElements()
Return true if there are review elements.
|
boolean |
hasSearchableTitles()
Return true if the article has searchable titles.
|
boolean |
hasTitledElementsList()
Return true if there is a list of titled elements (chapters or titles).
|
boolean |
hasTitles()
Return true if the article has at least one title.
|
boolean |
hasTOC()
Return true if the article should have a Table of content (true by default).
|
void |
incrementSortableTables(int inc)
Increment the number of sortable tables in the article.
|
boolean |
isDirect()
Return true.
|
boolean |
isIndex()
Return false.
|
boolean |
isKeepingCase()
Return true if the article title should keep the title description case.
|
boolean |
isNotesTwoColumns()
Return true if the notes layout is on two columns.
|
boolean |
isTemplate()
Return true if this article is a template.
|
boolean |
isTitlesResolved()
Return true if the titles has been resolved.
|
boolean |
isXMLArticle()
Return true.
|
void |
resolveTitles()
Tag the titles as resolved.
|
void |
setArticleNameAlreadyTaken(boolean articleNameAlreadyTaken)
Set if the article name was already taken, and the article was not added in the model.
|
void |
setCategories(java.util.Set<java.lang.String> categories)
Set the categories on which this article belongs.
|
void |
setDescription(java.lang.String id,
java.lang.String desc,
boolean keepCase)
Set the article description.
|
void |
setHasImageMaps(boolean hasImageMaps)
Set if the article has image maps.
|
void |
setID(java.lang.String id)
Set the article ID.
|
void |
setInputFile(java.io.File file)
Set the article input XML file.
|
void |
setJustification(char justification)
Set the justification of the article.
|
void |
setKeepCase(boolean keepCase)
Set if the article title should keep the title description case.
|
void |
setLinksFromFile(java.io.File file)
Set the article links from XML file.
|
void |
setMeta(java.lang.String meta)
Set the meta description to be used for the article for the dictionnary or categories.
|
void |
setNotesTwoColumns(boolean notesTwoColumns)
Set if the notes layout is on two columns.
|
void |
setOutputFile(java.io.File file)
Set the article output XML file.
|
void |
setPackage(java.lang.String pack)
Set the package ID of the article.
|
void |
setRelativePath(java.lang.String path)
Set the relative path of the article XML file, from the associated root.
|
void |
setSeeAlsoHeading(XMLSeeAlsoHeading seeAlsoHeading)
Set the "seeAlso" element in the heading.
|
void |
setSuffix(int suffix)
Set the article name suffix.
|
void |
setSyntaxType(short syntaxType)
Set the article syntax type.
|
void |
setTemplate(boolean isTemplate)
Set if this article is a template.
|
void |
setTitledElementsList(java.util.List<TitledElement> titledEltsList)
Set the ordered list of titled elements (chapters or titles).
|
void |
setTOC(boolean hasTOC)
Set if the article should have a Table of content.
|
java.lang.String |
toString() |
addArticleParent, addLinkFromArticle, addReference, addReference, getArticleParents, getCondition, getLinksFrom, getReferences, getRoot, hasCondition, hasImages, isPresent, setCondition, setImages, setLinkFromArticles, setRoot
addParagraph, getChapters, getParagraphs
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasNotes, isGlobalIndex
getNormalizedAlternateTitles, getRef, getRootElementType, getTitle, hasAlternateTitles, hasSuffix, isDirectXMLArticle, isRawHTMLArticle, isValid
getAbsolutePath, hasInputFile, isParsable
hasRoot, isArticle, isFallback, notExistingInputFile
addParagraph, getChapters, getParagraphs
hasOutputFile
protected java.lang.String id
protected java.lang.String desc
public XMLArticle(java.lang.String desc, boolean keepCase)
desc
- the article description. The article getID()
will be equal to its descriptionkeepCase
- true if the article description should keep the title description casepublic XMLArticle(java.lang.String id, java.lang.String desc, boolean keepCase)
id
- the article iddesc
- the article descriptionkeepCase
- true if the article description should keep the title description casepublic XMLArticle(java.lang.String desc, boolean keepCase, boolean isConcurrent)
desc
- the article description. The article getID()
will be equal to its descriptionkeepCase
- true if the article description should keep the title description caseisConcurrent
- true for concurrent parsingpublic XMLArticle(java.lang.String id, java.lang.String desc, boolean keepCase, boolean isConcurrent)
id
- the article iddesc
- the article descriptionkeepCase
- true if the article description should keep the title description caseisConcurrent
- true for a concurrent parsingpublic void setArticleNameAlreadyTaken(boolean articleNameAlreadyTaken)
setArticleNameAlreadyTaken
in interface Article
articleNameAlreadyTaken
- true if the article name was already takenpublic boolean articleNameAlreadyTaken()
articleNameAlreadyTaken
in interface Article
public short getArticleType()
getArticleType
in interface Article
public boolean isXMLArticle()
isXMLArticle
in interface XMLParentArticle
public int getSuffix()
public void setSuffix(int suffix)
public void setID(java.lang.String id)
public void setDescription(java.lang.String id, java.lang.String desc, boolean keepCase)
setDescription
in interface Article
id
- the article iddesc
- the article descriptionkeepCase
- true if the article description should keep the title description casepublic void setSyntaxType(short syntaxType)
syntaxType
- the article syntax typeSyntaxType
public short getSyntaxType()
SyntaxType
public void setNotesTwoColumns(boolean notesTwoColumns)
notesTwoColumns
- true if the notes layout is on two columnspublic boolean isNotesTwoColumns()
isNotesTwoColumns
in interface XMLParentArticle
public void setPackage(java.lang.String pack)
setPackage
in interface org.docgene.model.globals.XMLRootElement
pack
- the package ID of the articlepublic int countSortableTables()
countSortableTables
in interface XMLParentArticle
public void incrementSortableTables(int inc)
incrementSortableTables
in interface XMLParentArticle
inc
- the increment valuepublic java.lang.String getPackage()
getPackage
in interface Article
getPackage
in interface org.docgene.model.globals.PackagedElement
getPackage
in interface org.docgene.model.globals.XMLRootElement
public boolean hasPackage()
hasPackage
in interface org.docgene.model.globals.PackagedElement
hasPackage
in interface org.docgene.model.globals.XMLRootElement
public void setKeepCase(boolean keepCase)
keepCase
- true if the article title should keep the title description casepublic boolean isKeepingCase()
isKeepingCase
in interface Article
public void setTOC(boolean hasTOC)
hasTOC
- true if the article should have a Table of contentpublic boolean hasTOC()
public java.lang.String getHeader(boolean escaping)
public java.lang.String getHeader()
public boolean hasID()
public boolean addAlternateTitle(java.lang.String title, boolean keepCase, boolean inDictionnary)
addAlternateTitle
in interface Article
title
- the alternate titlekeepCase
- true if the title description should keep the title description caseinDictionnary
- true if the alternate title must be included in the dictionnary and categoriespublic java.util.Set<java.lang.String> getAlternateTitles()
getAlternateTitles
in interface Article
public java.util.Map<java.lang.String,AlternateTitle> getAlternateTitlesMap()
getAlternateTitlesMap
in interface Article
public void setMeta(java.lang.String meta)
meta
- the meta descriptionpublic java.lang.String getMeta()
public void setTemplate(boolean isTemplate)
isTemplate
- true if this article is a templatepublic boolean isTemplate()
isTemplate
in interface Article
public boolean isIndex()
public XMLParent getParent()
public void setInputFile(java.io.File file)
setInputFile
in interface org.docgene.model.globals.XMLRootElement
file
- the article input XML filepublic void setRelativePath(java.lang.String path)
path
- the relative pathpublic java.lang.String getRelativePath()
getRelativePath
in interface org.docgene.model.globals.XMLRootElement
public java.io.File getInputFile()
getInputFile
in interface org.docgene.model.globals.RootElement
public void setOutputFile(java.io.File file)
setOutputFile
in interface XMLParentArticle
file
- the article output XML filepublic java.io.File getOutputFile()
getOutputFile
in interface HTMLOutput
public void setLinksFromFile(java.io.File file)
setLinksFromFile
in interface XMLParentArticle
file
- the article links from XML filepublic java.io.File getLinksFromFile()
getLinksFromFile
in interface XMLParentArticle
public java.lang.String getDescription()
getDescription
in interface Article
public java.lang.String getID()
public ArticleRef getArticleRef()
public void setCategories(java.util.Set<java.lang.String> categories)
categories
- the categories on which this article belongspublic void addCategory(java.lang.String category)
category
- the categorypublic java.util.Set<java.lang.String> getCategories()
getCategories
in interface Article
public void addSeeAlsoReference(XMLSeeAlso ref)
ref
- the SeeAlso referencepublic void setSeeAlsoHeading(XMLSeeAlsoHeading seeAlsoHeading)
seeAlsoHeading
- the "seeAlso" element in the headingpublic java.util.List<XMLSeeAlso> getSeeAlso()
getSeeAlso
in interface XMLParentArticle
public XMLSeeAlsoHeading getSeeAlsoHeading()
getSeeAlsoHeading
in interface XMLParentArticle
public void setJustification(char justification)
justification
- the justificationpublic char getJustification()
public void addComment(XMLComment comment)
comment
- the commentpublic void addTodo(TodoElement todo)
todo
- the todopublic void addNote(NoteContent note)
note
- the notepublic boolean hasNote(java.lang.String id)
id
- the note idpublic NoteContent getNote(java.lang.String id)
id
- the note IDpublic java.util.Map<java.lang.String,NoteContent> getNotesByID()
public java.util.List<NoteContent> getNotes()
getNotes
in interface Article
getNotes
in interface XMLParentArticle
public java.util.List<ReviewElement> getReviewElements()
getReviewElements
in interface XMLParentArticle
public boolean hasReviewElements()
public void addMessageBox(XMLMessageBox messageBox)
messageBox
- the message boxpublic java.util.Collection<XMLMessageBox> getMessageBoxes()
getMessageBoxes
in interface XMLParentArticle
public boolean hasMessageBoxes()
hasMessageBoxes
in interface XMLParentArticle
public void addInfobox(XMLInfobox infobox)
infobox
- the infoboxpublic java.util.List<XMLInfobox> getInfoboxes()
getInfoboxes
in interface XMLParentArticle
public boolean hasInfoboxes()
hasInfoboxes
in interface XMLParentArticle
public void addInclude(XMLInclude include)
include
- the included article or templatepublic java.util.List<XMLInclude> getIncludes()
getIncludes
in interface XMLParentArticle
public boolean hasIncludes()
hasIncludes
in interface XMLParentArticle
public void addChapter(XMLChapter chapter)
addChapter
in interface XMLParent
addChapter
in class AbstractXMLParent
chapter
- the chapterpublic int countTitles()
public boolean isDirect()
public XMLArticle getArticle()
getArticle
in interface Article
public java.util.Map<java.lang.String,TitledElement> getSearchableTitles()
getSearchableTitles
in interface XMLParentArticle
public boolean hasSearchableTitles()
hasSearchableTitles
in interface Article
public boolean hasAnchors()
hasAnchors
in interface XMLParentArticle
public void addMap(XMLMap map)
map
- the Mappublic java.util.List<XMLMap> getMaps()
public boolean hasMaps()
public boolean hasImageMaps()
hasImageMaps
in interface Article
public void setHasImageMaps(boolean hasImageMaps)
hasImageMaps
- true if the article has image mapspublic void addTitle(TitledElement title, boolean allowIdenticalTitles)
title
- the title elementallowIdenticalTitles
- true if two titles with the same title are allowedpublic void addResolvedTitle(XMLTitle title, boolean allowIdenticalTitles)
title
- the titleallowIdenticalTitles
- true if two titles with the same title are allowedpublic void addResolvedChapter(XMLChapter chapter, boolean allowIdenticalTitles)
chapter
- the chapterallowIdenticalTitles
- true if two titles with the same title are allowedpublic void addTitle(XMLTitle title, boolean includeInSearch, boolean allowIdenticalTitles)
title
- the titleincludeInSearch
- true if the title must be included in the Search boxallowIdenticalTitles
- true if two titles with the same title are allowedpublic void addChapter(XMLChapter chapter, boolean includeInSearch, boolean allowIdenticalTitles)
chapter
- the chapterincludeInSearch
- true if the title must be included in the Search boxallowIdenticalTitles
- true if two titles with the same title are allowedpublic boolean hasTitles()
public void addAnchor(AnchorElement anchor)
anchor
- the Anchorpublic boolean hasAnchorElement(java.lang.String id)
id
- the titledelement IDpublic void setTitledElementsList(java.util.List<TitledElement> titledEltsList)
titledEltsList
- the ordered list of titled elements (chapters or titles)public java.util.List<TitledElement> getTitledElementsList()
getTitledElementsList
in interface XMLParentArticle
public boolean isTitlesResolved()
public void resolveTitles()
public java.util.List<TitleOrIncludeElement> getTitlesOrIncludes()
public boolean hasTitledElementsList()
hasTitledElementsList
in interface XMLParentArticle
public java.util.Map<java.lang.String,AnchorElement> getAnchorElements()
getAnchorElements
in interface XMLParentArticle
public java.util.Map<java.lang.String,XMLAnchor> getAnchors()
getAnchors
in interface XMLParentArticle
public AnchorElement getAnchor(java.lang.String id)
getAnchor
in interface XMLParentArticle
id
- the anchor IDpublic boolean hasAnchor(java.lang.String id)
hasAnchor
in interface XMLParentArticle
id
- the anchor IDpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence