What is Extensibility Interface?
Quark XML Author was designed to be extensible, so that it can be easily integrated
with custom and third party (external) applications. Quark XML Author communicates
with external applications via the Extensibility Interface (EI) section of the application and document configuration files. Functions that are document
type specific are specified in the DocConfig file. Functions that may be invoked for
all document types are specified in the application-level configuration file (AppConfig).
External applications typically are in the form of a Dynamic Link Library (DLL) or
an EXE. A DLL contains a set of functions, each of which has its own parameters. EI
is the mechanism by which these functions are called. EI must be told the details
of “when” and “how” a function is called.
This chapter covers the Extensibility Interface from two major viewpoints: programming
external methods for use with Quark XML Author, and configuring Quark XML Author to
make use of those external methods.
Section 17 of this manual, “Integration with Content Management Systems”, discusses
integrating Quark XML Author with Content Management Systems, and contains several
examples of creating Extensibility Interface methods. In addition, chapter 18, “Configuring
Smart Paste”, contains an EI method example.
Quark XML Author can be configured to call any external application that exposes public
methods. The person configuring Quark XML Author simply needs to know the assembly,
class, and method name and what parameters the method expects. For example, the following
method requires that an XML node and an array of Delegates be passed to it:
public bool IsEditableElement(XmlNode node, Delegate[] delegates)
{
try
{
IsEditableElement isEditableElementDelegate = delegates[0] as IsEditableElement;
if(isEditableElementDelegate != null && node != null && node is XmlElement)
{
return isEditableElementDelegate(node);
}
}
catch(Exception e)
{
System.Diagnostics.Debug.WriteLine("IsEditableElement Exception :" + e.Message + "\nStackTrace:" + e.StackTrace);
}
return false;
}
As long as the assembly and class to which this method belongs are known, Quark XML
Author can be configured to supply the XML node and any delegates that the method
requires. The method would do its work and return a Boolean value to Quark XML Author
to be acted upon.
In addition to being able to call external methods, Quark XML Author exposes its own
methods that can be called by external methods via delegates. Delegates are function
pointers to Quark XML Author methods that can be passed on to external DLLs. The External
DLLs may then call the methods to perform operations within the application. Custom
methods can accept delegates by implementing the Delegate[] argument type.