Pagero Server Connect

This guide contains technical information regarding the installation and updating Pagero Server Connect. Additionally it contains information about advanced features and network connectivity.

Table of Contents

  1. Installation Overview
  2. Software Upgrades
  3. Multiuser environment / Automated Processing
  4. Network Connectivity
  5. Testing the installation of Pagero Printer
  6. Advanced Features

 

1. Installation Overview

This document serves as an installation guide for those components that are needed to enable:

Single user environments. A single user environment is defined as a PC where one user at a time accesses Pagero’s e-invoicing software.

Multi user environments with manual processing. In this case, a multi user environment is when a PC with fast user switching or a server is used for access to Pagero’s e-invoicing software. This means that Pagero Connect is used as the communication software (see section 3).

Multi user environments with automated processing. In this case, a multi user environment is when a server is used for access to Pagero’s e-invoicing software, and when communication is fully automated using Pagero Server Connect as the communication software.

Definition of installation components

This section describes the different components needed to integrate your invoicing system with Pagero’s e-invoicing service:

 

1.png

 

  • Invoicing system. This is your invoicing system. Any changes needed in that system to enable e-invoicing is beyond the scope of this document.
  • Pagero Printer. Pagero Printer is a printer driver (PostScript compatible driver only) installed and made available to the invoicing system either as a local printer or a network printer. The printer will create PDF files from the print stream and store these on a configurable path on the file system. Depending on how your invoice system interacts with the printer, one PDF may contain one or several invoices. Pagero Online’s e-invoice service will split the PDF into individual invoices if needed. The printer runs as a user SYSTEM on the server/PC where it is installed.
  • Pagero Connect. Pagero Connect is a piece of communication software for single user system. Its job is to transport files created by the printer (or another application) to Pagero Online’s e-invoice service.
  • Pagero Server Connect. Pagero Server Connect is a piece of communication software, for multi user systems. Its job is to transport files created by the printer (or another application) to Pagero Online’s e-invoice service.
System requirements

The following requirements apply:

  • Java 11 installed (https://jdk.java.net/archive/)
  • RAM: 512 MB or more
  • Processor: 1GHz single core or better
  • Pagero Printer is developed for Windows platforms and supports the following operating systems: Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows XP Professional, Windows Vista Professional, Windows 7 Professional and Windows 8 Pro and Windows 10.
  • Pagero Connect and Pagero Server Connect are Java based, and have been tested on the following operating systems: Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows XP Professional, Windows Vista Professional, Windows 7 Professional, Windows 10, Ubuntu Linux and Mac OS X.
Network connectivity

The following ports need to be open to the Internet:

  • Pagero Connect: Port 443 for connection to *.pageroonline.com (www.pageroonline.com, c1.pageroonline.com, c2.pageroonline.com etc)
  • Pagero Server Connect:
    • Ports 80 and 443 for connection to www.pageroonline.com (document transfer)
    • A configured SMTP Server for mail notifications.
    • For version checks, Pagero Server Connect initiates connections to
    • For error reports, Pagero Server Connect version 1.17 and later initiates connections to api.pageroonline.com on port 443. Error reporting can be disabled.

For connectivity on the internal network, we require that Pagero Printer be accessible (as a local or network printer) from the invoicing system, that the printer can store files (temporarily) locally on the printer server, and that Pagero Connect and Pagero Server Connect can access the files on the printer server over the network if installed on a different server.

Where to install?
  • For a single user systems, we recommend installation on a local PC.
  • For multi user systems, or systems where the access to the invoicing system is through Terminal Service, Remote Desktop or Citrix desktop, we recommend installation on the server.

 It is possible to install the printer as a network printer (i.e. install the printer on a separate server dedicated to printers). We recommend this for multi users only.

 

 

2. Software Upgrades

If you are running the Pagero Server Connect software, a version check will occur upon every start of the application. If a newer version is available that requires you to upgrade, an email will be sent to the email address configured in the application. In case you receive an upgrade notification, follow steps below.

Upgrading Pagero Server Connect
  1. Make sure to pause the scheduler for Pagero Server Connect.
  2. Open a file explorer and browse for the installation folder for Server Connect. We want to keep the folder until the upgrade is done. Rename the folder, for example, by adding a date to the folders name.
  3. Create a new folder for the Pagero Server Connect Software.
  4. Log in to Pagero Online’s website (www.pageroonline.com). Go to Support - Downloads. Click the symbol 1.pngto download a zip file containing the installation.
  5. Extract the files to the new folder you created above. The folder should now contain the files listed in chapter 5.
  6. Copy the configuration file (config.xml) from the “old” install folder.
  7. Make sure that your scheduling software points to poscripted.jar and start the scheduler again.
  8. Upgrade is done.

 

3. Multiuser Environment / Automated Processing

Installation of a standalone virtual printer. Pagero Printer is available at Pagero Online’s web site (www.pageroonline.com). Sign in and go to Support - Downloads. Click the 1.png symbol to download the installation file. Follow the instructions on the page to install the printer as a standalone printer.

Making the printer a network printer (if applicable)
  1. Set the paths for prints (they will be saved on a local disc before transfer to Pagero Online). Open the file, printsettings.ini, which is in the folder Pagero Connect in the program folder (c:\Program, Program Files, Program Files (x86)). In this file there is a property, printTargetStandalonePrinter. Give this a value, which is a path to a folder.
    All printed invoices will be directed to this path. Note that every \ in the path, must be entered twice, for example, c:\\pagero\\invoices. You can also enter, c:\pagero\invoices. This folder must be located on the same computer that the printer is installed on.
  2. To avoid sending partially created files, set the configuration parameter temporaryPdfAsFile-OrDir=temp where temp is a subdirectory to the printTargetStandalonePrinter above.
    The file will then be written to the temp directory first, and then moved to the directory given in printTargetStandalonePrinter.
  3. Make sure the System account has read and write rights to the folder given above.
  4. If another user (than System) is used for scheduling Pagero Server Connect (see next section), then make sure that user has read and write access to the folder created in step 1.
  5. Share the printer for use in network by right-clicking the printer and select Share… Make sure all users that need access to the printer can access it.
Pagero Server Connect for communication

This section describes the installation procedure for Pagero Server Connect.

Pagero Server Connect is a java based client used to communicate with Pagero’s central server, in order to receive and send electronic documents. The scripted version faciliates fully automated communication. The application communicates using https with the Pagero Online service where documents are received and processed for further distribution to document recipient.

Instructions

This section contains instructions for installing Pagero Server Connect. Log in to Pagero Online’s website (www.pageroonline.com). Go to Support - Downloads. Click the 2.png symbol to download a zip file containing the installation.

Zip file content
The zip file should contain the following files:

  • changes.txt
  • config_example.xml
  • config_fs.xml
  • FileSplitt.bat
  • FileSplitt_And_ServerConnect.bat
  • install.txt
  • invis.vbs
  • NTEventLogAppender.dll
  • Pagero Server Connect.xml
  • PageroServerConnect-jar-with-dependencies.jar
  • PageroServerConnect-without-dependencies.jar
  • ServerConnect.bat
  • log folder
  • licencse folder
  • files folder
  • endorsed/xerceslmpl-2.11.0.jar
  • endorsed/xml-apis-2.11.0.jar 

Installation
Unpack the files in dedicated folder, and check that all files in the list are included. For support and tracking, Pagero recommend the path contain Pagero.
Example: C:\Program\Pagero\Poscripted
Edit config.xml (save an unedited version for backup).
Define log catalouge and log level. Add SMTP mail server and email group.

  • Pagero recommends that a specific email-group is created and used in order to minimize configuration in config.xml. Relevant users is then added and edited in the email-group.
  • Make sure the sending part (email-account) has the right to send mail via the email-server.

Configure the application
Multiple companies are added through copy and paste of the content:

 
<company name="Company 1" companyID = "">
  </company>

Pagero account: user & password. Account information is provided by Pagero Service Center and through confirmation mail.

Then define the following folders:
prodPath=”/home/prod”
testPath=”/home/test”
workPath=”/home/tmp”

  • If both sending and receiving through Pagero, define and configure both Inbox and Outbox settings.
  • All folders must be manually created.
  • Pagero strongly recommend all folders are created on the local server.

Finally, save and exit config.xml

  • In the event, that the folders used for reading and writing files are mounted devices, use a UNC path to indicate the location, like this: \\\\unit\path.
  • When using Outbox to send files, files should not be copied to the folder Pagero Connect reads from. This is because the partially copied file may be sent. Copy files to a different folder on the same disk, then move the file to the folder from where Pagero Server Connect reads.

Enable attachment handling for outbond traffic
The server connect application supports automatic attachment document binding using file name conventions. Use the following attributes on the outbox configuration element, to enable attachment handling.

ATTRIBUTE DESCRIPTION
subDocAware If true, outbox will be aware of sub documents (Attachments)
masterDocRegexp Regular expression for file name that identifies a master document (i.e. invoice) and has a group that extracts the document id.
subDocRegexp Regular expression for file name that identifies a sub document (i.e. attachment) and has a group that extracts the master document id.
subDocPresentationRegexp Regular expression for file name that identifies a presentation sub documentation and has a group that extracts the master document id.

Internet access through proxy
Follow the instructions below, if your company uses a proxy to access the Internet.

! Note that we do not currently support authenticated proxies. That is, proxies that require authentication for access.

Define the following environment variables:
JAVA_RUNTIME=C:\Program\Java\jre6 #The path to your Java runtime installation
PROXY_HOST=localhost #The proxy server host name
PROXY_PORT=8888 #The proxy server host port

Use this command line, when scheduling Pagero Server Connect:
%JAVA_RUNTIME%\bin\java
– Djavax.net.ssl.trustStore=%JAVA_RUNTIME%\lib\security\cacerts
– Djavax.net.ssl.trustStorePassword=changeit -Dhttps.proxyHost=%PROXY_HOST%
– Dhttps.proxyPort=%PROXY_PORT% -Dhttp.proxyHost=%PROXY_HOST%
– Dhttp.proxyPort=%PROXY_PORT% -jar postcripted-jar-with-dependencies.jar -config
config.xml

Scheduler
A scheduler is used to schedule sending/receiving of electronic invoices. In this example: Windows default Schedule.

User & Rights
Pagero recommends a specific user purely defines to execute the job. Choose/Create a specific (AD) user, with adequate rights for executing the job, or add user on local server/computer.

Configuration Windows Scheduler

  1. Define java: Example: C:\Program\Java\jre6\bin\ javaw.exe
  2. Set name to: Pagero Connect
  3. Choose interval, (editable and specifiable later).
  4. Define user & Password
  5. Choose: Advanced Settings
  6. Done

Alternatively import included task from the PageroServerConnect-folder: Pagero Server Connect.xml directly into the Windows Task Scheduler. 

Advanced settings/Activity

Option 1 – Use provided bat script(s)
Requires the vb script engine is installed and active.
Edit ServerConnect.bat and set the following parameters to fit your environment.

SET  PAGERO_ SC_CONFIGFILE  –  Configurationfile for serverconnect
SET  PAGERO_SC_LOGMODE  –  FILE or SYSTEM
SET  PAGERO_SC_LOGPATH  –  Path for your logs
SET  PAGERO_SC_MAILSERVER  –  servername:port
SET  PAGERO_SC_LOGLEVEL  –  INFO or WARN
SET  PAGERO_SC_MAILRECEIVERADDRESS  –  Receivers mail adress
SET  PAGERO_SC_SENDERRADDRESS  –  Senders mail adress

If you use Proxy, you must set following parameters
PROXY_HOST  –  Proxys addres
PROXY_PORT  –  Proxys port
PAGERO_ SC_PROXY=%PAGERO_SC_TRUST_STORE%  %PAGERO_SC_TRUST_PASSWORD%
%PAGERO_SC_HTTPS_PROXY%  %PAGERO_SC_HTTP_PROXY%

Then enter the following parameters into the scheduling tool
Run: “C\WINDOWS\system32\wscript.exe <install path>\invis.vbs <install path>\ServerConnect.bat
Run in: <path>
Run as: <user>
Make sure right user and password are used.

Option  2 – Schedule java application manually

  • Use javaw.exe instead of java.exe in order to avoid manual command window.
Run:
Default command: java -jar poscripted-jar-with-dependencies.jar -config config.xml
Full example (with path & command): C:\Program\Java\jre6\bin\javaw.exe -jar
poscripted-jar-with-dependencies.jar -config config.xml
Run in: <path>
Run as: <user>
Make sure right user and password are used.

Scheduling & Settings
Edit interval after your choice.

Security
Control user and rights.
Save and close.
Test the procedure.

config.xml

This section contains an example configuration file, used on a Windows server system.
You should not use special character in username (use only alphabetic, numbers and “_”).

<?xml version="1.0" encoding="UTF8"?>
 <poclient>
 <!-- The-logtag specifies how logging is done.
 Attributes:
 Mode FILE Logs to a text file
 SYSTEM Logs to the operating system log.
 For Windows the Event Log is used.
 For other system (i.e. Unix/Linux) the logs are
 logged to syslog at localhost via UDP
 Path if file mode is used it tells where the logfile shall be
 written

Verbose if true all DEBUG logs will be written to the log destination
 -->
 <log mode="FILE" path="c:/pagero/log" verbose="true"/>
 <!-- To get mail notification as a complement to the logs.
 Attributes:
 server The SMTP server that is used for sending mail
 level The level specifies which log level that shall be included in
 the mail.
 INFO All info, warn, error logs are included in the mail
 WARN All warn, error logs are included in the mail
 Note! If no logs are written no mail will be sent.
 Sender The sending mail address
 Receiver The receiver’s mail address
 -->
 <mail server="myMailServer" level="INFO" sender="sender@company.com"
 receiver="receiver@company.com"/>
 <!-- The company-tag specifies a configuration for a company. There can be one or
 more companytags.
 Attribute:
 Name The name of the company/account. Used in logs.
 companyId Identifies a company, this is for multicompany
 use. If more than one company is being represented
 the value for companyId is the current company. If
 companyId is empty then the company used for
 sending and receiving invoices
 will be the currently/last logged in company -->
 <company name="Company one" companyId="">
<!-- The po-tag specifies the user account used to access Pagero Online
 Attribute:
 Username The username in Pagero Online
 Password The user's password (remember to protect this config file)
 -->
 <po username="myUserName" password="mySecret"/>
<!-- The inbox-tag
 specifies where the received documents will be stored
 Attributes:
 active If true the inbox is fetched
 prodPath The path to the directory where incoming production documents
 will be stored
 testPath The path to the directory where incoming test documents will
 be stored
 tempPath The path to the directory where files will be temporary
 stored during fetching of documents. The files will then be
 moved to the final destination directory.
 This behavior is used to prevent providing incomplete files
 in the destination directory.
 documentType Type of document. Valid values are INVOICE, ORDER,
 ORDER_RESPONSE and DISPATCH_ADVICE. If empty value all
 types of documents will be fetched.
! All these directories shall be on the same disk to prevent copying of files to
 the destination directories.-->
 <inbox active="false"
 prodPath="c:/pagero/inbox/prod"
 testPath="c:/pagero/inbox/test"
 tempPath="c:/pagero/inbox/temp"
 documentType = "INVOICE"/>
 <!-- The outbox-tag specifies where the files to send will is stored

Attributes:
 active If true, the outbox is sent
 prodPath The path to the directory where outgoing production documents
 will be read from.
 testPath The path to the directory where outgoing test documents will
 be read from
 workPath The path to the directory where files will be temporary
 stored during sending and until they are completely
 processed. In the work Path a number of sub directories are
 created that shows the sent file's status.
 Temp The files are stored here during sending to Pagero Online.
 Sent The files are stored here when they are successfully sent to
 Pagero Online.
 Failed The files are stored here if they failed to send them to
 Pagero Online.
 Done The files are stored here when they are successfully
 processed by Pagero Online.
 Wait The files are stored here if they need manual handling by
 Pagero’s support.
 Normally this will be done within 24h during business hours.
 Error The files are stored here if there occurs an error that
 couldn’t be proccessed by Pagero Online. If this happens
 contacts are needed with Pagero Online.

 subDocAware attachments enabled if true
 masterDocRegexp file name pattern for invoice
 subDocRegexp file name pattern for attachment
 subDocPresentationRegexp file name pattern for invoice image
 -->
 <outbox active="true"
 prodPath="c:/pagero/outbox/prod"
 testPath="c:/pagero/outbox/test"
 workPath="c:/pagero/outbox/work"
 />
 </company>
 </poclient>

 

4. Network Connectivity

The following ports need to be open to the Internet

For connectivity to the internal network, we require that Pagero Printer be accessible (as a local or network printer) from the invoicing system, that the printer can store files (temporarily) locally on the printer server, and that Pagero Connect and Pagero Server Connect can access the files on the printer server over the network if installed on a different server. 

 

5. Testing the installation of Pagero Printer

Checklist
  • Is Pagero Printer listed among the installed printers?
  • Are you able to choose Pagero Printer when printing in the ERP/Financial system?
  • Can all the Users both Read & Write in C:\Documents and Settings\All Users\Application Data\Pagero\USER?
  • Is the Pagero PrinterListener running for all the users (check Task Manager)?
  • Can you find a PDF in C:\Documents and Settings\Application Data\Pagero Connect\VirtualPrinter\In?
  • Is the Pagero Connect application starting automatically (It should not be running before you carry out this test)?
Testing the printer

To test the installation, test the printer.

Test: Open a document (of any kind). Print it by choosing File/Print… Then select Pagero Printer’s printer driver.
Result: The document should print. If you are using Pagero Connect for communication, the application should start, and the document show up with a progress bar and a status showing that the document was sent.

If you are using Pagero Server Connect for communication; the file should be sent (but no GUI displays status). In either case above, to check that the document was sent to Pagero Online, log on to Pagero Online’s website (www.pageroonline.com). Go to Invoice history/Handle error batches. The file should be displayed in the list.

Testing attachment handling in Server Connect

The purpose of the test is to make sure your regular expressions for binding the main document to its attachments.

First a quick operational note: For the application to function as desired (that main documents are connected to attachments and transferred together to the Pagero Online processing platform), attachments need to be written to their destination folder first; and last the main document must be put in its place.

The important thing here is to identify how the files names will allow you to tie the documents together. This is done by letting parts of the file name be the same for files that belong together, in a way that eliminates ambiguity. In other words, the part of the name that is used to die documents together, must be unique. Make sure the flag subDocumentAware is set to true under the outbox-tag in the configuration file. Then define the regular expression needed to identify your file names.

Put files that are named according to your regular expressions (and that mirrors the file naming you will use in production) into the file folders used for testing of your outbox. Send the files to Pagero Online. Then log on to the Pagero Online portal, to check whether your files came across correctly.

Example 1: Invoice with one general attachment in PDF format.

masterDocRegexp=(.*).xml
subDocRegexp=(.*).pdf

Example 2: Invoice with one presentation attachment (invoice image) and general attachments.

masterDocRegexp=INVOICE_(.*).xml
subDocRegexp=ATTACHMENT_(.*)[_\d]?.pdf
subDocPresentationRegexp=IMAGE_(.*).pdf
Troubleshooting
  • The most common error is that Users do not have sufficient user rights in Document and Settings\All Users\application Data\Pagero. The Users need to be able to both Read & Write.
  • PageroPrinterListener needs to be running for all Users. This is easily verified through checking the Task Manager.
  • If the printed invoice (PDF file) is blank, a possible reason could be that a pcl-driver is used. Pagero Printer demands postscript.
  • To check if the printed PDF file actually was saved to Documents and Settings\All Users\application Data\Pagero\User, check the logfile in C:\WINDOWS\TempPageroPrintingNNNNNlog (txt).
  • The Log file for Pagero PrinterListener is found in C:\Documents and Settings\USER\Local Settings\Temp and is called PageroPrinterListener.log.
  • To check if the PDF was moved to the Virtual Printer directory in Pagero Connect, check if there is a *.pdfACK file in Documents and Settings\All Users\application Data\Pagero\USER.
Understanding the Pagero Printer normal flow
  1. The customer chooses to print an invoice, which results in a print dialogue being opened.
  2. Pagero Printer is chosen.
  3. Pagero Printer receives the data to be printed and creates a PDF, that is saved in Documents and Settings\All Users\application Data\Pagero\USER.
  4. PageroPrinterListener detects the new PDF file (the invoices) and moves it to Documents and Settings\USER\Application Data\Pagero Connect\VirtualPrinter\In.
  5. PageroPrinterListener notices or starts Pagero Connect and informs that there is a new PDF file (new invoices), that is ready to be sent.
  6. Pagero Connect sends the PDF files (invoices) to Pagero Online.

 

6. Advanced Features

Multiple printers setup

To be able to print e-invoices from more than one legal company/unit, you need one printer per company/unit. To create more than one printer you need to run the installation manually from the command line, feeding the install program parameters needed to create separate printers. Depending on how you plan to send the files to Pagero Online, the folder structure may look a little different.
Please read this section in its entirety before starting the set up.

Start by getting the printer install program. Pagero Printer is available at the Pagero Online web site. Log on, and go to Support -> Downloads. Click the printer symbol to download the installation file. Follow the instructions on the page, to install the printer as a standalone printer; but note the following extra parameters needed since you are installing two or more printers:

  • /portname (the name the printer will display, in the printer selection list available in most Windows applications)
  • /printname (a folder to which the printer will save the PDF files that are created when printing)

Assuming you downloaded the installation to your C:drive, this is what your command will look like:

C:\setuppageroprinter.exe /portname=port1 /printname=<companyName1_prod>
/PageroVersion=<version number> /javabin=”<path to java.exe>” /LANG=EN

NOTE: the given /printname parameter corresponds to a directory in the filesystem (see printTargetStandalonePrinter below) and must be created manually.

To install the second (and third, …) printer, just issue the command again, giving different values to the
/portame and /printname parameters.

C:\setuppageroprinter.exe /portname=port2 /printname=
< companyName2_prod >
/PageroVersion=<version number> /javabin=<path to java.exe> /LANG=EN

Now go to the printer configuration file located at:
$ProgramFiles\PageroConnect\printersettings.ini

Here you decide what main folder your printers will put the PDF files in.
printTargetStandalonePrinter=<main folder> (Create the folder manually).

Also add the following row to the printersettings.ini file:
fileNameFormat=$env{REDMON_PRINTER}\\$date{yyyyMMddHHmmss}.pdf
This parameters sets the name pattern for the PDF files that are created.

Your printersettings.ini should look like this:
printTargetStandalonePrinter=c:\\pagero
temporaryPdfAsFileOrDir=file

fileNameFormat=$env{REDMON_PRINTER}\\$date{yyyyMMddHHmmss}.pdf

The following shall be created if printers with name companyName1_prod and companyName2_prod are installed:
C:\pagero\ companyName1_prod c:\pagero\ companyName2_prod

To test the printers; open a text file using for example Notepad. Print the file using all of the printers (one at a time) and make sure the files are printed to the corresponding folder set as above. For the files to be sent to the Pagero e-invoice service, configure the communication software to read the folders where the PDF files are saved.

NOTE: If you are using Pagero Server Connect to communicate the files, please note that you need separate printers for production and test. The test printer should be named companyName1_test, and the corresponding folder should be c:\pagero\companyName1_test. The corresponding folder should be configured for reading test files in the server connect.

Example Server Connect configuration is given below: prodPath="C:/Pagero/companyName1_prod/" testPath="C:/Pagero/companyName1_test/" workPath="C:/Pagero/work/companyName1/" subDocAware="false" masterDocRegexp="(.*)\.xml" subDocRegexp="(.*)\.pdf" subDocPresentationRegexp="(.*)\.png">

Configure SAP to Pagero’s network printer

Filesplitter

For files that need to be split (Batch files containing multiple invoices), enriched or where you have sections that need to be removed you can use module Filesplitter. This module must be scheduled before ServerConnect. There is a file called FileSplitt.bat that starts the module. Before you run FileSplitt.bat you need to setup a configurationfile and edit FileSplitt.bat. Set configuration- and log-file in FileSplitt.bat. Create your configurationfile for FileSplitter, this will tell filesplitter what to do. You can make a copy of config_fs.xml and set your configuration.

Example of configuration file

 <fpclient>
 <log mode="FILE" path="c:/Temp/log/filsplitter.log">
 <filename pattern="MERFL.*xml">
 <defaultEncoding charset="ISO-8859-15">
 <path verbose="false">
 <incomming path="c:/Temp/incoming"/>
 <outgoing path="c:/Temp/outgoing"/>
 <temporary path="c:/Temp/temp"/>
 <backup path="c:Temp/backup"/>
 </path>
 <xmltag verbose="false">
 <removeTag pattern="^S[O-P].*"/>
 <splitTag pattern="Finvoice"/>
 <attachmentTag pattern="InvoiceFreeText" group="(.*)" filename="${1}"/>
 <savedBatchDataTag pattern="sectionInfo"
 appendAfterSplit="&lt;/section&gt;&lt;/batch&gt;"/>
 <CSVTag header="TRUE" csvIdentifier="14" useCSVIndex="TRUE"
 invoiceIdentifier="/Finvoice/InvoiceDetails/AgreementIdentifier"/>
 <modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName"
 action="BEFORE" value="A"/>
 <modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName"
 action="AFTER" value="B"/>
 <modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode"
 action="REPLACE" value="C"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/buyerExtra" action="CREATE"
value="D"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator"
action="BEFORE" value="1" useCSV="TRUE" useCSVIndex="TRUE"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator"
action="AFTER" value="InvoiceNumber" useCSV="TRUE" useCSVIndex="FALSE"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator[2]"
action="REPLACE" value="3" useCSV="TRUE" useCSVIndex="TRUE"/>
</xmltag>
</fpclient>

This example will search for files in C:/Temp/incoming/in path that have filename MERFL.*.xml, i.e. MERFL_123.xml. When a file is found we will remove SOAP tag and split content in different files.

Every new file have starttag and endtag Finvoice. Filesplitter will match invoice with attachment with help of tag InvoiceFreeText. Filesplitter will also identify a CSV file for invoice. Information in CSVTag tells Filesplitter how CSV is connected to an invoice. Index in CSV file should match value /Finvoice/InvoiceDetails/AgreementIdentifier in Invoice.

Values in CSV is used to enrich values in invoice. When all files successfully have been parsed, split invoices will be created in C:/Temp/outgoing and original files will be moved to C:/Temp/backup.

 

Description of tags and attributes in configurationfile

TAG ATTRIBUTE VALUE
Log Mode FILE for writing to file and SYSTEM to write to eventlog on Windows and syslog for a linux machine.
Log Path Where logfile will be saved, path must exist but not the file.
filename Pattern Regexp, Scan invoices file matching this pattern
path Vervbose false for information and true for extended information
incomming Path where original unspitted/unprocessed invoices and attachments are stored.
defaultEncoding charset Valid charset name. E.g ISO-8859-15 or UTF-8. This will be used as default encoding if FileSplitter fail to detect encoding from invoice or batch.
outgoing Path where to store spitted/processed invoices and attachments files.
temporary Path Working folder.
backup Path Path where to move original files from incomming. All processed files from incomming will be moved to this path when successful processed.
xmltag verbose false for information and true for extended information.
removeTag pattern Regexp, start and end of expression shoud be removed.
splitTag pattern Start and end tag that identifies a invoice in batch.
attachmentTag pattern To match attachments filename to an invoice you need to configure attachmentTag with attribute pattern, group and filename. Pattern is a regular expression.
Set pattern to a xmltag, then we will use group and filename to parse out that textvalue.
 attachmentTag groups
Create groups with regular expression. These groups will be used in attribute filename. l.e. ([a-z0-9A-Z-]*)\
([a-z0-9A-Z-]*) will create 2 groups.
 attachmentTag filename Here we create the filenames you will match to your invoice. l.e.
Test{1]_{2].pdf will use group 1 and group 2 that are specified in attribute groups.
 CSVTag header true if CSV file have a header otherwise false
 CSVTag csvIdentifier index of csv value (starts with 0) or header name for value in CSV
 CSVTag useCSVIndex true if csvIdentifier use index otherwise false.
 CSVTag csvFilenameIdentifier True if we want to match value in invoice with filename of CSV, otherwise FALSE.
 CSVTag invoiceIdentifier XPath to identify value in XML file.
 CSVTag invoiceIdentifierGroups Create groups with regular expression. l.e.
[a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*). Will get one group in textvalue.
 CSVTag invoiceIdentifierFilename Parsed text to use for finding CSV as filename or use value inside CSV file. l.e.
${1}.csv will use group 1 and replace ${1} with that value.
 modTag Xpath XPath to find in XML file that will be enriched.
 modTag Action Can be one of following values
BEFORE – Add value infront of textvalue.
AFTER – Add value after textvalue.
REPLACE – Replace all textvalue with new value, if xpath does not exist a new tag will be created.
CREATE – Create new xml tag that is the valid xpath with values.
 modTag Value New text to use when enrich XML file. If no useCSVIndex and useCSV is used then this static text will used to replace value in XML.
 modTag useCSVIndex true to use index, false to use header name.
 modTag useCSV true when using CSV file for enrichment otherwize false.
 saveBatchDataTag Pattern RegExp, to detect last node in batch before every single invoice.
 SaveBatchDataTag AppendAfterSplit Node or nodes that must be appended at end of every splitted invoice. This string must exist in the original batch.
Also notice that you can’t write xml tags within configuration file. So instead using character <or> you MUST enter &lt; or &gt; so
</INVOICES<>/CONTENT_FRAME></INOICE_CENTER> should be entered as
&lt;/INVOICES&gt;&lt;/CONTENT_FRAME&gt;/INVOICE_CENTER&gt;

You can enrich XML with static text or with values in a CSV file. If you enrich XML with static text you only need to add modTags to configurationfile and set xpath, action and value.
For example

<modtag xpath="/Finvoice/BuyerPartyDetails/ByerOrganisationName" action="BEFORE"
value="A"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName" action="AFTER"
value="B"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode" action="REPLACE"
value="C"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/buyerExtra" action="CREATE" value="D"/>

Here we will try to find xpath /Finvoice/BuyerPartyDetails/BuyerOrganisationName and add value A before and B after existing value. We also try to find xpath
/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode and replace existing value with C. The last line will create a new tag if xpath is valid and set value D.

To enrich XML with a CSV you need to add CSVtag and describe how to connect CSV with invoice. You can connect csv file with value inside csv or use its filename. To use its filename you should add attribute
csvFilenameIdentifier and set it to TRUE. Now Filesplitter will try to find value in invoice and match it to CSV filename.
To match CSV with invoice based on information inside files you must use attribute csvIdentifier and useCSVIndex.

With these two attributes Filesplitter will try to find value in CSV with given index or name and match to a invoice value that exist in given xpath. In modTag we set useCSV to true. We can then set useCSVIndex to true and value to a index number or we set useCSVIndex to falseand value to header name.
Filesplitter will now lookup value in CSV and enrich XML with found value.
CSV file must use “;” to separate values in file.

For example

<CSVTag header="TRUE" csvIdentifier="14" useCSVIndex="TRUE"
invoiceIdentifier="/Finvoice/InvoiceDetails/AgreementIdentifier"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator"
action="AFTER" value="InvoiceNumber" useCSV="TRUE" useCSVIndex="FALSE"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator[2]"
action="REPLACE" value="3" use CSV="TRUE" useCSVIndex="TRUE"/>

Here we will connect CSV file with help of index 14 and xpath
/Finvoice/InvoiceDetails/AgreementIdentifier.
If they have same value they are connected and csv will be used to enrich invoice. First modTag will append value in CSV that have header invoiceNumber second modtag will replace value in
/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator [2] with value in index 3 in CSV file.

Here is an example how a configuration of CSVTag can look like when matching with CSV filename.

<CSVTag header="TRUE" csvFilenameIdentifier="TRUE"
invoiceIdentifierGroups="[a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*)."
invoiceIdentifierFilename="${1}.csv"
invoiceIdentifier="/Finvoice/InvoiceDetails[1]/InvoiceFreeText[1]"/
>

First will invoiceIdentifier get the value between xml tags. Then will we apply this reg expr. [a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*). On value and get one group. After this we format our value with invoiceIdentifierFilename and use values inside groups that we have parsing out. I.e. value is “Test 123 ABC” then group 1 will get value 123 and last we apply ${1}.csv and get 123.csv as final value.

To run both Filesplitter and Serverconnect use FileSplitt_AND_ServerConnect.bat
To disable command prompt to be shown we use invis.vbs that takes the bat file as argument, i.e.

Run both Filesplitter and Serverconnect –
“C:\WINDOWS\system32\wscript.exe<install path>\invis.vbs<install path>\FileSplitt_And_ServerConnect.bat

Example configfile for TEAPPS.

<fpclient
 <log mode="FILE" path="/tmp/fileSplitter/log/startconf.log"/>
 <filename pattern="teappsInvoice.*xml"/>
 <defaultEncoding charset="ISO-8859-15"/>
 <path verbose="false">
 <incomming path="/tmp/fileSplitter/incoming"/>
 <outgoing path="/tmp/fileSplitter/outgoing"/>
 <temporary path="/tmp/fileSplitter/temp"/>
 <backup path="/tmp/fileSplitter/backup"/>
 </path>
 <xmltag verbose="false">
 <removeTag pattern="^S[OP].*"/>
 <splitTag pattern="^INVOICE$"/>
 <!--BGC-Invoice save batchdata when split →
 <saveBatchDataTag pattern="^INVOICES$"
 appendAfterSplit="&lt;/INVOICES&gt;&lt;/CONTENT_FRAME&gt;&lt;/INVOICE_CENTER&gt;"/>
 </xmltag>
 </fpclient>

Example configfile for BGCInvoice

<fpclient>
<log mode="FILE" path="/tmp/fileSplitter/log/startconf.log"/>
<filename pattern="BGCInvoice.*xml"/>
<defaultEncoding charset="ISO-8859-15"/>
<path verbose="false">
<incomming path="/tmp/fileSplitter/incoming"/>
<outgoing path="/tmp/fileSplitter/outgoing"/>
<temporary path="/tmp/fileSplitter/temp"/>
<backup path="/tmp/fileSplitter/backup"/>
</path>
<xmltag verbose="false">
<removeTag pattern="^S[OP].*"/>
<splitTag pattern="^document$"/>
<!--BGC-Invoice save batchdata when split →
<saveBatchDataTag pattern="sectionInfo" appendAfterSplit="&lt;/section&gt;&lt;/batch&gt;"/>
</xmltag>
</fpclient>

 

Have more questions? Submit a request