Class CMSStaticPage

java.lang.Object
io.goobi.viewer.model.cms.CMSStaticPage
All Implemented Interfaces:
Serializable

@Entity public class CMSStaticPage extends Object implements Serializable
Maps a CMS page to a static viewer page URL, allowing CMS content to replace built-in viewer pages.
See Also:
  • Constructor Details

    • CMSStaticPage

      public CMSStaticPage()
      Creates a new CMSStaticPage instance.
    • CMSStaticPage

      public CMSStaticPage(String name)
      Creates a new CMSStaticPage instance.
      Parameters:
      name - internal page name identifying this static page
      Throws:
      NullPointerException - if the given name is null
  • Method Details

    • getCmsPageOptional

      public Optional<CMSPage> getCmsPageOptional()
      getCmsPageOptional.
      Returns:
      the associated CMS page wrapped in an Optional, or an empty Optional if no page is assigned
    • getCmsPage

      public CMSPage getCmsPage()
      Getter for the field cmsPage.
      Returns:
      the associated CMS page, or null if none is set
    • setCmsPage

      public void setCmsPage(CMSPage cmsPage)
      Setter for the field cmsPage.
      Parameters:
      cmsPage - the CMS page to associate with this static page; also updates the stored page ID
    • getId

      public Long getId()
      Getter for the field id.
      Returns:
      the database primary key of this static page mapping
    • getPageName

      public String getPageName()
      Getter for the field pageName.
      Returns:
      the internal page name identifying this static page
    • isLanguageComplete

      public boolean isLanguageComplete(Locale locale)
      isLanguageComplete.
      Parameters:
      locale - locale to check for completeness
      Returns:
      true if the associated CMS page is complete for the given locale, false otherwise
    • isHasCmsPage

      public boolean isHasCmsPage()
      isHasCmsPage.
      Returns:
      true only if isUseCmsPage == true and cmsPage != null
    • getCmsPageId

      public Optional<Long> getCmsPageId()
      Getter for the field cmsPageId.
      Returns:
      the database ID of the associated CMS page wrapped in an Optional, or an empty Optional if no page is assigned
    • setCmsPageId

      public void setCmsPageId(Long cmsPageId)
      Setter for the field cmsPageId.
      Parameters:
      cmsPageId - the database ID of the associated CMS page; triggers a page lookup if changed
    • hashCode

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

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

      public PageType getPageType()