@SuppressWarnings("unchecked") @Override protected void handleEvent(AppEvent event) { if (event.getType() == AppEvents.AuditEventEntryView) { searchCriteria = null; currentEntity = Registry.get(Constants.ENTITY_ATTRIBUTE_MODEL); initUI(); if (Registry.get(Constants.AUDIT_EVENT_TYPE_CODES) != null) { List<AuditEventTypeWeb> auditEventTypes = (List<AuditEventTypeWeb>) Registry.get(Constants.AUDIT_EVENT_TYPE_CODES); /* * for (AuditEventTypeWeb type : auditEventTypes) { Info.display("Information", "Event Types: "+ * type.getAuditEventTypeCd() + ", " + type.getAuditEventTypeName()); } */ eventTypesStore.removeAll(); eventTypesStore.add(auditEventTypes); } } else if (event.getType() == AppEvents.Logout) { Dispatcher.get().dispatch(AppEvents.Logout); } else if (event.getType() == AppEvents.AuditEventReceived) { // Info.display("Information", "EventReceived"); store.removeAll(); AuditEventEntryListWeb events = (AuditEventEntryListWeb) event.getData(); if (events.getAuditEventEntries() != null) { store.add(events.getAuditEventEntries()); } grid.getSelectionModel().select(0, true); grid.getSelectionModel().deselect(0); status.hide(); searchButton.unmask(); } else if (event.getType() == AppEvents.EntityByIdRequest) { RecordWeb record = (RecordWeb) event.getData(); if (record != null) { identifierStore.removeAll(); buildRefRecordInfoDialog(); refRecordInfoDialog.show(); displayEntityRecord(attributeFieldMap, record); displayEntityIdentifier(record); } } else if (event.getType() == AppEvents.Error) { String message = event.getData(); MessageBox.alert("Information", "Failure: " + message, null); } }
private void submitSearch() { List<ModelData> query = new ArrayList<ModelData>(); for (Field<?> field : formFields) { ModelData md = new BaseModelData(); MetaField mf = findField(field.getName()); if (mf == null || !enabledFields.containsKey(mf.getName()) || field.getValue() == null || field.getValue().toString().length() == 0 || !field.isValid()) { GWT.log("Will not submit field " + field.getName() + ".", null); continue; } md.set("field", mf); md.set("value", field.getValue()); query.add(md); } GWT.log("Submitting search with " + query.size() + " query elements.", null); AppEvent evt = new AppEvent(ApplicationEvents.SUBMIT_ADVANCED_SEARCH, query); evt.setData("asset", combo.getValue().getBean()); Dispatcher.forwardEvent(evt); }
/** * Show or Hide South panel * * @param visible */ public static void manageSouth(boolean visible) { if (visible) { getInstance().south.show(); } else { getInstance().south.hide(); } Dispatcher.forwardEvent(GeoPlatformEvents.UPDATE_CENTER); }
/** * Show or Hide West panel * * @param visible */ public static void managePanel(ContentPanel cp, boolean visible) { if (visible) { cp.show(); } else { cp.hide(); } Dispatcher.forwardEvent(GeoPlatformEvents.UPDATE_CENTER); }
private void updateAttributeInfo(List<FilterAttribute> selection) { dataFilter.setRangeInfo(createInfoString(selection)); // Update the attribute info value written on the store if (browseFilterPanel.getAttributesListStore().contains(dataFilter)) browseFilterPanel.getAttributesListStore().update(dataFilter); else if (browseFilterPanel.getAttributesSelected().contains(dataFilter)) { browseFilterPanel.getAttributesListStore().update(dataFilter); if (dataFilter.getChecked() == 1) Dispatcher.get().dispatch(AppEvents.LoadMainData); } }
public void onModuleLoad() { GXT.setDefaultTheme(Theme.BLUE, true); Dispatcher dispatcher = Dispatcher.get(); dispatcher.addController(new DesktopController()); dispatcher.dispatch(DesktopAppEvents.Login); GXT.hideLoadingPanel("loading"); /* if (!GXT.isChrome){ WebMessageBox.info("Navegador incompatível", "Utilize o Google Chrome para um melhor funcionamento do sistema. " + "Caso não tenha instalado no seu computador faça o download clicando <a href='http://www.google.com/intl/pt-BR/chrome/browser/' target='_blank'>aqui</a>."); } */ }
/** Creates the south. */ private void createSouth() { BorderLayoutData data = new BorderLayoutData(LayoutRegion.SOUTH, Constants.SOUTH_PANEL_DIMENSION + 25); // data.setMargins(new Margins(5, 5, 5, 5)); // data.setHideCollapseTool(false); data.setMargins(new Margins(5, 0, 0, 0)); data.setCollapsible(true); data.setSplit(false); /* * south = new ContentPanel(); south.setBodyBorder(false); south.setAnimCollapse(true); * south.setCollapsible(true); south.setLayout(new FitLayout()); * south.setLayoutOnChange(true); south.setScrollMode(Scroll.AUTOY); * south.setHeaderVisible(true); * south.setHeading(I18nProvider.getMessages().accordionLabel()); * south.setMonitorWindowResize(true); south.setLayoutOnChange(true); south.layout(); */ south = new ContentPanel(); south.setBodyBorder(false); south.setLayout(new FitLayout()); south.setScrollMode(Scroll.AUTOY); south.setHeaderVisible(true); // south.setHeading(I18nProvider.getMessages().accordionLabel()); south.setMonitorWindowResize(true); south.setLayoutOnChange(true); south.layout(); south.addListener( Events.Resize, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE); // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE); } }); south.addListener( Events.Move, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE); // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE); } }); this.tabWidget = new TabWidget(); south.add(this.tabWidget); Dispatcher.forwardEvent(GeofenceEvents.ATTACH_BOTTOM_TAB_WIDGETS, this.tabWidget); center.add(south, data); }
private void addBaseLayer() { GeofenceGlobalConfiguration geoFenceConfiguration = (GeofenceGlobalConfiguration) GeofenceUtils.getInstance().getGlobalConfiguration(); /* base layer */ WMSParams wmsParams = new WMSParams(); wmsParams.setLayers(geoFenceConfiguration.getBaseLayerName()); wmsParams.setFormat(geoFenceConfiguration.getBaseLayerFormat()); wmsParams.setStyles(geoFenceConfiguration.getBaseLayerStyle()); WMSOptions wmsLayerParams = new WMSOptions(); wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE); WMS layer = new WMS( geoFenceConfiguration.getBaseLayerTitle(), geoFenceConfiguration.getBaseLayerURL(), wmsParams, wmsLayerParams); Dispatcher.forwardEvent(GeoGWTEvents.ADD_LAYER, layer); }
private void onInit(AppEvent event) { forwardToView(appView, event); Dispatcher.forwardEvent(new AppEvent(AppEvents.NavHome, null, HistoryTokens.HOME)); }
private void onCreateComplete() { Dispatcher.forwardEvent(EnvCreateEvents.CreateSuccess); }
public void sendRequestForUser() { injectValue(); Dispatcher.forwardEvent(AppEvents.SendRequestForEditUser, this.user); }
/** This is the entry point method. */ public void onModuleLoad() { // GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() { // public void onUncaughtException(Throwable e) { // Window.alert("Error: " + e.getMessage()); // log.log(Level.SEVERE, e.getMessage(), e); // e.printStackTrace(); // } // }); // GXT.setDefaultTheme(Theme.BLUE, true); // Initialize servlets repoxService = (RepoxServiceAsync) GWT.create(RepoxService.class); Registry.register(REPOX_SERVICE, repoxService); Registry.register(COOKIE_MANAGER, new CookieManager()); Registry.register(ES_MANAGEMENT_SERVICE, GWT.create(ESManagementService.class)); Registry.register(HARVEST_OPERATIONS_SERVICE, GWT.create(HarvestOperationsService.class)); Registry.register(RSS_SERVICE, GWT.create(RssService.class)); Registry.register(DP_SERVICE, GWT.create(DPService.class)); Registry.register(AGG_SERVICE, GWT.create(AGGService.class)); Registry.register(DATA_SET_OPERATIONS_SERVICE, GWT.create(DataSetOperationsService.class)); Registry.register(DATA_MANAGEMENT_SERVICE, GWT.create(DataManagementService.class)); Registry.register(TASK_MANAGEMENT_SERVICE, GWT.create(TaskManagementService.class)); Registry.register(TRANSFORMATIONS_SERVICE, GWT.create(TransformationsService.class)); Registry.register(TAGS_SERVICE, GWT.create(TagsService.class)); Registry.register(SEARCH_SERVICE, GWT.create(SearchService.class)); Registry.register(FILTER_SERVICE, GWT.create(FilterService.class)); userManagementService = (UserManagementServiceAsync) GWT.create(UserManagementService.class); Registry.register(USER_MANAGEMENT_SERVICE, userManagementService); Registry.register("MAIN_ROOT", this); // Add all controllers Dispatcher dispatcher = Dispatcher.get(); dispatcher.addController(new AppController()); dispatcher.addController(new BrowseController()); dispatcher.addController(new FormController()); dispatcher.addController(new DataSetController()); dispatcher.addController(new HarvestingController()); dispatcher.addController(new StatisticsController()); dispatcher.addController(new AdministrationController()); dispatcher.addController(new OaiTestController()); dispatcher.addController(new AccountEditController()); dispatcher.addController(new SchemaMapperController()); dispatcher.addController(new ServiceManagerController()); dispatcher.addController(new DataSetActionsController()); dispatcher.addController(new RssController()); // XMApper Controllers dispatcher.addController(new SaveMappingCtrl()); checkFirstTimeRepoxUsed(); History.addHistoryListener(this); }
public void onHistoryChanged(String historyToken) { String params = "[?]+"; String[] tokensFunc = historyToken.split(params); if (tokensFunc.length > 1) { // functions with parameters String function = tokensFunc[0]; String paramDelim = "[=]+"; String[] tokensPrms = tokensFunc[1].split(paramDelim); String firstParamID = tokensPrms[0]; String firstParamValue = tokensPrms[1]; // types of functions // if(function.equals("EDIT_AGG")) { // AggregatorUI aggregatorUI = UtilManager.getAggregatorUI(firstParamValue); // if(aggregatorUI == null) { // HarvesterUI.UTIL_MANAGER.getErrorBox("Edit Aggregator", "No Aggregator // found."); // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // } else{ // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // Dispatcher.forwardEvent(AppEvents.ViewAggregatorForm, aggregatorUI); // } // }else if(function.equals("EDIT_DP")) { // DataProviderUI dataProviderUI = // UtilManager.getDataProviderUI(firstParamValue); // if(dataProviderUI == null) { // HarvesterUI.UTIL_MANAGER.getErrorBox("Edit Data Provider", "No Data // Provider found."); // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // } else{ // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // Dispatcher.forwardEvent(AppEvents.ViewDataProviderForm, dataProviderUI); // } // } else if (function.equals("VIEW_DS")) { AsyncCallback<DataSourceUI> callback = new AsyncCallback<DataSourceUI>() { public void onFailure(Throwable caught) { new ServerExceptionDialog("Failed to get response from server", caught.getMessage()) .show(); } public void onSuccess(DataSourceUI dataSourceUI) { if (dataSourceUI == null) { HarvesterUI.UTIL_MANAGER.getErrorBox( HarvesterUI.CONSTANTS.viewDataSet(), CONSTANTS.noDataSetFound()); Dispatcher.forwardEvent(AppEvents.LoadMainData); } else Dispatcher.forwardEvent(AppEvents.ViewDataSetInfo, dataSourceUI); } }; DataManagementServiceAsync service = (DataManagementServiceAsync) Registry.get(HarvesterUI.DATA_MANAGEMENT_SERVICE); service.getDataSetInfo(firstParamValue, callback); } // Special case for Europeana // if(function.equals("CREATE_DATA_PROVIDER")) { // AggregatorUI aggregatorUI = UtilManager.getAggregatorUI(firstParamValue); // if(aggregatorUI == null) { // HarvesterUI.UTIL_MANAGER.getErrorBox("Edit Aggregator", "No Aggregator // found."); // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // } else{ // Dispatcher.forwardEvent(AppEvents.ReloadAllData); // Dispatcher.forwardEvent(AppEvents.ViewDataProviderForm, aggregatorUI); // } // } } else { if (historyToken.equals("HOME")) Dispatcher.forwardEvent(AppEvents.LoadMainData); else if (historyToken.equals("STATISTICS")) Dispatcher.forwardEvent(AppEvents.ViewStatistics); else if (historyToken.equals("CREATE_DATA_PROVIDER")) { Dispatcher.forwardEvent(AppEvents.LoadMainData); Dispatcher.forwardEvent(AppEvents.ViewDataProviderForm); } else if (historyToken.equals("CREATE_AGGREGATOR")) { Dispatcher.forwardEvent(AppEvents.LoadMainData); Dispatcher.forwardEvent(AppEvents.ViewAggregatorForm); } else if (historyToken.equals("IMPORT_DATA_PROVIDER")) { Dispatcher.forwardEvent(AppEvents.LoadMainData); Dispatcher.forwardEvent(AppEvents.ViewDPImportForm); } else if (historyToken.equals("MDR_SCHEMAS")) Dispatcher.forwardEvent(AppEvents.ViewSchemasPanel); else if (historyToken.equals("MDR_MAPPINGS")) Dispatcher.forwardEvent(AppEvents.ViewMappingsPanel); else if (historyToken.equals("MDR_XMAPPER")) Dispatcher.forwardEvent(AppEvents.ViewXMApperPanel); else if (historyToken.equals("OAI_TESTS")) Dispatcher.forwardEvent(AppEvents.ViewOAITest); // harvest menu tasks else if (historyToken.equals("CALENDAR")) Dispatcher.forwardEvent(AppEvents.ViewScheduledTasksCalendar); else if (historyToken.equals("SCHEDULED_TASKS")) Dispatcher.forwardEvent(AppEvents.ViewScheduledTasksList); else if (historyToken.equals("RUNNING_TASKS")) Dispatcher.forwardEvent(AppEvents.ViewRunningTasksList); else if (historyToken.equals("ADMIN_CONFIG")) Dispatcher.forwardEvent(AppEvents.ViewAdminForm); else if (historyToken.equals("USER_MANAGEMENT")) Dispatcher.forwardEvent(AppEvents.ViewUserManagementForm); else if (historyToken.equals("REST_OPERATIONS")) Dispatcher.forwardEvent(AppEvents.ViewRestRecordOperations); else if (historyToken.equals("EDIT_ACCOUNT")) { Dispatcher.forwardEvent(AppEvents.LoadMainData); Dispatcher.forwardEvent(AppEvents.ViewAccountEditForm); } else if (historyToken.equals("EXTERNAL_SERVICES_MANAGER")) Dispatcher.forwardEvent(AppEvents.ViewServiceManager); else if (historyToken.equals("RSS_PANEL")) Dispatcher.forwardEvent(AppEvents.ViewRssFeedPanel); else if (historyToken.equals("TAGS")) Dispatcher.forwardEvent(AppEvents.ViewTagsManager); if (!historyToken.equals("HOME")) UtilManager.unmaskCentralPanel(); } }
/** Creates the center. */ private void createCenter() { center = new ContentPanel(); center.setLayout(new BorderLayout()); center.setHeaderVisible(false); ContentPanel map = new ContentPanel(); map.setLayout(new FitLayout()); map.setHeaderVisible(false); // we dont need this since we have listener on south panel as well map.addListener( Events.Resize, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE); // Dispatcher.forwardEvent(AcoDBEvents.UPDATE_SOUTH_SIZE); } }); map.addListener( Events.Move, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE); // Dispatcher.forwardEvent(AcoDBEvents.UPDATE_SOUTH_SIZE); } }); map.setMonitorWindowResize(true); map.setLayoutOnChange(true); BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER); data.setMargins(new Margins(0)); // add map to center region of center panel center.add(map, data); data = new BorderLayoutData(LayoutRegion.CENTER); // data.setCollapsible(true); // data.setFloatable(true); // data.setSplit(true); data.setMargins(new Margins(5, 5, 5, 5)); viewport.add(center, data); /* map options */ MapOptions mapOptions = new MapOptions(); mapOptions.setUnits(MapUnits.DEGREES); mapOptions.setProjection("EPSG:4326"); MousePositionOutput mpOut = new MousePositionOutput() { public String format(LonLat lonLat, Map map) { String out = ""; out += "<font size='2' color='black' style='font-weight:900'>"; out += (float) lonLat.lon(); out += " "; out += (float) lonLat.lat(); out += "</font>"; return out; } }; MousePositionOptions mpOptions = new MousePositionOptions(); mpOptions.setFormatOutput(mpOut); JSObject[] controls = new JSObject[] { new Navigation().getJSObject(), new PanZoom().getJSObject(), new LayerSwitcher().getJSObject(), new ScaleLine().getJSObject(), new MousePosition(mpOptions).getJSObject() }; JObjectArray mapControls = new JObjectArray(controls); mapOptions.setControls(mapControls); Dispatcher.forwardEvent(GeoGWTEvents.INIT_MAPS_UI_MODULE, mapOptions); addBaseLayer(); Dispatcher.forwardEvent(GeoGWTEvents.ATTACH_MAP_WIDGET, map); GeofenceGlobalConfiguration geoFenceConfiguration = (GeofenceGlobalConfiguration) GeofenceUtils.getInstance().getGlobalConfiguration(); // Adjusting the Zoom level // Dispatcher.forwardEvent(GeoGWTEvents.ZOOM_TO_MAX_EXTENT); Dispatcher.forwardEvent( GeoGWTEvents.SET_MAP_CENTER, new Double[] { Double.valueOf(geoFenceConfiguration.getMapCenterLon()), Double.valueOf(geoFenceConfiguration.getMapCenterLat()) }); Dispatcher.forwardEvent( GeoGWTEvents.ZOOM, Integer.parseInt(geoFenceConfiguration.getMapZoom())); ToolbarItemManager toolbarItemManager = new ToolbarItemManager(); // defining toolbar tools GenericClientTool poweredBy = new GenericClientTool(); poweredBy.setId(ButtonBar.POWERED_BY); poweredBy.setOrder(-400); GenericClientTool toolbarSeparator1 = new GenericClientTool(); toolbarSeparator1.setId(ButtonBar.TOOLBAR_SEPARATOR); toolbarSeparator1.setOrder(-300); ActionClientTool pan = new ActionClientTool(); pan.setId("pan"); pan.setEnabled(true); pan.setType("toggle"); pan.setOrder(0); ActionClientTool zoomAll = new ActionClientTool(); zoomAll.setId("zoomAll"); zoomAll.setEnabled(true); zoomAll.setType("button"); zoomAll.setOrder(10); ActionClientTool zoomBox = new ActionClientTool(); zoomBox.setId("zoomBox"); zoomBox.setEnabled(true); zoomBox.setType("toggle"); zoomBox.setOrder(20); ActionClientTool zoomIn = new ActionClientTool(); zoomIn.setId("zoomIn"); zoomIn.setEnabled(true); zoomIn.setType("button"); zoomIn.setOrder(30); ActionClientTool zoomOut = new ActionClientTool(); zoomOut.setId("zoomOut"); zoomOut.setEnabled(true); zoomOut.setType("button"); zoomOut.setOrder(40); ActionClientTool drawFeature = new ActionClientTool(); drawFeature.setId("drawFeature"); drawFeature.setEnabled(true); drawFeature.setType("toggle"); drawFeature.setOrder(50); GenericClientTool toolbarSeparator2 = new GenericClientTool(); toolbarSeparator2.setId(ButtonBar.TOOLBAR_SEPARATOR); toolbarSeparator2.setOrder(300); // ToolbarActionRegistry.getRegistry().put("synchUsers", new ToolActionCreator() // { // // public ToolbarAction createActionTool() // { // UpdateUsersAction action = new UpdateUsersAction(); // action.initialize(); // // return action; // } // }); // // ActionClientTool synchUsers = new ActionClientTool(); // synchUsers.setId("synchUsers"); // synchUsers.setEnabled(true); // synchUsers.setType("button"); // synchUsers.setOrder(310); GenericClientTool fillItem = new GenericClientTool(); fillItem.setId(ButtonBar.FILL_ITEM); fillItem.setOrder(320); ToolbarActionRegistry.getRegistry() .put( "logout", new ToolActionCreator() { public ToolbarAction createActionTool() { LogoutAction action = new LogoutAction(); action.initialize(); return action; } }); ActionClientTool logout = new ActionClientTool(); logout.setId("logout"); logout.setEnabled(true); logout.setType("button"); logout.setOrder(500); List<GenericClientTool> clientTools = new ArrayList<GenericClientTool>(); // clientTools.add(poweredBy); // clientTools.add(toolbarSeparator1); clientTools.add(pan); clientTools.add(zoomAll); clientTools.add(zoomBox); clientTools.add(zoomIn); clientTools.add(zoomOut); clientTools.add(drawFeature); clientTools.add(toolbarSeparator2); // clientTools.add(synchUsers); clientTools.add(fillItem); clientTools.add(logout); toolbarItemManager.setClientTools(clientTools); if (GeoGWTUtils.getInstance().getGlobalConfiguration() == null) { GeoGWTUtils.getInstance().setGlobalConfiguration(new GeoGWTConfiguration()); } GeoGWTUtils.getInstance().getGlobalConfiguration().setToolbarItemManager(toolbarItemManager); Dispatcher.forwardEvent(GeoGWTEvents.ATTACH_TOOLBAR, this.north); // Dispatcher.forwardEvent(GeofenceEvents.ATTACH_MAP_WIDGET, this.center); }