/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks application info. If clientWidgetInfo's * are defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getApplicationClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getApplicationClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getApplicationClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getApplicationClientWidgetInfos()); return widgetInfos; }
/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks main map. If clientWidgetInfo's are * defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getMainMapClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getMainMapClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getMainMapClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getMainMapClientWidgetInfos()); return widgetInfos; }
/** * Retrieve the main map layers from the geodesk. If it's a geodesk without layers, the layers from the blueprint * are retrieved. * * @param geodesk the geodesk * @return a list of layers */ public static List<LayerDto> getMainMapLayers(BaseGeodeskDto geodesk) { if (geodesk instanceof GeodeskDto && (geodesk.getMainMapLayers() == null || geodesk.getMainMapLayers().isEmpty())) { return getMainMapLayers(((GeodeskDto) geodesk).getBlueprint()); } return geodesk.getMainMapLayers(); } }
/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks overview map. If clientWidgetInfo's are * defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getOverviewMapClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getOverviewMapClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getOverviewMapClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getOverviewMapClientWidgetInfos()); return widgetInfos; }
/** * Load all widget editors that are available on this blueprints user application, and add them to the tabset. * * @param bgd * the basegeodesk. */ private void loadWidgetTabs(BaseGeodeskDto bgd) { UserApplication ua = UserApplicationRegistry.getInstance().get(bgd.getUserApplicationInfo().getKey()); for (String key : ua.getSupportedApplicationWidgetKeys()) { addWidgetTab(WidgetEditorFactoryRegistry.getApplicationRegistry().get(key), bgd.getApplicationClientWidgetInfos(), GeodeskDtoUtil.getApplicationClientWidgetInfo(bgd), bgd); } for (String key : ua.getSupportedMainMapWidgetKeys()) { addWidgetTab(WidgetEditorFactoryRegistry.getMapRegistry().get(key), bgd.getMainMapClientWidgetInfos(), GeodeskDtoUtil.getMainMapClientWidgetInfo(bgd), bgd); } for (String key : ua.getSupportedOverviewMapWidgetKeys()) { addWidgetTab(WidgetEditorFactoryRegistry.getMapRegistry().get(key), bgd.getOverviewMapClientWidgetInfos(), GeodeskDtoUtil.getOverviewMapClientWidgetInfo(bgd), bgd); } }
/** * Retrieve the mapinfo from the geodesk's main map. * * @param geodesk the geodesk * @return the mapInfo */ public static ClientMapInfo getMainMap(BaseGeodeskDto geodesk) { return UserApplicationDtoUtil.getMainMap(geodesk.getUserApplicationInfo()); }
UserApplication ua = UserApplicationRegistry.getInstance().get(bp.getUserApplicationInfo().getKey()); for (String key : ua.getSupportedApplicationWidgetKeys()) { try { addWidgetTab(WidgetEditorFactoryRegistry.getApplicationRegistry().get(key), bp.getApplicationClientWidgetInfos(), GeodeskDtoUtil.getApplicationClientWidgetInfo(bp), bp); } catch (Exception e) { Log.logError("Error adding application widget editor for key: " + key + ", ", e); addWidgetTab(WidgetEditorFactoryRegistry.getMapRegistry().get(key), bp.getMainMapClientWidgetInfos(), GeodeskDtoUtil.getMainMapClientWidgetInfo(bp), bp); } catch (Exception e) { try { addWidgetTab(WidgetEditorFactoryRegistry.getMapRegistry().get(key), bp.getOverviewMapClientWidgetInfos(), GeodeskDtoUtil.getOverviewMapClientWidgetInfo(bp), bp); } catch (Exception e) { Log.logError("Error adding overview map widget editor for key: " + key + ", ", e);