Class PersistentCMSComponent
java.lang.Object
io.goobi.viewer.model.cms.pages.content.PersistentCMSComponent
- All Implemented Interfaces:
IPolyglott,Serializable,Comparable<PersistentCMSComponent>
@Entity
public class PersistentCMSComponent
extends Object
implements IPolyglott, Serializable, Comparable<PersistentCMSComponent>
JPA entity representing a CMS component instance persisted to the database, storing its
ordering, translated labels, content items, and the association to a CMS page or template.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJPA constructor.PersistentCMSComponent(CMSComponent component) PersistentCMSComponent(CMSComponent template, Collection<CMSContent> contentData) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContent(CMSContent content) intboolean<T extends CMSContent>
List<T> getAllContentOfType(Class<? extends CMSContent> clazz) getAttribute(String key) getContentByItemId(String itemId) <T extends CMSContent>
TgetFirstContentOfType(Class<? extends CMSContent> clazz) getId()getOrder()inthashCode()booleanisComplete(Locale locale) If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)also returns true.booleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.booleanisPaged()booleanOnly meaningful for the default language for which all required fields must be filled.voidsetAttribute(String key, String value) voidsetAttributes(Map<String, String> attributes) voidvoidvoidsetOwningPage(CMSPage ownerPage) voidsetOwningTemplate(CMSPageTemplate template) voidsetPublicationState(ContentItemPublicationState publicationState) voidsetSelectedLocale(Locale locale) Sets the locale to use for display and editing.voidsetTemplateFilename(String templateFilename) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
PersistentCMSComponent
public PersistentCMSComponent()JPA constructor. -
PersistentCMSComponent
-
PersistentCMSComponent
-
PersistentCMSComponent
-
-
Method Details
-
getId
-
setId
-
getPublicationState
-
setPublicationState
-
getOrder
-
setOrder
-
getContentItems
-
getOwningPage
-
setOwningPage
-
setOwningTemplate
-
getOwningTemplate
-
getTemplateFilename
-
setTemplateFilename
-
addContent
-
isComplete
Description copied from interface:IPolyglottIf this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)also returns true.- Specified by:
isCompletein interfaceIPolyglott- Parameters:
locale- the locale to check translation completeness for- Returns:
- true if
IPolyglott.isValid(Locale)returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale,IPolyglott.isComplete(Locale)andIPolyglott.isValid(Locale)are identical. For implementations with only one field, both methods are also always identical
-
isValid
Description copied from interface:IPolyglottOnly meaningful for the default language for which all required fields must be filled.- Specified by:
isValidin interfaceIPolyglott- Parameters:
locale- the locale to validate required fields for- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
Description copied from interface:IPolyglottIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.- Specified by:
isEmptyin interfaceIPolyglott- Parameters:
locale- the locale to check for empty fields- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocalein interfaceIPolyglott- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglottSets the locale to use for display and editing.- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale- the locale to select
-
getTranslatableContentItems
-
compareTo
- Specified by:
compareToin interfaceComparable<PersistentCMSComponent>
-
setAttribute
-
getAttribute
-
getAttributes
-
setAttributes
-
getContentByItemId
-
getFirstContentOfType
-
getAllContentOfType
-
isPaged
public boolean isPaged() -
hashCode
public int hashCode() -
equals
-