Class PersistentCMSComponent

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

@Entity public class PersistentCMSComponent extends Object implements IPolyglott, Serializable, Comparable<PersistentCMSComponent>
See Also:
  • Constructor Details

    • PersistentCMSComponent

      public PersistentCMSComponent()
      JPA constructor.
    • PersistentCMSComponent

      public PersistentCMSComponent(CMSComponent component)
    • PersistentCMSComponent

      public PersistentCMSComponent(CMSComponent template, Collection<CMSContent> contentData)
    • PersistentCMSComponent

      public PersistentCMSComponent(PersistentCMSComponent orig)
  • Method Details

    • getId

      public Long getId()
    • setId

      public void setId(Long id)
    • getPublicationState

      public ContentItemPublicationState getPublicationState()
      Returns:
      the publicationState
    • setPublicationState

      public void setPublicationState(ContentItemPublicationState publicationState)
      Parameters:
      publicationState - the publicationState to set
    • getOrder

      public Integer getOrder()
      Returns:
      the order
    • setOrder

      public void setOrder(Integer order)
      Parameters:
      order - the order to set
    • getContentItems

      public List<CMSContent> getContentItems()
      Returns:
      the contentItems
    • getOwningPage

      public CMSPage getOwningPage()
    • setOwningPage

      public void setOwningPage(CMSPage ownerPage)
    • setOwningTemplate

      public void setOwningTemplate(CMSPageTemplate template)
    • getOwningTemplate

      public CMSPageTemplate getOwningTemplate()
    • getTemplateFilename

      public String getTemplateFilename()
    • setTemplateFilename

      public void setTemplateFilename(String templateFilename)
    • addContent

      public void addContent(CMSContent content)
    • 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
    • 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
    • getTranslatableContentItems

      public List<TranslatableCMSContent> getTranslatableContentItems()
    • compareTo

      public int compareTo(PersistentCMSComponent o)
      Specified by:
      compareTo in interface Comparable<PersistentCMSComponent>
    • setAttribute

      public void setAttribute(String key, String value)
    • getAttribute

      public String getAttribute(String key)
    • getAttributes

      public Map<String,String> getAttributes()
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
    • getContentByItemId

      public Optional<CMSContent> getContentByItemId(String itemId)
    • getFirstContentOfType

      public <T extends CMSContent> T getFirstContentOfType(Class<? extends CMSContent> clazz)
    • getAllContentOfType

      public <T extends CMSContent> List<T> getAllContentOfType(Class<? extends CMSContent> clazz)
    • isPaged

      public boolean isPaged()
    • hashCode

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

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