Search in sources :

Example 1 with AddRenderEngineDatabaseAction

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

the class PluginServiceImpl method addRenderEngine.

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