Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/15 16:35:17 (9 years ago)
Author:
dglaser
Message:

#2388: Changed all files to connect to localhost / sqlexpress

HeuristicLab.Services.Hive-3.3:

  • Added Converter.cs and NewHiveService.cs, both will be integrated into existing HiveService.cs and Convert.cs when all methods are successfully implemented

HeuristicLab.Services.Hive.Web.Hive-3.3:

  • Added publish profiles

HeuristicLab.Services.WebApp.Statistics-3.3:

  • Added functionality to download TaskData as .hl file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/TaskController.cs

    r12562 r12584  
    2222using System;
    2323using System.Collections.Generic;
     24using System.IO;
    2425using System.Linq;
     26using System.Net;
     27using System.Net.Http;
     28using System.Net.Http.Headers;
    2529using System.Web.Http;
    2630using HeuristicLab.Services.Access;
     
    153157      }
    154158    }
     159
     160    public HttpResponseMessage GetTaskDataById(Guid id) {
     161      using (var pm = PersistenceManager) {
     162        var taskDataDao = pm.TaskDataDao;
     163        return pm.UseTransaction(() => {
     164          var taskData = taskDataDao.GetById(id);
     165          if (taskData == null)
     166            return new HttpResponseMessage(HttpStatusCode.NotFound);
     167          HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
     168          var stream = new MemoryStream(taskData.Data);
     169          result.Content = new StreamContent(stream);
     170          result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
     171          result.Content.Headers.ContentDisposition =
     172            new ContentDispositionHeaderValue("attachment") {
     173              FileName = string.Format("{0}.hl", id)
     174            };
     175          return result;
     176        });
     177      }
     178    }
    155179  }
    156180}
Note: See TracChangeset for help on using the changeset viewer.