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 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 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

How to configure the XML processor?

How to configure the XML processor?

The XML Processor Sample demonstrates IXMLProcessor specialization implementation based on the xslt. Sample is using xslt to trim XML references node data if character count is greater than 25.

Configuration

To configure the XML Processor Sample Sample, follow the steps mentioned below:

  • Copy following files to the Quark XML Author installation folder, e.g. “C:\Program Files (x86)\Quark\Quark XML Author”
    • Quark.CMSAdapters.Samples.XA.XMLProcessor.dll
    • Quark.CMSAdapters.Samples.XA.XMLProcessor.pdb
    • Quark.CMSAdapters.Samples.XA.XMLProcessor.xslt
  • Modify the Quark.CMSAdapters.config file as follows
    • Add the highlighted content below to the section:
    
<appSettings>
<!-- Other -->
<add key="IXMLProcessor" value="Quark.CMSAdapters.Samples.XA.XMLProcessor"/>
<!-- Other -->
</appSettings>
    

Download Sample

How to define your own XML schema?

How to define your own XML schema?

The Quark XML Author Structure (XAS) is the Quark XML Author equivalent of an XML schema file, in that it defines the allowed components of a document, and their relationships to each other. Quark XML Author uses the XAS to provide more flexibility than would be present with a standard XML Schema Definition (XSD) or Document Type Definition (DTD).

For more information, see the System Administrator Guide.