How to configure Quark XML Author to use external methods?
Programming for Quark XML Author
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
{
//read all the delegates here.
//The namespaces for all delegates are Quark.XA.ExtensibilityDelegates.
IsEditableElement isEditableElementDelegate = delegates[0] as IsEditableElement;
if(isEditableElementDelegate != null && node != null && node is XmlElement)
{
// This delegate indicates whether a node is editable or not.
// This is based on values associated to a proprietary
// Invision attribute called inv:access where
// xmlns:inv="urn:xpressauthor:xpressdocument".This attribute is usually
// applied in another EI method. A typical example would be a document coming
// from a CMS system with certain nodes
// tagged as non-editable, On an open, this EI method would read the non-editable
// tag from this document and add a Quark XML Author
//tag (inv:access="read-only") identifying it as a readOnly chunk.
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.
Calling Quark XML Author from an External Method with Delegates
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.
For more information, see the System Administrator Guide.