Ejemplo n.º 1
0
 private void LoadDOC(ICctsRepository repository)
 {
     DocL     = repository.GetDocLibraryById(Id);
     Document = DocL.DocumentRoot;
     if (_Document != null && _DocL != null)
     {
         DOC = new cDOC(Document.Name, Document.Id, CheckState.Unchecked, DocL.BaseURN, DocL.NamespacePrefix, this);
     }
     else
     {
         DOC = null;
     }
 }
Ejemplo n.º 2
0
 public void LoadDOC(ICctsRepository repository)
 {
     if (DOC == null)
     {
         IDocLibrary docl     = repository.GetDocLibraryById(Id);
         IMa         document = docl.DocumentRoot;
         if (document != null)
         {
             DOC = new cDOC(document.Name, document.Id, CheckState.Unchecked, docl.BaseURN, docl.NamespacePrefix);
         }
         else
         {
             throw new CacheException("No Document root found!");
         }
     }
 }
        private void buttonGenerate_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            richtextStatus.Text = "Starting to generate XML schemas ...\n\n";

            GatherUserInput();

            cBIV currentBIV = cache.BIVs[selectedBIVName];

            // TODO: check if path is valid
            IAbie rootAbie = null;
            cDOC  document = currentBIV.DOC;

            if (document != null && document.State == CheckState.Checked)
            {
                rootAbie = cctsR.GetAbieById(document.Id);
            }

            IDocLibrary docl = cctsR.GetDocLibraryById(currentBIV.Id);

            // TODO: xsd generator needs to be adapted - currently all doc libraries are being generated whereas
            // only the ones that are checked should be generated..

            //TODO: currently the wizard just takes the input from the text fields whereas the prefix and the
            // target namespace should be (a) stored in the cache and (b) read from there while generation..
            string targetNamespace   = textTargetNS.Text;
            string namespacePrefix   = textPrefixTargetNS.Text;
            bool   annotate          = checkboxAnnotations.CheckState == CheckState.Checked ? true : false;
            bool   allschemas        = checkboxAllschemas.CheckState == CheckState.Checked ? true : false;
            var    generationContext = new GeneratorContext(cctsR, targetNamespace,
                                                            namespacePrefix, annotate, allschemas,
                                                            outputDirectory, docl);

            generationContext.SchemaAdded += HandleSchemaAdded;
            export.cctsndr.XSDGenerator.GenerateSchemas(generationContext);

            richtextStatus.Text += "\nGenerating XML schemas completed!";
            progressBar.Value    = 100;
            Cursor.Current       = Cursors.Default;
        }
Ejemplo n.º 4
0
        private void buttonExport_Click(object sender, RoutedEventArgs e)
        {
            Cursor             = Cursors.Wait;
            textBoxStatus.Text = "Starting to generate XML schemas ...\n\n";
            GatherUserInput();
            cBIV currentBIV = cache.BIVs[selectedBIVName];


            IDocLibrary docl = cctsR.GetDocLibraryById(currentBIV.Id);

            // TODO: xsd generator needs to be adapted - currently all doc libraries are being generated whereas
            // only the ones that are checked should be generated..

            //TODO: currently the wizard just takes the input from the text fields whereas the prefix and the
            // target namespace should be (a) stored in the cache and (b) read from there while generation..

            if (comboboxDocumentModel.SelectedItem.Equals("CCTS"))
            {
                // TODO: check if path is valid
                cDOC document = currentBIV.DOC;
                if (document != null && document.State == CheckState.Checked)
                {
                }
                string targetNamespace   = textboxTagetNamespace.Text;
                string namespacePrefix   = textboxPrefix.Text;
                bool   annotate          = checkboxDocumentationAnnotations.IsChecked == true ? true : false;
                bool   allschemas        = checkboxGenerateCcSchemas.IsChecked == true ? true : false;
                var    generationContext = new GeneratorContext(cctsR, targetNamespace,
                                                                namespacePrefix, annotate, allschemas,
                                                                outputDirectory, docl);
                generationContext.SchemaAdded += HandleSchemaAdded;
                XSDGenerator.GenerateSchemas(generationContext);
            }
            else
            {
                SubsetExporter.ExportSubset(docl, originalXMLSchema, outputDirectory);
            }
            textBoxStatus.Text += "\nGenerating XML schemas completed!";
            Cursor              = Cursors.Arrow;
        }