public void execute(IUserContext ucxt) { try { if (category == null) { throw new OpenConfigurationException("The category must be set", null, null); } IOpenLConfiguration existing; if ((existing = ucxt.getOpenLConfiguration(category)) != null) { saveConfiguration(existing); return; } IOpenLConfiguration extendsConfiguration = null; if (extendsCategory != null) { if ((extendsConfiguration = ucxt.getOpenLConfiguration(extendsCategory)) == null) { throw new OpenConfigurationException("The extended category " + extendsCategory + " must have been loaded first", null, null); } } IConfigurableResourceContext cxt = getConfigurationContext(extendsConfiguration, ucxt); conf.setParent(extendsConfiguration); conf.setConfigurationContext(cxt); conf.validate(cxt); ucxt.registerOpenLConfiguration(category, conf); saveConfiguration(conf); } catch (Exception e) { e.printStackTrace(System.err); throw RuntimeExceptionWrapper.wrap(e); } }
public void execute(IUserContext ucxt) { try { if (category == null) { throw new OpenConfigurationException("The category must be set", null, null); } IOpenLConfiguration existing; if ((existing = ucxt.getOpenLConfiguration(category)) != null) { saveConfiguration(existing); return; } IOpenLConfiguration extendsConfiguration = null; if (extendsCategory != null) { if ((extendsConfiguration = ucxt.getOpenLConfiguration(extendsCategory)) == null) { throw new OpenConfigurationException("The extended category " + extendsCategory + " must have been loaded first", null, null); } } IConfigurableResourceContext cxt = getConfigurationContext(extendsConfiguration, ucxt); conf.setParent(extendsConfiguration); conf.setConfigurationContext(cxt); conf.validate(cxt); ucxt.registerOpenLConfiguration(category, conf); saveConfiguration(conf); } catch (Exception e) { e.printStackTrace(System.err); throw RuntimeExceptionWrapper.wrap(e); } }