Package io.goobi.viewer.managedbeans
Class GeoMapBean
java.lang.Object
io.goobi.viewer.managedbeans.GeoMapBean
- All Implemented Interfaces:
IPolyglott
,Serializable
Bean for managing
GeoMaps
in the admin Backend- Author:
- florian
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeatureSet
(GeoMap map, String type) void
Sets the currentMap to a new emptyGeoMap
void
Get a list of allGeoMap
s from the databse.getCoordinateSearchQueryTemplate
(SolrFeatureSet featureSet) getEditMapUrl
(GeoMap map) getFromCache
(GeoMap geomap) boolean
boolean
isActiveFeatureSet
(FeatureSet featureSet) 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.boolean
return false ifisValid(Locale)
returns true and vice versaboolean
boolean
boolean
Return true if the the current geomap is not null and its tile in the given locale is not empty Otherwise return falsevoid
removeFeatureSet
(GeoMap map, FeatureSet set) void
If the current map has an id, restore the map from the database, removing all unsaved changes.void
Save the current map.void
void
setActiveFeatureSet
(ManualFeatureSet activeFeatureSet) void
setActiveFeatureSetAsString
(String features) void
void
setCurrentMap
(GeoMap currentMap) Sets the current map to a clone of the given mapvoid
setCurrentMapId
(Long mapId) If a GeoMap of the given mapId exists in the database, set the current map to a clone of that mapvoid
setSelectedLanguage
(Locale selectedLanguage) void
setSelectedLocale
(Locale locale) Set the locale to use for display and editingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
GeoMapBean
public GeoMapBean()
-
-
Method Details
-
getCurrentMap
- Returns:
- the currentMap
-
setCurrentMap
Sets the current map to a clone of the given map- Parameters:
currentMap
- the currentMap to set
-
setCurrentMapId
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
- Returns:
- ID of the currently loaded map
-
saveCurrentMap
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
- Parameters:
map
-- Throws:
DAOException
-
getEditMapUrl
- Parameters:
map
-- Returns:
- Map edit URL
-
resetCurrentMap
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 emptyGeoMap
-
getSelectedLanguage
- Returns:
- the selectedLanguage
-
setSelectedLanguage
- Parameters:
selectedLanguage
- the selectedLanguage to set
-
getAllMaps
Get a list of allGeoMap
s from the databse. Note that the databse is queries at each method call- Returns:
- a list of all stored GeoMaps
- Throws:
DAOException
-
getPossibleMapTypes
-
getPossibleMarkers
-
hasCurrentFeature
public boolean hasCurrentFeature() -
isInUse
- Throws:
DAOException
-
getEmbeddingCmsPages
- Throws:
DAOException
-
isHasMaps
- Throws:
DAOException
-
getCoordinateSearchQueryTemplate
- Parameters:
featureSet
-- Returns:
- String
-
getHeatmapUrl
-
getFeatureUrl
-
addFeatureSet
- Parameters:
map
-type
-
-
removeFeatureSet
- Parameters:
map
-set
-
-
setCurrentGeoMapType
- Parameters:
type
-
-
getActiveFeatureSet
-
setActiveFeatureSet
-
getActiveFeatureSetAsString
- Throws:
PresentationException
-
setActiveFeatureSetAsString
-
setActiveFeatureSet
public void setActiveFeatureSet() -
isActiveFeatureSet
-
getFromCache
-
isComplete
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 interfaceIPolyglott
- 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)
andIPolyglott.isValid(Locale)
are identical. For implementations with only one field, both methods are also always identical
-
isValid
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 interfaceIPolyglott
- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
return false ifisValid(Locale)
returns true and vice versa- Specified by:
isEmpty
in interfaceIPolyglott
- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocale
in interfaceIPolyglott
- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglott
Set the locale to use for display and editing- Specified by:
setSelectedLocale
in interfaceIPolyglott
-