Class CmsCollectionsBean

java.lang.Object
io.goobi.viewer.managedbeans.CmsCollectionsBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class CmsCollectionsBean extends Object implements Serializable
Bean handling CMS settings for collections.
Author:
Florian Alpers
See Also:
  • 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 and solrFieldValue 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

      public MessageEntry getMessageEntryForFieldValue()
      Returns the MessageEntry representing existing translations for the current value of solrFieldValue. Use for the info widget in the collection administration.
      Returns:
      MessageEntry containing the translations for solrFieldValue; empty MessageEntry if none found
    • isDisplayImportDescriptionsWidget

      public boolean isDisplayImportDescriptionsWidget()
      Returns:
      true keys with description suffix found; false otherwise
    • importDescriptionsAction

      public String importDescriptionsAction(String solrField) throws DAOException
      Parameters:
      solrField -
      Returns:
      empty string
      Throws:
      DAOException
    • getCurrentCollection

      public CMSCollection getCurrentCollection()

      Getter for the field currentCollection.

      Returns:
      the currentCollection
    • setCurrentCollection

      public void setCurrentCollection(CMSCollection currentCollection)

      Setter for the field currentCollection.

      Parameters:
      currentCollection - the currentCollection to set
    • getSolrField

      public String getSolrField()

      Getter for the field solrField.

      Returns:
      the solrField
    • setSolrField

      public void setSolrField(String solrField)

      Setter for the field solrField.

      Parameters:
      solrField - the solrField to set
    • getSolrFieldValue

      public String getSolrFieldValue()

      Getter for the field solrFieldValue.

      Returns:
      the solrFieldValue
    • setSolrFieldValue

      public void setSolrFieldValue(String solrFieldValue)

      Setter for the field solrFieldValue.

      Parameters:
      solrFieldValue - the solrFieldValue to set
    • getCollectionName

      public String getCollectionName()
    • setCollectionName

      public void setCollectionName(String collectionName) throws DAOException
      Loads existing or creates a new CMSCollection for the current solrfield and the given collectionName.
      Parameters:
      collectionName - Collection field value
      Throws:
      DAOException
    • getAllCollectionFields

      public List<String> getAllCollectionFields()

      getAllCollectionFields.

      Returns:
      a List object.
    • getCollections

      public List<CMSCollection> getCollections()

      Getter for the field collections.

      Returns:
      the configuredColelctions
    • updateCollections

      public void updateCollections() throws DAOException

      updateCollections.

      Throws:
      DAOException - if any.
    • deleteCollection

      public void deleteCollection(CMSCollection collection) throws DAOException

      deleteCollection.

      Parameters:
      collection - a CMSCollection object.
      Throws:
      DAOException - if any.
    • editCollection

      public String editCollection(CMSCollection collection)

      editCollection.

      Parameters:
      collection - a CMSCollection object.
      Returns:
      a String object.
    • getCurrentLabel

      public CMSCollectionTranslation getCurrentLabel(String language)

      getCurrentLabel.

      Parameters:
      language - a String object.
      Returns:
      a CMSCollectionTranslation object.
    • getCurrentDescription

      public CMSCollectionTranslation getCurrentDescription(String language)

      getCurrentDescription.

      Parameters:
      language - a String object.
      Returns:
      a CMSCollectionTranslation object.
    • saveCurrentCollection

      public String saveCurrentCollection() throws DAOException

      saveCurrentCollection.

      Returns:
      a String object.
      Throws:
      DAOException - if any.
    • resetCurrentCollection

      public String resetCurrentCollection() throws DAOException

      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 - a FacesContext object.
      comp - a UIComponent object.
      value - a Object object.
      Throws:
      javax.faces.validator.ValidatorException - if any.
    • validatePI

      public static boolean validatePI(String pi) throws IndexUnreachableException, PresentationException
      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 - a String 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

      public void setImageMode(CmsCollectionsBean.CMSCollectionImageMode imageMode)
      Parameters:
      imageMode - the imageMode to set
    • initImageMode

      public void initImageMode()
      Sets the value of imageMode depending on the properties of currentCollection.
    • getCurrentTab

      public CMSCollectionTreeTab getCurrentTab()
      Returns:
      the currentTab
    • setCurrentTab

      public void setCurrentTab(CMSCollectionTreeTab currentTab)
      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, IndexUnreachableException
      Initializes the collection tree for the current solrField, but only if not yet loaded.
      Throws:
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      IndexUnreachableException
    • isDirty

      public boolean isDirty()
    • getSearchUrl

      public String getSearchUrl(CMSCollection collection)