Package io.goobi.viewer.model.cms
Class Highlight
java.lang.Object
io.goobi.viewer.model.cms.Highlight
- All Implemented Interfaces:
CMSMediaHolder,IPolyglott
Wraps a
HighlightData entity to provide a view-layer object for a highlighted content
item, including thumbnail generation, metadata loading, and multilingual label support.-
Constructor Summary
ConstructorsConstructorDescriptionHighlight(HighlightData data) Highlight(HighlightData data, ThumbnailHandler thumbs, Configuration config) -
Method Summary
Modifier and TypeMethodDescriptiongetData()getImageURI(int width, int height) Gets the URI to the image representing the object.A regular expression determining which filenames are shown in the media list and may be uploaded.getMediaItem.getMediaItemWrapper.A string representing the allowed media formates for a user.getMetadataForField(String field, Locale locale) getMetadataList(Locale locale) booleanChecks whether an image is set for this object.booleanhasMediaItem.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.booleanCheck if the object is active now.booleanisCurrent(LocalDateTime date) Checks if the object is active at the given date.booleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.booleanChecks if this object may be active at all.booleanisFuture()Check if this object is not currently active but will be active in the future.booleanisFuture(LocalDateTime date) Check if this object is not currently active but will be active in the future of the given date.booleanisPast()Check if this object is no longer active.booleanisPast(LocalDateTime date) Check if this object was only active before the given date.booleanalias forisCurrent().booleanOnly meaningful for the default language for which all required fields must be filled.voidsetMediaItem(CMSMediaItem item) setMediaItem.voidsetSelectedLocale(Locale locale) Sets the locale to use for display and editing.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
Highlight
-
Highlight
-
-
Method Details
-
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
-
getMediaFilter
Description copied from interface:CMSMediaHolderA regular expression determining which filenames are shown in the media list and may be uploaded.- Specified by:
getMediaFilterin interfaceCMSMediaHolder- Returns:
- the regex pattern used to filter acceptable media filenames for this holder
-
getMediaTypes
Description copied from interface:CMSMediaHolderA string representing the allowed media formates for a user. Should be a comma separated list of format names or filename suffixes- Specified by:
getMediaTypesin interfaceCMSMediaHolder- Returns:
String
-
hasMediaItem
public boolean hasMediaItem()Description copied from interface:CMSMediaHolderhasMediaItem.- Specified by:
hasMediaItemin interfaceCMSMediaHolder- Returns:
- true if this holder has an associated CMS media item, false otherwise
-
getMediaItem
Description copied from interface:CMSMediaHoldergetMediaItem.- Specified by:
getMediaItemin interfaceCMSMediaHolder- Returns:
- the associated CMS media item, or null if none is set
-
setMediaItem
Description copied from interface:CMSMediaHoldersetMediaItem.- Specified by:
setMediaItemin interfaceCMSMediaHolder- Parameters:
item- aCMSMediaItemobject.
-
getMediaItemWrapper
Description copied from interface:CMSMediaHoldergetMediaItemWrapper.- Specified by:
getMediaItemWrapperin interfaceCMSMediaHolder- Returns:
- the CMS media item wrapped with category and selection state information
-
getData
-
hasImageURI
public boolean hasImageURI()Checks whether an image is set for this object.- Returns:
- true if the image is taken from the record identifier or if it is taken from a media item and the media item is set
-
getImageURI
public URI getImageURI(int width, int height) throws IndexUnreachableException, PresentationException, ViewerConfigurationException Gets the URI to the image representing the object.- Parameters:
width- desired image width in pixelsheight- desired image height in pixels- Returns:
- true if
hasImageURI()returns true and, if the image is taken from the record identifier, the record identifier points to a records which has a representative image - Throws:
IndexUnreachableExceptionPresentationExceptionViewerConfigurationException
-
getImageURI
public URI getImageURI() throws IndexUnreachableException, PresentationException, ViewerConfigurationException -
isPresent
public boolean isPresent()alias forisCurrent().- Returns:
- true if startTime is before now (or null) and endTime is after now (or null)
-
isCurrent
public boolean isCurrent()Check if the object is active now. Mutually exclusive withisPast()andisFuture()- Returns:
- true if startTime is before now (or null) and endTime is after now (or null)
-
isCurrent
Checks if the object is active at the given date.- Parameters:
date- the point in time to check activity against- Returns:
- true if startTime is before now (or null) and endTime is after now (or null)
-
isPast
public boolean isPast()Check if this object is no longer active. Mutually exclusive withisCurrent()andisFuture()- Returns:
- true if timeEnd is not null and before now
-
isPast
Check if this object was only active before the given date.- Parameters:
date- the point in time to evaluate past status against- Returns:
- true if timeEnd is not null and before now
-
isFuture
public boolean isFuture()Check if this object is not currently active but will be active in the future. Mutually exclusive withisCurrent()andisPast()- Returns:
- true if startTime is not null and after now and timeEnd is either null or after now
-
isFuture
Check if this object is not currently active but will be active in the future of the given date.- Parameters:
date- the point in time to evaluate future status against- Returns:
- true if startTime is not null and after now and timeEnd is either null or after now
-
isEnabled
public boolean isEnabled()Checks if this object may be active at all.- Returns:
- true if data enabled; false otherwise
-
toString
-
getMetadataList
-
getMetadataList
public List<Metadata> getMetadataList(Locale locale) throws IndexUnreachableException, PresentationException - Parameters:
locale- locale for which to retrieve the metadata list- Returns:
- List
- Throws:
IndexUnreachableExceptionPresentationException
-
getMetadataForField
public List<Metadata> getMetadataForField(String field, Locale locale) throws IndexUnreachableException, PresentationException - Parameters:
field- Solr field name to filter metadata entries bylocale- locale used for language-specific field suffixes and metadata retrieval- Returns:
- List
- Throws:
IndexUnreachableExceptionPresentationException
-
getMetadataElement
-