Search in sources :

Example 1 with UpdateDeserializerDatabaseAction

use of org.bimserver.database.actions.UpdateDeserializerDatabaseAction in project BIMserver by opensourceBIM.

the class PluginServiceImpl method updateDeserializer.

@Override
public void updateDeserializer(SDeserializerPluginConfiguration deserializer) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        DeserializerPluginConfiguration convert = session.get(deserializer.getOid(), OldQuery.getDefault());
        getBimServer().getSConverter().convertFromSObject(deserializer, convert, session);
        session.executeAndCommitAction(new UpdateDeserializerDatabaseAction(session, getInternalAccessMethod(), convert));
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) DeserializerPluginConfiguration(org.bimserver.models.store.DeserializerPluginConfiguration) UpdateDeserializerDatabaseAction(org.bimserver.database.actions.UpdateDeserializerDatabaseAction) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 UpdateDeserializerDatabaseAction (org.bimserver.database.actions.UpdateDeserializerDatabaseAction)1 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)1 DeserializerPluginConfiguration (org.bimserver.models.store.DeserializerPluginConfiguration)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1