use of org.bimserver.interfaces.objects.SModelMergerPluginConfiguration 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.interfaces.objects.SModelMergerPluginConfiguration in project BIMserver by opensourceBIM.
the class PluginServiceImpl method addModelMerger.
@Override
public Long addModelMerger(SModelMergerPluginConfiguration modelMerger) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
ModelMergerPluginConfiguration convert = getBimServer().getSConverter().convertFromSObject(modelMerger, session);
return session.executeAndCommitAction(new AddModelMergerDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), convert));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.interfaces.objects.SModelMergerPluginConfiguration in project BIMserver by opensourceBIM.
the class PluginServiceImpl method updateModelMerger.
@Override
public void updateModelMerger(SModelMergerPluginConfiguration modelMerger) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
ModelMergerPluginConfiguration convert = session.get(modelMerger.getOid(), OldQuery.getDefault());
getBimServer().getSConverter().convertFromSObject(modelMerger, convert, session);
session.executeAndCommitAction(new UpdateModelMergerDatabaseAction(session, getInternalAccessMethod(), convert));
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
}
Aggregations