Package io.goobi.viewer.model.cms
Class Highlight
java.lang.Object
io.goobi.viewer.model.cms.Highlight
- All Implemented Interfaces:
CMSMediaHolder
,IPolyglott
-
Constructor Summary
ConstructorDescriptionHighlight
(HighlightData data) Highlight
(HighlightData data, ThumbnailHandler thumbs, Configuration config) -
Method Summary
Modifier and TypeMethodDescriptiongetData()
getImageURI
(int width, int height) Get the URI to the image representing the objectA regular expression determining which filenames are shown in the media list and may be uploadedgetMediaItem.getMediaItemWrapper.A string representing the allowed media formates for a user.getMetadataForField
(String field, Locale locale) getMetadataList
(Locale locale) boolean
Check whether an image is set for this objectboolean
hasMediaItem.boolean
isComplete
(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 trueboolean
Check if the object is active now.boolean
isCurrent
(LocalDateTime date) Check if the object is active at the given dateboolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
Check if this object may be active at allboolean
isFuture()
Check if this object is not currently active but will be active in the future.boolean
isFuture
(LocalDateTime date) Check if this object is not currently active but will be active in the future of the given date.boolean
isPast()
Check if this object is no longer active.boolean
isPast
(LocalDateTime date) Check if this object was only active before the given date.boolean
alias forisCurrent()
boolean
Only meaningfull for the default language for which all required fields must be filledvoid
setMediaItem
(CMSMediaItem item) setMediaItem.void
setSelectedLocale
(Locale locale) Set the locale to use for display and editingtoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
Highlight
-
Highlight
-
-
Method Details
-
isComplete
Description copied from interface:IPolyglott
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- Specified by:
isComplete
in interfaceIPolyglott
- 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:IPolyglott
Only meaningfull for the default language for which all required fields must be filled- Specified by:
isValid
in interfaceIPolyglott
- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
Description copied from interface:IPolyglott
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class- Specified by:
isEmpty
in interfaceIPolyglott
- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocale
in interfaceIPolyglott
- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglott
Set the locale to use for display and editing- Specified by:
setSelectedLocale
in interfaceIPolyglott
-
getMediaFilter
Description copied from interface:CMSMediaHolder
A regular expression determining which filenames are shown in the media list and may be uploaded
- Specified by:
getMediaFilter
in interfaceCMSMediaHolder
- Returns:
- a
String
object.
-
getMediaTypes
Description copied from interface:CMSMediaHolder
A string representing the allowed media formates for a user. Should be a comma separated list of format names or filename suffixes- Specified by:
getMediaTypes
in interfaceCMSMediaHolder
- Returns:
String
-
hasMediaItem
public boolean hasMediaItem()Description copied from interface:CMSMediaHolder
hasMediaItem.
- Specified by:
hasMediaItem
in interfaceCMSMediaHolder
- Returns:
- a boolean.
-
getMediaItem
Description copied from interface:CMSMediaHolder
getMediaItem.
- Specified by:
getMediaItem
in interfaceCMSMediaHolder
- Returns:
- a
CMSMediaItem
object.
-
setMediaItem
Description copied from interface:CMSMediaHolder
setMediaItem.
- Specified by:
setMediaItem
in interfaceCMSMediaHolder
- Parameters:
item
- aCMSMediaItem
object.
-
getMediaItemWrapper
Description copied from interface:CMSMediaHolder
getMediaItemWrapper.
- Specified by:
getMediaItemWrapper
in interfaceCMSMediaHolder
- Returns:
- a
CategorizableTranslatedSelectable
object.
-
getData
-
hasImageURI
public boolean hasImageURI()Check 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 Get the URI to the image representing the object- Parameters:
width
-height
-- 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:
IndexUnreachableException
PresentationException
ViewerConfigurationException
-
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
Check if the object is active at the given date- Parameters:
date
-- 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
-- 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
-- Returns:
- true if startTime is not null and after now and timeEnd is either null or after now
-
isEnabled
public boolean isEnabled()Check 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
-- Returns:
- List
- Throws:
IndexUnreachableException
PresentationException
-
getMetadataForField
public List<Metadata> getMetadataForField(String field, Locale locale) throws IndexUnreachableException, PresentationException - Parameters:
field
-locale
-- Returns:
- List
- Throws:
IndexUnreachableException
PresentationException
-
getMetadataElement
-