CustomInterfaceConnector
If OneOffixx 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 OneOffixx 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
OneOffixx 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>
<!-- Image is passed in Base64 format -->
<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>
<!-- Image is passed as URL -->
<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">
<Allgemein>
<Telefon_a>#Telefon_a#</Telefon_a>
<Telefon_b>#Telefon_b#</Telefon_b>
<Homepage>#Homepage#</Homepage>
<akadTitel>#akadTitel#</akadTitel>
<TelefonSekretariat>#TelefonSekretariat#</TelefonSekretariat>
<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>
</Allgemein>
<Auftrag>
<EntscheidDatum>#EntscheidDatum#</EntscheidDatum>
<VersandDatum>#VersandDatum#</VersandDatum>
<SBEntscheid>#SBEntscheid#</SBEntscheid>
<VerfuegungTitel>#VerfuegungTitel#</VerfuegungTitel>
<verrechnungstabelle>
<vteintrag>
<vtperiode>@01.01.1900-01.01.2016</vtperiode>
<vtanspruch>@11'600.00</vtanspruch>
<vtzurueckbezahlt>@1'234.00</vtzurueckbezahlt>
<vtoffen>@5'000.00</vtoffen>
</vteintrag>
<vteintrag>
<vtperiode>@01.01.1901-01.01.2016</vtperiode>
<vtanspruch>@11'600.01</vtanspruch>
<vtzurueckbezahlt>@1'234.01</vtzurueckbezahlt>
<vtoffen>@5'000.01</vtoffen>
</vteintrag>
</verrechnungstabelle>
<VTtotalText>#VTtotalText#</VTtotalText>
<VTTotal>#VTTotal#</VTTotal>
</Auftrag>
</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 are not passed in a NodeCollection -->
<SimpleBindingOne>1</SimpleBindingOne>
<SimpleBindingTwo>2</SimpleBindingTwo>
<SimpleBindingThree>3</SimpleBindingThree>
<List>
<!-- Outer NodeCollection -->
<NodeCollection Id="Row1">
<FirstName>Max</FirstName>
<Surname>Muster</Surname>
<Orders>
<!-- Nested NodeCollection in the <Orders> element of the parent NodeCollection -->
<NodeCollection Id="Row1">
<Id>123-321</Id>
<Product>Keyboard</Product>
</NodeCollection>
</Orders>
</NodeCollection>
</List>
<!-- Image is passed in Base64 format -->
<PictureSample>iVBORw0KGgoAAAANSUhEUgAAAF8AAAB4CAIAAAAbh7ksAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu
MTHaDTpWAAAA8UlEQVR4Xu3QQQ0AIAwAMfz/UIS0oWCnoEkV9Nw3bOwUO8VOsVPsFDvFTrFT7BQ7
xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvF
TrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VO
sVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6xU+wUO8VOsVPsFDvFTrFT7BQ7xU6x
U+wUO8VOsVPsFDvFTrFT7BQ7xc7uzQeYsdPzpHNxAAAAAABJRU5ErkJggg==</PictureSample>
<!-- Image is passed as URL -->
<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="Vorname">Max</Text>
<Text Id="Ort">Eschlikon TG</Text>
<Text Id="Nachname">Mustermann</Text>
<Text Id="Zivilstand">verheiratet</Text>
<DateTime Id="Geburtsdatum">1998-09-01</DateTime>
<Collection Id="Telefonnummern">
<Element>
<Text Id="Mobil">012 345 67 89</Text>
<Text Id="Festnetz">012 345 67 89</Text>
</Element>
</Collection>
</Interface>
</Arguments>
</Function>