use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getDefaultModelCompare.
public SModelComparePluginConfiguration getDefaultModelCompare() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultModelCompare());
} 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 getAllRenderEngines.
@Override
public List<SRenderEnginePluginConfiguration> getAllRenderEngines(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SRenderEnginePluginConfiguration> renderEngines = getBimServer().getSConverter().convertToSListRenderEnginePluginConfiguration(userSettings.getRenderEngines());
Collections.sort(renderEngines, new SPluginConfigurationComparator());
return renderEngines;
} 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 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();
}
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getDefaultRenderEngine.
public SRenderEnginePluginConfiguration getDefaultRenderEngine() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultRenderEngine());
} 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 getAllDeserializers.
@Override
public List<SDeserializerPluginConfiguration> getAllDeserializers(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
EList<DeserializerPluginConfiguration> deserializers = userSettings.getDeserializers();
List<SDeserializerPluginConfiguration> sDeserializers = new ArrayList<SDeserializerPluginConfiguration>();
for (DeserializerPluginConfiguration deserializerPluginConfiguration : deserializers) {
if (!onlyEnabled || (deserializerPluginConfiguration.getEnabled() && deserializerPluginConfiguration.getPluginDescriptor().getEnabled())) {
sDeserializers.add(getBimServer().getSConverter().convertToSObject(deserializerPluginConfiguration));
}
}
Collections.sort(sDeserializers, new SPluginConfigurationComparator());
return sDeserializers;
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
return null;
}
Aggregations