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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeatureSet(GeoMap map, String type) addFeatureSet.voidSets the currentMap to a new emptyGeoMap.voiddeleteMap.Getter for the fieldactiveFeatureSet.getActiveFeatureSetAsString.Get a list of allGeoMaps from the databse.static StringgetCoordinateSearchQuery(SolrFeatureSet featureSet, String longLat) Getter for the fieldcurrentMap.getCurrentMapId.getEditMapUrl(GeoMap map) getEditMapUrl.getEmbeddingCmsPages.getFeatureUrl.getFromCache(GeoMap geomap) getFromCache.getHeatmapUrl.getPossibleMapTypes.getPossibleMarkers.Getter for the fieldselectedLanguage.booleanhasCurrentFeature.booleanisActiveFeatureSet(FeatureSet featureSet) isActiveFeatureSet.booleanisComplete(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 truebooleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classbooleanisHasMaps.booleanisInUse.booleanOnly meaningful for the default language for which all required fields must be filledvoidremoveFeatureSet(GeoMap map, FeatureSet set) removeFeatureSet.voidIf the current map has an id, restore the map from the database, removing all unsaved changes.voidSave the current map.voidSetter for the fieldactiveFeatureSet.voidsetActiveFeatureSet(ManualFeatureSet activeFeatureSet) Setter for the fieldactiveFeatureSet.voidsetActiveFeatureSetAsString(String features) setActiveFeatureSetAsString.voidsetCurrentGeoMapType.voidsetCurrentMap(GeoMap currentMap) Sets the current map to a clone of the given map.voidsetCurrentMapId(Long mapId) If a GeoMap of the given mapId exists in the database, set the current map to a clone of that map.voidsetSelectedLanguage(Locale selectedLanguage) Setter for the fieldselectedLanguage.voidsetSelectedLocale(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, waitMethods 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- aLongobject- 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- aGeoMapobject- Throws:
DAOException
-
getEditMapUrl
getEditMapUrl.
- Parameters:
map- aGeoMapobject- 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 allGeoMaps 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
Collectionobject
-
getPossibleMarkers
getPossibleMarkers.
- Returns:
- a
Collectionobject
-
hasCurrentFeature
public boolean hasCurrentFeature()hasCurrentFeature.
- Returns:
- a boolean
-
isInUse
isInUse.
- Parameters:
map- aGeoMapobject- Returns:
- a boolean
- Throws:
DAOException- if any.
-
getEmbeddingCmsPages
getEmbeddingCmsPages.
- Parameters:
map- aGeoMapobject- Returns:
- a
Listobject - Throws:
DAOException- if any.
-
isHasMaps
isHasMaps.
- Returns:
- a boolean
- Throws:
DAOException- if any.
-
getCoordinateSearchQuery
-
getHeatmapUrl
getHeatmapUrl.
- Returns:
- a
Stringobject
-
getFeatureUrl
getFeatureUrl.
- Returns:
- a
Stringobject
-
addFeatureSet
addFeatureSet.
-
removeFeatureSet
removeFeatureSet.
- Parameters:
map- aGeoMapobjectset- aFeatureSetobject
-
setCurrentGeoMapType
setCurrentGeoMapType.
- Parameters:
type- aGeoMap.GeoMapTypeobject
-
getActiveFeatureSet
Getter for the field
activeFeatureSet.- Returns:
- a
FeatureSetobject
-
setActiveFeatureSet
Setter for the field
activeFeatureSet.- Parameters:
activeFeatureSet- aManualFeatureSetobject
-
getActiveFeatureSetAsString
getActiveFeatureSetAsString.
- Returns:
- a
Stringobject - Throws:
PresentationException- if any.
-
setActiveFeatureSetAsString
setActiveFeatureSetAsString.
- Parameters:
features- aStringobject
-
setActiveFeatureSet
public void setActiveFeatureSet()Setter for the field
activeFeatureSet. -
isActiveFeatureSet
isActiveFeatureSet.
- Parameters:
featureSet- aFeatureSetobject- 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:
isCompletein interfaceIPolyglott- Parameters:
locale-- 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 meaningful 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:
isValidin interfaceIPolyglott- Parameters:
locale-- 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:
isEmptyin interfaceIPolyglott- Parameters:
locale-- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocalein interfaceIPolyglott- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Set the locale to use for display and editing- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale-
-