Class CMSComponent
java.lang.Object
io.goobi.viewer.model.cms.pages.content.CMSComponent
- All Implemented Interfaces:
Serializable
,Comparable<CMSComponent>
- See Also:
-
Constructor Summary
ConstructorDescriptionCMSComponent
(CMSComponent template, List<CMSContentItem> items) CMSComponent
(CMSComponent template, Optional<PersistentCMSComponent> jpa) CMSComponent
(JsfComponent jsfComponent, String label, String description, String iconPath, String templateFilename, CMSComponentScope scope, Map<String, CMSComponentAttribute> attributes, Integer order) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addContentItem
(CMSContentItem item) int
<T extends CMSContent>
List<T>getAllContentOfType
(Class<? extends CMSContent> clazz) getAttribute
(String key) getAttributeValue
(String key) javax.faces.component.UIComponent
boolean
getBooleanAttributeValue
(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()
long
getScope()
javax.faces.component.UIComponent
boolean
boolean
hasContent
(String itemId) Check whether a contentItem with the given itemId exists and is not emptyboolean
isPaged()
boolean
boolean
whether this component should be displayed when the owning page is embedded in another page, rather than on the owning page itselfboolean
boolean
boolean
void
setAttribute
(String key, String value) void
setBackendUiComponent
(javax.faces.component.UIComponent backendUiComponent) void
setOrder
(int order) 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 itselfvoid
setPrivate
(boolean privat) void
setPublicationState
(ContentItemPublicationState publicationState) void
setPublished
(boolean published) void
setScope
(CMSComponentScope scope) void
setUiComponent
(javax.faces.component.UIComponent uiComponent) void
toggleAttribute
(String key, String value) void
void
toString()
-
Constructor Details
-
CMSComponent
- Parameters:
template
-items
-
-
CMSComponent
- Parameters:
template
-jpa
-
-
CMSComponent
public CMSComponent(JsfComponent jsfComponent, String label, String description, String iconPath, String templateFilename, CMSComponentScope scope, Map<String, CMSComponentAttribute> attributes, Integer order) - Parameters:
jsfComponent
-label
-description
-iconPath
-templateFilename
-scope
-attributes
-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
-
getIconPath
-
getTemplateFilename
-
isPageScope
public boolean isPageScope() -
compareTo
- Specified by:
compareTo
in interfaceComparable<CMSComponent>
-
getUiComponent
- Throws:
PresentationException
-
setUiComponent
public void setUiComponent(javax.faces.component.UIComponent uiComponent) - Parameters:
uiComponent
-
-
getBackendUiComponent
- Throws:
PresentationException
-
setBackendUiComponent
public void setBackendUiComponent(javax.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() -
toString
-