Skip to main content

How to configure track-changes content validation rules?

How to configure track-changes content validation rules?

The Track Changes Content Validation Rules Sample provides validation for the presence of tracked changes inside the document.

Configuration

To configure the Track Changes Content Validation Rules Sample, follow the steps mentioned below:

  • 1. Copy the following files to the Quark XML Author installation folder, e.g. “C:\Program Files (x86)\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges.dll
    • Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges.pdb
  • Add the highlighted EIs below to the [Language Folder]/AppConfig/AppConfig-ext/MethodInfo_ext.xml
    
    <Method id="TrackChangesValidationRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges" class="Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges.ExtensibilityMethods" method="TrackChangesValidationRule">
      <Argument type="XomRoot"/>
      <Argument type="Tokens">
        <Token>>xpath=//*[local-name()='delText']|//*[local-name()='insText']</Token>
      </Argument>
    </Method>
    <Method id="TrackChangesValidationRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges" class="Quark.CMSAdapters.Samples.XA.ContentValidation.TrackChanges.ExtensibilityMethods" method="TrackChangesValidationRuleInfo" />
    
  • ContentValidationRules/RuleSet/Rule configuration section. The sample snippet below only demonstrates configuration for the SAVE trigger, the same can be done for OUTPUT and EXPORT triggers as well.
    
    <ContentValidationRules>
      <RuleSet componentRoot="topic" productLine="busdoc">
    <Rule id="SaveRules" trigger="SAVE" condition="" policy="PROHIBIT" externalMethodIds="TrackChangesValidationRule"/>
      </RuleSet>
    </ContentValidationRules>
    
    
  • If the sample is configured with Quark Publishing Platform, you could additionally configure the condition for the rule to be triggered on a specific workflow and status. In that case the appropriate check-in or output evaluation policy also needs to be set on the workflow/status

Download Sample

How to configure Schematron content validation rules?

How to configure Schematron content validation rules?

The Schematron Content Validation Rules Sample provides a Schematron Rules Engine (http://www.schematron.com) based content assertion and validation. The system integrator can configure a rules XML that asserts document rules. The nodes that fail the document validation are flagged as failing the rule. The user can also configure the highlight color to be used for the erroneous nodes.

As a sample demonstration, the sample also provides an example Schematron rules file ‘rules.xml‘ which asserts that an author should be associated with the document.

Configuration

To configure the Content Validation Rules Sample, follow the steps mentioned below:

  • Copy the following files to the Quark XML Author installation folder, e.g. “C:\Program Files (x86)\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron.dll
    • Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron.pdb
    • rules.xml
  • Download, extract and copy the following assemblies from http://sourceforge.net/projects/dotnetopensrc (NMatrix.Schematron.0.6.zip), these provide a .Net based implementation of the Schematron specification:
    • GotDotNet.Exslt.dll
    • NMatrix.Schematron.dll
  • Add the highlighted EIs below to the [Language Folder]/AppConfig/AppConfig-ext/MethodInfo_ext.xml file
    
    <Method id="SchematronValidationRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron" class="Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron.ExtensibilityMethods" method="SchematronValidationRule">
            <Argument type="XomRoot"/>
            <Argument type="Tokens">
              <Token>ruleFilePath=rules.xml</Token>
              <Token>highlightcolor=Orange</Token>
            </Argument>
          </Method>
          <Method id="SchematronValidationRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron" class="Quark.CMSAdapters.Samples.XA.ContentValidation.Schematron.ExtensibilityMethods" method="SchematronValidationRuleInfo" >
    </Method>
    
    
  • Modify the Quark.CMSAdapters.config file to add the EI methods to the ContentValidationRules/RuleSet/Rule configuration section. The sample snippet below only demonstrates configuration for the SAVE trigger, the same can be done for OUTPUT and EXPORT triggers as well.
    
    <ContentValidationRules>
      <RuleSet componentRoot="topic" productLine="busdoc">
    <Rule id="SaveRules" trigger="SAVE" condition="" policy="PROHIBIT" externalMethodIds="SchematronValidationRule"/>
      </RuleSet>
    </ContentValidationRules>
    
    
  • If the sample is configured with Quark Publishing Platform, you could additionally configure the condition for the rule to be triggered on a specific workflow and status. In that case the appropriate check-in or output evaluation policy also needs to be set on the workflow/status

Download Sample

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 configure an NPM Package?

How to configure an NPM Package?

You can configure an NPM package from the command line, environment variables, and .npmrc files. Before you install Quark artifacts (QWC and PWC), create a .npmrc file in the root folder of an app and paste the following code in the file:


@quark:registry=https://qrk.pkgs.visualstudio.com/0fe979d5-4bc4-4a46-9db2-f0a80d796161/_packaging/qrkce/npm/registry/
@quark:always-auth=true

How to import custom elements schema?

How to import custom elements schema?

Importing custom elements schema allows an NgModule to contain non-Angular elements with dash case or element properties named with dash case.

To import CUSTOM_ELEMENTS_SCHEMA, add the following code to the file app.module.ts:

import {CUSTOM-ELEMENTS_SCHEMA} from '@angualar/core';
@NgModule({
  schemas: [ CUSTOM-ELEMENTS_SCHEMA ]
})
export class AppModule {}

How to configure callback handler?

How to configure callback handler?

The Callbacks Sample demonstrates the capability to register for events related to document save, edit and discard actions.

The system integrators can add custom code in the callbacks to achieve use cases like attribute validation before saving document to server or performing some actions before/after checkout or cancel checkout action.

Configuration

To configure the Callbacks Sample, follow the steps mentioned below:

  • Copy the following files to the Quark XML Author installation folder, e.g. “C:\Program Files\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.QPP.Callbacks.dll
    • Quark.CMSAdapters.Samples.XA.QPP.Callbacks.pdb
  • Add the highlighted EI below to the [Language Folder]/AppConfig/AppConfig-ext/MethodInfo_ext.xml file
    
    <Method id="RegisterCallbacks" assembly="Quark.CMSAdapters.Samples.XA.QPP.Callbacks" class="Quark.CMSAdapters.Samples.XA.QPP.Callbacks.ExtensibilityMethods" method="RegisterCallbacks" />
    
  • Add the highlighted below to the [Language Folder]/AppConfig/AppConfig-ext/ Connect_ext.xml file

    
    <ExtensibilityMethod id="RegisterCallbacks"/>
    

Download Sample

How to configure content validation rules?

How to configure content validation rules?

The Content Validation Rules Sample provides a set of XPath and regular expression based validation and auto resolve rules.

The system integrator can configure an XPath that selects node in the content which are then matched using the supplied Regex expression. The nodes that match the regex are flagged as failing the rule. The user can configure many such rules that the content based. Please refer to the following configuration section for examples.

The user can also configure the error message shown for the nodes and the highlight color to be used for the erroneous nodes.

As a sample demonstration, the sample also supports a regular expression based validation and automatic resolve rules. This sample maps the regex for symbols $ and € and converts them to USD and EUR respectively, If symbols are placed before numerical value. (E.g. $23 to USD23).

Configuration

To configure the Content Validation Rules Sample, follow the steps mentioned below:

  • Copy the following files to the Quark XML Author installation folder, e.g. “C:\Program Files (x86)\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.ContentValidation.dll
    • Quark.CMSAdapters.Samples.XA.ContentValidation.pdb
  • Add the highlighted EIs below to the [Language Folder]/AppConfig/AppConfig-ext/MethodInfo_ext.xml file

<Method id="TrailingLeadingSpacesValidationRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexValidationRuleInfo" >
<Argument type="Tokens" >
<Token> name=Trailing or Leading Spaces Validation Rule </Token>
<Token> description=Checks whether paragraphs have leading or trailing spaces. </Token>
</Argument>
</Method>
<Method id="TrailingLeadingSpacesValidationRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexValidationRule" >
<Argument type="XomRoot" />
<Argument type="Tokens" >
<Token>xpath=//p</Token>
<Token>regex=^\s+|\s+$</Token>
<Token>error=The node contains tracked changes.</Token>
<Token>highlightcolor=Yellow</Token>
</Argument>
</Method>

The sample also provides for auto correction of invalid rules. This can be configured as below. The following example fixes the leading and trailing spaces in a paragraph by deleting them.


<Method id="TrailingLeadingSpacesAutoResolveRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexAutoResolveRule" >
<Argument type="XomRoot" />
<Argument type="Tokens" >
<Token>xpath=//p</Token>
<Token>regex=^\s+|\s+$</Token>
<Token>replacement=</Token>
</Argument>
</Method>
<Method  id="TrailingLeadingSpacesAutoResolveRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexValidationRuleInfo" >
<Argument type="Tokens" >
<Token> name=Trailing or Leading Spaces automatic resolve rule.</Token>
<Token> description=Checks and automatically removes leading and trailing spaces from paragraphs.</Token>
</Argument >

Other examples may include currency conversion. For example look at the below configuration examples that replace the $ and € to their respective full forms.


<Method id="USDCurrencyAutoResolveRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexAutoResolveRule">
<Argument type="XomRoot"/>
<Argument type="Tokens">
<Token> xpath=//p </Token>
<Token> regex=(\$)(\s?((\d{1,3},?)+[.?\d{2}]?)) </Token>
<Token> replacement=USD$2 </Token>
</Argument>
</Method>
<Method id="USDCurrencyAutoResolveRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexValidationRuleInfo" >
<Argument type="Tokens">
<Token> name=US Dollar currency auto converter rule </Token>
<Token> description=Auto corrects $ symbols to USD in paragraphs. </Token>
</Argument >
</Method >
<Method id="EuroCurrencyAutoResolveRule" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexAutoResolveRule" >
<Argument type="XomRoot"/ >
<Argument type="Tokens" >
<Token> xpath=//p < /Token > 
<Token> regex=(\€)(\s?((\d{1,3},?)+[.?\d{2}]?))</Token>
<Token> replacement=EUR$2 </Token >
</Argument >
</Method > 
<Method id="EuroCurrencyAutoResolveRuleInfo" assembly="Quark.CMSAdapters.Samples.XA.ContentValidation" class="Quark.CMSAdapters.Samples.XA.ContentValidation.ExtensibilityMethods" method="RegexValidationRuleInfo" >
<Argument type="Tokens" >
<Token> name=Euro currency auto converter rule </Token >
<Token> description=Auto corrects € symbols to EUR in paragraphs.</Token>
</Argument>
</Method>

Modify the Quark.CMSAdapters.config file to add the EI methods to the ContentValidationRules/RuleSet/Rule configuration section. The sample snippet below only demonstrates configuration for the SAVE trigger, the same can be done for OUTPUT, EXPORT and CUSTOM triggers as well.


<ContentValidationRules>
<RuleSet componentRoot="topic" productLine="busdoc">
<Rule id="SaveRules" trigger="SAVE" condition="" policy="PROHIBIT" externalMethodIds="EuroCurrencyAutoResolveRule, USDCurrencyAutoResolveRule, TrailingLeadingSpacesAutoResolveRule"/>
</RuleSet>
</ContentValidationRules>

If rules are configured for CUTSOM trigger then it is up to the system integrator how they want to invoke these rules.

If the sample is configured with Quark Publishing Platform, you could additionally configure the condition for the rule to be triggered on a specific workflow and status. In that case the appropriate check-in or output evaluation policy also needs to be set on the workflow/status


Download Sample

How to add custom actions and tabs to Smart Document Pane?

How to add custom actions and tabs to Smart Document Pane?

This sample demonstrates the capability of adding custom tabs and context menu items in Smart Document Pane, along with handling conditional validation and execution of associated actions.

In general, using Task Pane extensibility following use cases can be achieved

Add new custom tab

You can add a custom tab based on Angular library or iframe. In case of Angular library, make sure to register your library as plug-in, using Web Application or by directly adding plugins-config.json file in the server configuration folder. Please refer Web Application extensibility documentation for more details around plug-in development

After plug-in configuration, you can specify custom tab configuration in the entity-actions.json file under assetTabs key. This file should be present in the server configuration folder under sub folder named xmlauthor. This sample is adding two custom tabs with id “qpp-iframe-tab” and “qpp-library-tab”.

Hide default tabs

You can hide default tabs by setting hidden property of the specific tab in the entity-actions.json file e.g., following configuration will hide Properties tab.


"assetTabs": [
// Other Tabs
{
"id": "qpp-properties-tab",
"hidden": true
},
// Other Tabs
]

Override label of default tabs

You can change label of default tabs by setting displayText property of the specific tab in the entity-actions.json file e.g., following configuration will change label of “Where Used” and “Links” tab


"assetTabs": [
// Other Tabs
{
"id": "qpp-links-tab",
"displayText":  "Includes",
"hidden": false
},
{
"id": "qpp-usedby-tab",
"displayText":: "Included In",
"hidden": false
}
// Other Tabs
]

Add new custom context menu actions

You can define custom context menu actions in the entity-actions.json file under assetContextMenuActions key e.g., this sample is adding following context menu actions

  • qpp-iframe-action: The type of this context menu action is “tab” and it selects iframe based custom tab (specified by tabId).
  • qpp-library-action: The type of this context menu action is “tab” and it selects Angular library based custom tab (specified by tabId).
  • qpp-custom-action: This is “default” type of context menu action. When clicked, it invokes Java Script function specified by actionHandler.

You can conditionally hide custom context menu actions by specifying visibilityHandler Java Script function.

Please note, all Java Script functions should be available as part of EntityActions object at the window level.

Hide default context menu actions

You can hide default context menu actions by setting hidden property of the specific action in the entity-actions.json file e.g., following configuration will hide Properties action.


"assetContextMenuActions": [
// Other Actions
{
"id":  "qpp-properties-action",
"hidden": true
}
// Other Actions
]

Override labels of default context menu actions

You can change label of default context menu actions by setting displayText property of the specific action in the entity-actions.json file e.g., following configuration will change label of “Go to” action


"assetContextMenuActions": [
// Other Actions
{
"id":  "qpp-go-to-action",
"displayText": "Go to content",
"hidden": false
}
// Other Actions
]

Configuration

To configure the Task Pane Sample, follow the steps mentioned below:

  • Copy the following files to the Quark XML Author installation folder, e.g. “C:\Program Files\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.QPP.TaskPane.dll
    • Quark.CMSAdapters.Samples.XA.QPP.TaskPane.pdb
  • Copy all files and folders inside config/client to the Quark XML Author installation folder.
  • Copy all files and folders inside config/server to the Platform Server configuration folder.
  • Add the highlighted EI below to the [Language Folder]/AppConfig/AppConfig-ext/MethodInfo_ext.xml file
    <Method id="RegisterJsCallbacks" assembly="Quark.CMSAdapters.Samples.XA.QPP.TaskPane" 
    class="Quark.CMSAdapters.Samples.XA.QPP.TaskPane.ExtensibilityMethods" method="RegisterJsCallbacks"/>
  • Add the highlighted below to the [Language Folder]/AppConfig/AppConfig-ext/ Connect_ext.xml file
    <ExtensibilityMethod id="RegisterJsCallbacks"/>

Download Sample