Class Page

    • Constructor Detail

      • Page

        public Page()
    • Method Detail

      • setPosition

        public void setPosition​(Integer position)
      • incPosition

        public void incPosition()
      • getPosition

        public Integer getPosition()
      • setParent

        @Deprecated
        public void setParent​(Page parent)
        Deprecated.
        Since 1.1. Do not call this method. It exists solely for hibernate to use. Use #setParentPage instead. I would have made this method private, but CGLIB was complaining.
        Specified by:
        setParent in interface Hierarchical<Page>
      • setParentPage

        public void setParentPage​(Page parent)
        Public setter that makes sure that the parent page is valid
        Parameters:
        parent - the page to set as this page's parent
        Throws:
        IllegalArgumentException - if the parent page is in a different space.
      • getSortedChildren

        public List<Page> getSortedChildren()
      • isHomePage

        public boolean isHomePage()
      • getType

        public String getType()
        Description copied from class: ContentEntityObject
        An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

        This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

        Specified by:
        getType in interface ContentTypeAware
        Specified by:
        getType in class ContentEntityObject
        Returns:
        the content type
      • convertToHistoricalVersion

        public void convertToHistoricalVersion()
        Description copied from interface: Versioned
        Remove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.

        When using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time.

        Specified by:
        convertToHistoricalVersion in interface Versioned
        Overrides:
        convertToHistoricalVersion in class AbstractPage
      • severParentChildRelationships

        public void severParentChildRelationships()
        sever parent/child relationships
      • getDescendants

        public List<Page> getDescendants()
        Get descendants with "current" state only
        Returns:
        list of descendants
      • getAncestors

        public List<Page> getAncestors()
        Gets the list of ancestors of this page (its parents, and its parents parents, right up to the root level of the containing space). This is more efficient than repeatedly calling getParent() as it does a single join across the ancestors table instead of one query per parent.

        For strange historical reasons, this list is in the opposite order you would expect. The LAST element of the list will be this page's parent.

        Specified by:
        getAncestors in interface Hierarchical<Page>
        Returns:
        the list of ancestors of the page, ordered from the root of the space.
      • setAncestors

        public void setAncestors​(List<Page> ancestors)
        This should only ever be set by Hibernate.
      • isIndexable

        public boolean isIndexable()
        Description copied from class: SpaceContentEntityObject
        pages, blogs etc that aren't not associated with a space (either because they are historical or corrupt) should not be indexed if they are indexed, and returned in search results, they are broken and are therefore useless
        Specified by:
        isIndexable in interface Searchable
        Overrides:
        isIndexable in class SpaceContentEntityObject
      • shouldConvertToContent

        public boolean shouldConvertToContent()
        Specified by:
        shouldConvertToContent in interface ContentConvertible
        Returns:
        true if the implementer wants to be part of the core API (default value), false otherwise
      • copyLatestVersion

        public Page copyLatestVersion()
        Copy page information
        Returns:
        Since:
        5.10