Esempio n. 1
0
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //string connectionStringValue = this.GetConnectionStringValue(source, "ConnectionStringName");
            //FormsSettings newPlugin = new FormsSettings(connectionStringValue);
            FormsSettings newPlugin = new FormsSettings();

            endpoint.AddPlugin <FormsSettings>(newPlugin);
        }
Esempio n. 2
0
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            var settings = new RedditSettings {
                BlogPath = base.GetStringValue(source, "Blog Path")
            };

            endpoint.AddPlugin(settings);
        }
Esempio n. 3
0
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            var settings = new FileSettings()
            {
                FilePath = GetStringValue(source, FileNameFieldName)
            };

            endpoint.AddPlugin(settings);
        }
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //
            //create the plugin
            var settings = new GitHubSettings();

            //
            //add the plugin to the endpoint
            endpoint.AddPlugin(settings);
        }
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //create the plugin
            var settings = new JsonApiEndpointSettings
            {
                EndpointURL = this.GetStringValue(source, TemplateFieldEndpointURL)
            };

            //add the plugin to the endpoint
            endpoint.AddPlugin(settings);
        }
        public void IterableDataSettingsPluginAddedToPipelineContext()
        {
            var builder = new StringBuilder();

            builder.AppendLine("a-b-c");
            builder.AppendLine("1-2-3");
            var fileName = Path.GetTempFileName();

            File.WriteAllText(fileName, builder.ToString());
            var textFileSettings = new TextFileSettings
            {
                Path = fileName,
                ColumnHeadersInFirstLine = false,
                ColumnSeparator          = "-"
            };
            var endpointFrom = new Endpoint();

            endpointFrom.AddPlugin(textFileSettings);
            var pipelineStep = new PipelineStep {
                Enabled = true
            };

            pipelineStep.AddPlugin(new EndpointSettings {
                EndpointFrom = endpointFrom
            });
            var pipelineContext = new PipelineContext(new PipelineBatchContext());
            var logger          = Substitute.For <ILogger>();
            var processor       = new ReadTextFileStepProcessor();

            processor.StartProcessing(pipelineStep, pipelineContext, logger);
            var dataSettings = pipelineContext.GetPlugin <IterableDataSettings>();

            Assert.NotNull(dataSettings);
            Assert.NotNull(dataSettings.Data);
            var count = 0;

            foreach (var data in dataSettings.Data)
            {
                Assert.NotNull(data);
                Assert.IsType <string[]>(data);
                var dataAsArray = data as string[];
                Assert.NotNull(dataAsArray);
                Assert.Equal(3, dataAsArray.Length);
                count++;
            }
            Assert.Equal(2, count);
            File.Delete(fileName);
        }
Esempio n. 7
0
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            var applicationEndpointSettings = new ApplicationEndpointSettings();
            var model = this.ConvertReferenceToModel <ApplicationSettings>(source, ApplicationEndpointItemModel.Application);

            if (model != null)
            {
                applicationEndpointSettings.Application = model;
            }

            if (applicationEndpointSettings.Application == null)
            {
                Context.Logger.Error("No application was specified for the endpoint. (item: {0}, field: {1})", source.GetItemId(), Templates.RESTfulEndpoint.FieldNames.Application);
            }

            endpoint.AddPlugin <ApplicationEndpointSettings>(applicationEndpointSettings);
        }
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //
            //create the plugin
            var settings = new TextFileSettings
            {
                //
                //populate the plugin using values from the item
                ColumnHeadersInFirstLine = this.GetBoolValue(source, TemplateFieldColumnHeadersInFirstLine),
                ColumnSeparator          = this.GetStringValue(source, TemplateFieldColumnSeparator),
                Path = this.GetStringValue(source, TemplateFieldPath)
            };

            //
            //add the plugin to the endpoint
            endpoint.AddPlugin(settings);
        }
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //
            //create the plugin
            var settings = new WordpressSettings
            {
                PostsUrl      = GetStringValue(source, IWordPress_Endpoint_Constants.Posts_URL_FieldName),
                TagsUrl       = GetStringValue(source, IWordPress_Endpoint_Constants.Tags_URL_FieldName),
                CategoriesUrl = GetStringValue(source, IWordPress_Endpoint_Constants.Categories_URL_FieldName)
            };

            //
            //populate the plugin using values from the item
            //WordPressEndpointItemModel.PostsUrl);
            //WordPressEndpointItemModel.TagsUrl);
            //WordPressEndpointItemModel.CategoriesUrl);
            //add the plugin to the endpoint
            endpoint.AddPlugin(settings);
        }
        public void NoIterableDataSettingsPluginAddedToPipelineContextWhenNoPathIsSetOnTheTextFileSettingsPluginSetOnTheEndpoint()
        {
            var textFileSettings = new TextFileSettings();
            var endpointFrom     = new Endpoint();

            endpointFrom.AddPlugin(textFileSettings);
            var pipelineStep = new PipelineStep {
                Enabled = true
            };

            pipelineStep.AddPlugin(new EndpointSettings {
                EndpointFrom = endpointFrom
            });
            var pipelineContext = new PipelineContext(new PipelineBatchContext());
            var logger          = Substitute.For <ILogger>();
            var processor       = new ReadTextFileStepProcessor();

            processor.StartProcessing(pipelineStep, pipelineContext, logger);
            Assert.Null(pipelineContext.GetPlugin <IterableDataSettings>());
        }
        protected override void AddPlugins(ItemModel source, Endpoint endpoint)
        {
            //
            //create the plugin
            var settings = new ServiceBusSettings
            {
                //
                //populate the plugin using values from the item
                ConnectionString    = GetStringValue(source, TemplateFieldConnectionString),
                Topic               = GetStringValue(source, TemplateFieldTopic),
                Market              = GetStringValue(source, TemplateFieldMarket),
                Sender              = GetStringValue(source, TemplateFieldSender),
                BatchSize           = GetIntValue(source, TemplateFieldBatchSize),
                MaxNumberOfMessages = GetIntValue(source, TemplateFieldMaxNumberOfMessages)
            };

            //
            //add the plugin to the endpoint
            endpoint.AddPlugin(settings);
        }