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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteCollection
(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 theMessageEntry
representing existing translations for the current value ofsolrFieldValue
.getSearchUrl
(CMSCollection collection) Getter for the fieldsolrField
.Getter for the fieldsolrFieldValue
.importDescriptionsAction
(String solrField) void
Sets the value ofimageMode
depending on the properties ofcurrentCollection
.void
Initializes the collection tree for the currentsolrField
, but only if not yet loaded.boolean
Checks the current collection for validity.boolean
isDirty()
boolean
boolean
boolean
boolean
void
loadCollection
(String field) Initializes the collection tree for the given index field name.resetCurrentCollection.saveCurrentCollection.void
setCollectionName
(String collectionName) Loads existing or creates a newCMSCollection
for the currentsolrfield
and the givencollectionName
.void
setCurrentCollection
(CMSCollection currentCollection) Setter for the fieldcurrentCollection
.void
setCurrentTab
(CMSCollectionTreeTab currentTab) void
void
setSolrField
(String solrField) Setter for the fieldsolrField
.void
setSolrFieldValue
(String solrFieldValue) Setter for the fieldsolrFieldValue
.void
updateCollections.static boolean
validatePI
(String pi) Checks if the given pi matches a known PI in the solr index.void
validatePI
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent comp, Object value) validatePI.
-
Constructor Details
-
CmsCollectionsBean
public CmsCollectionsBean()Constructor for CmsCollectionsBean.
-
-
Method Details
-
isDisplayTranslationWidget
public boolean isDisplayTranslationWidget()- Returns:
- true if the if translations for the values of
solrField
are 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
solrField
andsolrFieldValue
are 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 theMessageEntry
representing existing translations for the current value ofsolrFieldValue
. Use for the info widget in the collection administration.- Returns:
MessageEntry
containing the translations forsolrFieldValue
; emptyMessageEntry
if 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 newCMSCollection
for the currentsolrfield
and the givencollectionName
.- Parameters:
collectionName
- Collection field value- Throws:
DAOException
-
getAllCollectionFields
getAllCollectionFields.
- Returns:
- a
List
object.
-
getCollections
Getter for the field
collections
.- Returns:
- the configuredColelctions
-
updateCollections
updateCollections.
- Throws:
DAOException
- if any.
-
deleteCollection
deleteCollection.
- Parameters:
collection
- aCMSCollection
object.- Throws:
DAOException
- if any.
-
editCollection
editCollection.
- Parameters:
collection
- aCMSCollection
object.- Returns:
- a
String
object.
-
getCurrentLabel
getCurrentLabel.
- Parameters:
language
- aString
object.- Returns:
- a
CMSCollectionTranslation
object.
-
getCurrentDescription
getCurrentDescription.
- Parameters:
language
- aString
object.- Returns:
- a
CMSCollectionTranslation
object.
-
saveCurrentCollection
saveCurrentCollection.
- Returns:
- a
String
object. - Throws:
DAOException
- if any.
-
resetCurrentCollection
resetCurrentCollection.
- Returns:
- a
String
object. - 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(javax.faces.context.FacesContext context, javax.faces.component.UIComponent comp, Object value) throws javax.faces.validator.ValidatorException validatePI.
- Parameters:
context
- aFacesContext
object.comp
- aUIComponent
object.value
- aObject
object.- Throws:
javax.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
- aString
object.- 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 ofimageMode
depending 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.IllegalRequestException
IndexUnreachableException
-
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.IllegalRequestException
IndexUnreachableException
-
isDirty
public boolean isDirty() -
getSearchUrl
-