public Dictionary <string, CloudFileInfo> GetBaseImagesDictionary(IContainerService container)
        {
            var containerClient = GetServiceContainer(container);

            Dictionary <string, LocalFileInfo> myBaseImagesDictionary = new Dictionary <string, LocalFileInfo>();

            GetLocalFiles(myBaseImagesDictionary, containerClient.FullName, 1);
            return(myBaseImagesDictionary.ToDictionary(x => Path.GetFileName(x.Key), x => new CloudFileInfo(x.Value.Size, x.Value.Date)));
        }
Пример #2
0
 public SidebarDashboardDriver(
     ICRMContentOwnershipService crmContentOwnershipService,
     IContentDefinitionManager contentDefinitionManager,
     IOrchardServices orchardServices,
     ISiteService siteService,
     IFeedManager feedManager, IContainerService containerService)
     : base(crmContentOwnershipService, contentDefinitionManager, orchardServices, siteService, feedManager, containerService)
 {
 }
Пример #3
0
 public bool CreateClientContainer(IContainerService clientContainer)
 {
     if (CheckIfContainerExists(clientContainer))
     {
         return(false);
     }
     _blobServiceClient.CreateBlobContainer(clientContainer.GetContainerName(), PublicAccessType.Blob);
     return(true);
 }
Пример #4
0
 public ListPartSettingsDisplayDriver(
     IContentDefinitionManager contentDefinitionManager,
     IContainerService containerService,
     IStringLocalizer <ListPartSettingsDisplayDriver> localizer)
 {
     _contentDefinitionManager = contentDefinitionManager;
     _containerService         = containerService;
     S = localizer;
 }
        public Dictionary <string, DateTime> GetCacheImagesDictionary(IContainerService container)
        {
            Dictionary <string, LocalFileInfo> cachedImages = new Dictionary <string, LocalFileInfo>();
            var containerClient = GetServiceContainer(container);

            GetLocalFiles(cachedImages, containerClient.FullName, 3);

            return(cachedImages.ToDictionary(x => x.Key, x => x.Value.Date));
        }
        public ContainerPartHandler(
            IRepository<ContainerPartRecord> repository, 
            IContentDefinitionManager contentDefinitionManager, 
            IListViewService listViewService, 
            IContainerService containerService) {

            _contentDefinitionManager = contentDefinitionManager;
            _listViewService = listViewService;
            _containerService = containerService;
            Filters.Add(StorageFilter.For(repository));
            OnInitializing<ContainerPart>((context, part) => {
                part.Record.ItemsShown = part.Settings.GetModel<ContainerTypePartSettings>().ItemsShownDefault
                                        ?? part.PartDefinition.Settings.GetModel<ContainerPartSettings>().ItemsShownDefault;
                part.Record.PageSize = part.Settings.GetModel<ContainerTypePartSettings>().PageSizeDefault
                                        ?? part.PartDefinition.Settings.GetModel<ContainerPartSettings>().PageSizeDefault;
                part.Record.Paginated = part.Settings.GetModel<ContainerTypePartSettings>().PaginatedDefault
                                        ?? part.PartDefinition.Settings.GetModel<ContainerPartSettings>().PaginatedDefault;

            });

            OnGetContentItemMetadata<ContainerPart>((context, part) => {
                    context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                    {"Area", "Containers"},
                    {"Controller", "Item"},
                    {"Action", "Display"},
                    {"id", context.ContentItem.Id}
                };
            });

            OnActivated<ContainerPart>((context, part) => {
                part.ContainerSettingsField.Loader(() => part.Settings.GetModel<ContainerTypePartSettings>());

                part.ItemContentTypesField.Loader(() => {
                    var settings = part.ContainerSettings;
                    var types = settings.RestrictItemContentTypes ? settings.RestrictedItemContentTypes : part.Record.ItemContentTypes;
                    return _contentDefinitionManager.ParseContentTypeDefinitions(types);
                });

                part.ItemContentTypesField.Setter(value => {
                    part.Record.ItemContentTypes = _contentDefinitionManager.JoinContentTypeDefinitions(value);
                    return value;
                });

                part.AdminListViewField.Loader(() => {
                    var providers = _listViewService.Providers.ToList();
                    var listViewProviderName = !String.IsNullOrWhiteSpace(part.Record.AdminListViewName)
                        ? part.Record.AdminListViewName
                        : !String.IsNullOrWhiteSpace(part.ContainerSettings.AdminListViewName)
                            ? part.ContainerSettings.AdminListViewName
                            : providers.Any() ? providers.First().Name : null;

                    return _listViewService.GetProvider(listViewProviderName) ?? _listViewService.GetDefaultProvider();
                });
            });

            OnPublished<ContainerPart>((context, part) => _containerService.UpdateItemCount(part));
        }
Пример #7
0
 public bool DeleteSingleCacheImage(string cacheImagePath, IContainerService container)
 {
     if (!CheckIfImageExists(cacheImagePath, container))
     {
         return(false);
     }
     GetBlobImage(cacheImagePath, container).Delete();
     return(true);
 }
        public Dictionary <string, long> GetImagesDictionaryPathAndSize(IContainerService container)
        {
            var containerClient = GetServiceContainer(container);

            var containerFiles = containerClient.GetFiles("*", SearchOption.AllDirectories)
                                 .Where(x => CheckIfFileIsSupported(x.Name));

            return(containerFiles.ToDictionary(file => file.FullName, file => file.Length));
        }
Пример #9
0
        public async Task InitializeAsync()
        {
            var webHostUrl = FixtureUtils.IsRunningInContainer
                ? FixtureUtils.GetLocalIPAddress()
                : "127.0.0.1";

            var settings = new LambdaTestHostSettings(() => new TestLambdaContext())
            {
                WebHostUrl       = $"http://{webHostUrl}:0",
                ConfigureLogging = logging =>
                {
                    logging.AddXUnit(_outputHelper);
                    logging.SetMinimumLevel(LogLevel.Debug);
                }
            };

            settings.AddFunction(new LambdaFunctionInfo(
                                     nameof(SimpleLambdaFunction),
                                     typeof(SimpleLambdaFunction),
                                     nameof(SimpleLambdaFunction.FunctionHandler)));
            _lambdaTestHost = await LambdaTestHost.Start(settings);

            var lambdaInvokeEndpoint = FixtureUtils.GetLambdaInvokeEndpoint(_outputHelper, _lambdaTestHost);

            _stepFunctionsLocal = new Builder()
                                  .UseContainer()
                                  .WithName("lambda-testhost-stepfunctions")
                                  .UseImage("amazon/aws-stepfunctions-local:latest")
                                  .WithEnvironment($"LAMBDA_ENDPOINT={lambdaInvokeEndpoint}")
                                  .ReuseIfExists()
                                  .ExposePort(0, ContainerPort)
                                  .Build()
                                  .Start();

            var exposedPort = _stepFunctionsLocal
                              .GetConfiguration()
                              .NetworkSettings
                              .Ports.First()
                              .Value.First()
                              .HostPort;

            var stepFunctionsServiceUrl = new UriBuilder($"http://localhost:{exposedPort}");

            if (FixtureUtils.IsRunningInContainer)
            {
                var host = _stepFunctionsLocal
                           .GetConfiguration()
                           .NetworkSettings
                           .IPAddress;

                stepFunctionsServiceUrl.Host = host;
                stepFunctionsServiceUrl.Port = ContainerPort;
            }

            _stepFunctionsServiceUrl = stepFunctionsServiceUrl.Uri;
        }
        public ContainerPartHandler(
            IRepository <ContainerPartRecord> repository,
            IContentDefinitionManager contentDefinitionManager,
            IListViewService listViewService,
            IContainerService containerService)
        {
            _contentDefinitionManager = contentDefinitionManager;
            _listViewService          = listViewService;
            _containerService         = containerService;
            Filters.Add(StorageFilter.For(repository));
            OnInitializing <ContainerPart>((context, part) => {
                part.Record.ItemsShown = part.Settings.GetModel <ContainerTypePartSettings>().ItemsShownDefault
                                         ?? part.PartDefinition.Settings.GetModel <ContainerPartSettings>().ItemsShownDefault;
                part.Record.PageSize = part.Settings.GetModel <ContainerTypePartSettings>().PageSizeDefault
                                       ?? part.PartDefinition.Settings.GetModel <ContainerPartSettings>().PageSizeDefault;
                part.Record.Paginated = part.Settings.GetModel <ContainerTypePartSettings>().PaginatedDefault
                                        ?? part.PartDefinition.Settings.GetModel <ContainerPartSettings>().PaginatedDefault;
            });

            OnGetContentItemMetadata <ContainerPart>((context, part) => {
                context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                    { "Area", "Containers" },
                    { "Controller", "Item" },
                    { "Action", "Display" },
                    { "id", context.ContentItem.Id }
                };
            });

            OnActivated <ContainerPart>((context, part) => {
                part.ContainerSettingsField.Loader(() => part.Settings.GetModel <ContainerTypePartSettings>());

                part.ItemContentTypesField.Loader(() => {
                    var settings = part.ContainerSettings;
                    var types    = settings.RestrictItemContentTypes ? settings.RestrictedItemContentTypes : part.Record.ItemContentTypes;
                    return(_contentDefinitionManager.ParseContentTypeDefinitions(types));
                });

                part.ItemContentTypesField.Setter(value => {
                    part.Record.ItemContentTypes = _contentDefinitionManager.JoinContentTypeDefinitions(value);
                    return(value);
                });

                part.AdminListViewField.Loader(() => {
                    var providers            = _listViewService.Providers.ToList();
                    var listViewProviderName = !String.IsNullOrWhiteSpace(part.Record.AdminListViewName)
                        ? part.Record.AdminListViewName
                        : !String.IsNullOrWhiteSpace(part.ContainerSettings.AdminListViewName)
                            ? part.ContainerSettings.AdminListViewName
                            : providers.Any() ? providers.First().Name : null;

                    return(_listViewService.GetProvider(listViewProviderName) ?? _listViewService.GetDefaultProvider());
                });
            });

            OnPublished <ContainerPart>((context, part) => _containerService.UpdateItemCount(part));
        }
        public ContainablePartHandler(IRepository<ContainablePartRecord> repository, IContainerService containerService) {
            _containerService = containerService;
            Filters.Add(StorageFilter.For(repository));

            OnCreated<ContainablePart>((context, part) => UpdateItemCount(part));
            OnPublished<ContainablePart>((context, part) => UpdateItemCount(part));
            OnUnpublished<ContainablePart>((context, part) => UpdateItemCount(part));
            OnVersioned<ContainablePart>((context, part, newVersionPart) => UpdateItemCount(newVersionPart));
            OnRemoved<ContainablePart>((context, part) => UpdateItemCount(part));
        }
Пример #12
0
 public ContainedPartDisplayDriver(
     IContentManager contentManager,
     ISession session,
     IContainerService containerService
     )
 {
     _session          = session;
     _contentManager   = contentManager;
     _containerService = containerService;
 }
 public ListPartSettingsDisplayDriver(IContainerService containerService,
                                      IStringLocalizer <ListPartSettingsDisplayDriver> localizer,
                                      IListViewService listViewService,
                                      ISession session)
 {
     _containerService = containerService;
     S = localizer;
     _listViewService = listViewService;
     _session         = session;
 }
Пример #14
0
        public MockServerContainer()
        {
            HostPort = GetAvailablePort(3000);

            ContainerService = new Builder()
                               .UseContainer()
                               .UseImage(ContainerImage)
                               .ExposePort(HostPort, ContainerPort)
                               .Build();
        }
Пример #15
0
 public ListPartDisplayDriver(
     IContentDefinitionManager contentDefinitionManager,
     IContainerService containerService,
     IUpdateModelAccessor updateModelAccessor
     )
 {
     _contentDefinitionManager = contentDefinitionManager;
     _containerService         = containerService;
     _updateModelAccessor      = updateModelAccessor;
 }
Пример #16
0
        public bool DeleteClientContainer(IContainerService container)
        {
            if (!CheckIfContainerExists(container))
            {
                return(false);
            }

            _blobServiceClient.DeleteBlobContainer(container.GetContainerName());
            return(true);
        }
 public bool DeleteSingleCacheImage(string cacheImagePath, IContainerService container)
 {
     if (CheckIfImageExists(cacheImagePath, container))
     {
         string path = Path.GetDirectoryName(GetFullFilePath(container, cacheImagePath));
         Directory.Delete(Path.GetFullPath(path), true);
         return(true);
     }
     return(false);
 }
Пример #18
0
        public ContainerModel(IContainerService container)
        {
            var config = container.GetConfiguration();

            this.Id        = container.Id;
            this.Name      = config.Name;
            this.Image     = container.Image.Name;
            this.IsWindows = container.IsWindowsContainer;
            this.State     = container.State.ToString();
        }
Пример #19
0
 public AdminMenu(
     IContainerService containerService, 
     IContentManager contentManager,
     IAuthorizationService authorizationService, 
     IWorkContextAccessor workContextAccessor
     ) {
     _containerService = containerService;
     _contentManager = contentManager;
     _authorizationService = authorizationService;
     _workContextAccessor = workContextAccessor;
 }
Пример #20
0
        public UnitTestManager()
        {
            IServiceCollection services = new ServiceCollection();

            services.AddSingleton <IConfiguration>(Configuration);

            _mockupService    = new MockupServices();
            _containerService = new ContainerService(_config, _mockupService);
            _azureFileService = new AzureFileService(_config, _mockupService);
            connectionString  = _config["storageconnectionstring"];
        }
 public GenericDashboardDriver(
     IContentDefinitionManager contentDefinitionManager,
     IOrchardServices orchardServices,
     ICRMContentOwnershipService crmContentOwnershipService,
     ISiteService siteService,
     IFeedManager feedManager, IContainerService containerService)
     : base(crmContentOwnershipService, contentDefinitionManager, orchardServices, siteService, feedManager, containerService)
 {
     // display all  the items in the Dashboard
     pageSize = -1;
 }
Пример #22
0
 public UpdateService(FastContext context, IItemsService itemsService, IContainerService containerService,
                      ICategoryService categoryService,
                      ICurrencyService currencyService, ISelectionContainerService selectionContainerService)
 {
     _context                   = context;
     _itemsService              = itemsService;
     _containerService          = containerService;
     _categoryService           = categoryService;
     _currencyService           = currencyService;
     _selectionContainerService = selectionContainerService;
 }
        private static IEnumerable <string> ExecuteCommandAgainstDockerWithOutput(IContainerService container, string command)
        {
            var    output = container.Execute(command);
            string error  = output.Error;

            error.Should().BeEmpty();
            output.Success.Should().BeTrue();
            output.Data.Should().NotBeNullOrEmpty();

            return(output.Data);
        }
Пример #24
0
        public ContainablePartHandler(IRepository <ContainablePartRecord> repository, IContainerService containerService)
        {
            _containerService = containerService;
            Filters.Add(StorageFilter.For(repository));

            OnCreated <ContainablePart>((context, part) => UpdateItemCount(part));
            OnPublished <ContainablePart>((context, part) => UpdateItemCount(part));
            OnUnpublished <ContainablePart>((context, part) => UpdateItemCount(part));
            OnVersioned <ContainablePart>((context, part, newVersionPart) => UpdateItemCount(newVersionPart));
            OnRemoved <ContainablePart>((context, part) => UpdateItemCount(part));
        }
Пример #25
0
 public Plan(IContainerService containerService, Fr8Account dockyardAccount, IActivity activity,
             ICrateManager crate, ISecurityServices security, IJobDispatcher dispatcher, IPusherNotifier pusher)
 {
     _containerService = containerService;
     _dockyardAccount  = dockyardAccount;
     _activity         = activity;
     _crate            = crate;
     _security         = security;
     _dispatcher       = dispatcher;
     _pusherNotifier   = pusher;
 }
        public MemoryStream DownloadImageFromStorageToStream(string imagePath, IContainerService container)
        {
            MemoryStream outputStream = new MemoryStream();

            using (var fs = File.Open(GetFullFilePath(container, imagePath), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                fs.CopyTo(outputStream);
                fs.Dispose();
            }
            return(outputStream);
        }
Пример #27
0
 public JobRunner(ITagService tagService,
                  IContainerService containerService,
                  IDatabaseEnvironmentService databaseEnvironmentService,
                  IRuleExecutionService executionService,
                  IRuleService ruleService)
 {
     _tagService                 = tagService;
     _containerService           = containerService;
     _databaseEnvironmentService = databaseEnvironmentService;
     _executionService           = executionService;
     _ruleService                = ruleService;
 }
 public bool DeleteClientContainer(IContainerService clientContainer)
 {
     try
     {
         GetServiceContainer(clientContainer).Delete(true);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Пример #29
0
 //TODO: Refactor this
 public MessageParser(IMovementService movementService, IMessageService messageService, IFlightDataValidation flightDataValidation,
                      IFlightService flightService,
                      IContainerService containerService, IParserMovementUtility parserMovementUtility, IParserCPMUtility parserCPMUtility)
 {
     this.movementService       = movementService;
     this.messageService        = messageService;
     this.flightDataValidation  = flightDataValidation;
     this.flightService         = flightService;
     this.containerService      = containerService;
     this.parserMovementUtility = parserMovementUtility;
     this.parserCPMUtility      = parserCPMUtility;
 }
Пример #30
0
 public UpdateImageHandler(IMapper mapper, IRegistryAuthService authService, IContainerService containerService,
                           IImageRepository imageRepository, IDeploymentRepository deploymentRepository, INetworkRepository networkRepository, INetworkService networkService, IContainerRepository containerRepository)
 {
     _mapper               = mapper;
     _authService          = authService;
     _containerService     = containerService;
     _imageRepository      = imageRepository;
     _deploymentRepository = deploymentRepository;
     _networkRepository    = networkRepository;
     _networkService       = networkService;
     _containerRepository  = containerRepository;
 }
 public bool DeleteLetterDirectory(string fileName, IContainerService container)
 {
     try
     {
         Directory.Delete(Path.Combine(_serviceClient.FullName, container.GetContainerName(), fileName[0].ToString()), true);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Пример #32
0
        public EventStoreFixture()
        {
            _image = new Builder().UseContainer()
                     .UseImage("eventstore/eventstore:latest")
                     .WithEnvironment("EVENTSTORE_EXT_HTTP_PORT=2113")
                     .WithEnvironment("EVENTSTORE_EXT_TCP_PORT=1113")
                     .ExposePort(2113, 2113)
                     .ExposePort(1113, 1113)
                     .Build().Start();

            _image.WaitForRunning();
        }
Пример #33
0
 public AdminMenu(
     IContainerService containerService,
     IContentManager contentManager,
     IAuthorizationService authorizationService,
     IWorkContextAccessor workContextAccessor
     )
 {
     _containerService     = containerService;
     _contentManager       = contentManager;
     _authorizationService = authorizationService;
     _workContextAccessor  = workContextAccessor;
 }
Пример #34
0
        public AdminController(
            IOrchardServices services,
            IContentDefinitionManager contentDefinitionManager,
            IShapeFactory shapeFactory,
            IContainerService containerService, 
            IListViewService listViewService,
            ITransactionManager transactionManager) {

            _services = services;
            _contentManager = services.ContentManager;
            _contentDefinitionManager = contentDefinitionManager;
            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
            Shape = shapeFactory;
            _containerService = containerService;
            _listViewService = listViewService;
            _transactionManager = transactionManager;
        }
 public PropertiesController(IContainerService containerService)
 {
     this.containerService = containerService;
 }
Пример #36
0
 public StreamOutService(IContainerService containerService, ITarStreamService tarStreamService)
 {
     this.containerService = containerService;
     this.tarStreamService = tarStreamService;
 }
Пример #37
0
 public LimitsController(IContainerService containerService)
 {
     this.containerService = containerService;
 }
Пример #38
0
 public NetController(IContainerService containerService)
 {
     this.containerService = containerService;
 }
 public ContainerProcessController(IContainerService containerService)
 {
     this.containerService = containerService;
 }
 public ContainerInfoService(IContainerService containerService, IOptions options)
 {
     this.containerService = containerService;
     this.options = options;
 }
Пример #41
0
 public AdminMenu(IContainerService containerService, IContentManager contentManager) {
     _containerService = containerService;
     _contentManager = contentManager;
 }
Пример #42
0
 public ContainerInfoService(IContainerService containerService, IExternalIP externalIP)
 {
     this.containerService = containerService;
     this.externalIP = externalIP;
 }
 public ListFilterForm(IShapeFactory shapeFactory, IContainerService containerService, IContentManager contentManager) {
     _containerService = containerService;
     _contentManager = contentManager;
     New = shapeFactory;
 }
 public ContainerSettingsHooks(IContainerService containerService, IContentDefinitionManager contentDefinitionManager, IListViewService listViewService) {
     _containerService = containerService;
     _contentDefinitionManager = contentDefinitionManager;
     _listViewService = listViewService;
 }
 public ContainerProcessHandler(IContainerService containerService, IRunService runService, ILogger logger)
 {
     this.containerService = containerService;
     this.runService = runService;
     this.logger = logger;
 }
 public GraceTimeController(IContainerService containerService)
 {
     this.containerService = containerService;
 }
Пример #47
0
 public ContainersController(IContainerService containerService, ILogger logger)
 {
     this.containerService = containerService;
     this.logger = logger;
 }