Skip to main content

How to map Check-in/Asset Picker attributes?

How to map Check-in/Asset Picker attributes?

  • name: This is the name of the attribute.
  • value: This is the value of the attribute.
  • indexingOption: You can specify indexingOption with the following values:
    • INITIAL_VERSION: Set this value when you want to trigger indexing only for the first version of the document
      This is the default value of the indexingOption
    • ALL_VERSIONS: Set this value when you want to trigger indexing for every revision of a document.

qa-config.json (available for every content type)

"features": {
    "attributemappings": {
        "attributemapping": [
            {
                "contentType": "Smart Document",
                "attributes": [
                    {
                        "indexingOption": "INITIAL_VERSION",
                        "name": "Collection Path",
                        "value": "Home/Documents"
                    },
                    {
                        "indexingOption": "ALL_VERSIONS",
                        "name": "Date Type Attribute",
                        "value": "2022-03-03"
                    },
                    {
                        "indexingOption": "ALL_VERSIONS",
                        "name": "Collection Path",
                        "value": "../../Sections"
                    },
                    {
                        "indexingOption": "ALL_VERSIONS",
                        "name": "Multi Valued",
                        "value": "G1,G2"
                    }
                ]
            }
    }
}

How to configure Quark Author to add panes, plugins, widgets, and navigation menu items?

How to configure Quark Author to add panes, plugins, widgets, and navigation menu items?

To configure Quark Author to add panes, plugins, widgets, and navigation menu items:

  1. Create a folder ext in the directory qaservice in the s3 bucket.

  2. Create a folder feature in the folder ext.

  3. Create a folder for the feature you want to add in the folder feature and name it with the name of the feature. For example, if you want to add left pane, the folder structure should be – qaservice/ext/feature/left_pane. The folder contains the manifest.json file which lists the metadata for all the modules (plugins, panes, nav menu items, and so on) for that feature. The manifest file has the properties “version” and “modules”. The property “modules” contains the meta for the type of extensibility and has the following attributes:

    1. type: “qa-canvas-plugin” for ck-editor plugin/ “qa-extensible-pane” for the extensible side panes / “qa-nav-menu” for adding navigation menu items, “qa-extensible-toolbar” for adding extensible toolbar.
    2. name: A unique name of the feature. For plugins, the name attribute must match the original name of the plugin.
    3. bundle: The JS bundle location when the feature is a plugin, widget, or a command.
    4. displayName: The name of the plugin icon, the pane heading, or the menu label on the User Interface.
    5. iconUrl: The location of the icon for the panes. This value can be both absolute (http://test.com/icon.png) or relative (/assets/icon.png).
    6. frameUrl: The index URL of the frame in the pane, menu dialog or extensible toolbar on the User Interface. This value can be both – absolute (http://example.com) or relative (frame_data/index.html).
    7. position: The position of a pane (left or right) in the author window.
    8. show: A Boolean value to show/hide the navigation menu options.
    9. action: Name of the action; for example, ckeditor command for actionType command, API endpoint for actionType endpoint. For navigation menu option, when the attribute hasChildren is set to true for an item, you should not specify the property action.
    10. actionType: This attribute specifies the type of action to be performed when you select a navigation menu item.
    11. dialogConfig: This is an optional attribute that specifies the height and width of the dialog box to be opened when you select a navigation menu item. By default, the dimension of the dialog box is 600px X 600px.
    12. showInReadOnly: A Boolean value to show/hide a navigation option when the currently open section is read only.
    13. showInAllSections: A Boolean value to show/hide a navigation option in the all the sections.
    14. menu: This attribute sets the id of the menu where the navigation option should be placed
    15. hasChildren: A Boolean value to specify whether a navigation option has further children item(s) or not.
    16. toolBarHeight: This attribute specifies the height of the extensible toolbar in number of pixels
  4. Add the feature name to the “extensions” property array of the file qa-config for that respective content type. When you specify the “panes” property explicitly in the file qa-config, also add the additional pane names to panes array.

  5. To configure navigation options that are already available, specify the array type property “navMenus” in the file qa-config, which takes in menu config object with the following properties:

    • id (string): refers to a unique id for a navigation menu option
    • show (Boolean): to hide/unhide the menu option
    • label (string): refers to the new display name for that option
  6. When you specify a plugin as a feature that utilizes a User Interface toolbar button, add the toolbar property to specify the toolbar structure and the position of the new button in the qa-config file.

For more information on developing a custom CKEditor plugin, see documentation.

What is a .npmrc file?

What is a .npmrc file?

A .npmrc file is the configuration file for an NPM (node package manager) package, which allows you to define the settings on how the NPM package should function in response to the commands that you run. A .npmrc file in the root of a project (as a sibling to the files node_modules and package.json) sets the configuration values that are specific to that project.

Here, the .npmrc file allows you to access Quark artifacts – QWC and PWC in your application.

How to add custom tags?

How to add custom tags?

The Custom Tags plugin adds custom tags into the authoring canvas. The plugin allows you to add button in toolbar, invoke dialog, and apply tags in the content.

To add Custom Tags plugin to Quark Author:

  1. Create a folder feature in the directory qaservice/ext in the s3 bucket.
  2. Create a folder customTags in the folder feature.
  3. Add the Custom Tags plugin to the folder customTags.

The name of the folder customTags must be the same as you have specified in the file qa-config.json under the property “extensions.”

Sample qa-config.json (available for every content type)

"extensions": [
    "customTags"
]
"toolbar": {
    "mainTabs": [
        {
            "id": "home",
            "label": "Home",
            "type": "main",
            "mode": "any",
            "items": [
                "customTagBtn" // Custom button defined in plugin.js
            ]
        }
    ]
}

The folder customTags also must contain the file “manifest.json” with the key “modules” with “type” defined as “qa-canvas-plugin” and “bundle” defined as JavaScript file path.

Sample manifest.json

{
    "version": "0.0.1",
    "modules": [
        {
            "type": "qa-canvas-plugin",
            "name": "customTags",
            "bundle": "customTags/plugin.js"
        }
    ]
}

How to add a callback handler?

How to add a callback handler?

The Callback Handler plugin (window.QA.author.qaCallbackManager) registers various callbacks to allow you to perform additional tasks.

To add Callback Handler plugin to Quark Author:

  1. Create a folder feature in the directory qaservice/ext in the s3 bucket.
  2. Create a folder callback-handler in the folder feature.
  3. Add the Callback Handler plugin to the folder callback-handler.

The name of the folder callback-handler must be the same as you have specified in the file qa-config.json under the property “extensions.”

Sample qa-config.json (available for every content type)

"extensions": [
    "callback-handler"
]

The folder callback-handler also must contain the file “manifest.json” with the key “modules” with “type” defined as “qa-canvas-plugin” and “bundle” defined as JavaScript file path.

Sample manifest.json

{
    "version": "0.0.1",
    "modules": [
        {
            "type": "qa-canvas-plugin",
            "name": "statusValidation",
            "bundle": "statusValidation/plugin.js"
        }
    ]
}

How to add a custom figure?

How to add a custom figure?

The Custom Figure plugin inserts/deletes custom figure into the authoring canvas. The plugin allows you to add buttons in toolbar, to add custom styles, to insert element in the authoring canvas and to add context menu for the same.

To add Custom Figure plugin to Quark Author:

  1. Create a folder feature in the directory qaservice/ext in the s3 bucket.
  2. Create a folder customFigure in the folder feature.
  3. Add the Custom Figure plugin to the folder customFigure.

The name of the folder customFigure must be the same as you have specified in the file qa-config.json under the property “extensions.”

Sample qa-config.json (available for every content type)

"extensions": [
    "customFigure"
]
// Map a widget for a bodydiv
"editorconfigs": {
    "ckeditorconfigs": [
        {
            "name": "canvas_WidgetToBodydivMapping",
            "value": [
                {
                    "widgetName": "custom-figure",
                    "bodydivType": "custom-figure"
                }
            ]
        }
    ]
}
"toolbar": {
    "mainTabs": [
        {
            "id": "home",
            "label": "Home",
            "type": "main",
            "mode": "any",
            "items": [
                "customFigureBtn" // Custom button defined in plugin.js
            ]
        }
    ]
}

The folder customFigure also must contain the file “manifest.json” with the key “modules” with “type” defined as “qa-canvas-plugin” and “bundle” defined as JavaScript file path.

Sample manifest.json

{
    "version": "0.0.1",
    "modules": [
        {
            "type": "qa-canvas-plugin",
            "name": "customFigure",
            "bundle": "customFigure/plugin.js"
        }
    ]
}

Quark Author Configuration files

Quark Author Configuration files

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:

  1. Map a Query for Document Templates
  2. Show/Hide Template Meta while Initiating Document
  3. Show/Hide a Document Content Type in New Document Menu
  4. Enable Older Versions Selection of an Asset in the Asset Picker Dialog
  5. 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

In the file qa-config.json, you can make the following common configurations:

  1. Hide a Toolbar or Items from Ribbon
  2. Specify Note Types and Buttons in the Notes Pane
  3. Specify Section Bursting Rules
  4. Specify Block Bursting Rules
  5. Specify Default Proofreading Language
  6. Auto Start-up Proofreading
  7. Auto Start-up Tracking
  8. Enable DOM Optimization while Inserting Table from Excel
  9. Specify Minimum Number of Rows to Display on Canvas When DOM Optimization Is Enabled
  10. Hide Default Panes
  11. Check-in an Asset to Default Collection
  12. Map a Widget for a bodydiv
  13. Maintain Style while Copy-pasting Table from Excel
  14. Specify Changes in Meta Pane for Meta
  15. 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",
                        "displayfilters": [
                            {
                                "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.
                                "selectors": [
                                    {
                                        "element": "section",
                                        "elementType": "section",
                                        "sectionTypePath": "/document/section"
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    }