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; } }
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; }
private void MirrorDOCsToUI() { // todo: extend PathIsValid GatherUserInput(); cache.BIVs[selectedBIVName].LoadDOC(cctsR); // model // todo: set default value for document model and select afterwards //comboModels.SelectedItem = cache.DOCLs[selectedBIVName].DocumentModel; // documents checkedlistboxDOCs.Items.Clear(); cDOC doc = cache.BIVs[selectedBIVName].DOC; if (doc != null) { checkedlistboxDOCs.Items.Add(doc.Name, doc.State); } }