Class CMSComponent

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

public class CMSComponent extends Object implements Comparable<CMSComponent>, Serializable
See Also:
  • Constructor Details

  • Method Details

    • getPersistentComponent

      public PersistentCMSComponent getPersistentComponent()
      Returns:
      the persistentComponent
    • setPublicationState

      public void setPublicationState(ContentItemPublicationState publicationState)
      Parameters:
      publicationState -
    • getPublicationState

      public ContentItemPublicationState getPublicationState()
    • setOrder

      public void setOrder(int order)
      Parameters:
      order -
    • getOrder

      public Integer getOrder()
    • addContentItem

      public boolean addContentItem(CMSContentItem item)
      Parameters:
      item -
      Returns:
      true if item added successfully; false otherwise
    • removeContentItem

      public boolean removeContentItem(CMSContentItem item)
      Parameters:
      item -
      Returns:
      true if item removed successfully; false otherwise
    • getContentItems

      public List<CMSContentItem> getContentItems()
    • getFirstContentItem

      public CMSContentItem getFirstContentItem()
    • getFirstContentOfType

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

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

      public CMSContentItem getFirstContentItem(String className)
    • getContentItem

      public CMSContentItem getContentItem(String componentId)
    • getTranslatableContentItems

      public List<CMSContentItem> getTranslatableContentItems()
    • getJsfComponent

      public JsfComponent getJsfComponent()
    • getLabel

      public String getLabel()
    • getDescription

      public String getDescription()
    • getIconPath

      public String getIconPath()
    • getTemplateFilename

      public String getTemplateFilename()
    • isPageScope

      public boolean isPageScope()
    • compareTo

      public int compareTo(CMSComponent o)
      Specified by:
      compareTo in interface Comparable<CMSComponent>
    • getUiComponent

      public javax.faces.component.UIComponent getUiComponent() throws PresentationException
      Throws:
      PresentationException
    • setUiComponent

      public void setUiComponent(javax.faces.component.UIComponent uiComponent)
      Parameters:
      uiComponent -
    • getBackendUiComponent

      public javax.faces.component.UIComponent getBackendUiComponent() throws PresentationException
      Throws:
      PresentationException
    • setBackendUiComponent

      public void setBackendUiComponent(javax.faces.component.UIComponent backendUiComponent)
      Parameters:
      backendUiComponent -
    • getAttribute

      public CMSComponentAttribute getAttribute(String key)
      Parameters:
      key -
      Returns:
      CMSComponentAttribute
    • getBooleanAttributeValue

      public boolean getBooleanAttributeValue(String key, boolean defaultValue)
      Parameters:
      key -
      defaultValue -
      Returns:
      a boolean
    • getAttributeValue

      public String getAttributeValue(String key)
      Parameters:
      key -
      Returns:
      String
    • setAttribute

      public void setAttribute(String key, String value)
      Parameters:
      key -
      value -
    • toggleAttribute

      public void toggleAttribute(String key, String value)
      Parameters:
      key -
      value -
    • getAttributes

      public Map<String,CMSComponentAttribute> getAttributes()
    • isPublished

      public boolean isPublished()
    • setPublished

      public void setPublished(boolean published)
      Parameters:
      published -
    • isPrivate

      public boolean isPrivate()
    • setPrivate

      public void setPrivate(boolean privat)
      Parameters:
      privat -
    • togglePrivate

      public void togglePrivate()
    • togglePublished

      public void togglePublished()
    • hasAccess

      public boolean hasAccess(User user)
      Parameters:
      user -
      Returns:
      a boolean
    • getContentData

      public String getContentData(String itemId)
      Parameters:
      itemId -
      Returns:
      String
    • getContentData

      public String getContentData(String itemId, Integer width, Integer height)
      Parameters:
      itemId -
      width -
      height -
      Returns:
      String
    • hasContent

      public boolean hasContent(String itemId)
      Check whether a contentItem with the given itemId exists and is not empty
      Parameters:
      itemId -
      Returns:
      true if the contentItem with the given itemId exists and its CMSContent.isEmpty() method returns false
    • getContent

      public CMSContent getContent(String itemId)
    • setPreview

      public void setPreview(boolean preview)
      Set wether this component should be displayed when the owning page is embedded in another page, rather than on the owning page itself
      Parameters:
      preview -
    • isPreview

      public boolean isPreview()
      whether this component should be displayed when the owning page is embedded in another page, rather than on the owning page itself
      Returns:
      true if scope is CMSComponentScope.PREVIEW; false otherwise
    • getScope

      public CMSComponentScope getScope()
    • setScope

      public void setScope(CMSComponentScope scope)
    • getPersistenceId

      public long getPersistenceId()
    • getOwningPage

      public CMSPage getOwningPage()
    • isPaged

      public boolean isPaged()
    • toString

      public String toString()
      Overrides:
      toString in class Object