Class CMSComponent
java.lang.Object
io.goobi.viewer.model.cms.pages.content.CMSComponent
- All Implemented Interfaces:
Serializable,Comparable<CMSComponent>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAdditional properties that can be passed to the component to set certain behaviour -
Constructor Summary
ConstructorsConstructorDescriptionCMSComponent(CMSComponent template, List<CMSContentItem> items) CMSComponent(CMSComponent template, Optional<PersistentCMSComponent> jpa) CMSComponent(JsfComponent jsfComponent, String label, String description, List<String> types, String templateFilename, CMSComponentScope scope, Map<String, CMSComponentAttribute> attributes, List<CMSComponent.Property> properties, Integer order) Constructor to create Component from template file -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddContentItem(CMSContentItem item) int<T extends CMSContent>
List<T> getAllContentOfType(Class<? extends CMSContent> clazz) getAttribute(String key) getAttributeValue(String key) jakarta.faces.component.UIComponentbooleangetBooleanAttributeValue(String key, boolean defaultValue) getContent(String itemId) getContentData(String itemId) getContentData(String itemId, Integer width, Integer height) getContentItem(String componentId) getFirstContentItem(String className) <T extends CMSContent>
TgetFirstContentOfType(Class<? extends CMSContent> clazz) getLabel()getOrder()longgetScope()getTypes()jakarta.faces.component.UIComponentbooleanbooleanhasContent(String itemId) Check whether a contentItem with the given itemId exists and is not emptybooleanhasProperty(CMSComponent.Property property) booleanisPaged()booleanbooleanwhether this component should be displayed when the owning page is embedded in another page, rather than on the owning page itselfbooleanbooleanbooleanvoidsetAttribute(String key, String value) voidsetBackendUiComponent(jakarta.faces.component.UIComponent backendUiComponent) voidsetOrder(int order) voidsetPreview(boolean preview) Set wether this component should be displayed when the owning page is embedded in another page, rather than on the owning page itselfvoidsetPrivate(boolean privat) voidsetPublicationState(ContentItemPublicationState publicationState) voidsetPublished(boolean published) voidsetScope(CMSComponentScope scope) voidsetUiComponent(jakarta.faces.component.UIComponent uiComponent) voidtoggleAttribute(String key, String value) voidvoidtoString()
-
Constructor Details
-
CMSComponent
- Parameters:
template-items-
-
CMSComponent
- Parameters:
template-jpa-
-
CMSComponent
public CMSComponent(JsfComponent jsfComponent, String label, String description, List<String> types, String templateFilename, CMSComponentScope scope, Map<String, CMSComponentAttribute> attributes, List<CMSComponent.Property> properties, Integer order) Constructor to create Component from template file- Parameters:
jsfComponent-label-description-types-templateFilename-scope-attributes-properties-order-
-
-
Method Details
-
getPersistentComponent
- Returns:
- the persistentComponent
-
setPublicationState
- Parameters:
publicationState-
-
getPublicationState
-
setOrder
public void setOrder(int order) - Parameters:
order-
-
getOrder
-
addContentItem
- Parameters:
item-- Returns:
- true if item added successfully; false otherwise
-
removeContentItem
- Parameters:
item-- Returns:
- true if item removed successfully; false otherwise
-
getContentItems
-
getFirstContentItem
-
getFirstContentOfType
-
getAllContentOfType
-
getFirstContentItem
-
getContentItem
-
getTranslatableContentItems
-
getJsfComponent
-
getLabel
-
getDescription
-
getTemplateFilename
-
isPageScope
public boolean isPageScope() -
compareTo
- Specified by:
compareToin interfaceComparable<CMSComponent>
-
getUiComponent
- Throws:
PresentationException
-
setUiComponent
public void setUiComponent(jakarta.faces.component.UIComponent uiComponent) - Parameters:
uiComponent-
-
getBackendUiComponent
- Throws:
PresentationException
-
setBackendUiComponent
public void setBackendUiComponent(jakarta.faces.component.UIComponent backendUiComponent) - Parameters:
backendUiComponent-
-
getAttribute
- Parameters:
key-- Returns:
CMSComponentAttribute
-
getBooleanAttributeValue
- Parameters:
key-defaultValue-- Returns:
- a boolean
-
getAttributeValue
- Parameters:
key-- Returns:
String
-
setAttribute
- Parameters:
key-value-
-
toggleAttribute
- Parameters:
key-value-
-
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
- Parameters:
user-- Returns:
- a boolean
-
getContentData
- Parameters:
itemId-- Returns:
String
-
getContentData
- Parameters:
itemId-width-height-- Returns:
String
-
hasContent
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
-
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
-
setScope
-
getPersistenceId
public long getPersistenceId() -
getOwningPage
-
isPaged
public boolean isPaged() -
getTypes
-
getProperties
-
hasProperty
-
toString
-