Package io.goobi.viewer.managedbeans
Class GeoMapBean
java.lang.Object
io.goobi.viewer.managedbeans.GeoMapBean
- All Implemented Interfaces:
IPolyglott
,Serializable
Bean for managing
GeoMap
s in the admin Backend.- Author:
- florian
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeatureSet
(GeoMap map, String type) addFeatureSet.void
Sets the currentMap to a new emptyGeoMap
.void
deleteMap.Getter for the fieldactiveFeatureSet
.getActiveFeatureSetAsString.Get a list of allGeoMap
s from the databse.static String
getCoordinateSearchQuery
(SolrFeatureSet featureSet, String longLat) getCoordinateSearchQueryTemplate
(SolrFeatureSet featureSet) getCoordinateSearchQueryTemplate.Getter for the fieldcurrentMap
.getCurrentMapId.getEditMapUrl
(GeoMap map) getEditMapUrl.getEmbeddingCmsPages.getFeatureUrl.getFromCache
(GeoMap geomap) getFromCache.getHeatmapUrl.getPossibleMapTypes.getPossibleMarkers.Getter for the fieldselectedLanguage
.boolean
hasCurrentFeature.boolean
isActiveFeatureSet
(FeatureSet featureSet) isActiveFeatureSet.boolean
isComplete
(Locale locale) If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)
also returns trueboolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
isHasMaps.boolean
isInUse.boolean
Only meaningfull for the default language for which all required fields must be filledvoid
removeFeatureSet
(GeoMap map, FeatureSet set) removeFeatureSet.void
If the current map has an id, restore the map from the database, removing all unsaved changes.void
Save the current map.void
Setter for the fieldactiveFeatureSet
.void
setActiveFeatureSet
(ManualFeatureSet activeFeatureSet) Setter for the fieldactiveFeatureSet
.void
setActiveFeatureSetAsString
(String features) setActiveFeatureSetAsString.void
setCurrentGeoMapType.void
setCurrentMap
(GeoMap currentMap) Sets the current map to a clone of the given map.void
setCurrentMapId
(Long mapId) If a GeoMap of the given mapId exists in the database, set the current map to a clone of that map.void
setSelectedLanguage
(Locale selectedLanguage) Setter for the fieldselectedLanguage
.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()Constructor for GeoMapBean.
-
-
Method Details
-
getCurrentMap
Getter for the field
currentMap
.- 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
- aLong
object- Throws:
DAOException
-
getCurrentMapId
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
deleteMap.
- Parameters:
map
- aGeoMap
object- Throws:
DAOException
-
getEditMapUrl
getEditMapUrl.
- Parameters:
map
- aGeoMap
object- 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
Getter for the field
selectedLanguage
.- Returns:
- the selectedLanguage
-
setSelectedLanguage
Setter for the field
selectedLanguage
.- 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
getPossibleMapTypes.
- Returns:
- a
Collection
object
-
getPossibleMarkers
getPossibleMarkers.
- Returns:
- a
Collection
object
-
hasCurrentFeature
public boolean hasCurrentFeature()hasCurrentFeature.
- Returns:
- a boolean
-
isInUse
isInUse.
- Parameters:
map
- aGeoMap
object- Returns:
- a boolean
- Throws:
DAOException
- if any.
-
getEmbeddingCmsPages
getEmbeddingCmsPages.
- Parameters:
map
- aGeoMap
object- Returns:
- a
List
object - Throws:
DAOException
- if any.
-
isHasMaps
isHasMaps.
- Returns:
- a boolean
- Throws:
DAOException
- if any.
-
getCoordinateSearchQueryTemplate
getCoordinateSearchQueryTemplate.
- Parameters:
featureSet
- aSolrFeatureSet
object- Returns:
- String
-
getCoordinateSearchQuery
-
getHeatmapUrl
getHeatmapUrl.
- Returns:
- a
String
object
-
getFeatureUrl
getFeatureUrl.
- Returns:
- a
String
object
-
addFeatureSet
addFeatureSet.
-
removeFeatureSet
removeFeatureSet.
- Parameters:
map
- aGeoMap
objectset
- aFeatureSet
object
-
setCurrentGeoMapType
setCurrentGeoMapType.
- Parameters:
type
- aGeoMap.GeoMapType
object
-
getActiveFeatureSet
Getter for the field
activeFeatureSet
.- Returns:
- a
FeatureSet
object
-
setActiveFeatureSet
Setter for the field
activeFeatureSet
.- Parameters:
activeFeatureSet
- aManualFeatureSet
object
-
getActiveFeatureSetAsString
getActiveFeatureSetAsString.
- Returns:
- a
String
object - Throws:
PresentationException
- if any.
-
setActiveFeatureSetAsString
setActiveFeatureSetAsString.
- Parameters:
features
- aString
object
-
setActiveFeatureSet
public void setActiveFeatureSet()Setter for the field
activeFeatureSet
. -
isActiveFeatureSet
isActiveFeatureSet.
- Parameters:
featureSet
- aFeatureSet
object- Returns:
- a boolean
-
getFromCache
getFromCache.
-
isComplete
If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.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 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
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 interfaceIPolyglott
- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class 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
Set the locale to use for display and editing- Specified by:
setSelectedLocale
in interfaceIPolyglott
-