Class CMSContentItem

java.lang.Object
io.goobi.viewer.model.cms.pages.content.CMSContentItem

public class CMSContentItem extends Object
Wraps a CMSContent within a CMSPage.
Author:
Florian Alpers
  • Constructor Details

    • CMSContentItem

      public CMSContentItem(CMSContentItem orig, CMSComponent owningComponent)
    • CMSContentItem

      public CMSContentItem(String itemId, CMSContent content, String label, String description, String htmlGroup, JsfComponent jsfComponent, CMSComponent owningComponent, boolean required)
      Parameters:
      itemId - unique identifier within the owning component
      content - the CMS content wrapped by this item
      label - human-readable label shown in the backend
      description - explanatory text shown in the backend
      htmlGroup - optional HTML group name for grouping content items
      jsfComponent - the JSF component used to render this item
      owningComponent - the component that contains this content item
      required - true if this content item must not be empty
  • Method Details

    • isRequired

      public boolean isRequired()
    • getItemId

      public String getItemId()
    • getContent

      public CMSContent getContent()
    • getLabel

      public String getLabel()
    • getItemLabel

      public String getItemLabel()
    • getDescription

      public String getDescription()
    • getJsfComponent

      public JsfComponent getJsfComponent()
    • hashCode

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

      public boolean isMandatory()
    • equals

      public boolean equals(Object obj)
      Two CMSContentItems are equal if their itemIds are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare for equality
      Returns:
      true if the given object is equal to this instance, false otherwise
    • getUiComponent

      public UIComponent getUiComponent() throws PresentationException
      Throws:
      PresentationException
    • setUiComponent

      public void setUiComponent(UIComponent uiComponent)
    • isEmpty

      public boolean isEmpty()
      Check if the content attribute exists (i.e. database data is present). If so, and it is textual or media content, also check if text is empty or the media item exists
      Returns:
      true if no database entry exists or if it doesn't contain data which can be presented
    • isShortText

      public boolean isShortText()
    • isHtmlText

      public boolean isHtmlText()
    • isMedia

      public boolean isMedia()
    • getHtmlGroup

      public String getHtmlGroup()
    • getOwningComponent

      public CMSComponent getOwningComponent()
    • toString

      public String toString()
      Overrides:
      toString in class Object