using System;
using System.Linq;
using System.Web;
using Telerik.Reporting.Cache.Interfaces;
using Telerik.Reporting.Services.Engine;
using Telerik.Reporting.Services.WebApi;

namespace TelerikHTML5ReportViewer.Controllers
{
    public class ReportsController : ReportsControllerBase
    {
        protected override IReportResolver CreateReportResolver()
        {
            var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");

            return new ReportFileResolver(
                        new ReportFileResolverFromRepository(reportsPath,
                            new ReportFileResolverWeb(
                                new ReportTypeResolver(null))));
        }

        protected override ICache CreateCache()
        {
            return CacheFactory.CreateFileCache();
        }
    }
}
