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()

      Constructor for GeoMapBean.

  • Method Details

    • getCurrentMap

      public GeoMap getCurrentMap()

      Getter for the field currentMap.

      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 - a Long object
      Throws:
      DAOException
    • getCurrentMapId

      public Long getCurrentMapId()

      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

      deleteMap.

      Parameters:
      map - a GeoMap object
      Throws:
      DAOException
    • getEditMapUrl

      public String getEditMapUrl(GeoMap map)

      getEditMapUrl.

      Parameters:
      map - a GeoMap object
      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()

      Getter for the field selectedLanguage.

      Returns:
      the selectedLanguage
    • setSelectedLanguage

      public void setSelectedLanguage(Locale selectedLanguage)

      Setter for the field 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()

      getPossibleMapTypes.

      Returns:
      a Collection object
    • getPossibleMarkers

      public Collection<GeoMapMarker> getPossibleMarkers()

      getPossibleMarkers.

      Returns:
      a Collection object
    • hasCurrentFeature

      public boolean hasCurrentFeature()

      hasCurrentFeature.

      Returns:
      a boolean
    • isInUse

      public boolean isInUse(GeoMap map) throws DAOException

      isInUse.

      Parameters:
      map - a GeoMap object
      Returns:
      a boolean
      Throws:
      DAOException - if any.
    • getEmbeddingCmsPages

      public List<CMSPage> getEmbeddingCmsPages(GeoMap map) throws DAOException

      getEmbeddingCmsPages.

      Parameters:
      map - a GeoMap object
      Returns:
      a List object
      Throws:
      DAOException - if any.
    • isHasMaps

      public boolean isHasMaps() throws DAOException

      isHasMaps.

      Returns:
      a boolean
      Throws:
      DAOException - if any.
    • getCoordinateSearchQueryTemplate

      public String getCoordinateSearchQueryTemplate(SolrFeatureSet featureSet)

      getCoordinateSearchQueryTemplate.

      Parameters:
      featureSet - a SolrFeatureSet object
      Returns:
      String
    • getCoordinateSearchQuery

      public static String getCoordinateSearchQuery(SolrFeatureSet featureSet, String longLat)
    • getHeatmapUrl

      public String getHeatmapUrl()

      getHeatmapUrl.

      Returns:
      a String object
    • getFeatureUrl

      public String getFeatureUrl()

      getFeatureUrl.

      Returns:
      a String object
    • addFeatureSet

      public void addFeatureSet(GeoMap map, String type)

      addFeatureSet.

      Parameters:
      map - a GeoMap object
      type - a String object
    • removeFeatureSet

      public void removeFeatureSet(GeoMap map, FeatureSet set)

      removeFeatureSet.

      Parameters:
      map - a GeoMap object
      set - a FeatureSet object
    • setCurrentGeoMapType

      public void setCurrentGeoMapType(GeoMap.GeoMapType type)

      setCurrentGeoMapType.

      Parameters:
      type - a GeoMap.GeoMapType object
    • getActiveFeatureSet

      public FeatureSet getActiveFeatureSet()

      Getter for the field activeFeatureSet.

      Returns:
      a FeatureSet object
    • setActiveFeatureSet

      public void setActiveFeatureSet(ManualFeatureSet activeFeatureSet)

      Setter for the field activeFeatureSet.

      Parameters:
      activeFeatureSet - a ManualFeatureSet object
    • getActiveFeatureSetAsString

      public String getActiveFeatureSetAsString() throws PresentationException

      getActiveFeatureSetAsString.

      Returns:
      a String object
      Throws:
      PresentationException - if any.
    • setActiveFeatureSetAsString

      public void setActiveFeatureSetAsString(String features)

      setActiveFeatureSetAsString.

      Parameters:
      features - a String object
    • setActiveFeatureSet

      public void setActiveFeatureSet()

      Setter for the field activeFeatureSet.

    • isActiveFeatureSet

      public boolean isActiveFeatureSet(FeatureSet featureSet)

      isActiveFeatureSet.

      Parameters:
      featureSet - a FeatureSet object
      Returns:
      a boolean
    • getFromCache

      public GeoMap getFromCache(GeoMap geomap)

      getFromCache.

      Parameters:
      geomap - a GeoMap object
      Returns:
      a GeoMap object
    • isComplete

      public boolean isComplete(Locale locale)
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless IPolyglott.isEmpty(Locale) also returns true 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)
      Only meaningfull for the default language for which all required fields must be filled 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)
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class 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)
      Set the locale to use for display and editing
      Specified by:
      setSelectedLocale in interface IPolyglott