@echo off

rem # adjust JAVA_HOME variable - specify the JRE location
set JAVA_HOME=C:\Program Files\Java\jre8
echo using JAVA_HOME=%JAVA_HOME%

rem # adjust EPARAKSTS_LIB_HOME variable
set EPARAKSTS_LIB_HOME=..

rem # adjust PATH variable - specify the native library path
set PATH=%PATH%;%EPARAKSTS_LIB_HOME%\lib\native\win32

set EDOC_LIBS=%EPARAKSTS_LIB_HOME%\lib\eparaksts-lib-2.13.1.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\eparaksts-bc-1.70.0.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\log4j-api-2.20.0.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\apdu4j-jnasmartcardio-0.2.7+191107.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jakarta.xml.bind-api-3.0.1.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jna-5.14.0.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\pkcs11wrapper-1.6.10.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\slf4j-api-2.0.9.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\xmlsec-3.0.2.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jaxb\istack-commons-runtime-4.0.1.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jaxb\jakarta.activation-2.0.1.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jaxb\jaxb-core-3.0.2.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\jaxb\jaxb-runtime-3.0.2.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\optional\log4j-core-2.20.0.jar
set EDOC_LIBS=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\lib\optional\log4j-slf4j-impl-2.20.0.jar

set EPARAKSTS_LIB_CLASSPATH=%EDOC_LIBS%;%EPARAKSTS_LIB_HOME%\config;%EPARAKSTS_LIB_HOME%\samples;
rem echo using CLASSATH=%EPARAKSTS_LIB_CLASSPATH%

rem # SAMPLE 1 : EDoc2Sample #
rem # This example demonstrates how to create a signed EDOC 2.0 format document.
rem # Example creates EDOC 2.0 object,
rem # adds data file '%EPARAKSTS_LIB_HOME%\Readme.txt',
rem # signs EDOC document if password is provided as a parameter
rem # and finally writes EDOC document to file '%EPARAKSTS_LIB_HOME%\samples\sample.edoc'.
"%JAVA_HOME%\bin\java" -cp %EPARAKSTS_LIB_CLASSPATH% lv.eparaksts.sample.EDoc2Sample %EPARAKSTS_LIB_HOME%\Readme.txt %EPARAKSTS_LIB_HOME%\samples\sample.edoc %1

rem # SAMPLE 2 : EDoc2BatchSample #
rem # This example demonstrates how to create multiple signed EDOC 2.0 format documents in a batch job.
rem # Example creates EDOC 2.0 objects,
rem # adds 3 data files from directory '%EPARAKSTS_LIB_HOME%\samples',
rem # signs EDOC documents if password is provided as a parameter
rem # and finally writes EDOC documents to directory '%EPARAKSTS_LIB_HOME%\samples\batch'.
REM "%JAVA_HOME%\bin\java" -cp %EPARAKSTS_LIB_CLASSPATH% lv.eparaksts.sample.EDoc2BatchSample %EPARAKSTS_LIB_HOME%\samples %EPARAKSTS_LIB_HOME%\samples\batch %1

rem # SAMPLE 3 : PdfSample #
rem # This example demonstrates how to create a signed PDF format document.
rem # Example opens PDF file '%EPARAKSTS_LIB_HOME%\docs\eparaksts-lib-user-2.13.1.pdf',
rem # signs PDF document if password is provided as a parameter
rem # and finally writes PDF document to file '%EPARAKSTS_LIB_HOME%\samples\sample.pdf'.
set EPARAKSTS_LIB_CLASSPATH=%EPARAKSTS_LIB_CLASSPATH%;%EPARAKSTS_LIB_HOME%\lib\eparaksts-pdfbox-2.0.5.jar
REM "%JAVA_HOME%\bin\java" -cp %EPARAKSTS_LIB_CLASSPATH% lv.eparaksts.sample.PdfSample %EPARAKSTS_LIB_HOME%\docs\eparaksts-lib-user.pdf %EPARAKSTS_LIB_HOME%\samples\sample.pdf %1
