Class CMSPageTemplate

java.lang.Object
io.goobi.viewer.model.cms.pages.CMSPageTemplate
All Implemented Interfaces:
IPolyglott, Serializable, Comparable<CMSPageTemplate>

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

Template to create a CMSPage. Contains some general information about the template as well as a list of components and sidebar widgets to be included in the page

See Also:
  • Constructor Details

    • CMSPageTemplate

      public CMSPageTemplate()

      Constructor for CMSPage.

    • CMSPageTemplate

      public CMSPageTemplate(CMSPageTemplate original)
      creates a deep copy of the original CMSPage. Only copies persisted properties and performs initialization for them
      Parameters:
      original - a CMSPageTemplate object.
    • CMSPageTemplate

      public CMSPageTemplate(CMSPage original)
  • Method Details

    • initialiseCMSComponents

      public void initialiseCMSComponents(CMSTemplateManager templateManager)
    • hashCode

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

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

      public int compareTo(CMSPageTemplate o)
      Specified by:
      compareTo in interface Comparable<CMSPageTemplate>
    • addSidebarElement

      public void addSidebarElement(CMSSidebarElement element)

      addSidebarElement.

      Parameters:
      element - a CMSSidebarElement object.
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getDateCreated

      public LocalDateTime getDateCreated()

      Getter for the field dateCreated.

      Returns:
      the dateCreated
    • setDateCreated

      public void setDateCreated(LocalDateTime dateCreated)

      Setter for the field dateCreated.

      Parameters:
      dateCreated - the dateCreated to set
    • getDateUpdated

      public LocalDateTime getDateUpdated()
    • setDateUpdated

      public void setDateUpdated(LocalDateTime dateUpdated)

      Setter for the field dateUpdated.

      Parameters:
      dateUpdated - the dateUpdated to set
    • isPublished

      public boolean isPublished()

      isPublished.

      Returns:
      the published
    • setPublished

      public void setPublished(boolean published)

      Setter for the field published.

      Parameters:
      published - the published to set
    • isUseDefaultSidebar

      public boolean isUseDefaultSidebar()

      isUseDefaultSidebar.

      Returns:
      the useDefaultSidebar
    • setUseDefaultSidebar

      public void setUseDefaultSidebar(boolean useDefaultSidebar)

      Setter for the field useDefaultSidebar.

      Parameters:
      useDefaultSidebar - the useDefaultSidebar to set
    • getSidebarElements

      public List<CMSSidebarElement> getSidebarElements()

      Getter for the field sidebarElements.

      Returns:
      the sidebarElements
    • setSidebarElements

      public void setSidebarElements(List<CMSSidebarElement> sidebarElements)

      Setter for the field sidebarElements.

      Parameters:
      sidebarElements - the sidebarElements to set
    • addToSidebar

      public void addToSidebar(List<WidgetDisplayElement> widgets)
    • moveUpSidebarElement

      public void moveUpSidebarElement(CMSSidebarElement element)
    • moveDownSidebarElement

      public void moveDownSidebarElement(CMSSidebarElement element)
    • removeSidebarElement

      public void removeSidebarElement(CMSSidebarElement element)
    • containsSidebarElement

      public boolean containsSidebarElement(WidgetDisplayElement widget)
    • getCategories

      public List<CMSCategory> getCategories()

      Getter for the field categories.

      Returns:
      the classifications
    • setCategories

      public void setCategories(List<CMSCategory> categories)

      Setter for the field categories.

      Parameters:
      categories - a List object.
    • addCategory

      public void addCategory(CMSCategory category)

      addCategory.

      Parameters:
      category - a CMSCategory object.
    • removeCategory

      public void removeCategory(CMSCategory category)

      removeCategory.

      Parameters:
      category - a CMSCategory object.
    • getSidebarElementString

      public String getSidebarElementString()

      Getter for the field sidebarElementString.

      Returns:
      the sidebarElementString
    • setSidebarElementString

      public void setSidebarElementString(String sidebarElementString)

      Setter for the field sidebarElementString.

      Parameters:
      sidebarElementString - the sidebarElementString to set
    • isLanguageComplete

      public boolean isLanguageComplete(Locale locale)

      isLanguageComplete.

      Parameters:
      locale - a Locale object.
      Returns:
      a boolean.
    • getTitle

      public String getTitle()

      getTitle.

      Returns:
      a String object.
    • getTitle

      public String getTitle(Locale locale)

      getTitle.

      Parameters:
      locale - a Locale object.
      Returns:
      a String object.
    • getTitleTranslations

      public de.intranda.metadata.multilanguage.IMetadataValue getTitleTranslations()
    • getDescription

      public TranslatedText getDescription()
    • setDescription

      public void setDescription(TranslatedText description)
    • getSubThemeDiscriminatorValue

      public String getSubThemeDiscriminatorValue()

      Getter for the field subThemeDiscriminatorValue.

      Returns:
      the subThemeDiscriminatorValue
    • setSubThemeDiscriminatorValue

      public void setSubThemeDiscriminatorValue(String subThemeDiscriminatorValue)

      Setter for the field subThemeDiscriminatorValue.

      Parameters:
      subThemeDiscriminatorValue - the subThemeDiscriminatorValue to set
    • isHasSidebarElements

      public boolean isHasSidebarElements()

      isHasSidebarElements.

      Returns:
      a boolean.
    • toString

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

      public String getWrapperElementClass()

      Getter for the field wrapperElementClass.

      Returns:
      the wrapperElementClass
    • setWrapperElementClass

      public void setWrapperElementClass(String wrapperElementClass)

      Setter for the field wrapperElementClass.

      Parameters:
      wrapperElementClass - the wrapperElementClass to set
    • writeSelectableCategories

      public void writeSelectableCategories()
      Retrieve all categories fresh from the DAO and write them to this depending on the state of the selectableCategories list. Saving the categories from selectableCategories directly leads to ConcurrentModificationexception when persisting page
    • getSelectableCategories

      public List<Selectable<CMSCategory>> getSelectableCategories() throws DAOException

      Getter for the field selectableCategories.

      Returns:
      the selectableCategories
      Throws:
      DAOException - if any.
    • resetSelectableCategories

      public void resetSelectableCategories()
    • getAdminBackendUrl

      public String getAdminBackendUrl()
    • getPersistentComponents

      public List<PersistentCMSComponent> getPersistentComponents()
    • getComponents

      public List<CMSComponent> getComponents()
    • getAsCMSComponent

      public CMSComponent getAsCMSComponent(PersistentCMSComponent p)
    • removeComponent

      public boolean removeComponent(PersistentCMSComponent component)
    • removeComponent

      public boolean removeComponent(CMSComponent component)
    • addComponent

      public PersistentCMSComponent addComponent(CMSComponent template)
    • isComplete

      public boolean isComplete(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless IPolyglott.isEmpty(Locale) also returns true
      Specified by:
      isComplete in interface IPolyglott
      Returns:
      true if IPolyglott.isValid(Locale) returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale, IPolyglott.isComplete(Locale) and IPolyglott.isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      public boolean isValid(Locale locale)
      Description copied from interface: IPolyglott
      Only meaningfull for the default language for which all required fields must be filled
      Specified by:
      isValid in interface IPolyglott
      Returns:
      true if all required fields contain a value in the given locale
    • hasSearchFunctionality

      public boolean hasSearchFunctionality()
    • getSearch

      public Optional<SearchFunctionality> getSearch()
    • setComponentOrder

      public void setComponentOrder(CMSComponent component, int order)
      Set the order attribute of the PersistentCMSComponent belonging to the given CMSComponent to the given order value. Also, sets the order value of all Components which previously had the given order to the order value of the given component
      Parameters:
      component -
      order -
    • incrementOrder

      public void incrementOrder(CMSComponent component)
    • decrementOrder

      public void decrementOrder(CMSComponent component)
    • isFirstComponent

      public boolean isFirstComponent(CMSComponent component)
    • isLastComponent

      public boolean isLastComponent(CMSComponent component)
    • isEmpty

      public boolean isEmpty(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class
      Specified by:
      isEmpty in interface IPolyglott
      Returns:
      true if no fields are filled for the given locale
    • getSelectedLocale

      public Locale getSelectedLocale()
      Specified by:
      getSelectedLocale in interface IPolyglott
      Returns:
      the locale currently set by IPolyglott.setSelectedLocale(Locale)
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      Description copied from interface: IPolyglott
      Set the locale to use for display and editing
      Specified by:
      setSelectedLocale in interface IPolyglott
    • isLockComponents

      public boolean isLockComponents()
    • setLockComponents

      public void setLockComponents(boolean lockComponents)
    • isLegacyTemplate

      public boolean isLegacyTemplate()
    • setLegacyTemplate

      public void setLegacyTemplate(boolean legacyTemplate)
    • addComponent

      public PersistentCMSComponent addComponent(String filename, CMSTemplateManager templateManager) throws IllegalArgumentException, IllegalStateException
      Throws:
      IllegalArgumentException
      IllegalStateException
    • isContainsPagedComponents

      public boolean isContainsPagedComponents()
    • getName

      public String getName()
    • setTitleTranslations

      public void setTitleTranslations(TranslatedText title)