private bool ResetConnection()
        {
            bool reset = true;

            lock (locked)
            {
                if (m_publishingServiceChannel == null || ((ICommunicationObject)m_publishingServiceChannel).State == CommunicationState.Faulted || ((ICommunicationObject)m_publishingServiceChannel).State == CommunicationState.Closed)
                {
                    try
                    {
                        m_channelFactory          = new ChannelFactory <IPublishingService>(this.Endpoint.Binding, this.Endpoint.Address);
                        m_channelFactory.Faulted += ChannelFactory_Faulted;

                        m_channelFactory.Open();

                        m_publishingServiceChannel = m_channelFactory.CreateChannel();
                        ((ICommunicationObject)m_publishingServiceChannel).Faulted += new EventHandler(Client_Faulted);
                        reset = true;
                    }
                    catch (Exception ex)
                    {
                        reset = false;
                        Logger.Log("Error connecting to the publisher service", LogLevel.Warning, new Dictionary <string, object>()
                        {
                            { "Exception", ex }
                        });
                    }
                }
            }
            return(reset);
        }
Пример #2
0
        public DS4ToolService()
        {
            this.ServiceName = Constants.SERVICE_NAME;
            this.CanStop = true;
            this.CanPauseAndContinue = false;
            this.AutoLog = false;

            this.EventLog.Source = Constants.SERVICE_NAME;
            this.EventLog.Log = "Application";
            if (!EventLog.SourceExists(this.EventLog.Source))
            {
                EventLog.CreateEventSource(this.EventLog.Source, this.EventLog.Log);
            }

            SendService sndServ = new SendService(this);
            ServiceHost svcHost = new ServiceHost(sndServ, new Uri(Constants.PIPE_ADDRESS));
            svcHost.AddServiceEndpoint(typeof(ISendService), new NetNamedPipeBinding(), "tester");
            svcHost.Open();

            SubscribingService subServ = new SubscribingService(this.EventLog);
            ServiceHost serviceHost = new ServiceHost(subServ, new Uri(Constants.PIPE_ADDRESS));
            serviceHost.AddServiceEndpoint(typeof(ISubscribingService), new NetNamedPipeBinding(), Constants.SERVICE_NAME);
            serviceHost.Open();
            publisher = new PublishingService();
        }
Пример #3
0
        public void Subscribe()
        {
            IPublishingService subscriber = OperationContext.Current.GetCallbackChannel <IPublishingService>();

            SubscriptionManager.AddSubscriber(subscriber);
            Console.WriteLine("Subscriber added");
        }
Пример #4
0
 private TopicService SetupTopicService(
     ContentDbContext contentContext       = null,
     StatisticsDbContext statisticsContext = null,
     PersistenceHelper <ContentDbContext> persistenceHelper = null,
     IMapper mapper           = null,
     IUserService userService = null,
     IReleaseSubjectRepository releaseSubjectRepository = null,
     IReleaseDataFileService releaseDataFileService     = null,
     IReleaseFileService releaseFileService             = null,
     IPublishingService publishingService   = null,
     IMethodologyService methodologyService = null)
 {
     return(new TopicService(
                Mock.Of <IConfiguration>(),
                contentContext ?? Mock.Of <ContentDbContext>(),
                statisticsContext ?? Mock.Of <StatisticsDbContext>(),
                persistenceHelper ?? MockUtils.MockPersistenceHelper <ContentDbContext, Topic>(_topic.Id, _topic).Object,
                mapper ?? AdminMapper(),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                releaseSubjectRepository ?? Mock.Of <IReleaseSubjectRepository>(),
                releaseDataFileService ?? Mock.Of <IReleaseDataFileService>(),
                releaseFileService ?? Mock.Of <IReleaseFileService>(),
                publishingService ?? Mock.Of <IPublishingService>(),
                methodologyService ?? Mock.Of <IMethodologyService>(),
                Mock.Of <IBlobCacheService>()
                ));
 }
        private void Disconnect()
        {
            try
            {
                if (m_channelFactory != null && m_channelFactory.State != CommunicationState.Faulted)
                {
                    m_channelFactory.Close();
                }
            }
            catch (Exception ex)
            {
                Logger.Log("Error closing the channel factory", LogLevel.Verbose, new Dictionary <string, object>()
                {
                    { "Exception", ex }
                });
            }
            m_channelFactory = null;

            try
            {
                if (m_publishingServiceChannel != null && ((ICommunicationObject)m_publishingServiceChannel).State != CommunicationState.Faulted)
                {
                    ((ICommunicationObject)m_publishingServiceChannel).Close();
                }
            }
            catch (Exception ex)
            {
                Logger.Log("Error closing the client", LogLevel.Verbose, new Dictionary <string, object>()
                {
                    { "Exception", ex }
                });
            }
            m_publishingServiceChannel = null;
        }
Пример #6
0
 public TopicService(
     IConfiguration configuration,
     ContentDbContext contentContext,
     StatisticsDbContext statisticsContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IMapper mapper,
     IUserService userService,
     IReleaseSubjectRepository releaseSubjectRepository,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IPublishingService publishingService,
     IMethodologyService methodologyService,
     IBlobCacheService cacheService)
 {
     _contentContext           = contentContext;
     _statisticsContext        = statisticsContext;
     _persistenceHelper        = persistenceHelper;
     _mapper                   = mapper;
     _userService              = userService;
     _releaseSubjectRepository = releaseSubjectRepository;
     _releaseDataFileService   = releaseDataFileService;
     _releaseFileService       = releaseFileService;
     _publishingService        = publishingService;
     _methodologyService       = methodologyService;
     _cacheService             = cacheService;
     _topicDeletionAllowed     = configuration.GetValue <bool>("enableThemeDeletion");
 }
Пример #7
0
 public async Task <ClaimedVersion> ClaimVersionAsync(
     [Service] IPublishingService service,
     string gitVersion,
     string applicationName,
     string applicationPartName,
     string environmentName,
     CancellationToken cancellationToken)
 => await service.ClaimVersionAsync(gitVersion,
 public PublishReleaseFilesFunction(IPublishingService publishingService,
                                    IQueueService queueService,
                                    IReleaseStatusService releaseStatusService)
 {
     _publishingService    = publishingService;
     _queueService         = queueService;
     _releaseStatusService = releaseStatusService;
 }
Пример #9
0
        /// <summary>
        /// Конструктор сервиса
        /// </summary>
        /// <param name="db">Класс репозиториев, созданный в соответствии с паттерном Unit of Work</param>
        /// <param name="employeeService">Сервис сотрудников издательства</param>
        /// <param name="publishingService">Сервис изданий</param>
        /// <param name="articleService">Сервис статей</param>
        public ReviewService(IUnitOfWork db, IEmployeeService employeeService, IPublishingService publishingService, IArticleService articleService)
        {
            this.db = db;
            this.employeeService   = employeeService;
            this.publishingService = publishingService;
            this.articleService    = articleService;

            mapper = new MapperConfiguration(cfg => cfg.AddProfile(new ReviewBusinessMapProfile())).CreateMapper();
        }
    public async Task <IEnumerable <DeployedEnvironment> > GetDeployments(
        [Service] IPublishingService service,
        [Parent] ApplicationPart applicationPart,
        CancellationToken cancellationToken)
    {
        IReadOnlyList <Environment> envs = await service
                                           .GetDeployedEnvironmentByPartIdAsync(applicationPart.Id, cancellationToken);

        return(envs.Select(x => new DeployedEnvironment(applicationPart.Id, x.Id)));
    }
Пример #11
0
        /// <summary>
        /// Конструктор контроллера
        /// </summary>
        /// <param name="reviewService">Сервис рецензий</param>
        /// <param name="publishingService">Сервис публикаций</param>
        /// <param name="employeeService">Сервис сотрудников</param>
        /// <param name="articleService">Сервис статей</param>
        public ReviewController(IReviewService reviewService, IPublishingService publishingService,
                                IEmployeeService employeeService, IArticleService articleService)
        {
            this.reviewService     = reviewService;
            this.publishingService = publishingService;
            this.employeeService   = employeeService;
            this.articleService    = articleService;

            mapper = new MapperConfiguration(cfg => cfg.AddProfile(new ReviewMapProfile())).CreateMapper();
        }
Пример #12
0
 static public void AddSubscriber(IPublishingService subscriberCallbackReference)
 {
     lock (_locker)
     {
         if (!Subscribers.Contains(subscriberCallbackReference))
         {
             Subscribers.Add(subscriberCallbackReference);
         }
     }
 }
Пример #13
0
 static public void RemoveSubscriber(IPublishingService subscriberCallbackReference)
 {
     lock (_locker)
     {
         if (Subscribers.Contains(subscriberCallbackReference))
         {
             Subscribers.Remove(subscriberCallbackReference);
         }
     }
 }
        public PackageBuildOutputCommand(IUserInterface userInterface, IBuildOutputPackagingService buildOutputPackagingService, IPublishingService publishingService)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (buildOutputPackagingService == null)
            {
                throw new ArgumentNullException("buildOutputPackagingService");
            }

            if (publishingService == null)
            {
                throw new ArgumentNullException("publishingService");
            }

            this.userInterface = userInterface;
            this.buildOutputPackagingService = buildOutputPackagingService;
            this.publishingService = publishingService;

            this.Attributes = new CommandAttributes
            {
                CommandName = CommandName,
                AlternativeCommandNames = this.alternativeCommandNames,
                RequiredArguments = new[]
                    {
                        ArgumentNameBuildOutputFolderPath,
                        ArgumentNamePublishingConfiguration
                    },
                PositionalArguments = new[]
                    {
                        ArgumentNameBuildOutputFolderPath,
                        ArgumentNamePublishingConfiguration
                    },
                Description = Resources.PackageBuildOutputCommand.CommandDescriptionText,
                Usage = string.Format("{0} -{1}=<FolderPath>", CommandName, ArgumentNameBuildOutputFolderPath),
                Examples = new Dictionary<string, string>
                    {
                        {
                            string.Format("{0} -{1}=C:\\build-output", CommandName, ArgumentNameBuildOutputFolderPath),
                            Resources.PackageBuildOutputCommand.CommandExampleDescription1
                        }
                    },
                ArgumentDescriptions = new Dictionary<string, string>
                    {
                        { ArgumentNameBuildOutputFolderPath, Resources.PackageBuildOutputCommand.ArgumentDescriptionBuildOutputPath },
                        { ArgumentNamePublishingConfiguration, Resources.PackageBuildOutputCommand.ArgumentDescriptionPublishingConfiguration }
                    }
            };

            this.Arguments = new Dictionary<string, string>();
        }
 public MethodologyService(ContentDbContext context,
                           IMapper mapper,
                           IPublishingService publishingService,
                           IUserService userService,
                           IPersistenceHelper <ContentDbContext> persistenceHelper)
 {
     _context           = context;
     _mapper            = mapper;
     _publishingService = publishingService;
     _userService       = userService;
     _persistenceHelper = persistenceHelper;
 }
 public PublishStagedReleaseContentFunction(IContentService contentService,
                                            INotificationsService notificationsService,
                                            IReleasePublishingStatusService releasePublishingStatusService,
                                            IPublishingService publishingService,
                                            IReleaseService releaseService)
 {
     _contentService                 = contentService;
     _notificationsService           = notificationsService;
     _releasePublishingStatusService = releasePublishingStatusService;
     _publishingService              = publishingService;
     _releaseService                 = releaseService;
 }
Пример #17
0
 public ThemeService(
     ContentDbContext context,
     IMapper mapper,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     ITopicService topicService,
     IPublishingService publishingService)
 {
     _context           = context;
     _mapper            = mapper;
     _persistenceHelper = persistenceHelper;
     _userService       = userService;
     _topicService      = topicService;
     _publishingService = publishingService;
 }
 public PublicationService(
     ContentDbContext context,
     IMapper mapper,
     IUserService userService,
     IPublicationRepository publicationRepository,
     IPublishingService publishingService,
     IPersistenceHelper <ContentDbContext> persistenceHelper)
 {
     _context               = context;
     _mapper                = mapper;
     _userService           = userService;
     _publicationRepository = publicationRepository;
     _publishingService     = publishingService;
     _persistenceHelper     = persistenceHelper;
 }
 public AzureTopicEventReceiver(
     ILogger<AzureTopicEventReceiver> logger,
     IOptions<AzureTopicEventReceiverOptions> config,
     IPublishingService publishingService,
     IEventsSerializationService eventsSerializationService,
     ITopicSubscriptionsService topicSubscriptionsService,
     ISubscriptionClientFactory subscriptionClientFactory
 )
 {
     _options = config.Value;
     _logger = logger;
     _publishingService = publishingService;
     _eventsSerializationService = eventsSerializationService;
     _topicSubscriptionsService = topicSubscriptionsService;
     _subscriptionClientFactory = subscriptionClientFactory;
 }
Пример #20
0
 /// <summary>
 /// Initializes a new instance of <see cref="Uploader"/>
 /// </summary>
 /// <param name="imageDataProvider">Image data provider</param>
 /// <param name="mappingFactory">Mapping factory</param>
 /// <param name="metadataExtractorFactory">Metadata extractor factory</param>
 /// <param name="builderService">Builder service</param>
 /// <param name="publishingService">Publishing service</param>
 /// <param name="imageWriteService">Image write service</param>
 /// <param name="writeService">Write service</param>
 public Uploader(IImageDataProvider imageDataProvider,
                 IMappingFactory mappingFactory,
                 IMetadataExtractorFactory metadataExtractorFactory,
                 IBuilderService builderService,
                 IPublishingService publishingService,
                 IImageWriteService imageWriteService,
                 IWriteService writeService)
 {
     _imageDataProvider        = imageDataProvider;
     _mappingFactory           = mappingFactory;
     _metadataExtractorFactory = metadataExtractorFactory;
     _builderService           = builderService;
     _publishingService        = publishingService;
     _imageWriteService        = imageWriteService;
     _writeService             = writeService;
 }
 public ThemeService(
     IConfiguration configuration,
     ContentDbContext context,
     IMapper mapper,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     ITopicService topicService,
     IPublishingService publishingService)
 {
     _context              = context;
     _mapper               = mapper;
     _persistenceHelper    = persistenceHelper;
     _userService          = userService;
     _topicService         = topicService;
     _publishingService    = publishingService;
     _themeDeletionAllowed = configuration.GetValue <bool>("enableThemeDeletion");
 }
 private static ThemeService SetupThemeService(
     ContentDbContext context,
     IMapper mapper = null,
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     IUserService userService             = null,
     ITopicService topicService           = null,
     IPublishingService publishingService = null)
 {
     return(new ThemeService(
                context,
                mapper ?? AdminMapper(),
                persistenceHelper ?? new PersistenceHelper <ContentDbContext>(context),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                topicService ?? new Mock <ITopicService>().Object,
                publishingService ?? new Mock <IPublishingService>().Object
                ));
 }
Пример #23
0
 private ThemeService SetupThemeService(
     ContentDbContext context = null,
     IMapper mapper           = null,
     PersistenceHelper <ContentDbContext> persistenceHelper = null,
     IUserService userService             = null,
     ITopicService topicService           = null,
     IPublishingService publishingService = null)
 {
     return(new ThemeService(
                DefaultConfigurationMock().Object,
                context ?? new Mock <ContentDbContext>().Object,
                mapper ?? AdminMapper(),
                persistenceHelper ?? MockPersistenceHelper <ContentDbContext, Theme>(_theme.Id, _theme).Object,
                userService ?? AlwaysTrueUserService().Object,
                topicService ?? new Mock <ITopicService>().Object,
                publishingService ?? new Mock <IPublishingService>().Object
                ));
 }
Пример #24
0
        public PublishCommand(IUserInterface userInterface, IPublishingService publishingService)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (publishingService == null)
            {
                throw new ArgumentNullException("publishingService");
            }

            this.userInterface = userInterface;
            this.publishingService = publishingService;

            this.Attributes = new CommandAttributes
            {
                CommandName = CommandName,
                AlternativeCommandNames = this.alternativeCommandNames,
                RequiredArguments = new string[] { },
                PositionalArguments = new[] { ArgumentNameNugetPackagePath, ArgumentNamePublishConfigurationName },
                Description = Resources.PublishCommand.CommandDescriptionText,
                Usage = string.Format("{0} <{1}> <{2}>", CommandName, ArgumentNameNugetPackagePath, ArgumentNamePublishConfigurationName),
                Examples = new Dictionary<string, string>
                    {
                        {
                            string.Format("{0} \"{1}\" \"{2}\"", CommandName, @"C:\local-repository\SomePackage.1.0.0.nupkg", "Nuget Gallery"),
                            string.Format(Resources.PublishCommand.CommandExampleDescription1, @"C:\local-repository\SomePackage.1.0.0.nupkg", "Nuget Gallery")
                        },
                        {
                            string.Format("{0} -{1}=\"{2}\" {3}=\"{4}\"", CommandName, ArgumentNameNugetPackagePath, @"C:\local-repository\SomePackage.1.0.0.nupkg", ArgumentNamePublishConfigurationName, "Nuget Gallery"),
                            string.Format(Resources.PublishCommand.CommandExampleDescription2, @"C:\local-repository\SomePackage.1.0.0.nupkg", "Nuget Gallery")
                        }
                    },
                ArgumentDescriptions = new Dictionary<string, string>
                    {
                        { ArgumentNameNugetPackagePath, Resources.PublishCommand.ArgumentDescriptionNugetPackagePath },
                        { ArgumentNamePublishConfigurationName, Resources.PublishCommand.ArgumentDescriptionPublishConfigurationName }
                    }
            };

            this.Arguments = new Dictionary<string, string>();
        }
 public TopicService(
     ContentDbContext contentContext,
     StatisticsDbContext statisticsContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IMapper mapper,
     IUserService userService,
     IReleaseSubjectService releaseSubjectService,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IPublishingService publishingService)
 {
     _contentContext         = contentContext;
     _statisticsContext      = statisticsContext;
     _persistenceHelper      = persistenceHelper;
     _mapper                 = mapper;
     _userService            = userService;
     _releaseSubjectService  = releaseSubjectService;
     _releaseDataFileService = releaseDataFileService;
     _releaseFileService     = releaseFileService;
     _publishingService      = publishingService;
 }
Пример #26
0
 public MethodologyApprovalService(
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     ContentDbContext context,
     IBlobCacheService publicBlobCacheService,
     IMethodologyContentService methodologyContentService,
     IMethodologyFileRepository methodologyFileRepository,
     IMethodologyVersionRepository methodologyVersionRepository,
     IMethodologyImageService methodologyImageService,
     IPublishingService publishingService,
     IUserService userService)
 {
     _persistenceHelper            = persistenceHelper;
     _context                      = context;
     _publicBlobCacheService       = publicBlobCacheService;
     _methodologyContentService    = methodologyContentService;
     _methodologyFileRepository    = methodologyFileRepository;
     _methodologyVersionRepository = methodologyVersionRepository;
     _methodologyImageService      = methodologyImageService;
     _publishingService            = publishingService;
     _userService                  = userService;
 }
 private ReleaseService BuildReleaseService(
     ContentDbContext context             = null,
     IMapper mapper                       = null,
     IPublishingService publishingService = null,
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     IUserService userService                         = null,
     IReleaseRepository releaseRepository             = null,
     ISubjectService subjectService                   = null,
     ITableStorageService tableStorageService         = null,
     IReleaseFileService releaseFileService           = null,
     IReleaseDataFileService releaseDataFileService   = null,
     IImportStatusService importStatusService         = null,
     IFootnoteService footnoteService                 = null,
     StatisticsDbContext statisticsDbContext          = null,
     IDataBlockService dataBlockService               = null,
     IReleaseChecklistService releaseChecklistService = null,
     IReleaseSubjectService releaseSubjectService     = null)
 {
     return(new ReleaseService(
                context ?? new Mock <ContentDbContext>().Object,
                mapper ?? AdminMapper(),
                publishingService ?? new Mock <IPublishingService>().Object,
                persistenceHelper ?? DefaultPersistenceHelperMock().Object,
                userService ?? new Mock <IUserService>().Object,
                releaseRepository ?? new Mock <IReleaseRepository>().Object,
                subjectService ?? new Mock <ISubjectService>().Object,
                tableStorageService ?? new Mock <ITableStorageService>().Object,
                releaseDataFileService ?? new Mock <IReleaseDataFileService>().Object,
                releaseFileService ?? new Mock <IReleaseFileService>().Object,
                importStatusService ?? new Mock <IImportStatusService>().Object,
                footnoteService ?? new Mock <IFootnoteService>().Object,
                statisticsDbContext ?? new Mock <StatisticsDbContext>().Object,
                dataBlockService ?? new Mock <IDataBlockService>().Object,
                releaseChecklistService ?? new Mock <IReleaseChecklistService>().Object,
                releaseSubjectService ?? new Mock <IReleaseSubjectService>().Object,
                new SequentialGuidGenerator()
                ));
 }
 public ReleaseApprovalService(
     ContentDbContext context,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IPublishingService publishingService,
     IReleaseChecklistService releaseChecklistService,
     IContentService contentService,
     IPreReleaseUserService preReleaseUserService,
     IReleaseFileRepository releaseFileRepository,
     IReleaseFileService releaseFileService,
     IReleaseRepository releaseRepository)
 {
     _context                 = context;
     _persistenceHelper       = persistenceHelper;
     _userService             = userService;
     _publishingService       = publishingService;
     _releaseChecklistService = releaseChecklistService;
     _contentService          = contentService;
     _preReleaseUserService   = preReleaseUserService;
     _releaseFileRepository   = releaseFileRepository;
     _releaseFileService      = releaseFileService;
     _releaseRepository       = releaseRepository;
 }
 private TopicService SetupTopicService(
     ContentDbContext contentContext       = null,
     StatisticsDbContext statisticsContext = null,
     PersistenceHelper <ContentDbContext> persistenceHelper = null,
     IMapper mapper           = null,
     IUserService userService = null,
     IReleaseSubjectService releaseSubjectService   = null,
     IReleaseDataFileService releaseDataFileService = null,
     IReleaseFileService releaseFileService         = null,
     IPublishingService publishingService           = null)
 {
     return(new TopicService(
                contentContext ?? new Mock <ContentDbContext>().Object,
                statisticsContext ?? new Mock <StatisticsDbContext>().Object,
                persistenceHelper ?? MockUtils.MockPersistenceHelper <ContentDbContext, Topic>(_topic.Id, _topic).Object,
                mapper ?? AdminMapper(),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                releaseSubjectService ?? new Mock <IReleaseSubjectService>().Object,
                releaseDataFileService ?? new Mock <IReleaseDataFileService>().Object,
                releaseFileService ?? new Mock <IReleaseFileService>().Object,
                publishingService ?? new Mock <IPublishingService>().Object
                ));
 }
Пример #30
0
 // TODO EES-212 - ReleaseService needs breaking into smaller services as it feels like it is now doing too
 // much work and has too many dependencies
 public ReleaseService(
     ContentDbContext context,
     IMapper mapper,
     IPublishingService publishingService,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IReleaseRepository repository,
     ISubjectService subjectService,
     ITableStorageService coreTableStorageService,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IImportStatusService importStatusService,
     IFootnoteService footnoteService,
     StatisticsDbContext statisticsDbContext,
     IDataBlockService dataBlockService,
     IReleaseChecklistService releaseChecklistService,
     IReleaseSubjectService releaseSubjectService,
     IGuidGenerator guidGenerator)
 {
     _context                 = context;
     _publishingService       = publishingService;
     _mapper                  = mapper;
     _persistenceHelper       = persistenceHelper;
     _userService             = userService;
     _repository              = repository;
     _subjectService          = subjectService;
     _coreTableStorageService = coreTableStorageService;
     _releaseDataFileService  = releaseDataFileService;
     _releaseFileService      = releaseFileService;
     _importStatusService     = importStatusService;
     _footnoteService         = footnoteService;
     _statisticsDbContext     = statisticsDbContext;
     _dataBlockService        = dataBlockService;
     _releaseChecklistService = releaseChecklistService;
     _releaseSubjectService   = releaseSubjectService;
     _guidGenerator           = guidGenerator;
 }
Пример #31
0
 public void UsePublisher(IPublishingService service)
 {
     Publisher = service;
 }
Пример #32
0
 public void UsePublisher(IPublishingService service)
 {
     Publisher = service;
 }
Пример #33
0
 protected void SetupService()
 {
     PublishingService = new PublishingService(DataStoreMock, UploadServiceFactoryMock);
 }
Пример #34
0
 public Task <IReadOnlyList <ClaimedVersion> > GetClaimsVersions(
     [Service] IPublishingService service,
     [Parent] PublishedApplicationPart parent,
     CancellationToken cancellationToken) =>
 service.GetClaimedVersionByPublishedPartIdAsync(parent.Id, cancellationToken);
Пример #35
0
        public PackageSolutionCommand(IUserInterface userInterface, ISolutionPackagingService solutionPackagingService, IBuildPropertyParser buildPropertyParser, IPublishingService publishingService)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (solutionPackagingService == null)
            {
                throw new ArgumentNullException("solutionPackagingService");
            }

            if (buildPropertyParser == null)
            {
                throw new ArgumentNullException("buildPropertyParser");
            }

            if (publishingService == null)
            {
                throw new ArgumentNullException("publishingService");
            }

            this.userInterface = userInterface;
            this.solutionPackagingService = solutionPackagingService;
            this.buildPropertyParser = buildPropertyParser;
            this.publishingService = publishingService;

            this.Attributes = new CommandAttributes
            {
                CommandName = CommandName,
                AlternativeCommandNames = this.alternativeCommandNames,
                RequiredArguments = new[]
                    {
                        ArgumentNameSolutionPath,
                        ArgumentNameBuildConfiguration,
                        ArgumentNameMSBuildProperties,
                        ArgumentNamePublishingConfiguration
                    },
                PositionalArguments = new[]
                    {
                        ArgumentNameSolutionPath,
                        ArgumentNameBuildConfiguration,
                        ArgumentNameMSBuildProperties,
                        ArgumentNamePublishingConfiguration
                    },
                Description = Resources.PackageSolutionCommand.CommandDescriptionText,
                Usage = string.Format("{0} -{1}=<Path> -{2}=<Debug|Release> -{3}=<Property1=Value1;Property2=Value2>", CommandName, ArgumentNameSolutionPath, ArgumentNameBuildConfiguration, ArgumentNameMSBuildProperties),
                Examples = new Dictionary<string, string>
                    {
                        {
                            string.Format("{0} -{1}=C:\\dev\\projects\\sample\\sample.sln -{2}=Release -{3}=IsAutoBuild=True", CommandName, ArgumentNameSolutionPath, ArgumentNameBuildConfiguration, ArgumentNameMSBuildProperties),
                            Resources.PackageSolutionCommand.CommandExampleDescription1
                        }
                    },
                ArgumentDescriptions = new Dictionary<string, string>
                    {
                        { ArgumentNameSolutionPath, Resources.PackageSolutionCommand.ArgumentDescriptionSolutionPath },
                        { ArgumentNameBuildConfiguration, Resources.PackageSolutionCommand.ArgumentDescriptionBuildConfiguration },
                        { ArgumentNameMSBuildProperties, Resources.PackageSolutionCommand.ArgumentDescriptionMSBuildProperties },
                        { ArgumentNamePublishingConfiguration, Resources.PackageSolutionCommand.ArgumentDescriptionPublishingConfiguration }
                    }
            };

            this.Arguments = new Dictionary<string, string>();
        }
Пример #36
0
        public void Setup()
        {
            this.applicationInformation = ApplicationInformationProvider.GetApplicationInformation();
            IEncodingProvider encodingProvider = new DefaultFileEncodingProvider();
            IFilesystemAccessor filesystemAccessor = new PhysicalFilesystemAccessor(encodingProvider);
            IPackageServerFactory packageServerFactory = new PackageServerFactory();
            IPublishConfigurationFactory publishConfigurationFactory = new PublishConfigurationFactory();
            IObjectSerializer<PublishConfiguration[]> publishConfigurationSerializer = new JSONObjectSerializer<PublishConfiguration[]>();
            IFilesystemPersistence<PublishConfiguration[]> publishConfigurationPersistence = new FilesystemPersistence<PublishConfiguration[]>(filesystemAccessor, publishConfigurationSerializer);
            this.publishConfigurationAccessor = new ConfigFilePublishConfigurationAccessor(this.applicationInformation, publishConfigurationFactory, publishConfigurationPersistence);

            this.publishingService = new PublishingService(filesystemAccessor, packageServerFactory, this.publishConfigurationAccessor);

            this.localPublishingFolder = Path.Combine(this.applicationInformation.StartupFolder, "publish-target");
            this.samplePackageFilepath = Path.Combine(this.applicationInformation.StartupFolder, "IntegrationTests", "Publishing", SamplePackageFilename);
        }