class SettingServiceImpl extends RemoteServiceServlet implements SettingService {

	@Override
	public void saveSettings(GUIParameter[] settings) throws ServerException {
		Session session = ServiceUtil.checkMenu(getThreadLocalRequest(), Menu.ADMINISTRATION);

		try {
			int counter = 0;

			ContextProperties conf = Context.get().getProperties();
			for (int i = 0; i < settings.length; i++) {
				if (settings[i] == null || StringUtils.isEmpty(settings[i].getName()))
					continue;
				conf.setProperty(settings[i].getName(), settings[i].getValue() != null ? settings[i].getValue() : "");
				counter++;
			}

			conf.write();

			log.info("Successfully saved {} parameters", counter);
		} catch (Throwable e) {
			ServiceUtil.throwServerException(session, log, e);
		}
	}

}