Search in sources :

Example 1 with UpdateRenderEngineDatabaseAction

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

the class PluginServiceImpl method updateRenderEngine.

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