Package io.goobi.viewer.managedbeans
Class CmsCollectionsBean
java.lang.Object
io.goobi.viewer.managedbeans.CmsCollectionsBean
- All Implemented Interfaces:
Serializable
Bean handling CMS settings for collections.
- Author:
- Florian Alpers
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCollection(CMSCollection collection) deleteCollection.editCollection(CMSCollection collection) editCollection.getAllCollectionFields.Getter for the fieldcollections.Getter for the fieldcurrentCollection.getCurrentDescription(String language) getCurrentDescription.getCurrentLabel(String language) getCurrentLabel.Returns theMessageEntryrepresenting existing translations for the current value ofsolrFieldValue.getSearchUrl(CMSCollection collection) Getter for the fieldsolrField.Getter for the fieldsolrFieldValue.importDescriptionsAction(String solrField) voidSets the value ofimageModedepending on the properties ofcurrentCollection.voidInitializes the collection tree for the currentsolrField, but only if not yet loaded.booleanChecks the current collection for validity.booleanisDirty()booleanbooleanbooleanbooleanvoidloadCollection(String field) Initializes the collection tree for the given index field name.resetCurrentCollection.saveCurrentCollection.voidsetCollectionName(String collectionName) Loads existing or creates a newCMSCollectionfor the currentsolrfieldand the givencollectionName.voidsetCurrentCollection(CMSCollection currentCollection) Setter for the fieldcurrentCollection.voidsetCurrentTab(CMSCollectionTreeTab currentTab) voidvoidsetSolrField(String solrField) Setter for the fieldsolrField.voidsetSolrFieldValue(String solrFieldValue) Setter for the fieldsolrFieldValue.voidupdateCollections.voidvalidatePI(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent comp, Object value) validatePI.static booleanvalidatePI(String pi) Checks if the given pi matches a known PI in the solr index.
-
Constructor Details
-
CmsCollectionsBean
public CmsCollectionsBean()Constructor for CmsCollectionsBean.
-
-
Method Details
-
isDisplayTranslationWidget
public boolean isDisplayTranslationWidget()- Returns:
- true if the if translations for the values of
solrFieldare not or only partially translated; false if they are fully translated
-
isDisplayTranslationWidgetEdit
public boolean isDisplayTranslationWidgetEdit()- Returns:
- true if the if translations for the values of
solrFieldandsolrFieldValueare not or only partially translated; false if they are fully translated
-
isDisplaySolrFieldSelectionWidget
public boolean isDisplaySolrFieldSelectionWidget()- Returns:
- true if number of available collections is greater than 1; false otherwise
-
getMessageEntryForFieldValue
Returns theMessageEntryrepresenting existing translations for the current value ofsolrFieldValue. Use for the info widget in the collection administration.- Returns:
MessageEntrycontaining the translations forsolrFieldValue; emptyMessageEntryif none found
-
isDisplayImportDescriptionsWidget
public boolean isDisplayImportDescriptionsWidget()- Returns:
- true keys with description suffix found; false otherwise
-
importDescriptionsAction
- Parameters:
solrField-- Returns:
- empty string
- Throws:
DAOException
-
getCurrentCollection
Getter for the field
currentCollection.- Returns:
- the currentCollection
-
setCurrentCollection
Setter for the field
currentCollection.- Parameters:
currentCollection- the currentCollection to set
-
getSolrField
Getter for the field
solrField.- Returns:
- the solrField
-
setSolrField
Setter for the field
solrField.- Parameters:
solrField- the solrField to set
-
getSolrFieldValue
Getter for the field
solrFieldValue.- Returns:
- the solrFieldValue
-
setSolrFieldValue
Setter for the field
solrFieldValue.- Parameters:
solrFieldValue- the solrFieldValue to set
-
getCollectionName
-
setCollectionName
Loads existing or creates a newCMSCollectionfor the currentsolrfieldand the givencollectionName.- Parameters:
collectionName- Collection field value- Throws:
DAOException
-
getAllCollectionFields
getAllCollectionFields.
- Returns:
- a
Listobject.
-
getCollections
Getter for the field
collections.- Returns:
- the configuredColelctions
-
updateCollections
updateCollections.
- Throws:
DAOException- if any.
-
deleteCollection
deleteCollection.
- Parameters:
collection- aCMSCollectionobject.- Throws:
DAOException- if any.
-
editCollection
editCollection.
- Parameters:
collection- aCMSCollectionobject.- Returns:
- a
Stringobject.
-
getCurrentLabel
getCurrentLabel.
- Parameters:
language- aStringobject.- Returns:
- a
CMSCollectionTranslationobject.
-
getCurrentDescription
getCurrentDescription.
- Parameters:
language- aStringobject.- Returns:
- a
CMSCollectionTranslationobject.
-
saveCurrentCollection
saveCurrentCollection.
- Returns:
- a
Stringobject. - Throws:
DAOException- if any.
-
resetCurrentCollection
resetCurrentCollection.
- Returns:
- a
Stringobject. - Throws:
DAOException- if any.
-
isCurrentCollectionValid
public boolean isCurrentCollectionValid()Checks the current collection for validity. Currently only checks if a possibly entered PI exists in the solr- Returns:
- a boolean.
-
validatePI
public void validatePI(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent comp, Object value) throws jakarta.faces.validator.ValidatorException validatePI.
- Parameters:
context- aFacesContextobject.comp- aUIComponentobject.value- aObjectobject.- Throws:
jakarta.faces.validator.ValidatorException- if any.
-
validatePI
Checks if the given pi matches a known PI in the solr index. If the pi is empty, true is returned to allow not setting any pi- Parameters:
pi- aStringobject.- Returns:
- false if no current collection is set, the pi does not match any known work
- Throws:
IndexUnreachableException- if any.PresentationException- if any.
-
getImageMode
- Returns:
- the imageMode
-
setImageMode
- Parameters:
imageMode- the imageMode to set
-
initImageMode
public void initImageMode()Sets the value ofimageModedepending on the properties ofcurrentCollection. -
getCurrentTab
- Returns:
- the currentTab
-
setCurrentTab
- Parameters:
currentTab- the currentTab to set
-
loadCollection
public void loadCollection(String field) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, IndexUnreachableException Initializes the collection tree for the given index field name.- Parameters:
field-- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionIndexUnreachableException
-
initSolrField
public void initSolrField() throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, IndexUnreachableExceptionInitializes the collection tree for the currentsolrField, but only if not yet loaded.- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionIndexUnreachableException
-
isDirty
public boolean isDirty() -
getSearchUrl
-