Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -16,15 +16,15 @@ namespace Disco.BI.DocumentTemplateBI.Importer
public const string WatcherFilter = "*.pdf";
public string DropBoxLocation { get; private set; }
public DocumentDropBoxMonitor(DiscoDataContext Context, ISchedulerFactory SchedulerFactory, Cache HttpCache)
public DocumentDropBoxMonitor(DiscoDataContext Database, ISchedulerFactory SchedulerFactory, Cache HttpCache)
{
if (Context == null)
if (Database == null)
throw new System.ArgumentNullException("Context");
this._httpCache = HttpCache;
var location = DataStore.CreateLocation(Context, "DocumentDropBox");
var location = DataStore.CreateLocation(Database, "DocumentDropBox");
this.DropBoxLocation = location.EndsWith(@"\") ? location : string.Concat(location, @"\");
this._scheduler = SchedulerFactory.GetScheduler();
@@ -13,7 +13,7 @@ namespace Disco.BI.DocumentTemplateBI.Importer
public override bool SingleInstanceTask { get { return true; } }
public override bool CancelInitiallySupported { get { return false; } }
public override void InitalizeScheduledTask(DiscoDataContext dbContext)
public override void InitalizeScheduledTask(DiscoDataContext Database)
{
// Trigger Daily @ 12:30am
TriggerBuilder triggerBuilder = TriggerBuilder.Create().WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(0, 30));
@@ -24,9 +24,9 @@ namespace Disco.BI.DocumentTemplateBI.Importer
protected override void ExecuteTask()
{
string dataStoreLocation;
using (DiscoDataContext dbContext = new DiscoDataContext())
using (DiscoDataContext database = new DiscoDataContext())
{
dataStoreLocation = DataStore.CreateLocation(dbContext, "Cache\\DocumentDropBox_SessionPages");
dataStoreLocation = DataStore.CreateLocation(database, "Cache\\DocumentDropBox_SessionPages");
}
int deleteCount = 0;
@@ -40,12 +40,12 @@ namespace Disco.BI.DocumentTemplateBI.Importer
try
{
using (DiscoDataContext dbContext = new DiscoDataContext())
using (DiscoDataContext database = new DiscoDataContext())
{
if (retryCount < 18)
{
context.JobDetail.JobDataMap["RetryCount"] = (++retryCount);
bool processResult = Interop.Pdf.PdfImporter.ProcessPdfAttachment(filename, dbContext, sessionId, httpCache);
bool processResult = Interop.Pdf.PdfImporter.ProcessPdfAttachment(filename, database, sessionId, httpCache);
if (processResult)
{
@@ -60,7 +60,7 @@ namespace Disco.BI.DocumentTemplateBI.Importer
{
try
{
string folderError = DataStore.CreateLocation(dbContext, "DocumentDropBox_Errors");
string folderError = DataStore.CreateLocation(database, "DocumentDropBox_Errors");
string filenameError = Path.Combine(folderError, Path.GetFileName(filename));
int filenameErrorCount = 0;
while (File.Exists(filenameError))
@@ -85,7 +85,7 @@ namespace Disco.BI.DocumentTemplateBI.Importer
{
try
{
string folderError = DataStore.CreateLocation(dbContext, "DocumentDropBox_Errors");
string folderError = DataStore.CreateLocation(database, "DocumentDropBox_Errors");
string filenameError = Path.Combine(folderError, Path.GetFileName(filename));
int filenameErrorCount = 0;
while (File.Exists(filenameError))