Class CMSNavigationItem

java.lang.Object
io.goobi.viewer.model.cms.CMSNavigationItem
All Implemented Interfaces:
Serializable, Comparable<CMSNavigationItem>
Direct Known Subclasses:
SelectableNavigationItem

@Entity public class CMSNavigationItem extends Object implements Comparable<CMSNavigationItem>, Serializable

CMSNavigationItem class.

See Also:
  • Constructor Details

    • CMSNavigationItem

      public CMSNavigationItem()
      Empty constructor.
    • CMSNavigationItem

      public CMSNavigationItem(CMSNavigationItem original)
      Created a copy of the passed item ignoring all data concerning the item hierarchy (order, child and parent items)
      Parameters:
      original - a io.goobi.viewer.model.cms.navigation.CMSNavigationItem object.
    • CMSNavigationItem

      public CMSNavigationItem(String targetUrl, String label)

      Constructor for CMSNavigationItem.

      Parameters:
      targetUrl - a String object.
      label - a String object.
    • CMSNavigationItem

      public CMSNavigationItem(CMSPage cmsPage)

      Constructor for CMSNavigationItem.

      Parameters:
      cmsPage - a CMSPage object.
  • Method Details

    • hashCode

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

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

      public int compareTo(CMSNavigationItem o)
      Specified by:
      compareTo in interface Comparable<CMSNavigationItem>
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      a Long object.
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - a Long object.
    • getItemLabel

      public String getItemLabel()

      Getter for the field itemLabel.

      Returns:
      a String object.
    • setItemLabel

      public void setItemLabel(String itemLabel)

      Setter for the field itemLabel.

      Parameters:
      itemLabel - a String object.
    • getOrder

      public Integer getOrder()

      Getter for the field order.

      Returns:
      the order
    • setOrder

      public void setOrder(Integer order)

      Setter for the field order.

      Parameters:
      order - the order to set
    • getParentItem

      public CMSNavigationItem getParentItem()

      Getter for the field parentItem.

      Returns:
      the parentItem
    • setParentItem

      public void setParentItem(CMSNavigationItem parentItem)

      Setter for the field parentItem.

      Parameters:
      parentItem - the parentItem to set
    • getChildItems

      public List<CMSNavigationItem> getChildItems()

      Getter for the field childItems.

      Returns:
      a List object.
    • setChildItems

      public void setChildItems(List<CMSNavigationItem> childItems)

      Setter for the field childItems.

      Parameters:
      childItems - a List object.
    • getActiveChildItems

      public List<CMSNavigationItem> getActiveChildItems()
    • addChildItem

      public void addChildItem(CMSNavigationItem child)

      addChildItem.

      Parameters:
      child - a io.goobi.viewer.model.cms.navigation.CMSNavigationItem object.
    • removeChildItem

      public void removeChildItem(CMSNavigationItem child)

      removeChildItem.

      Parameters:
      child - a io.goobi.viewer.model.cms.navigation.CMSNavigationItem object.
    • getCmsPage

      public CMSPage getCmsPage()

      Getter for the field cmsPage.

      Returns:
      a CMSPage object.
    • setCmsPage

      public void setCmsPage(CMSPage cmsPage)

      Setter for the field cmsPage.

      Parameters:
      cmsPage - a CMSPage object.
    • getNavigationUrl

      public String getNavigationUrl()

      getNavigationUrl.

      Returns:
      a String object.
    • getPageUrl

      public String getPageUrl()

      Getter for the field pageUrl.

      Returns:
      a String object.
    • setPageUrl

      public void setPageUrl(String pageUrl)

      Setter for the field pageUrl.

      Parameters:
      pageUrl - a String object.
    • hasUnpublishedCmsPage

      public boolean hasUnpublishedCmsPage()

      hasUnpublishedCmsPage.

      Returns:
      true if this item has an associated cmsPage and this page's status is unpublished
    • isValid

      public boolean isValid()

      isValid.

      Returns:
      a boolean.
    • isShouldDisplay

      public boolean isShouldDisplay()

      isShouldDisplay.

      Returns:
      a boolean.
    • hasDeletedCmsPage

      public boolean hasDeletedCmsPage()

      hasDeletedCmsPage.

      Returns:
      true if this item has no associated cmsPage, but the url is that of a cms page or is empty
    • hasCmsPage

      public boolean hasCmsPage()

      hasCmsPage.

      Returns:
      a boolean.
    • matchesLabel

      public boolean matchesLabel(String currentPage)
      Check to highlight this item as 'currentPage'. Checks both the items label and all child labels whether they equal currentPage
      Parameters:
      currentPage - a String object.
      Returns:
      a boolean.
    • getLevel

      public int getLevel()
      Returns the hierarchy level of this item, i.e. the number of ancestor items
      Returns:
      a int.
    • getSortingListId

      public Integer getSortingListId()

      Getter for the field sortingListId.

      Returns:
      the sortingListId
    • setSortingListId

      public void setSortingListId(Integer sortingListId)

      Setter for the field sortingListId.

      Parameters:
      sortingListId - the sortingListId to set
    • isAbsoluteLink

      public boolean isAbsoluteLink()

      isAbsoluteLink.

      Returns:
      a boolean.
    • setAbsoluteLink

      public void setAbsoluteLink(boolean absoluteLink)

      Setter for the field absoluteLink.

      Parameters:
      absoluteLink - a boolean.
    • isVisible

      public boolean isVisible()

      isVisible.

      Returns:
      a boolean.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setDisplayRule

      public void setDisplayRule(CMSNavigationItem.DisplayRule rule)

      Setter for the field displayRule.

      Parameters:
      rule - a io.goobi.viewer.model.cms.navigation.CMSNavigationItem.DisplayRule object.
    • getDisplayRule

      public CMSNavigationItem.DisplayRule getDisplayRule()

      Getter for the field displayRule.

      Returns:
      a io.goobi.viewer.model.cms.navigation.CMSNavigationItem.DisplayRule object.
    • setDisplayForUsersOnly

      public void setDisplayForUsersOnly(boolean display)

      setDisplayForUsersOnly.

      Parameters:
      display - a boolean.
    • isDisplayForUsersOnly

      public boolean isDisplayForUsersOnly()

      isDisplayForUsersOnly.

      Returns:
      a boolean.
    • setDisplayForAdminsOnly

      public void setDisplayForAdminsOnly(boolean display)

      setDisplayForAdminsOnly.

      Parameters:
      display - a boolean.
    • isDisplayForAdminsOnly

      public boolean isDisplayForAdminsOnly()

      isDisplayForAdminsOnly.

      Returns:
      a boolean.
    • setAssociatedTheme

      public void setAssociatedTheme(String associatedTheme)
      Sets the associatedTheme to the given theme, or to null if the given theme is empty or blank
      Parameters:
      associatedTheme - the associatedTheme to set
    • getAssociatedTheme

      public String getAssociatedTheme()

      Getter for the field associatedTheme.

      Returns:
      the associatedTheme; null if no associated theme exists
    • setOpenInNewWindow

      public void setOpenInNewWindow(boolean openInNewWindow)

      Setter for the field openInNewWindow.

      Parameters:
      openInNewWindow - if the link should open in a new tab/window
    • isOpenInNewWindow

      public boolean isOpenInNewWindow()

      isOpenInNewWindow.

      Returns:
      if the link should open in a new tab/window
    • getMeWithDescendants

      public List<CMSNavigationItem> getMeWithDescendants()

      getMeWithDescendants.

      Returns:
      a List object.
    • isAssociatedWithSubtheme

      public boolean isAssociatedWithSubtheme()
      Returns:
      true if the item links to a cmsPage and that page has a subtheme associated with it.
    • getAssociatedSubtheme

      public String getAssociatedSubtheme()
    • matchesPage

      public boolean matchesPage(String page)
    • isEnabled

      public boolean isEnabled()