use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class GetSerializerByPluginClassNameDatabaseAction method execute.
@Override
public SerializerPluginConfiguration execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
PluginDescriptor pluginDescriptor = getDatabaseSession().querySingle(StorePackage.eINSTANCE.getPluginDescriptor_PluginClassName(), pluginClassName);
if (pluginDescriptor == null) {
throw new UserException("No plugin found with classname " + pluginClassName);
}
User user = getUserByUoid(authorization.getUoid());
UserSettings userSettings = user.getUserSettings();
for (SerializerPluginConfiguration serializerPluginConfiguration : userSettings.getSerializers()) {
if (serializerPluginConfiguration.getPluginDescriptor() == pluginDescriptor) {
return serializerPluginConfiguration;
}
}
throw new UserException("No plugin found for this user with classname " + pluginClassName);
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getAllInternalServices.
@Override
public List<SInternalServicePluginConfiguration> getAllInternalServices(Boolean onlyEnabled) throws UserException, ServerException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
EList<InternalServicePluginConfiguration> services2 = userSettings.getServices();
List<SInternalServicePluginConfiguration> services = getBimServer().getSConverter().convertToSListInternalServicePluginConfiguration(services2);
Collections.sort(services, new SPluginConfigurationComparator());
return services;
} 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 getAllSerializers.
@Override
public List<SSerializerPluginConfiguration> getAllSerializers(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SSerializerPluginConfiguration> sSerializers = new ArrayList<SSerializerPluginConfiguration>();
for (SerializerPluginConfiguration serializerPluginConfiguration : userSettings.getSerializers()) {
if (!onlyEnabled || (serializerPluginConfiguration.getEnabled() && serializerPluginConfiguration.getPluginDescriptor().getEnabled())) {
sSerializers.add(getBimServer().getSConverter().convertToSObject(serializerPluginConfiguration));
}
}
Collections.sort(sSerializers, new SPluginConfigurationComparator());
return sSerializers;
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
return null;
}
use of org.bimserver.models.store.UserSettings in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getDefaultSerializer.
public SSerializerPluginConfiguration getDefaultSerializer() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultSerializer());
} 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 getDefaultObjectIDM.
public SObjectIDMPluginConfiguration getDefaultObjectIDM() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultObjectIDM());
} catch (BimserverDatabaseException e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations