Class CMSCollection
- All Implemented Interfaces:
CMSMediaHolder,IPolyglott,BrowseElementInfo,Serializable,Comparable<CMSCollection>
- Author:
- Florian Alpers
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for CMSCollection.CMSCollection(CMSCollection orig) Cloning constructorCMSCollection(String solrField, String solrFieldValue) Default constructor, creating a Collection from the identifying fieldssolrFieldandsolrFieldValue -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescription(CMSCollectionTranslation description) Adds a translation for the collection descriptionvoidaddLabel(CMSCollectionTranslation label) Adds a translation for the collection labelintcompareTo(CMSCollection other) Compares collection by the alphabatical sorting of theirgetSolrFieldValue()booleancontentEquals(CMSCollection other) booleanACMSCollectionis equal to any other object if that is also a CMSCollection and returns the same values forgetSolrField()andgetSolrFieldValue()Getter for the fieldcollectionUrl.static URIgetDefaultIcon(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 aLocaleand 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_TAGgetIconURI.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_TAGgetLinkURI.getLinkURI(jakarta.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.IMetadataValuede.intranda.metadata.multilanguage.IMetadataValuegetTranslationsForName.inthashCode()Returns the hashCode ofgetSolrFieldValue()booleanhasImage()hasImage.booleanhasMediaItem.booleanhasRepresentativeWork.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 truebooleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classbooleanOnly meaningful for the default language for which all required fields must be filledvoidpopulateDescriptions.voidpopulateDescriptions(List<String> languages) populateDescriptions.voidpopulateLabels.voidsetCollectionUrl(String collectionUrl) Setter for the fieldcollectionUrl.voidsetDescription(String value, String language) setDescription.voidsetLabel.voidsetMediaItem(CMSMediaItem mediaItem) setMediaItem.voidsetRepresentativeWorkPI(String representativeWorkPI) Setter for the fieldrepresentativeWorkPI.voidsetSelectedLocale(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, waitMethods inherited from interface io.goobi.viewer.model.viewer.collections.BrowseElementInfo
hasDescriptionMethods 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 fieldssolrFieldandsolrFieldValue- 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:
getMediaItemin interfaceCMSMediaHolder- Returns:
- the mediaItem
-
setMediaItem
setMediaItem.
- Specified by:
setMediaItemin interfaceCMSMediaHolder- Parameters:
mediaItem- aCMSMediaItemobject.
-
getCollectionUrl
Getter for the field
collectionUrl.- Returns:
- the collectionUri
-
setCollectionUrl
Setter for the field
collectionUrl.- Parameters:
collectionUrl- aStringobject.
-
addLabel
Adds a translation for the collection label- Parameters:
label- aCMSCollectionTranslationobject.
-
addDescription
Adds a translation for the collection description- Parameters:
description- aCMSCollectionTranslationobject.
-
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- aLocaleobject.- Returns:
- The string value of the label of the given locale, or an empty string
-
getLabelAsTranslation
getLabelAsTranslation.
- Parameters:
language- aStringobject.- Returns:
- a
CMSCollectionTranslationobject.
-
getDescriptionAsTranslation
getDescriptionAsTranslation.
- Parameters:
language- aStringobject.- Returns:
- a
CMSCollectionTranslationobject.
-
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 aLocaleand is case insensitive- Specified by:
getDescriptionin interfaceBrowseElementInfo- Parameters:
language- aStringobject.- 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- aLocaleobject.- 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:
getDescriptionin 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:
compareToin interfaceComparable<CMSCollection>
-
hashCode
public int hashCode()Returns the hashCode ofgetSolrFieldValue() -
equals
ACMSCollectionis 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:
hasMediaItemin 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:
getNamein interfaceBrowseElementInfo- Returns:
- a
Stringobject.
-
getLinkURI
getLinkURI.
- Specified by:
getLinkURIin interfaceBrowseElementInfo- Returns:
- a
URIobject.
-
getLinkURI
getLinkURI.
- Specified by:
getLinkURIin interfaceBrowseElementInfo- Parameters:
request- aHttpServletRequestobject.- Returns:
- a
URIobject.
-
getIconURI
getIconURI.
- Specified by:
getIconURIin interfaceBrowseElementInfo- Returns:
- a
URIobject.
-
getIconURI
getIconURI.
- Specified by:
getIconURIin interfaceBrowseElementInfo- Parameters:
width- a int.height- a int.- Returns:
- a
URIobject.
-
getIconURI
getIconURI.
- Specified by:
getIconURIin interfaceBrowseElementInfo- Parameters:
size- a int.- Returns:
- a
URIobject.
-
getDefaultIcon
Deprecated.- Parameters:
collectionName-- Returns:
URI
-
getRepresentativeWork
getRepresentativeWork.
- Returns:
- a
Optionalobject.
-
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:
getTranslationsForNamein interfaceBrowseElementInfo- Returns:
- a
IMetadataValueobject.
-
getTranslationsForDescription
public de.intranda.metadata.multilanguage.IMetadataValue getTranslationsForDescription()- Specified by:
getTranslationsForDescriptionin interfaceBrowseElementInfo- Returns:
IMetadataValue
-
getMediaFilter
A regular expression determining which filenames are shown in the media list and may be uploaded
- Specified by:
getMediaFilterin interfaceCMSMediaHolder- Returns:
- a
Stringobject.
-
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
-
getMediaItemWrapper
getMediaItemWrapper.
- Specified by:
getMediaItemWrapperin interfaceCMSMediaHolder- Returns:
- a
CategorizableTranslatedSelectableobject.
-
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-- 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-- 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-- 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:IPolyglottSet the locale to use for display and editing- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale-
-