- java.lang.Object
-
- com.semanticcms.core.model.Node
-
- com.semanticcms.core.model.Page
-
- All Implemented Interfaces:
Freezable<Node>
,Comparable<Page>
public class Page extends Node implements Comparable<Page>
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_TOC_LEVELS
static int
MAX_TOC_LEVELS
This matches the table of contents implementation in /semanticcms-section-servlet/toc.inc.jspx and is a result of HTML only having H1 through H6.static int
MIN_TOC_LEVELS
-
Constructor Summary
Constructors Constructor Description Page()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAuthor(Author author)
void
addChildRef(ChildRef childRef)
void
addElement(Element element)
Adds an element to this page.void
addParentRef(ParentRef parentRef)
int
compareTo(Page o)
boolean
equals(Object obj)
<E extends Element>
List<E>filterElements(Class<E> clazz)
Gets all elements in the page (including all child elements) that are of the given type, in the order they were declared in the page.Page
freeze()
boolean
getAllowChildMismatch()
boolean
getAllowParentMismatch()
Boolean
getAllowRobots()
Gets the allowRobots setting.Set<Author>
getAuthors()
Set<ChildRef>
getChildRefs()
Copyright
getCopyright()
DateTime
getDateCreated()
DateTime
getDateModified()
DateTime
getDatePublished()
DateTime
getDateReviewed()
This has no equivalent in https://schema.org/, however we feel it is important to actively review content to ensure its accuracy, even when it has not been modified.String
getDescription()
List<Element>
getElements()
Gets all elements in the page (including all child elements), in the order they were declared in the page.Map<String,Element>
getElementsById()
Gets the elements indexed by id, in no particular order.Set<String>
getGeneratedIds()
Gets which element IDs were generated.String
getKeywords()
String
getLabel()
The page label is its short title.PageRef
getPageRef()
ThePageRef
that refers to this page.Set<ParentRef>
getParentRefs()
Registry
getRegistry()
Gets the page-scope web resource registry for this page ornull
if the page has not configured any resources.String
getShortTitle()
A short title is used when the context of a page is well established, such as when showing a path to the current location in the site.PageRef
getSrc()
The PageRef of the editable source for this page, if any.String
getTitle()
Boolean
getToc()
Gets the table of contents (toc) setting: null (The default) - Show table of contents depending on number of entries in the table true - Always show table of contents false - Never show table of contents TODO: Move this to Section.int
getTocLevels()
TODO: Move this to Section.int
hashCode()
void
setAllowChildMismatch(boolean allowChildMismatch)
void
setAllowParentMismatch(boolean allowParentMismatch)
void
setAllowRobots(Boolean allowRobots)
void
setCopyright(Copyright copyright)
void
setDateCreated(ReadableDateTime dateCreated)
void
setDateModified(ReadableDateTime dateModified)
void
setDatePublished(ReadableDateTime datePublished)
void
setDateReviewed(ReadableDateTime dateReviewed)
void
setDescription(String description)
void
setKeywords(String keywords)
void
setPageRef(PageRef pageRef)
void
setRegistry(Registry registry)
Sets the page-scope web resource registry for this page ornull
if the page has not configured any resources.void
setShortTitle(String shortTitle)
void
setSrc(PageRef src)
void
setTitle(String title)
void
setToc(Boolean toc)
void
setTocLevels(int tocLevels)
-
Methods inherited from class com.semanticcms.core.model.Node
addChildElement, addPageLink, appendLabel, checkNotFrozen, findChildElement, findChildElement, findTopLevelElements, getBody, getChildElements, getPageLinks, getProperty, requireChildElement, requireChildElement, setBody, setProperty, toString
-
-
-
-
Field Detail
-
MIN_TOC_LEVELS
public static final int MIN_TOC_LEVELS
- See Also:
- Constant Field Values
-
MAX_TOC_LEVELS
public static final int MAX_TOC_LEVELS
This matches the table of contents implementation in /semanticcms-section-servlet/toc.inc.jspx and is a result of HTML only having H1 through H6. H1 is reserved for the page title and headings become H2 through H6.- See Also:
- Constant Field Values
-
DEFAULT_TOC_LEVELS
public static final int DEFAULT_TOC_LEVELS
- See Also:
- Constant Field Values
-
-
Method Detail
-
compareTo
public int compareTo(Page o)
- Specified by:
compareTo
in interfaceComparable<Page>
- See Also:
PageRef.compareTo(com.semanticcms.core.model.PageRef)
-
freeze
public Page freeze()
-
setPageRef
public void setPageRef(PageRef pageRef)
-
getSrc
public PageRef getSrc()
The PageRef of the editable source for this page, if any. Note: Although atypical, the page source may be in a different book than the page itself.
-
setSrc
public void setSrc(PageRef src)
-
getCopyright
public Copyright getCopyright()
-
setCopyright
public void setCopyright(Copyright copyright)
-
addAuthor
public void addAuthor(Author author)
-
getDateCreated
public DateTime getDateCreated()
-
setDateCreated
public void setDateCreated(ReadableDateTime dateCreated)
-
getDatePublished
public DateTime getDatePublished()
-
setDatePublished
public void setDatePublished(ReadableDateTime datePublished)
-
getDateModified
public DateTime getDateModified()
-
setDateModified
public void setDateModified(ReadableDateTime dateModified)
-
getDateReviewed
public DateTime getDateReviewed()
This has no equivalent in https://schema.org/, however we feel it is important to actively review content to ensure its accuracy, even when it has not been modified.
-
setDateReviewed
public void setDateReviewed(ReadableDateTime dateReviewed)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getShortTitle
public String getShortTitle()
A short title is used when the context of a page is well established, such as when showing a path to the current location in the site. The short title defaults togetTitle
.- Returns:
- the short page title
- See Also:
getTitle()
-
setShortTitle
public void setShortTitle(String shortTitle)
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String description)
-
getKeywords
public String getKeywords()
-
setKeywords
public void setKeywords(String keywords)
-
getAllowRobots
public Boolean getAllowRobots()
Gets the allowRobots setting.- null (The default) - Inherit setting from parent(s) within the book or book settings if have no parents within the book
- true - Robots allowed
- false - Robots not allowed
-
setAllowRobots
public void setAllowRobots(Boolean allowRobots)
-
getRegistry
public Registry getRegistry()
Gets the page-scope web resource registry for this page ornull
if the page has not configured any resources.
-
setRegistry
public void setRegistry(Registry registry)
Sets the page-scope web resource registry for this page ornull
if the page has not configured any resources.
-
getToc
public Boolean getToc()
Gets the table of contents (toc) setting:- null (The default) - Show table of contents depending on number of entries in the table
- true - Always show table of contents
- false - Never show table of contents
-
setToc
public void setToc(Boolean toc)
-
getTocLevels
public int getTocLevels()
TODO: Move this to Section.
-
setTocLevels
public void setTocLevels(int tocLevels)
-
addParentRef
public void addParentRef(ParentRef parentRef)
-
getAllowParentMismatch
public boolean getAllowParentMismatch()
-
setAllowParentMismatch
public void setAllowParentMismatch(boolean allowParentMismatch)
-
addChildRef
public void addChildRef(ChildRef childRef)
-
getAllowChildMismatch
public boolean getAllowChildMismatch()
-
setAllowChildMismatch
public void setAllowChildMismatch(boolean allowChildMismatch)
-
getElements
public List<Element> getElements()
Gets all elements in the page (including all child elements), in the order they were declared in the page.
-
filterElements
public <E extends Element> List<E> filterElements(Class<E> clazz)
Gets all elements in the page (including all child elements) that are of the given type, in the order they were declared in the page.
-
getElementsById
public Map<String,Element> getElementsById()
Gets the elements indexed by id, in no particular order. Note, while the page is being created, elements with automatic IDs will not be in this map. However, once frozen, every element will have an ID.- See Also:
freeze()
-
addElement
public void addElement(Element element)
Adds an element to this page.
-
getLabel
public String getLabel()
The page label is its short title.- Specified by:
getLabel
in classNode
- See Also:
getShortTitle()
-
-