protected SecurityNamedServiceConfig createFilterConfig(String name, Class<?> aClass) { SecurityNamedServiceConfig config = new BaseSecurityNamedServiceConfig(); config.setName(name); config.setClassName(aClass.getName()); return config; }
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { // create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); // update the form model form.setModel(new CompoundPropertyModel<T>(config)); // create the new panel panel = createPanel("content", panelInfo, new Model(config)); // remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.add(panelContainer); } }
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { //create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); //update the form model form.setModel(new CompoundPropertyModel<T>(config)); //create the new panel panel = createPanel("content", panelInfo, new Model(config)); //remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.addComponent(panelContainer); } }
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { //create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); //update the form model form.setModel(new CompoundPropertyModel<T>(config)); //create the new panel panel = createPanel("content", panelInfo, new Model(config)); //remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.addComponent(panelContainer); } }
@Override protected void onSetUp(SystemTestData testData) throws Exception { SecurityNamedServiceConfig filterCfg = new BaseSecurityNamedServiceConfig(); filterCfg.setName("custom"); filterCfg.setClassName(AuthCapturingFilter.class.getName()); GeoServerSecurityManager secMgr = getSecurityManager(); secMgr.saveFilter(filterCfg); SecurityManagerConfig cfg = secMgr.getSecurityConfig(); cfg.getFilterChain() .insertAfter( "/web/**", filterCfg.getName(), GeoServerSecurityFilterChain.REMEMBER_ME_FILTER); // cfg.getFilterChain().put("/web/**", Arrays.asList( // new FilterChainEntry(filterCfg.getName(), Position.AFTER, // GeoServerSecurityFilterChain.REMEMBER_ME_FILTER))); secMgr.saveSecurityConfig(cfg); }