Esempio n. 1
0
 public XmlParseActivityBuilder(XslBuilder xslBuilder, XmlParserHelperBuilder xmlParserHelperBuilder, XsdBuilder xsdBuilder, XsdParser xsdParser)
 {
     this.xslBuilder             = xslBuilder;
     this.xmlParserHelperBuilder = xmlParserHelperBuilder;
     this.xsdBuilder             = xsdBuilder;
     this.xsdParser = xsdParser;
 }
        public void SetUp()
        {
            this.xsdParser       = new XsdParser();
            mapperActivityParser = new MapperActivityParser(xsdParser);
            var xml =
                @"<pd:activity name=""Mappe Equity"" xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"">
<pd:type>com.tibco.plugin.mapper.MapperActivity</pd:type>
<config>
<element ref=""pfx2:NTMMessage""/>

</config>
<pd:inputBindings>
    <sqlParams>
        <FundName>
            <xsl:value-of select=""testvalue""/>
        </FundName>
        <AdminID>
            <xsl:value-of select=""EVL""/>
        </AdminID>
    </sqlParams>
</pd:inputBindings>
</pd:activity>";

            doc = XElement.Parse(xml);
        }
Esempio n. 3
0
        public EditorControlViewModel(IContainerExtension container, IEventAggregator eventAggregator, IApplicationCommands appCommands)
        {
            _xsdParser       = container.Resolve <XsdParser>();
            _eventAggregator = eventAggregator;
            _appCommands     = appCommands;

            InitEvent();
            InitCommand();
        }
Esempio n. 4
0
        public void CanParseXFormFromXmlFileDocumentumArchivageSettingsXsd()
        {
            //asign
            var xsdParser = new XsdParser();

            //action
            var xForm = xsdParser.ParseXsdFile("DocumentumArchivageSettings.xsd");

            //assert
            Assert.NotNull(xForm);
        }
Esempio n. 5
0
        public void CanParseXFormFromXmlFileMoveCopySettingsXsd()
        {
            //asign
            var xsdParser = new XsdParser();

            //action
            var xForm = xsdParser.ParseXsdFile("MoveCopySettings.xsd");

            //assert
            Assert.NotNull(xForm);
        }
Esempio n. 6
0
        public void Should_return_complexType_with_targetNamespace()
        {
            var    xsdParser = new XsdParser();
            string xml       = @"<xsd:element name=""group"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><xsd:complexType><xsd:sequence><xsd:element name=""adminID"" type=""xsd:string"" /></xsd:sequence></xsd:complexType></xsd:element>";

            var doc    = XElement.Parse(xml);
            var actual = xsdParser.Parse(new List <XNode>()
            {
                doc
            }, "Mytarget.Namespace");

            Assert.AreEqual("Mytarget.Namespace.group", actual[0].Type);
        }
Esempio n. 7
0
        public void CanParseXFormFromXmlFileDocumentumArchivageSettingsXml()
        {
            //asign
            var xmlParser = new XmlParser();
            var xsdParser = new XsdParser();
            var xForm     = xsdParser.ParseXsdFile("DocumentumArchivageSettings.xsd");

            //action
            var xFormFromXml = xmlParser.GetFilledXForm("DocumentumArchivageSettings.xml", xForm);

            //assert
            Assert.NotNull(xFormFromXml);
        }
 public ActivityBuilderFactory()
 {
     this.xpathBuilder                      = new XpathBuilder();
     this.xslBuilder                        = new XslBuilder(this.xpathBuilder);
     this.dataAccessBuilder                 = new DataAccessBuilder();
     this.dataAccessServiceBuilder          = new DataAccessServiceBuilder();
     this.dataAccessInterfacesCommonBuilder = new DataAccessInterfacesCommonBuilder();
     this.resultSetBuilder                  = new ResultSetBuilder();
     this.xmlParserHelperBuilder            = new XmlParserHelperBuilder();
     this.engineCommandServiceHelperBuilder = new EngineCommandServiceHelperBuilder();
     this.xsdBuilder                        = new XsdBuilder();
     this.xsdParser         = new XsdParser();
     this.subscriberBuilder = new SubscriberInterfaceBuilder();
 }
Esempio n. 9
0
        public void Should_return_One_element_with_Type_String()
        {
            var    xsdParser = new XsdParser();
            string xml       = @"<xsd:element name=""adminID"" type=""xsd:string"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""/>";

            var doc    = XElement.Parse(xml);
            var actual = xsdParser.Parse(new List <XNode>()
            {
                doc
            });

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual("adminID", actual[0].Name);
            Assert.AreEqual("System.String", actual[0].Type);
        }
Esempio n. 10
0
        private void CreateAFile(string className)
        {
            _gen = new XsdParser(XsdFilePath + className + ".xsd");

            var generatedFileFullName = ClassFilePath + className + ".cs";

            if (File.Exists(generatedFileFullName))
            {
                File.Delete(generatedFileFullName);
            }
            //_gen.EdiNodeTree = new Node() {Name = "Name", IsOptional = true, Nodes = null, Segment = null};
            _gen.CreateClassFile(ClassFilePath, className);
            Assert.AreNotEqual(_gen.EdiDocument, null);
            Assert.IsTrue(File.Exists(generatedFileFullName));
        }
Esempio n. 11
0
        public void Should_Manage_ref_element_without_prefix()
        {
            var    xsdParser = new XsdParser();
            string xml       = @"<xsd:element ref=""mkdSchedulerInfo"" minOccurs=""0"" maxOccurs=""unbounded"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""/>";

            var doc    = XElement.Parse(xml);
            var actual = xsdParser.Parse(new List <XNode>()
            {
                doc
            });

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual("mkdSchedulerInfo", actual[0].Name);
            Assert.AreEqual("mkdSchedulerInfo", actual[0].Type);
        }
Esempio n. 12
0
        /// <summary>
        /// Creates XForm from given Xsd file
        /// </summary>
        /// <param name="file">Path to Xsd file.</param>
        internal void GenerateFormFromXsdFile(string file)
        {
            _mainPanel.Controls.Clear();
            _xForm = null;

            _controlManager.Clear();//prepare for new rendering

            var xsdParser = new XsdParser();

            _xForm     = xsdParser.ParseXsdFile(file);
            _xFormData = xsdParser.ParseXsdFile(file);
            var generateGuiGetGroupBox = _controlManager.GetGroupBoxGui(_xForm.Root, _xFormData.Root);

            _mainPanel.Controls.Add(generateGuiGetGroupBox);
        }
Esempio n. 13
0
        public void Should_return_One_element_with_One_Child()
        {
            var    xsdParser = new XsdParser();
            string xml       = @"<xsd:element name=""group"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><xsd:complexType><xsd:sequence><xsd:element name=""adminID"" type=""xsd:string"" /></xsd:sequence></xsd:complexType></xsd:element>";

            var doc    = XElement.Parse(xml);
            var actual = xsdParser.Parse(new List <XNode>()
            {
                doc
            });

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual("group", actual[0].Name);
            Assert.AreEqual("group", actual[0].Type);
            Assert.AreEqual("adminID", actual[0].ChildProperties[0].Name);
            Assert.AreEqual("System.String", actual[0].ChildProperties[0].Type);
        }
Esempio n. 14
0
        public void Should_return_One_With_3_child_when_parsing_the_exemple()
        {
            var xsdParser = new XsdParser();
            var doc       = XElement.Load("../../ressources/xsdtest.xsd");
            var actual    = xsdParser.Parse(new List <XNode>()
            {
                doc
            });

            Assert.AreEqual(1, actual.Count);

            Assert.AreEqual("group", actual[0].Name);
            Assert.AreEqual("group", actual[0].Type);
            Assert.AreEqual(3, actual[0].ChildProperties.Count);
            Assert.AreEqual("adminID", actual[0].ChildProperties[1].Name);
            Assert.AreEqual("System.String", actual[0].ChildProperties[1].Type);
            Assert.AreEqual("param", actual[0].ChildProperties[2].Name);
        }
Esempio n. 15
0
        public void Dispose()
        {
            //Events
            _settingChangedEvent.Unsubscribe(OnSettingChanged);
            _loadTextEvent.Unsubscribe(OnLoadText);
            _updateTabStatusEvent.Unsubscribe(OnUpdateTabStatus);
            _selectTabEvent.Unsubscribe(OnSelectTab);

            //Command
            _appCommands.SaveCommand.UnregisterCommand(SaveCommand);
            _appCommands.CompileCommand.UnregisterCommand(CompileCommand);
            _appCommands.RedoCommand.UnregisterCommand(RedoCommand);
            _appCommands.UndoCommand.UnregisterCommand(UndoCommand);

            _textEditor?.Dispose();
            _textEditor = null;

            _xsdParser = null;
        }
Esempio n. 16
0
        public void SetUp()
        {
            this.xsdParser         = new XsdParser();
            xmlParseActivityParser = new XmlParseActivityParser(xsdParser);
            var xml =
                @"<pd:activity name=""Parse Equity"" xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"">
<pd:type>com.tibco.plugin.xml.XMLParseActivity</pd:type>
<config>
    <inputStyle>text</inputStyle>
    <term ref=""pfx4:EquityRecord""/>
</config>
<pd:inputBindings>
    <sqlParams>
        <xsl:value-of select=""testvalue""/>
    </sqlParams>
</pd:inputBindings>
</pd:activity>";

            doc = XElement.Parse(xml);
        }
 private void lbDataSets_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems[0] is DataSet selDataSet)
     {
         _viewModel.DataTables = XsdParser.GetDataTables(selDataSet.FilePath);
         _viewModel.Relations  = XsdParser.GetRelations(selDataSet.FilePath);
         CollectionView view = CollectionViewSource.GetDefaultView(lbRelations.ItemsSource) as CollectionView;
         view.Filter = obj =>
         {
             var item           = obj as Relation;
             var selectedtables = lbDataTables.SelectedItems.Cast <Models.Table>();
             if (selectedtables != null)
             {
                 return(selectedtables.Where(t => t.Name == item.ParentDataSource).Any() && selectedtables.Where(t => t.Name == item.ChildDataSource).Any());
             }
             return(true);
         };
     }
     else
     {
         _viewModel.DataTables = null;
         _viewModel.Relations  = null;
     }
 }
Esempio n. 18
0
 public XsdFileProcessorService(ISourceCodeGeneratorService sourceCodeGeneratorService)
 {
     this.sourceCodeGeneratorService = sourceCodeGeneratorService;
     this.xsdParser = new XsdParser();
 }
 public MapperActivityBuilder(XslBuilder xslBuilder, XsdBuilder xsdBuilder, XsdParser xsdParser)
 {
     this.xslBuilder = xslBuilder;
     this.xsdBuilder = xsdBuilder;
     this.xsdParser  = xsdParser;
 }
Esempio n. 20
0
 public XsdParserTests()
 {
     parser = new XsdParser(logger.Object);
 }
Esempio n. 21
0
 public XsdGenerator(string xsdFilePath)
 {
     InitializeComponent();
     _xDocument           = XsdParser.GenerateXmlDictionary(xsdFilePath);
     tbDictionaryXml.Text = _xDocument.ToString();
 }
Esempio n. 22
0
        private void InitCodeCompletionParser()
        {
            _xsdParser = new XsdParser();

            Task.Run(() => IsCodeCompletion = _xsdParser.TryParse());
        }
Esempio n. 23
0
 public XsdBuilder()
 {
     this.xsdParser = new XsdParser();
 }