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 Details

    • MIN_TOC_LEVELS

      public static final int MIN_TOC_LEVELS
      See Also:
    • 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:
    • DEFAULT_TOC_LEVELS

      public static final int DEFAULT_TOC_LEVELS
      See Also:
  • Constructor Details

    • Page

      public Page()
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Page o)
      Specified by:
      compareTo in interface Comparable<Page>
      See Also:
    • freeze

      public Page freeze()
      Specified by:
      freeze in interface Freezable<Node>
      Overrides:
      freeze in class Node
    • getPageRef

      public PageRef getPageRef()
      The PageRef that refers to this page.
    • 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)
    • getAuthors

      public Set<Author> getAuthors()
    • addAuthor

      public void addAuthor(Author author)
    • getDateCreated

      public DateTime getDateCreated()
      See Also:
    • setDateCreated

      public void setDateCreated(ReadableDateTime dateCreated)
    • getDatePublished

      public DateTime getDatePublished()
      See Also:
    • 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 to getTitle.
      Returns:
      the short page title
      See Also:
    • 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 or null if the page has not configured any resources.
    • setRegistry

      public void setRegistry(Registry registry)
      Sets the page-scope web resource registry for this page or null 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
      TODO: Move this to Section.
    • setToc

      public void setToc(Boolean toc)
    • getTocLevels

      public int getTocLevels()
      TODO: Move this to Section.
    • setTocLevels

      public void setTocLevels(int tocLevels)
    • getParentRefs

      public Set<ParentRef> getParentRefs()
    • addParentRef

      public void addParentRef(ParentRef parentRef)
    • getAllowParentMismatch

      public boolean getAllowParentMismatch()
    • setAllowParentMismatch

      public void setAllowParentMismatch(boolean allowParentMismatch)
    • getChildRefs

      public Set<ChildRef> getChildRefs()
    • 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:
    • getGeneratedIds

      public Set<String> getGeneratedIds()
      Gets which element IDs were generated.
    • 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 class Node
      See Also: