Search in sources :

Example 1 with RegenerateGeometryDatabaseAction

use of org.bimserver.database.actions.RegenerateGeometryDatabaseAction 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();
    }
}
Also used : RegenerateGeometryDatabaseAction(org.bimserver.database.actions.RegenerateGeometryDatabaseAction) ProgressOnProjectTopic(org.bimserver.notifications.ProgressOnProjectTopic) SRevision(org.bimserver.interfaces.objects.SRevision) Revision(org.bimserver.models.store.Revision) CheckinRevision(org.bimserver.models.store.CheckinRevision) SExtendedDataAddedToRevision(org.bimserver.interfaces.objects.SExtendedDataAddedToRevision) DatabaseSession(org.bimserver.database.DatabaseSession) SUser(org.bimserver.interfaces.objects.SUser) IOException(java.io.IOException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) SerializerException(org.bimserver.plugins.serializers.SerializerException) BcfException(org.opensourcebim.bcf.BcfException) UserException(org.bimserver.shared.exceptions.UserException) CannotBeScheduledException(org.bimserver.longaction.CannotBeScheduledException) DeserializeException(org.bimserver.plugins.deserializers.DeserializeException) ServerException(org.bimserver.shared.exceptions.ServerException) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException) LongGenericAction(org.bimserver.longaction.LongGenericAction)

Aggregations

IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 MessagingException (javax.mail.MessagingException)1 AddressException (javax.mail.internet.AddressException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 RegenerateGeometryDatabaseAction (org.bimserver.database.actions.RegenerateGeometryDatabaseAction)1 SExtendedDataAddedToRevision (org.bimserver.interfaces.objects.SExtendedDataAddedToRevision)1 SRevision (org.bimserver.interfaces.objects.SRevision)1 SUser (org.bimserver.interfaces.objects.SUser)1 CannotBeScheduledException (org.bimserver.longaction.CannotBeScheduledException)1 LongGenericAction (org.bimserver.longaction.LongGenericAction)1 CheckinRevision (org.bimserver.models.store.CheckinRevision)1 Revision (org.bimserver.models.store.Revision)1 ProgressOnProjectTopic (org.bimserver.notifications.ProgressOnProjectTopic)1 DeserializeException (org.bimserver.plugins.deserializers.DeserializeException)1 SerializerException (org.bimserver.plugins.serializers.SerializerException)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1