Search in sources :

Example 1 with SExtendedDataAddedToRevision

use of org.bimserver.interfaces.objects.SExtendedDataAddedToRevision in project BIMserver by opensourceBIM.

the class ServiceImpl method triggerNewExtendedData.

@Override
public void triggerNewExtendedData(Long edid, Long soid) throws ServerException, UserException {
    DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.POSSIBLY_WRITE);
    try {
        ExtendedData extendedData = (ExtendedData) session.get(StorePackage.eINSTANCE.getExtendedData(), edid, OldQuery.getDefault());
        SExtendedDataAddedToRevision newExtendedData = new SExtendedDataAddedToRevision();
        newExtendedData.setRevisionId(extendedData.getRevision().getOid());
        newExtendedData.setExtendedDataId(edid);
        getBimServer().getNotificationsManager().notify(new NewExtendedDataOnRevisionNotification(getBimServer(), edid, extendedData.getRevision().getProject().getOid(), extendedData.getRevision().getOid(), soid));
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
}
Also used : ExtendedData(org.bimserver.models.store.ExtendedData) StoreExtendedData(org.bimserver.models.store.StoreExtendedData) SExtendedData(org.bimserver.interfaces.objects.SExtendedData) DatabaseSession(org.bimserver.database.DatabaseSession) SExtendedDataAddedToRevision(org.bimserver.interfaces.objects.SExtendedDataAddedToRevision) NewExtendedDataOnRevisionNotification(org.bimserver.notifications.NewExtendedDataOnRevisionNotification) ServiceException(org.bimserver.shared.exceptions.ServiceException) 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) PluginException(org.bimserver.shared.exceptions.PluginException) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException) FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException)

Aggregations

IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)1 MessagingException (javax.mail.MessagingException)1 AddressException (javax.mail.internet.AddressException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 SExtendedData (org.bimserver.interfaces.objects.SExtendedData)1 SExtendedDataAddedToRevision (org.bimserver.interfaces.objects.SExtendedDataAddedToRevision)1 CannotBeScheduledException (org.bimserver.longaction.CannotBeScheduledException)1 ExtendedData (org.bimserver.models.store.ExtendedData)1 StoreExtendedData (org.bimserver.models.store.StoreExtendedData)1 NewExtendedDataOnRevisionNotification (org.bimserver.notifications.NewExtendedDataOnRevisionNotification)1 DeserializeException (org.bimserver.plugins.deserializers.DeserializeException)1 SerializerException (org.bimserver.plugins.serializers.SerializerException)1 PluginException (org.bimserver.shared.exceptions.PluginException)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 ServiceException (org.bimserver.shared.exceptions.ServiceException)1 UserException (org.bimserver.shared.exceptions.UserException)1