How to Configure Quark Author?
To configure Quark Author, make changes in the following configuration files:
- S3/qaservice/conf/app-config.json
- S3/qaservice/conf/structure/Smart Document/qa-config.json
window.QA contains two objects – author and engine.
These objects contain all the APIs required for Quark Author.
Examples of Accessing QA APIs
- Get Editor Instance
QA.author.qaCore.editorInstance - Add Event Listener
QA.engine.qaMetaDataManager.addListener(QA.engine.qaMetaDataManager.Events.META_VALUE_CHANGE, (data) => { console.log(data) } );
Configure app-config.json
In the file app-config.json, you can make the following common configurations:
- Map a Query for Document Templates
- Show/Hide Template Meta while Initiating Document
- Show/Hide a Document Content Type in New Document Menu
- Enable Older Versions Selection of an Asset in the Asset Picker Dialog
- Configure Action Buttons (Save, Discard and Done Editing)
Map a Query for Document Templates
{
"documenttemplate": [
{
"contenttype": "Document Content Type",
"templatequery": " Starter Documents” //Shared query name saved in workspace for templates.
}
]
}
Show/Hide Template Meta while Initiating Document
{
"documenttemplate": [
{
"contenttype": "Document Content Type",
"showTemplateMeta": false //Default value is true. Set to false to hide meta while initiating document.
}
]
}
Show/Hide a Document Content Type in New Document Menu
{
"documenttemplate": [
{
"contenttype": "Document Content Type",
"enableNew": false //Default value is true. Set to false to hide content type from new document menu.
}
]
}
Enable Older Versions Selection of an Asset in the Asset Picker Dialog
{
"applicationsettings": {
"enableVersionSelectOnAssetPicker": true //Default value is false. Set to true to link to older versions of an asset in the Asset Picker dialog.
}
}
Configure Action Buttons (Save, Discard and Done Editing)
{
"applicationsettings": {
"actions":[
{
"id": "qa-save-toolbar-btn",
"displayText": "Save", // Button label
"iconUrl": "S3://assets/save.png" // S3 or absolute url of icon
"iconCls" : "fas fa-check" // Font awesome also supported
},
{
"id": "qa-discard-toolbar-btn",
"displayText": "Discard",
"iconUrl": "assets/images/reference/discard-changes.png"
},
{
"id": "qa-done-editing-toolbar-btn",
"displayText": "Done Editing",
"iconCls" : "fas fa-check"
}
]
}
Configure qa-config.json
To configure qa-config.json, make changes in the following configuration files:
- S3/qaservice/conf/qa-config.json
This is global configuration which will be applicable for all content models. - S3/qaservice/conf/structure/Smart Document/qa-config.json
This configuration is specific to the content model. Like in example it is for Smart Document.
To override any configuration be at global or content model level you can refer to the default qa-config.json given below.
{
"ckeditorPlugins": [
"tableaschart",
"reference-toolbar",
"changetracking",
"comment",
"note",
"figure",
"imagepicker",
"conref",
"excel",
"xref",
"calstable",
"initmeta",
"qalink",
"region",
"pastefromserver",
"proofreader",
"find",
"qaspecialchar",
"viewxml",
"workflow-status",
"tableresize",
"locksmith",
"ckeditor_wiris",
"panelbutton",
"colordialog",
"colorbutton",
"domoptimizer",
"video",
"customtab",
"selectall",
"readonlyhandler",
"imageresizer",
"data-source"
],
"toolbar": {
"mainTabs": [
{
"id": "home",
"label": "Home",
"type": "main",
"mode": "any",
"items": [
"ParaStyles",
"InlineStyles",
"Bold",
"Italic",
"Underline",
"Strike",
"Subscript",
"Superscript",
"BulletedList",
"NumberedList",
"Indent",
"Outdent",
"Find",
"viewxml"
]
},
{
"id": "insert",
"label": "Insert",
"items": [
"calstable",
"insert-table-from-server",
"insert-region-from-server",
"tableaschart",
"figure",
"imagepicker",
"video",
"excel-table",
"excel-chart",
"paste-from-server",
"QaSpecialChar",
"ckeditor_wiris_formulaEditor"
]
},
{
"id": "review",
"label": "Review",
"type": "main",
"mode": "any",
"items": [
"addComment",
"deleteComment",
"showHideComment",
"previousComment",
"nextComment",
"Tracking",
"Highlighting",
"PreviousChange",
"NextChange",
"AcceptAndMove",
"RejectAndMove",
"Accept",
"Reject",
"AcceptAllChanges",
"RejectAllChanges",
"ProofReader"
]
},
{
"id": "references",
"label": "References",
"mode": "any",
"items": [
"qalink",
"xref",
"updatexref",
"update-all-xref",
"-",
"FootNote",
"EndNote",
"Citation",
"citation-from-server",
"table-notes",
"section-notes",
"-",
"edit-block",
"save-block-component",
"save-close-block-component",
"cancel-checkout-block-component",
"refresh",
"removereference",
"pin-component-reference",
"unpin-component-reference",
"remove-component-reference"
]
},
{
"id": "table",
"label": "Table",
"mode": "edit",
"items": [
"TableTypes",
"create-table-component",
"replace-table-from-server",
"insert-table-title",
"insert-table-description",
"add-para-after-table",
"insert-row-before",
"insert-row-after",
"insert-column-left",
"insert-column-right",
"split-cells-horizontal",
"split-cells-vertical",
"merge-cells",
"row-delete",
"column-delete",
"delete-table",
"BGColor",
"TextColor",
"data-source"
]
},
{
"id": "region",
"label": "Region",
"mode": "any",
"items": [
"RegionTypes",
"create-region-component",
"insert-region-title",
"insert-para-after-region",
"replace-region-from-server",
"remove-region"
]
}
]
},
"notesPane": [
"refresh",
"FootNote",
"EndNote",
"Citation",
"table-notes",
"section-notes",
"delete"
],
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "di-display-columns",
"priority": "560",
"sort": "ASC",
"component": {
"name": "DomainValuePicker",
"valueField": "name",
"params": {
"domainName": "Display Column Names"
}
}
}
},
{
"metaconfig": {
"name": "di-column-type",
"priority": "560",
"sort": "ASC",
"component": {
"name": "DomainValuePicker",
"valueField": "name",
"params": {
"domainName": "Column Types"
}
}
}
},
{
"metaconfig": {
"name": "di-master-table",
"component": {
"name": "AssetPicker",
"params": {
"filter": "STRUCTURED_TABLE_BROWSER"
}
}
}
}
]
}
},
"blockburstingconfig" : {
"burstingrules" : [ {
"contentType" : "Smart Citation",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation"
} ],
"assetBrowserId" : "CITATION_BROWSER"
}, {
"contentType" : "Journal Article",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "journal-article"
} ],
"assetBrowserId" : "JOURNAL_ARTICLE_BROWSER"
}, {
"contentType" : "Personal Communication",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "personal-communication"
} ],
"assetBrowserId" : "PERSONAL_COMMUNICATION_BROWSER"
}, {
"contentType" : "Web Page",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "web-page"
} ],
"assetBrowserId" : "WEB_PAGE_BROWSER"
}, {
"contentType" : "Government Document",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "government-document"
} ],
"assetBrowserId" : "GOVERNMENT_DOCUMENT_BROWSER"
}, {
"contentType" : "Press Release",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "press-release"
} ],
"assetBrowserId" : "PRESS_RELEASE_BROWSER"
}, {
"contentType" : "Conference Proceedings",
"selectors" : [ {
"elementName" : "note",
"elementType" : "citation",
"elementSubType" : "conference-proceedings"
} ],
"assetBrowserId" : "CONFERENCE_PROCEEDINGS_BROWSER"
}]
}
}
In the file qa-config.json, you can make the following common configurations:
- Hide a Toolbar or Items from Ribbon
- Specify Note Types and Buttons in the Notes Pane
- Specify Section Bursting Rules
- Specify Block Bursting Rules
- Specify Default Proofreading Language
- Auto Start-up Proofreading
- Auto Start-up Tracking
- Enable DOM Optimization while Inserting Table from Excel
- Specify Minimum Number of Rows to Display on Canvas When DOM Optimization Is Enabled
- Hide Default Panes
- Check-in an Asset to Default Collection
- Map a Widget for a bodydiv
- Maintain Style while Copy-pasting Table from Excel
- Specify Changes in Meta Pane for Meta
Hide a Toolbar or Items from Ribbon
"toolbar": {
"mainTabs": [
{
"id": "home",
"label": "Home",
"type": "main",
"mode": "any",
"items": [
"ParaStyles" //This configuration enables only Paragraph styles and Home tab. You can also add or remove toolbar tabs or items from ribbon through this configuration.
]
}
]
}
Specify Note Types and Buttons in the Notes Pane
"notesPane": [
"refresh",
"FootNote",
"EndNote",
"Citation",
"table-notes", //Remove any entry from this list to hide that item from notes pane.
"section-notes",
"delete"
]
Specify Section Bursting Rules
"sectionburstingconfig": {
"burstingrules": [
{
"contentType": "Smart Section",
"sectionTypePath": "/document/section",
"assetBrowserId": "SMART_SECTION_BROWSER"
}
]
}
Specify Block Bursting Rules
"blockburstingconfig": {
"burstingrules": [
{
"contentType": "Box",
"assetBrowserId": "BOX_BROWSER",
"selectors": [
{
"elementName": "region",
"elementType": "box"
}
]
},
{
"contentType": "Smart Table",
"assetBrowserId": "STRUCTURED_TABLE_BROWSER",
"selectors": [
{
"elementName": "table"
}
]
}
]
}
Specify Default Proofreading Language
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "proofreader_defaultLanguage",
"value": "en-US"
}
]
}
Auto Start-up for Proofreading
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "proofreader_autoStartup",
"value": false //Default value is true. Set to false to disable auto startup for proofreading.
}
]
}
Auto Start-up for Tracking
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "tracking_autoStartup",
"value": true //Default value is false. Set to true to enable auto startup for tracking.
}
]
}
Enable DOM Optimization while Inserting Table from Excel
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "reference_enableDOMOptimization",
"value": true //Default value is false. Set to true to enable DOM optimization.
}
]
}
Specify Minimum Number of Rows to Display on Canvas When DOM Optimization Is Enabled
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "reference_minimumPlaceholderRows",
"value": “10”
}
]
}
Hide Default Panes
"panes": [
"preview",
"trackChanges",
"notes",
“comments”,
"properties", //Remove any pane from this list to hide it in quark author
"history",
"link",
"workflow",
"statistics",
"navigation"
]
Check-in an Asset to Default Collection
"features": {
"attributemappings": {
"attributemapping": [
{
"contentType": "Smart Citation",
"attributes": [
{
"name": "Collection Path",
"value": "Home/Parent/Child",
"indexingOption": "INITIAL_VERSION"
}
]
}
]
}
}
Map a Widget for a bodydiv
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "canvas_WidgetToBodydivMapping",
"value": [
{
"widgetName": "custom-figure",
"bodydivType": "custom-figure" //custom plugin
}
]
}
]
}
Maintain Style while Copy-pasting Table from Excel
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "excel_maintainStyleOnPaste",
"value": false //Default value is true. Set to false to remove styling while copy pasting content from excel.
}
]
}
Specify Changes in Meta Pane for Meta
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "lang",
"selectors": [
{
"element": "section", // Defines the element for which configuration will be applied
"elementType": "section", // Defines the type of element for which configuration will be applied
"sectionTypePath": "/document/section" // Defines the section path in which configuration while pe applied
"parentMetaHierarchy: "", // Defines the hierarchical path of the meta data. Example: "parentMeta1/parentMeta2
"mandatory": true, //Default is false. Set to true to validate a meta value while saving document.
"hidden": false, //Default is false. Set to true to hide a meta at particular location in document.
}
]
}
}
]
}
}
Configuration for applying quarky keywords to custom meta
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "lang",
"mapKeywords": true
}
}
]
}
}
The custom meta should be of type "attrib-multivalue" so that multiple values can be applied to it.
Specify Changes in Meta Pane for Meta Attribute Mapping
This will only works for document level attributes.
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "Region",
"selectors": [
{
"element": "section",
"elementType": "section",
"sectionTypePath": "/document"
"parentMetaHierarchy": "",
"attributeConfig": { // Specify attibute configuration here
"name" : "RegionList",
"bidirectional": true, // Open document attribute value will be set to meta
"indexingOption": "INITIAL_VERSION" or "ALL_VERSIONS"
}
}
]
}
}
]
}
}
Configure Asset picker, Domain value picker, Block picker for meta
Asset picker
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "di-master-table",
"component": {
"name": "AssetPicker",
"params": {
"filter": "STRUCTURED_TABLE_BROWSER"
}
}
}
}
]
}
}
Domain value picker
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "di-row-type",
"priority": "560",
"sort": "ASC",
"component": {
"name": "DomainValuePicker",
"valueField": "name",
"params": {
"domainName": "Row Types"
}
}
}
}
]
}
}
Block picker
"features": {
"metapane": {
"metaConfigs": [
{
"metaconfig": {
"name": "selectStep",
"component": {
"name": "BlockPicker"
}
}
}
]
}
}
These above components (asset picker, domain value picker, and block picker) can also be configured at selector level with following configuration:
{
"metaconfig": {
"name": "di-display-columns",
"priority": "560",
"sort": "ASC",
"selector": [
{
"element": "table",
"elementType": "tabletype1",
"sectionTypePath": "document",
"component": {
"name": "DomainValuePicker",
"valueField": "name",
"params": {
"domainName": "Source 1"
}
}
},
{
"element": "table",
"elementType": "tabletype2",
"sectionTypePath": "document",
"component": {
"name": "DomainValuePicker",
"valueField": "name",
"params": {
"domainName": "Source 2"
}
}
}
]
}
}