use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultSerializer.
public void setDefaultSerializer(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.setDefaultSerializer(find(userSettings.getSerializers(), 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 getAllQueryEngines.
@Override
public List<SQueryEnginePluginConfiguration> getAllQueryEngines(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SQueryEnginePluginConfiguration> queryEngines = getBimServer().getSConverter().convertToSListQueryEnginePluginConfiguration(userSettings.getQueryEngines());
Collections.sort(queryEngines, new SPluginConfigurationComparator());
return queryEngines;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getDefaultQueryEngine.
public SQueryEnginePluginConfiguration getDefaultQueryEngine() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultQueryEngine());
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getAllModelMergers.
@Override
public List<SModelMergerPluginConfiguration> getAllModelMergers(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SModelMergerPluginConfiguration> modelMergers = getBimServer().getSConverter().convertToSListModelMergerPluginConfiguration(userSettings.getModelMergers());
Collections.sort(modelMergers, new SPluginConfigurationComparator());
return modelMergers;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method setDefaultObjectIDM.
public void setDefaultObjectIDM(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.setDefaultObjectIDM(find(userSettings.getObjectIDMs(), oid));
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
Aggregations