Difference between revisions of "E-Boks doc2mail"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
m (19 revisions imported)
 
(15 intermediate revisions by one other user not shown)
Line 22: Line 22:
   sudo chmod 777 *
   sudo chmod 777 *


== Test setup ==
== Test commandline setup ==
In this step you will configure and test the configuration for the commandline
 
Update the parameters below  
Update the parameters below  
* i: Location of a test PDF
* i: Location of a test PDF
Line 49: Line 51:
   </uploadStatus>
   </uploadStatus>


== Server configuration ==
== Server configuration: Linux ==
In this step you will deploy the commandline configuration
 
Make the following substitutions
* i: $DOCUMENT
* title: $TITLE
* r: $CPR
* testmode: 0
 
The connection string should look something like
 
  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "$DOCUMENT" --title "$TITLE" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r $CPR --rt CPR
 
=== Create execution script ===
 
  cd /mnt/sda/deploy/doc2mail
  sudo nano send.sh
 
Paste the execution script (above)
 
  DOCUMENT=$1
  CPR=$2
  TITLE="$3 $4 $5 $6 $7"
 
  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "$DOCUMENT" --title "$TITLE" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r $CPR --rt CPR
 
The set up permissions for the script
 
  sudo chmod 777 send.sh
 
=== Copy the value to the server configuration parameter ===
# Modules > Static content > Add
# Set title = '''eboksIntegrationTemplate'''
 
  /mnt/sda/deploy/doc2mail/send.sh @@DOCUMENT@@ @@CPR@@ @@TITLE@@
 
=== Set doc2mail as ebox provider ===
# Edit the setting '''eboksProvider''' (url: ServerSettingSingle.do?PolicyName=eboksProvider&DataType=3)
# Set the value to: '''doc2mail'''
 
=== Activate token rewrites ===
# Edit the setting '''interfaceTokenRewrite'''  (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewrite&DataType=1)
# Set the value to '''true'''
# Edit the setting '''interfaceTokenRewriteUrl'''  (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewriteUrl&DataType=3)
# Set the value to '''https://svar.link/FOOBAR/'''
#* FOOBAR is the name of your application as registered in svar.link
 
=== Reboot the server ===
 
== Server configuration : Windows ==
In this step you will deploy the commandline configuration
 
Make the following substitutions
Make the following substitutions
* i: @@DOCUMENT@@
* i: @@DOCUMENT@@
Line 60: Line 113:
   java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "@@DOCUMENT@@" --title "@@TITLE@@" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r @@CPR@@ --rt CPR
   java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "@@DOCUMENT@@" --title "@@TITLE@@" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r @@CPR@@ --rt CPR


Finally copy this value to the server configuration parameter: '''eboksIntegrationTemplate'''
=== Copy the value to the server configuration parameter ===
# Modules > Static content > Add
# Set title = '''eboksIntegrationTemplate'''
# Set value ''the string above''
 
=== Set doc2mail as ebox provider ===
# Edit the setting '''eboksProvider''' (url: ServerSettingSingle.do?PolicyName=eboksProvider&DataType=3)
# Set the value to: '''doc2mail'''
 
=== Activate token rewrites ===
# Edit the setting '''interfaceTokenRewrite'''  (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewrite&DataType=1)
# Set the value to '''true'''
# Edit the setting '''interfaceTokenRewriteUrl'''  (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewriteUrl&DataType=3)
# Set the value to '''https://svar.link/FOOBAR/'''
#* FOOBAR is the name of your application as registered in svar.link
 
=== Finally reboot the server ===

Latest revision as of 11:51, 10 December 2021

Install components

Before you start ensure Java 8 is the default

Certificate

Ensure you have a valid certificate

 sudo nano /mnt/sda/certs/doc2mail.pke

Copy paste contents of the certificate

 sudo chmod 777 /mnt/sda/certs/doc2mail.pke

Binaries

Download OneTooX implementation

 cd /mnt/sda/deploy
 sudo wget https://www.tempusserva.dk/install/doc2mail/doc2mail.zip
 unzip doc2mail.zip
 sudo mv lib doc2mail
 cd doc2mail
 sudo chmod 777 *

Test commandline setup

In this step you will configure and test the configuration for the commandline

Update the parameters below

  • i: Location of a test PDF
  • t: Name of the document type
  • r: A real CPR number

Execute the following command

  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "/tmp/eboks_test.pdf" --title "Oplysningsskemaet" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 3 -r 1234561234 --rt CPR

A success messag will look something like

 <uploadStatus>
   <deliveryInformation>
       <destination>5</destination>
       <errorCode>0</errorCode>
       <id>148069122</id>
       <mailPriority>B</mailPriority>
       <responseInfo>No response</responseInfo>
       <status>OK</status>
       <succeeded>true</succeeded>
   </deliveryInformation>
   <message>OK</message>
   <success>true</success>
   
 </uploadStatus>

Server configuration: Linux

In this step you will deploy the commandline configuration

Make the following substitutions

  • i: $DOCUMENT
  • title: $TITLE
  • r: $CPR
  • testmode: 0

The connection string should look something like

  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "$DOCUMENT" --title "$TITLE" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r $CPR --rt CPR

Create execution script

 cd /mnt/sda/deploy/doc2mail
 sudo nano send.sh

Paste the execution script (above)

 DOCUMENT=$1
 CPR=$2
 TITLE="$3 $4 $5 $6 $7"
  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "$DOCUMENT" --title "$TITLE" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r $CPR --rt CPR

The set up permissions for the script

 sudo chmod 777 send.sh

Copy the value to the server configuration parameter

  1. Modules > Static content > Add
  2. Set title = eboksIntegrationTemplate
 /mnt/sda/deploy/doc2mail/send.sh @@DOCUMENT@@ @@CPR@@ @@TITLE@@

Set doc2mail as ebox provider

  1. Edit the setting eboksProvider (url: ServerSettingSingle.do?PolicyName=eboksProvider&DataType=3)
  2. Set the value to: doc2mail

Activate token rewrites

  1. Edit the setting interfaceTokenRewrite (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewrite&DataType=1)
  2. Set the value to true
  3. Edit the setting interfaceTokenRewriteUrl (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewriteUrl&DataType=3)
  4. Set the value to https://svar.link/FOOBAR/
    • FOOBAR is the name of your application as registered in svar.link

Reboot the server

Server configuration : Windows

In this step you will deploy the commandline configuration

Make the following substitutions

  • i: @@DOCUMENT@@
  • title: @@TITLE@@
  • r:@@CPR@@
  • testmode: 0

The connection string should look something like

  java -cp .:/mnt/sda/deploy/doc2mail/* dk.doc2mail.client.FileUploaderClient --address "https://privat.doc2mail.dk/delivery/FileUploader.asmx" --certificate "/mnt/sda/certs/doc2mail.pke" -i "@@DOCUMENT@@" --title "@@TITLE@@" -d ebokskmdprint -u "domainX\userY" -t "tempus serva" --ss "Oplysningsskema" --testmode 0 -r @@CPR@@ --rt CPR

Copy the value to the server configuration parameter

  1. Modules > Static content > Add
  2. Set title = eboksIntegrationTemplate
  3. Set value the string above

Set doc2mail as ebox provider

  1. Edit the setting eboksProvider (url: ServerSettingSingle.do?PolicyName=eboksProvider&DataType=3)
  2. Set the value to: doc2mail

Activate token rewrites

  1. Edit the setting interfaceTokenRewrite (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewrite&DataType=1)
  2. Set the value to true
  3. Edit the setting interfaceTokenRewriteUrl (url: ServerSettingSingle.do?PolicyName=interfaceTokenRewriteUrl&DataType=3)
  4. Set the value to https://svar.link/FOOBAR/
    • FOOBAR is the name of your application as registered in svar.link

Finally reboot the server