package org.gcube.portlets.user.geoportaldataviewer.client; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile; import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject; public class ViewerStatus { private GNADataViewerConfigProfile geonaDataViewerProfile; private ViewerConfiguration config; // ucid -> index layer private Map> openedIndexes; // ucid -> projectId -> layers private Map>> openedProjects; public GNADataViewerConfigProfile getGeonaDataViewerProfile() { return geonaDataViewerProfile; } public void setGeonaDataViewerProfile(GNADataViewerConfigProfile geonaDataViewerProfile) { this.geonaDataViewerProfile = geonaDataViewerProfile; } public ViewerConfiguration getConfig() { return config; } public void setConfig(ViewerConfiguration config) { this.config = config; } public Map> getOpenedIndexes() { return openedIndexes; } public Map>> getOpenedProjects() { return openedProjects; } public void addOpenedIndex(String ucid, LayerObject indexId) { if(openedIndexes==null) openedIndexes=new HashMap>(); if(!openedIndexes.containsKey(ucid)) openedIndexes.put(ucid, new ArrayList()); openedIndexes.get(ucid).add(indexId); } public void addOpenedProjectLayer(String ucid, String projectId, LayerObject projectLayer) { if(openedProjects==null) openedProjects=new HashMap>>(); if(!openedProjects.containsKey(ucid)) openedProjects.put(ucid, new HashMap>()); Map> map=openedProjects.get(ucid); if(!map.containsKey(projectId)) map.put(ucid, new ArrayList()); map.get(projectId).add(projectLayer); } }