Aras Innovator Platform

7.3 Configuring a Table of Contents

The Content Generator enables you to create and modify the Table of Contents for a document using the TOC XML schema element and the tp_TOCContentGenerator method. The TOC XML Schema element contains the parameters used to create a Table of Contents as shown in the following screenshot.

You can specify the:

  • Chapter and Section headings.
  • Maximum depth of headings that appear in the Table of Contents.
  • Name of the document element to create for each TOC item.

The SourceElements JSON Object Parameter identifies the Container Document Elements and Text-based elements to use for each Table of Content Item. The format is as follows:

Container Element Name: Text Document Element Name

For example, the following searches for ‘Chapter’ and ‘Section’ Document Elements and will use the content of the first ‘Title’ Document Element within each for the TOC text.

“SourceElements": {

“Chapter": “Title”,

“Section": “Title”

},

The MaxLevel Parameter specifies the maximum depth to use for the Table of Contents. Valid values are equal to or greater than 1. The following example sets the depth to 3; meaning that the TOC Generator will search to a depth level of 3 for child and grandchild Chapter and/or Section Documents for the content of the TOC.

“MaxLevel": 3,

The TOCItemName Parameter specifies the Name of the Document Element to create for each TOC Item generated. The following example will create a ‘TOC-Item’ Document Element for each TOC Item it creates:

“TOCItemName": “TOC-Item”

The values you specify should be passed to the tp_TOCGenerator method in JSON format. The Generator Parameters property accesses the specified values. It’s critical that JSON formatting be accurate when setting these properties. The following example show the proper configuration for the example settings discussed above:

{

"SourceElements": {

"Chapter": "Title",

"Section": "Title"

},

"MaxLevel": 3,

"TOCItemName": "TOC-Item"

}

Note
In the example above, note the use of the outer ‘{‘s and the use of ‘{‘s for the SourceElements JSON Object. Also note the use of ‘,’s for separating values and the use of “:” for separating name and value pairs.
Note
JavaScript Object Notation (JSON) is used to serialize JavaScript Object data. It is used in the Technical Document Framework to enable complex configuration data for parameterizing Methods. A description of JSON, including how JSON can be represented via Collection classes in .Net, is outside the scope of this document.