use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class DeleteRenderEngineDatabaseAction method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
RenderEnginePluginConfiguration object = getDatabaseSession().get(geteClass(), getOid(), OldQuery.getDefault());
UserSettings settings = object.getUserSettings();
settings.getRenderEngines().remove(object);
getDatabaseSession().store(settings);
return super.execute();
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class DeleteSerializerDatabaseAction method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
SerializerPluginConfiguration object = getDatabaseSession().get(geteClass(), getOid(), OldQuery.getDefault());
UserSettings settings = object.getUserSettings();
settings.getSerializers().remove(object);
getDatabaseSession().store(settings);
return super.execute();
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultModelMerger.
public void setDefaultModelMerger(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.setDefaultModelMerger(find(userSettings.getModelMergers(), oid));
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultRenderEngine.
public void setDefaultRenderEngine(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.setDefaultRenderEngine(find(userSettings.getRenderEngines(), oid));
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultQueryEngine.
public void setDefaultQueryEngine(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.setDefaultQueryEngine(find(userSettings.getQueryEngines(), oid));
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
Aggregations