Esempio n. 1
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            string Key             = txtKey.Text;
            string PropertyPath    = txtPropertyPath.Text;
            string DestinationPath = txtDestinationPath.Text;
            string ListName        = txtListName.Text;

            IBaseMessage message = MessageHelper.CreateFromString("<testfile/>");

            message.Context.Promote(new ContextProperty(PropertyPath), Key);

            var component = new SharepointLookup()
            {
                Disabled        = false,
                PropertyPath    = PropertyPath,
                DestinationPath = DestinationPath,
                ListName        = ListName,
                ThrowException  = true,
                PromoteProperty = true
            };

            SendPipelineWrapper sendPipeline = PipelineFactory.CreateEmptySendPipeline();

            sendPipeline.AddComponent(component, PipelineStage.PreAssemble);

            IBaseMessage results = sendPipeline.Execute(message);

            string result = (string)results.Context.Read(new ContextProperty(DestinationPath));

            txtResult.Text = result;
        }
Esempio n. 2
0
        public void Test()
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            if (config.AppSettings.Settings["SharePointSite"] == null)
            {
                config.AppSettings.Settings.Add("SharePointSite", "https://TestUrl.org");
            }
            else
            {
                config.AppSettings.Settings["SharePointSite"].Value = "https://TestUrl.org";
            }

            string Key             = "274";
            string DestinationPath = "https://Test.Schemas.PropertySchema#Destination";

            IBaseMessage message = MessageHelper.CreateFromString("<Test/>");

            message.Context.Write("Key", "https://Test.Schemas.PropertySchema", Key);
            message.Context.Write("DestinationPath", "https://Test.Schemas.PropertySchema", DestinationPath);

            var component = new SharepointLookup()
            {
                Disabled        = false,
                PropertyPath    = "https://Test.Schemas.PropertySchema#Key",
                DestinationPath = "https://Test.Schemas.PropertySchema#DestinationPath",
                ListName        = "TestList",
                ThrowException  = true,
                PromoteProperty = true
            };

            SendPipelineWrapper sendPipeline = PipelineFactory.CreateEmptySendPipeline();

            sendPipeline.AddComponent(component, PipelineStage.PreAssemble);

            IBaseMessage results = sendPipeline.Execute(message);

            Assert.AreEqual(Key, results.Context.Read("StoreId", "https://Test.Schemas.PropertySchema"));

            Assert.IsTrue(results.Context.IsPromoted("DestinationPath", "https://Test.Schemas.PropertySchema"));
        }