Class CMSContentItem
java.lang.Object
io.goobi.viewer.model.cms.pages.content.CMSContentItem
Wraps a
CMSContent within a CMSPage.- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionCMSContentItem(CMSContentItem orig, CMSComponent owningComponent) CMSContentItem(String itemId, CMSContent content, String label, String description, String htmlGroup, JsfComponent jsfComponent, CMSComponent owningComponent, boolean required) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo CMSContentItems are equal if theiritemIds are equal.getLabel()Returns this item's JSF component tree, building it on first access.inthashCode()booleanisEmpty()Check if thecontentattribute exists (i.e. database data is present).booleanbooleanbooleanisMedia()booleanbooleanvoidsetUiComponent(UIComponent uiComponent) toString()
-
Constructor Details
-
CMSContentItem
-
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 componentcontent- the CMS content wrapped by this itemlabel- human-readable label shown in the backenddescription- explanatory text shown in the backendhtmlGroup- optional HTML group name for grouping content itemsjsfComponent- the JSF component used to render this itemowningComponent- the component that contains this content itemrequired- true if this content item must not be empty
-
-
Method Details
-
isRequired
public boolean isRequired() -
getItemId
-
getContent
-
getLabel
-
getItemLabel
-
getDescription
-
getJsfComponent
-
hashCode
public int hashCode() -
isMandatory
public boolean isMandatory() -
equals
Two CMSContentItems are equal if theiritemIds are equal. -
getUiComponent
Returns this item's JSF component tree, building it on first access.Like
CMSComponent.getUiComponent()the subtree is built into a local panel group and only published touiComponentonce it is complete, so that concurrent requests sharing this instance through the session-scopedCmsBeancannot append their children to the same panel group and thereby create duplicate JSF ids. Publication happens inside a short lock that performs no I/O; a losing thread discards its own subtree. As a side effect a failed build is no longer cached.- Returns:
- the UI component for this content item
- Throws:
PresentationException- if the JSF component cannot be built
-
setUiComponent
-
isEmpty
public boolean isEmpty()Check if thecontentattribute 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
-
getOwningComponent
-
toString
-