Class GeoMapBean

java.lang.Object
io.goobi.viewer.managedbeans.GeoMapBean
All Implemented Interfaces:
IPolyglott, Serializable

@Named @ViewScoped public class GeoMapBean extends Object implements Serializable, IPolyglott
Bean for managing GeoMaps in the admin Backend
Author:
florian
See Also:
  • Constructor Details

    • GeoMapBean

      public GeoMapBean()
  • Method Details

    • getCurrentMap

      public GeoMap getCurrentMap()
      Returns:
      the currentMap
    • setCurrentMap

      public void setCurrentMap(GeoMap currentMap)
      Sets the current map to a clone of the given map
      Parameters:
      currentMap - the currentMap to set
    • setCurrentMapId

      public void setCurrentMapId(Long mapId) throws DAOException
      If a GeoMap of the given mapId exists in the database, set the current map to a clone of that map
      Parameters:
      mapId -
      Throws:
      DAOException
    • getCurrentMapId

      public Long getCurrentMapId()
      Returns:
      ID of the currently loaded map
    • saveCurrentMap

      public void saveCurrentMap() throws DAOException
      Save the current map. Either add it to database if it has no id yet, or otherwise update it in the database
      Throws:
      DAOException
    • deleteMap

      public void deleteMap(GeoMap map) throws DAOException
      Parameters:
      map -
      Throws:
      DAOException
    • getEditMapUrl

      public String getEditMapUrl(GeoMap map)
      Parameters:
      map -
      Returns:
      Map edit URL
    • resetCurrentMap

      public void resetCurrentMap() throws DAOException
      If the current map has an id, restore the map from the database, removing all unsaved changes. If the current map exists but has no id, set the current map to a new empty map
      Throws:
      DAOException
    • createEmptyCurrentMap

      public void createEmptyCurrentMap()
      Sets the currentMap to a new empty GeoMap
    • getSelectedLanguage

      public Locale getSelectedLanguage()
      Returns:
      the selectedLanguage
    • setSelectedLanguage

      public void setSelectedLanguage(Locale selectedLanguage)
      Parameters:
      selectedLanguage - the selectedLanguage to set
    • getAllMaps

      public List<GeoMap> getAllMaps() throws DAOException
      Get a list of all GeoMaps from the databse. Note that the databse is queries at each method call
      Returns:
      a list of all stored GeoMaps
      Throws:
      DAOException
    • getPossibleMapTypes

      public Collection<GeoMap.GeoMapType> getPossibleMapTypes()
    • getPossibleMarkers

      public Collection<GeoMapMarker> getPossibleMarkers()
    • hasCurrentFeature

      public boolean hasCurrentFeature()
    • isInUse

      public boolean isInUse(GeoMap map) throws DAOException
      Throws:
      DAOException
    • getEmbeddingCmsPages

      public List<CMSPage> getEmbeddingCmsPages(GeoMap map) throws DAOException
      Throws:
      DAOException
    • isHasMaps

      public boolean isHasMaps() throws DAOException
      Throws:
      DAOException
    • getCoordinateSearchQueryTemplate

      public String getCoordinateSearchQueryTemplate(SolrFeatureSet featureSet)
      Parameters:
      featureSet -
      Returns:
      String
    • getHeatmapUrl

      public String getHeatmapUrl()
    • getFeatureUrl

      public String getFeatureUrl()
    • addFeatureSet

      public void addFeatureSet(GeoMap map, String type)
      Parameters:
      map -
      type -
    • removeFeatureSet

      public void removeFeatureSet(GeoMap map, FeatureSet set)
      Parameters:
      map -
      set -
    • setCurrentGeoMapType

      public void setCurrentGeoMapType(GeoMap.GeoMapType type)
      Parameters:
      type -
    • getActiveFeatureSet

      public FeatureSet getActiveFeatureSet()
    • setActiveFeatureSet

      public void setActiveFeatureSet(ManualFeatureSet activeFeatureSet)
    • getActiveFeatureSetAsString

      public String getActiveFeatureSetAsString() throws PresentationException
      Throws:
      PresentationException
    • setActiveFeatureSetAsString

      public void setActiveFeatureSetAsString(String features)
    • setActiveFeatureSet

      public void setActiveFeatureSet()
    • isActiveFeatureSet

      public boolean isActiveFeatureSet(FeatureSet featureSet)
    • getFromCache

      public GeoMap getFromCache(GeoMap geomap)
    • isComplete

      public boolean isComplete(Locale locale)
      Return true if the the current geomap is not null and its title in the given locale is not empty and the description is either not empty for the current locale of the description for the default locale is empty. Otherwise return false
      Specified by:
      isComplete in interface IPolyglott
      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) and IPolyglott.isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      public boolean isValid(Locale locale)
      Return true if the the current geomap is not null and its tile in the given locale is not empty Otherwise return false
      Specified by:
      isValid in interface IPolyglott
      Returns:
      true if all required fields contain a value in the given locale
    • isEmpty

      public boolean isEmpty(Locale locale)
      return false if isValid(Locale) returns true and vice versa
      Specified by:
      isEmpty in interface IPolyglott
      Returns:
      true if no fields are filled for the given locale
    • getSelectedLocale

      public Locale getSelectedLocale()
      Specified by:
      getSelectedLocale in interface IPolyglott
      Returns:
      the locale currently set by IPolyglott.setSelectedLocale(Locale)
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      Description copied from interface: IPolyglott
      Set the locale to use for display and editing
      Specified by:
      setSelectedLocale in interface IPolyglott