Custom Interface Connector
If primedocs is called from a specialist application, specific data can be transferred to the template. Element and attribute names are freely selectable or can be defined and adapted by the specialist application. For each interface a unique interface name must be defined. This enables primedocs to transform the data internally and prepare it for document generation.
<Interface Name="ExampleInterface" />
Example configuration:
<Function name="CustomInterfaceConnector" id="70E94788-CE84-4460-9698-5663878A295B">
<Arguments>
<Interface Name="ExampleInterface">
<Node Id="KeyA">ValueA</Node>
<Node Id="KeyB">ValueB</Node>
<Node Id="KeyC">ValueC</Node>
</Interface>
</Arguments>
</Function>
Transformation
primedocs transforms the specialist application's XML into an internal format. To do this, the document function Connect interface definition must be appended and configured in the template.
It is possible to pass images in the form of a URL or in Base64 format. To do this, the Type="Image" attribute must also be specified in the node element. If a URL is passed, the client and/or the server must have read access to the images.
Example of a transformation configuration; the element contents are used as sample contents during the design phase:
<InterfaceDescription Name="CollectionDemo">
<Node Id="SimpleBindingOne" XPath="//SimpleBindingOne">SimpleBindingOneText</Node>
<Node Id="SimpleBindingTwo" XPath="//SimpleBindingTwo">SimpleBindingTwoText</Node>
<Node Id="SimpleBindingThree" XPath="//SimpleBindingThree">SimpleBindingThreeText</Node>
<NodeCollection Id="ListBinding" XPath="//List/EachElement">
<Node Id="Firstname" XPath="./FirstName" /> // these Elements are beneath <EachElement>
<Node Id="Surname" XPath="./Surname" /> // these Elements are beneath <EachElement>
<NodeCollection Id="Orders" XPath="./Orders/Order"> // even Collection in Collections are supported
<Node Id="OrderId" XPath="./Id" />
<Node Id="OrderProduct" XPath="./Product" />
</NodeCollection>
</NodeCollection>
<!-- Bild wird im Base64-Format übergeben -->
<Node Id="PictureSample" Type="Image" XPath="//PictureSample" >iVBORw0KGgoAAAANSUhEUgAAAF8AAAB4CAIAAAAbh7ksAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu
MTHaDTpWAAAA8UlEQVR4Xu3QQQ0AIAwAMfz/UIS0oWCnoEkV9Nw3bOwUO8VOsVPsFDvFTrFT7BQ7
xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvF
TrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VO
sVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6x
U+wUO8VOsVPsFDvFTrFT7BQ7xc7uzQeYsdPzpHNxAAAAAABJRU5ErkJggg==</Node>
<!-- Bild wird als URL übergeben -->
<Node Id="PictureFilePathSample" Type="Image" XPath="//PictureFilePathSample" /> <!-- The file path needs file:// as a prefix -->
</InterfaceDescription>
Example call in German, configuring a transformation:
Example of the associated connect files:
Data CustomInterface
If the interface is specified with type='Data', no configured interface must be stored in the configuration. The data is interpreted as CustomXmlNodes and is available in the editor as well as in the document.
Example:
PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland