public BaseController(ICatalogueRepository cat) { this.cat = cat; }
public HICDataLoadFactory(ILoadMetadata loadMetadata, HICDatabaseConfiguration databaseConfiguration, HICLoadConfigurationFlags loadConfigurationFlags, ICatalogueRepository repository, ILogManager logManager) { _databaseConfiguration = databaseConfiguration; _loadConfigurationFlags = loadConfigurationFlags; _repository = repository; _logManager = logManager; LoadMetadata = loadMetadata; // If we are not supplied any catalogues to load, it is expected that we will load all catalogues associated with the provided ILoadMetadata _cataloguesToLoad = LoadMetadata.GetAllCatalogues().ToList(); if (!_cataloguesToLoad.Any()) { throw new InvalidOperationException("LoadMetadata " + LoadMetadata.ID + " is not related to any Catalogues, there is nothing to load"); } }
public BaseController() { this.cat = new CatalogueRepository(new ProductCatalogueEntities()); }
private void LoadMEF(ICatalogueRepository catalogueRepository, ICheckNotifier notifier) { DirectoryInfo downloadDirectory = catalogueRepository.MEF.DownloadDirectory; //make sure the MEF directory exists if (!downloadDirectory.Exists) { downloadDirectory.Create(); } var compatiblePlugins = catalogueRepository.PluginManager.GetCompatiblePlugins(); List <DirectoryInfo> dirs = new List <DirectoryInfo>(); List <DirectoryInfo> toLoad = new List <DirectoryInfo>(); //always load the current application directory toLoad.Add(new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory)); for (int i = 0; i < compatiblePlugins.Length; i++) { var subDirName = compatiblePlugins[i].GetPluginDirectoryName(downloadDirectory); var subdir = Directory.CreateDirectory(subDirName); dirs.Add(subdir); var existingFiles = subdir.GetFiles("*" + PackPluginRunner.PluginPackageSuffix).ToList(); //if we have not downloaded this yet if (!existingFiles.Any(f => f.Name.Equals(compatiblePlugins[i].Name))) { compatiblePlugins[i].LoadModuleAssemblies.SingleOrDefault()?.DownloadAssembly(subdir); } else { notifier.OnCheckPerformed(new CheckEventArgs("Found existing file '" + compatiblePlugins[i].Name + "' so didn't bother downloading it.", CheckResult.Success)); } foreach (var archive in subdir.GetFiles("*" + PackPluginRunner.PluginPackageSuffix).ToList()) { //get rid of any old out dirs var outDir = subdir.EnumerateDirectories("out").SingleOrDefault(); bool mustUnzip = true; //if theres already an unpacked version if (outDir != null && outDir.Exists) { //if the directory has no files we have to unzip - otherwise it has an unzipped version already yay mustUnzip = !outDir.GetFiles("*.dll", SearchOption.AllDirectories).Any(); if (mustUnzip) { outDir.Delete(true); } } else { outDir = subdir.CreateSubdirectory("out"); } if (mustUnzip) { using (var zf = ZipFile.OpenRead(archive.FullName)) try { zf.ExtractToDirectory(outDir.FullName); } catch (Exception ex) { notifier.OnCheckPerformed(new CheckEventArgs("Could not extract Plugin to '" + outDir.FullName + "'", CheckResult.Warning, ex)); } } else { notifier.OnCheckPerformed(new CheckEventArgs("Found existing directory '" + outDir.FullName + "' so didn't bother unzipping.", CheckResult.Success)); } var dir = _environmentInfo.GetPluginSubDirectory(outDir.CreateSubdirectory("lib"), notifier); //it is a UI only plugin? or plugin doesn't support the current runtime/platform if (dir == null) { continue; } toLoad.Add(dir); //tell them we downloaded it MEFFileDownloaded(this, new MEFFileDownloadProgressEventArgs(subdir, compatiblePlugins.Length, i + 1, archive.Name, false, MEFFileDownloadEventStatus.Success)); } } //The only Directories in MEF folder should be Plugin subdirectories, any that don't correspond with a plugin should be deleted foreach (DirectoryInfo unexpectedDirectory in downloadDirectory.GetDirectories().Where(expected => !dirs.Any(d => d.FullName.Equals(expected.FullName)))) { try { unexpectedDirectory.Delete(true); notifier.OnCheckPerformed(new CheckEventArgs("Deleted unreferenced plugin folder " + unexpectedDirectory.FullName, CheckResult.Success)); } catch (Exception ex) { notifier.OnCheckPerformed( new CheckEventArgs( "Found unreferenced (no Plugin) folder " + unexpectedDirectory.FullName + " but we were unable to delete it (possibly because it is in use, try closing all your local RDMP applications and restarting this one)", CheckResult.Fail, ex)); } } AssemblyResolver.SetupAssemblyResolver(toLoad.ToArray()); MEFSafeDirectoryCatalog = new SafeDirectoryCatalog(notifier, toLoad.Select(d => d.FullName).ToArray()); catalogueRepository.MEF.Setup(MEFSafeDirectoryCatalog); notifier.OnCheckPerformed(new CheckEventArgs("Loading Help...", CheckResult.Success)); var sw = Stopwatch.StartNew(); if (!CatalogueRepository.SuppressHelpLoading) { catalogueRepository.CommentStore.ReadComments(Environment.CurrentDirectory, "SourceCodeForSelfAwareness.zip"); } sw.Stop(); notifier.OnCheckPerformed(new CheckEventArgs("Help loading took:" + sw.Elapsed, CheckResult.Success)); }
public override FixedReleaseSource <ReleaseAudit> GetReleaseSource(ICatalogueRepository catalogueRepository) { return(new MsSqlReleaseSource <ReleaseAudit>(catalogueRepository)); }
public PipelineSelectionUI(IActivateItems activator, IPipelineUseCase useCase, ICatalogueRepository repository) { _activator = activator; _useCase = useCase; _repository = repository; InitializeComponent(); if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) //dont connect to database in design mode { return; } RefreshPipelineList(); tt.SetToolTip(btnClonePipeline, "Create a new copy of the selected pipeline"); tt.SetToolTip(btnEditPipeline, "Change which components are run in the Pipeline and with what settings"); ddPipelines.DrawMode = DrawMode.OwnerDrawFixed; ddPipelines.DrawItem += new DrawItemEventHandler(cmb_Type_DrawItem); }
public GovernanceReport(IDetermineDatasetTimespan timespanCalculator, ICatalogueRepository repository) { _timespanCalculator = timespanCalculator; _repository = repository; }
public FavouritesProvider(IActivateItems activator, ICatalogueRepository catalogueRepository) { _activator = activator; _catalogueRepository = catalogueRepository; CurrentFavourites = catalogueRepository.GetAllObjectsWhere <Favourite>("Username", Environment.UserName).ToList(); }
public MetadataReport(ICatalogueRepository repository, MetadataReportArgs args) { _repository = repository; _args = args; }
public TicketingSystemFactory(ICatalogueRepository repository) { _repository = repository; }
/// <summary> /// Sets class up to create <see cref="AggregateFilter"/> objects in the provided <paramref name="repository"/> /// </summary> /// <param name="repository"></param> public AggregateFilterFactory(ICatalogueRepository repository) { _repository = repository; }
public RuntimeTaskFactory(ICatalogueRepository repository) { _repository = repository; }
/// <inheritdoc/> public ObjectImport(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { SharingUID = r["SharingUID"].ToString(); }
public CustomDateCaching(ICacheProgress cacheProgress, ICatalogueRepository catalogueRepository) { _cacheProgress = cacheProgress; _catalogueRepository = catalogueRepository; }
/// <summary> /// Overload with specific cache items to download for this permission window /// </summary> /// <param name="permissionWindow"></param> /// <param name="cacheProgressItems"></param> /// <param name="repository"></param> /// <param name="pipelineEngineExecutionStrategy"></param> public PermissionWindowCacheDownloader(IPermissionWindow permissionWindow, List <ICacheProgress> cacheProgressItems, ICatalogueRepository repository, IMultiPipelineEngineExecutionStrategy pipelineEngineExecutionStrategy) { _permissionWindow = permissionWindow; CheckCacheProgressesUseCorrectPermissionWindow(cacheProgressItems); _cacheProgressItems = cacheProgressItems; _repository = repository; _pipelineEngineExecutionStrategy = pipelineEngineExecutionStrategy; }
private IEnumerable <PreLoadDiscardedColumn> GetAllPreloadDiscardedColumnsInScope(ICatalogueRepository repository, IArgumentHost parent) { if (parent is ProcessTask || parent is LoadMetadata) { return(GetTableInfosInScope(repository, parent).SelectMany(t => t.PreLoadDiscardedColumns)); } return(repository.GetAllObjects <PreLoadDiscardedColumn>()); }