Search in sources :

Example 1 with UpdateSerializerDatabaseAction

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

the class PluginServiceImpl method updateSerializer.

@Override
public void updateSerializer(SSerializerPluginConfiguration serializer) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        SerializerPluginConfiguration convert = session.get(serializer.getOid(), OldQuery.getDefault());
        getBimServer().getSConverter().convertFromSObject(serializer, convert, session);
        session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session, getInternalAccessMethod(), convert));
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
}
Also used : UpdateSerializerDatabaseAction(org.bimserver.database.actions.UpdateSerializerDatabaseAction) DatabaseSession(org.bimserver.database.DatabaseSession) SerializerPluginConfiguration(org.bimserver.models.store.SerializerPluginConfiguration) SSerializerPluginConfiguration(org.bimserver.interfaces.objects.SSerializerPluginConfiguration) 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 UpdateSerializerDatabaseAction (org.bimserver.database.actions.UpdateSerializerDatabaseAction)1 SSerializerPluginConfiguration (org.bimserver.interfaces.objects.SSerializerPluginConfiguration)1 SerializerPluginConfiguration (org.bimserver.models.store.SerializerPluginConfiguration)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1