Search in sources :

Example 1 with AddSerializerDatabaseAction

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

the class PluginServiceImpl method addSerializer.

@Override
public Long addSerializer(SSerializerPluginConfiguration serializer) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        SerializerPluginConfiguration convert = getBimServer().getSConverter().convertFromSObject(serializer, session);
        return session.executeAndCommitAction(new AddSerializerDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), convert));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : AddSerializerDatabaseAction(org.bimserver.database.actions.AddSerializerDatabaseAction) 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 AddSerializerDatabaseAction (org.bimserver.database.actions.AddSerializerDatabaseAction)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