Class CMSCollection
- All Implemented Interfaces:
CMSMediaHolder
,IPolyglott
,BrowseElementInfo
,Serializable
,Comparable<CMSCollection>
- Author:
- Florian Alpers
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructor for CMSCollection.CMSCollection
(CMSCollection orig) Cloning constructorCMSCollection
(String solrField, String solrFieldValue) Default constructor, creating a Collection from the identifying fieldssolrField
andsolrFieldValue
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescription
(CMSCollectionTranslation description) Adds a translation for the collection descriptionvoid
addLabel
(CMSCollectionTranslation label) Adds a translation for the collection labelint
compareTo
(CMSCollection other) Compares collection by the alphabatical sorting of theirgetSolrFieldValue()
boolean
contentEquals
(CMSCollection other) boolean
ACMSCollection
is equal to any other object if that is also a CMSCollection and returns the same values forgetSolrField()
andgetSolrFieldValue()
Getter for the fieldcollectionUrl
.static URI
getDefaultIcon
(String collectionName) Deprecated.get the description for the current locale (given byBeanUtils.getLocale()
, or an empty string if no matching description existsgetDescription
(String language) get the description for the givenlanguage
, or an empty string if no matching description exists the language should be the language code of aLocale
and is case insensitivegetDescription
(Locale locale) get the description for the givenlocale
, or an empty string if no matching description existsgetDescriptionAsTranslation
(String language) getDescriptionAsTranslation.returns all translations of this page with the tagDESCRIPTION_TAG
getIconURI.getIconURI
(int size) getIconURI.getIconURI
(int width, int height) getIconURI.getId()
Getter for the fieldid
.get the label for the givenlocale
, or an empty string if no matching label existsgetLabelAsTranslation
(String language) getLabelAsTranslation.returns all translations of this page with the tagLABEL_TAG
getLinkURI.getLinkURI
(javax.servlet.http.HttpServletRequest request) getLinkURI.A regular expression determining which filenames are shown in the media list and may be uploadedGetter for the fieldmediaItem
.getMediaItemWrapper.A string representing the allowed media formates for a user.getName()
getName.getRepresentativeWork.Getter for the fieldrepresentativeWorkPI
.Getter for the fieldsolrField
.Getter for the fieldsolrFieldValue
.de.intranda.metadata.multilanguage.IMetadataValue
de.intranda.metadata.multilanguage.IMetadataValue
getTranslationsForName.int
hashCode()
Returns the hashCode ofgetSolrFieldValue()
boolean
hasImage()
hasImage.boolean
hasMediaItem.boolean
hasRepresentativeWork.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
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
Only meaningfull for the default language for which all required fields must be filledvoid
populateDescriptions.void
populateDescriptions
(List<String> languages) populateDescriptions.void
populateLabels.void
setCollectionUrl
(String collectionUrl) Setter for the fieldcollectionUrl
.void
setDescription
(String value, String language) setDescription.void
setLabel.void
setMediaItem
(CMSMediaItem mediaItem) setMediaItem.void
setRepresentativeWorkPI
(String representativeWorkPI) Setter for the fieldrepresentativeWorkPI
.void
setSelectedLocale
(Locale locale) Set the locale to use for display and editingtoString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.viewer.collections.BrowseElementInfo
hasDescription
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
CMSCollection
public CMSCollection()Constructor for CMSCollection.
-
CMSCollection
Default constructor, creating a Collection from the identifying fieldssolrField
andsolrFieldValue
- Parameters:
solrField
- The name of the SOLR field holding the values for the collectionsolrFieldValue
- The value of the solrField identifying this collection- Throws:
IllegalArgumentException
- If either argument returns true forStringUtils.isBlank(CharSequence)
-
CMSCollection
Cloning constructor- Parameters:
orig
-
-
-
Method Details
-
getMediaItem
Getter for the field
mediaItem
.- Specified by:
getMediaItem
in interfaceCMSMediaHolder
- Returns:
- the mediaItem
-
setMediaItem
setMediaItem.
- Specified by:
setMediaItem
in interfaceCMSMediaHolder
- Parameters:
mediaItem
- aCMSMediaItem
object.
-
getCollectionUrl
Getter for the field
collectionUrl
.- Returns:
- the collectionUri
-
setCollectionUrl
Setter for the field
collectionUrl
.- Parameters:
collectionUrl
- aString
object.
-
addLabel
Adds a translation for the collection label- Parameters:
label
- aCMSCollectionTranslation
object.
-
addDescription
Adds a translation for the collection description- Parameters:
description
- aCMSCollectionTranslation
object.
-
getLabels
returns all translations of this page with the tagLABEL_TAG
- Returns:
- all labels for this collections
-
getDescriptions
returns all translations of this page with the tagDESCRIPTION_TAG
- Returns:
- all descriptions for this collections
-
getLabel
get the label for the givenlocale
, or an empty string if no matching label exists- Parameters:
locale
- aLocale
object.- Returns:
- The string value of the label of the given locale, or an empty string
-
getLabelAsTranslation
getLabelAsTranslation.
- Parameters:
language
- aString
object.- Returns:
- a
CMSCollectionTranslation
object.
-
getDescriptionAsTranslation
getDescriptionAsTranslation.
- Parameters:
language
- aString
object.- Returns:
- a
CMSCollectionTranslation
object.
-
getDescriptionAsTranslation
- Returns:
CMSCollectionTranslation
-
setLabel
setLabel.
-
getDescription
get the description for the givenlanguage
, or an empty string if no matching description exists the language should be the language code of aLocale
and is case insensitive- Specified by:
getDescription
in interfaceBrowseElementInfo
- Parameters:
language
- aString
object.- Returns:
- The string value of the description of the given language, or an empty string
-
getDescription
get the description for the givenlocale
, or an empty string if no matching description exists- Parameters:
locale
- aLocale
object.- Returns:
- The string value of the description of the given locale, or an empty string
-
getDescription
get the description for the current locale (given byBeanUtils.getLocale()
, or an empty string if no matching description exists- Specified by:
getDescription
in interfaceBrowseElementInfo
- Returns:
- The string value of the description of the current locale, or an empty string
-
setDescription
setDescription.
-
getSolrField
Getter for the field
solrField
.- Returns:
- the solrField. Guaranteed to hold a non-blank value
-
getSolrFieldValue
Getter for the field
solrFieldValue
.- Returns:
- the solrFieldValue. Guaranteed to hold a non-blank value
-
compareTo
Compares collection by the alphabatical sorting of theirgetSolrFieldValue()
- Specified by:
compareTo
in interfaceComparable<CMSCollection>
-
hashCode
public int hashCode()Returns the hashCode ofgetSolrFieldValue()
-
equals
ACMSCollection
is equal to any other object if that is also a CMSCollection and returns the same values forgetSolrField()
andgetSolrFieldValue()
-
contentEquals
- Parameters:
other
-- Returns:
- a boolean
-
populateLabels
public void populateLabels()populateLabels.
-
populateDescriptions
public void populateDescriptions()populateDescriptions.
-
populateDescriptions
populateDescriptions.
- Parameters:
languages
-
-
hasMediaItem
public boolean hasMediaItem()hasMediaItem.
- Specified by:
hasMediaItem
in interfaceCMSMediaHolder
- Returns:
- a boolean.
-
hasRepresentativeWork
public boolean hasRepresentativeWork()hasRepresentativeWork.
- Returns:
- a boolean.
-
hasImage
public boolean hasImage()hasImage.
- Returns:
- a boolean.
-
getId
Getter for the field
id
.- Returns:
- the id
-
toString
-
getName
getName.
- Specified by:
getName
in interfaceBrowseElementInfo
- Returns:
- a
String
object.
-
getLinkURI
getLinkURI.
- Specified by:
getLinkURI
in interfaceBrowseElementInfo
- Returns:
- a
URI
object.
-
getLinkURI
getLinkURI.
- Specified by:
getLinkURI
in interfaceBrowseElementInfo
- Parameters:
request
- aHttpServletRequest
object.- Returns:
- a
URI
object.
-
getIconURI
getIconURI.
- Specified by:
getIconURI
in interfaceBrowseElementInfo
- Returns:
- a
URI
object.
-
getIconURI
getIconURI.
- Specified by:
getIconURI
in interfaceBrowseElementInfo
- Parameters:
width
- a int.height
- a int.- Returns:
- a
URI
object.
-
getIconURI
getIconURI.
- Specified by:
getIconURI
in interfaceBrowseElementInfo
- Parameters:
size
- a int.- Returns:
- a
URI
object.
-
getDefaultIcon
Deprecated.- Parameters:
collectionName
-- Returns:
URI
-
getRepresentativeWork
getRepresentativeWork.
- Returns:
- a
Optional
object.
-
getRepresentativeWorkPI
Getter for the field
representativeWorkPI
.- Returns:
- the representativeWorkPI
-
setRepresentativeWorkPI
Setter for the field
representativeWorkPI
.- Parameters:
representativeWorkPI
- the representativeWorkPI to set
-
getTranslationsForName
public de.intranda.metadata.multilanguage.IMetadataValue getTranslationsForName()getTranslationsForName.
- Specified by:
getTranslationsForName
in interfaceBrowseElementInfo
- Returns:
- a
IMetadataValue
object.
-
getTranslationsForDescription
public de.intranda.metadata.multilanguage.IMetadataValue getTranslationsForDescription()- Specified by:
getTranslationsForDescription
in interfaceBrowseElementInfo
- Returns:
IMetadataValue
-
getMediaFilter
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
-
getMediaItemWrapper
getMediaItemWrapper.
- Specified by:
getMediaItemWrapper
in interfaceCMSMediaHolder
- Returns:
- a
CategorizableTranslatedSelectable
object.
-
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
-