Search in sources :

Example 1 with AddDeserializerDatabaseAction

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

the class PluginServiceImpl method addDeserializer.

@Override
public Long addDeserializer(SDeserializerPluginConfiguration deserializer) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        DeserializerPluginConfiguration convert = getBimServer().getSConverter().convertFromSObject(deserializer, session);
        return session.executeAndCommitAction(new AddDeserializerDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), convert));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) AddDeserializerDatabaseAction(org.bimserver.database.actions.AddDeserializerDatabaseAction) SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) DeserializerPluginConfiguration(org.bimserver.models.store.DeserializerPluginConfiguration) 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 AddDeserializerDatabaseAction (org.bimserver.database.actions.AddDeserializerDatabaseAction)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