use of org.bimserver.database.actions.UserSettingsSetter in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultModelCompare.
public void setDefaultModelCompare(final Long oid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetUserSettingDatabaseAction action = new SetUserSettingDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), new UserSettingsSetter() {
@Override
public void set(UserSettings userSettings) {
userSettings.setDefaultModelCompare(find(userSettings.getModelCompares(), oid));
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
Aggregations