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:

<Function name="CustomInterfaceConnector" id="70E94788-CE84-4460-9698-5663878A295B"> <Arguments> <Interface Name="ExampleInterface"> <General> <Phone_a>#Phone_a#</Phone_a> <Phone_b>#Phone_b#</Phone_b> <Homepage>#Homepage#</Homepage> <acadTitel>#acadTitel#</acadTitel> <PhoneSecretary>#PhoneSecretary#</PhoneSecretary> <ObjKeyOrgProfile>#ObjKeyOrgProfile#</ObjKeyOrgProfile> <PictureFilePath>http://www.mycompany.com/files/pics/Bild_1234.jpg</PictureFilePath> <Picture>iVBORw0KGgoAAAANSUhEUgAAAF8AAAB4CAIAAAAbh7ksAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu MTHaDTpWAAAA8UlEQVR4Xu3QQQ0AIAwAMfz/UIS0oWCnoEkV9Nw3bOwUO8VOsVPsFDvFTrFT7BQ7 xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvF TrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VO sVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6x U+wUO8VOsVPsFDvFTrFT7BQ7xc7uzQeYsdPzpHNxAAAAAABJRU5ErkJggg==</Picture> </General> <Order> <DecisionDate>#DecisionDate#</DecisionDate> <ShippingDate>#ShippingDate#</ShippingDate> <SBDecision>#SBDecision#</SBDecision> <DispositionTitle>#DispositionTitle#</DispositionTitle> <SettlementTable> <stentry> <stperiod>@01.01.1900-01.01.2016</stperiod> <stclaim>@11'600.00</stclaim> <strepaid>@1'234.00</strepaid> <stopen>@5'000.00</stopen> </stentry> <stentry> <stperiod>@01.01.1901-01.01.2016</stperiod> <stclaim>@11'600.01</stclaim> <strepaid>@1'234.01</strepaid> <stopen>@5'000.01</stopen> </stentry> </SettlementTable> <STtotalText>#STtotalText#</STtotalText> <STTotal>#STTotal#</STTotal> </Order> </Interface> </Arguments> </Function>

 

Example of the associated connect files:

<?xml version="1.0" encoding="UTF-8"?> <OneOffixxConnectBatch xmlns="http://schema.oneoffixx.com/OneOffixxConnectBatch/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Entries> <OneOffixxConnect> <Arguments> <LanguageLcid>2055</LanguageLcid> <TemplateId>a032bdcc-78b9-4eda-a75f-d8394226b91f</TemplateId> </Arguments> <Function name="CustomInterfaceConnector" id="70E94788-CE84-4460-9698-5663878A295B"> <Arguments> <Interface Name="CollectionDemo"> <!-- SimpleBindings werden nicht in einer NodeCollection übergeben --> <SimpleBindingOne>1</SimpleBindingOne> <SimpleBindingTwo>2</SimpleBindingTwo> <SimpleBindingThree>3</SimpleBindingThree> <List> <!-- Äussere NodeCollection --> <NodeCollection Id="Row1"> <FirstName>John</FirstName> <Surname>Doe</Surname> <Orders> <!-- Verschachtelte NodeCollection im Element <Orders> der übergeorneten NodeCollection --> <NodeCollection Id="Row1"> <Id>123-321</Id> <Product>Keyboard</Product> </NodeCollection> </Orders> </NodeCollection> </List> <!-- Bild wird im Base64-Format übergeben --> <PictureSample>iVBORw0KGgoAAAANSUhEUgAAAF8AAAB4CAIAAAAbh7ksAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu MTHaDTpWAAAA8UlEQVR4Xu3QQQ0AIAwAMfz/UIS0oWCnoEkV9Nw3bOwUO8VOsVPsFDvFTrFT7BQ7 xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvF TrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VO sVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6x U+wUO8VOsVPsFDvFTrFT7BQ7xc7uzQeYsdPzpHNxAAAAAABJRU5ErkJggg==</PictureSample> <!-- Bild wird als URL übergeben --> <PictureFilePathSample>file://C:/Users/user/Desktop/Image3.png</PictureFilePathSample> </Interface> </Arguments> </Function> </OneOffixxConnect> </Entries> </OneOffixxConnectBatch>

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:

<Function name="CustomInterfaceConnector" id="70E94788-CE84-4460-9698-5663878A295B" xmlns=""> <Arguments> <Interface Name="ReportAusFachapplikation" type="Data"> <Text Id="ID">42</Text> <Text Id="FirstName">John</Text> <Text Id="City">Bern BE</Text> <Text Id="LastName">Doe</Text> <Text Id="MaritalStatus">married</Text> <DateTime Id="Birthdate">1980-09-01</DateTime> <Collection Id="PhoneNumbers"> <Element> <Text Id="Mobile">012 345 67 89</Text> <Text Id="Phone">012 345 67 89</Text> </Element> </Collection> </Interface> </Arguments> </Function>

PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland