private RequiredAndOptionalSectionsTableGenerator(IObjectRepository tdb, TableCollection tables, HyperlinkTracker hyperlinkTracker, List <Template> templates)
 {
     this.tdb              = tdb;
     this.tables           = tables;
     this.hyperlinkTracker = hyperlinkTracker;
     this.templates        = templates;
 }
 private TemplateContainmentGenerator(IObjectRepository tdb, WordprocessingDocument document, List <ViewTemplateRelationship> relationships, List <Template> allTemplates, TableCollection tables, HyperlinkTracker hyperlinkTracker)
 {
     this.tdb              = tdb;
     this.document         = document;
     this.relationships    = relationships;
     this.allTemplates     = allTemplates;
     this.tables           = tables;
     this.hyperlinkTracker = hyperlinkTracker;
 }
Exemplo n.º 3
0
 public ValueSetsExport(IIGTypePlugin igTypePlugin, MainDocumentPart mainPart, HyperlinkTracker hyperlinkTracker, TableCollection tables, bool generateAsAppendix, int defaultMaxMembers, Dictionary <string, int> valueSetMaximumMembers)
 {
     this.igTypePlugin           = igTypePlugin;
     this.mainPart               = mainPart;
     this.hyperlinkTracker       = hyperlinkTracker;
     this.tables                 = tables;
     this.generateAsAppendix     = generateAsAppendix;
     this.defaultMaxMembers      = defaultMaxMembers;
     this.valueSetMaximumMembers = valueSetMaximumMembers;
 }
Exemplo n.º 4
0
 public TemplateConstraintTable(IObjectRepository tdb, List <ConstraintReference> references, IGSettingsManager igSettings, IIGTypePlugin igTypePlugin, List <Template> templates, TableCollection tables, List <string> selectedCategories, HyperlinkTracker hyperlinkTracker)
 {
     this.tdb                = tdb;
     this.references         = references;
     this.igSettings         = igSettings;
     this.igTypePlugin       = igTypePlugin;
     this.templates          = templates;
     this.tables             = tables;
     this.selectedCategories = selectedCategories;
     this.hyperlinkTracker   = hyperlinkTracker;
 }
Exemplo n.º 5
0
        private TemplateContextTable(IObjectRepository tdb, List <ViewTemplateRelationship> relationships, TableCollection tables, Body documentBody, Template template, List <Template> exportedTemplates, HyperlinkTracker hyperlinkTracker)
        {
            this.tdb               = tdb;
            this.relationships     = relationships;
            this.tables            = tables;
            this.template          = template;
            this.documentBody      = documentBody;
            this.exportedTemplates = exportedTemplates;
            this.hyperlinkTracker  = hyperlinkTracker;

            this.allConstraints = template.ChildConstraints;
        }
Exemplo n.º 6
0
 private RequiredAndOptionalSectionsTableGenerator(
     IObjectRepository tdb,
     TableCollection tables,
     HyperlinkTracker hyperlinkTracker,
     List <Template> templates,
     int documentTemplateTypeId,
     int sectionTemplateTypeId)
 {
     this.tdb                    = tdb;
     this.tables                 = tables;
     this.hyperlinkTracker       = hyperlinkTracker;
     this.templates              = templates;
     this.documentTemplateTypeId = documentTemplateTypeId;
     this.sectionTemplateTypeId  = sectionTemplateTypeId;
 }
Exemplo n.º 7
0
        public static void Append(
            IObjectRepository tdb,
            TableCollection tableCollection,
            HyperlinkTracker hyperlinkTracker,
            List <Template> templates,
            int documentTemplateTypeId,
            int sectionTemplateTypeId)
        {
            RequiredAndOptionalSectionsTableGenerator generator = new RequiredAndOptionalSectionsTableGenerator(
                tdb,
                tableCollection,
                hyperlinkTracker,
                templates,
                documentTemplateTypeId,
                sectionTemplateTypeId);

            generator.Generate();
        }
Exemplo n.º 8
0
        public static IConstraintGenerator NewConstraintGenerator(
            IGSettingsManager igSettings,
            MainDocumentPart mainPart,
            CommentManager cmtMgr,
            FigureCollection figures,
            bool includeSamples,
            IObjectRepository dataSource,
            List <TemplateConstraint> rootConstraints,
            List <TemplateConstraint> allConstraints,
            Template currentTemplate,
            List <Template> allTemplates,
            string constraintHeadingStyle,
            List <string> selectedCategories,
            HyperlinkTracker hyperlinkTracker)
        {
            IConstraintGenerator constraintGenerator = null;

            if (igSettings.GetBoolSetting(IGSettingsManager.SettingProperty.UseConsolidatedConstraintFormat))
            {
                constraintGenerator = new ConsolidatedGeneration();
            }
            else
            {
                constraintGenerator = new LegacyGeneration();
            }

            constraintGenerator.IGSettings             = igSettings;
            constraintGenerator.Figures                = figures;
            constraintGenerator.IncludeSamples         = includeSamples;
            constraintGenerator.DataSource             = dataSource;
            constraintGenerator.RootConstraints        = rootConstraints;
            constraintGenerator.AllConstraints         = allConstraints;
            constraintGenerator.CurrentTemplate        = currentTemplate;
            constraintGenerator.AllTemplates           = allTemplates;
            constraintGenerator.ConstraintHeadingStyle = constraintHeadingStyle;
            constraintGenerator.CommentManager         = cmtMgr;
            constraintGenerator.IncludeCategory        = !string.IsNullOrEmpty(igSettings.GetSetting(IGSettingsManager.SettingProperty.Categories));
            constraintGenerator.SelectedCategories     = selectedCategories;
            constraintGenerator.HyperlinkTracker       = hyperlinkTracker;
            constraintGenerator.MainPart               = mainPart;
            constraintGenerator.DocumentBody           = mainPart.Document.Body;

            return(constraintGenerator);
        }
Exemplo n.º 9
0
        public void BuildImplementationGuide(ExportSettings aModel, IIGTypePlugin igTypePlugin)
        {
            this.exportSettings = aModel;
            this.igTypePlugin   = igTypePlugin;

            this.docStream = new MemoryStream();
            this.document  = WordprocessingDocument.Create(this.docStream, WordprocessingDocumentType.Document);
            this.document.AddMainDocumentPart();

            this.SetupStyles();

            this.document.MainDocumentPart.Document =
                new Document(
                    new Body());

            this.hyperlinkTracker         = new HyperlinkTracker();
            this.tables                   = new TableCollection(this.document.MainDocumentPart.Document.Body, this.hyperlinkTracker);
            this.constraintTableGenerator = new TemplateConstraintTable(this._tdb, this.constraintReferences, this.igSettings, igTypePlugin, this.templates, this.tables, exportSettings.SelectedCategories, this.hyperlinkTracker);
            this.figures                  = new FigureCollection(this.document.MainDocumentPart.Document.Body);
            this.valueSetsExport
                = new ValueSetsExport(
                      igTypePlugin,
                      this.document.MainDocumentPart,
                      this.hyperlinkTracker,
                      this.tables,
                      exportSettings.GenerateValueSetAppendix,
                      exportSettings.DefaultValueSetMaxMembers,
                      exportSettings.ValueSetMaxMembers);
            this.codeSystemTable = new CodeSystemTable(this._tdb, this.document.MainDocumentPart.Document.Body, this.templates, this.tables);

            this.AddTitlePage();

            this.AddTableOfContents();

            this.AddVolume1(false);

            this.AddTemplateTypeSections();

            if (exportSettings.GenerateDocTemplateListTable || exportSettings.GenerateDocContainmentTable)
            {
                Paragraph entryLevelHeading = new Paragraph(
                    new ParagraphProperties(
                        new ParagraphStyleId()
                {
                    Val = Properties.Settings.Default.TemplateTypeHeadingStyle
                }),
                    new Run(
                        new Text("Template Ids in This Guide")));
                this.document.MainDocumentPart.Document.Body.AppendChild(entryLevelHeading);

                if (exportSettings.GenerateDocTemplateListTable)
                {
                    // Add used template table
                    this.AddDocumentTemplateListTable();
                }

                if (exportSettings.GenerateDocContainmentTable)
                {
                    TemplateContainmentGenerator.AddTable(this._tdb, this.document, this.templateRelationships, this.templates, this.tables, this.hyperlinkTracker);
                }
            }

            this.valueSetsExport.AddValueSetsAppendix();

            this.codeSystemTable.AddCodeSystemAppendix();

            this.AddRetiredTemplatesAppendix();

            if (exportSettings.IncludeChangeList)
            {
                this.LoadChangesAppendix();
            }

            this.AddVolume1(true);
        }
Exemplo n.º 10
0
        public static void AddTable(IObjectRepository tdb, List <ViewTemplateRelationship> relationships, TableCollection tables, Body documentBody, Template template, List <Template> exportedTemplates, HyperlinkTracker hyperlinkTracker)
        {
            TemplateContextTable cot = new TemplateContextTable(tdb, relationships, tables, documentBody, template, exportedTemplates, hyperlinkTracker);

            cot.AddTemplateContextTable();
        }
Exemplo n.º 11
0
 public static Paragraph CreateTableCaption(int tableCount, string title, string bookmarkId = null, string caption = "Table ", HyperlinkTracker hyperlinkTracker = null)
 {
     return(CreateCaption(++tableCount, title, caption, CaptionTypes.Table,
                          bookmarkId: bookmarkId,
                          hyperlinkTracker: hyperlinkTracker));
 }
Exemplo n.º 12
0
        public static Paragraph CreateCaption(int count, string title, string caption, CaptionTypes captionType, string bookmarkId = null, HyperlinkTracker hyperlinkTracker = null)
        {
            FieldCode fieldCode = null;

            if (captionType == CaptionTypes.Table)
            {
                fieldCode = new FieldCode(" SEQ Table \\* ARABIC ");
            }
            else if (captionType == CaptionTypes.Figure)
            {
                fieldCode = new FieldCode(" SEQ Figure \\* ARABIC ");
            }

            Paragraph p3 = new Paragraph(
                new ParagraphProperties(
                    new ParagraphStyleId()
            {
                Val = Properties.Settings.Default.TableCaptionStyle
            })
                );

            p3.Append(
                DocHelper.CreateRun(caption),
                new Run(
                    new FieldChar()
            {
                FieldCharType = new EnumValue <FieldCharValues>(FieldCharValues.Begin)
            }),
                new Run(fieldCode),
                new Run(
                    new FieldChar()
            {
                FieldCharType = new EnumValue <FieldCharValues>(FieldCharValues.Separate)
            }),
                DocHelper.CreateRun(count.ToString()),
                new Run(
                    new FieldChar()
            {
                FieldCharType = new EnumValue <FieldCharValues>(FieldCharValues.End)
            }),
                DocHelper.CreateRun(": "));

            var titleRun = DocHelper.CreateRun(title);

            if (!string.IsNullOrEmpty(bookmarkId))
            {
                hyperlinkTracker.AddAnchorAround(p3, bookmarkId, titleRun);
            }
            else
            {
                p3.Append(titleRun);
            }

            return(p3);
        }
Exemplo n.º 13
0
 public TableCollection(Body documentBody, HyperlinkTracker hyperlinkTracker)
 {
     this.documentBody     = documentBody;
     this.hyperlinkTracker = hyperlinkTracker;
 }
        public static void AddTable(IObjectRepository tdb, WordprocessingDocument document, List <ViewTemplateRelationship> relationships, List <Template> allTemplates, TableCollection tables, HyperlinkTracker hyperlinkTracker)
        {
            TemplateContainmentGenerator tcg = new TemplateContainmentGenerator(tdb, document, relationships, allTemplates, tables, hyperlinkTracker);

            tcg.GenerateTable();
        }