use of org.bimserver.longaction.LongGenericAction in project BIMserver by opensourceBIM.
the class ServiceImpl method regenerateGeometry.
@Override
public Long regenerateGeometry(Long roid, Long eoid) throws ServerException, UserException {
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
Revision revision = session.get(roid, OldQuery.getDefault());
SUser user = getCurrentUser();
ProgressOnProjectTopic progressTopic = getBimServer().getNotificationsManager().createProgressOnProjectTopic(getAuthorization().getUoid(), revision.getProject().getOid(), SProgressTopicType.UPLOAD, "Regenerate geometry");
RegenerateGeometryDatabaseAction action = new RegenerateGeometryDatabaseAction(getBimServer(), session, getInternalAccessMethod(), revision.getProject().getOid(), roid, getCurrentUser().getOid(), eoid);
LongGenericAction longAction = new LongGenericAction(progressTopic.getKey().getId(), getBimServer(), user.getUsername(), user.getName(), getAuthorization(), action);
getBimServer().getLongActionManager().start(longAction);
return progressTopic.getKey().getId();
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations