Projet

Général

Profil

Actions

Anomalie #17650

fermé

[saas][arnage] scantomaarch ne fonctionne pas (depuis la migration 20.03 vers 21.03)

Ajouté par Support Maarch il y a plus de 3 ans. Mis à jour il y a plus de 2 ans.

Statut:
Clôturé
Priorité:
0-Bloquant
Assigné à:
Version cible:
Début:
21/05/2021
Echéance:

Description

J'ai copié le import.bat (1.1.1 du git, j'ai mis la bonne url mais j'avais toujours le message d'erreur (pj1)

https://labs.maarch.org/maarch/scantomaarch/blob/1.1.1/import.bat

Après plusieurs essai j'ai fini par modifier l'url en bas du import.bat également comme ci-dessous (

cho off

REM APPLICATION URL. Always end with a "/" Ex: http://user:password@application_url/
URL=https://cchaplin:maarch@courrier.xelians.fr/arnage_mc/

REM USERGROUP ID TO INDEX DOCUMENT WITH
set GROUPID=1

REM ====================================================================
REM Change to current folder
cd /D "%~dp0"

del scanToMaarch.log

REM ====================================================================
REM Check 32 or 64 bits
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32|| set OS=64
echo [%date% %time%] Windows OS: %OS% >> scanToMaarch.log

REM ====================================================================
REM PARSER URL
FOR /F "TOKENS=1 DELIMS=:" %%A IN ("%URL%") DO (SET "proto=%%~A")
FOR /F "TOKENS=2 DELIMS=@" %%A IN ("%URL%") DO (SET "posturl=%%~A")
echo [%date% %time%] URL Protocole: %proto% >> scanToMaarch.log
echo [%date% %time%] URL after password: %posturl% >> scanToMaarch.log

REM ====================================================================
REM Check file

set fileName=%1

FOR %%i IN (%fileName%) DO (
set file_name=%%~ni
set fileextension=%%~xi
)

echo [%date% %time%] File: %fileName% >> scanToMaarch.log
echo [%date% %time%] File name: %file_name% >> scanToMaarch.log
echo [%date% %time%] File extension: %fileextension% >> scanToMaarch.log

if not exist "%fileName%" (
 echo [%date% %time%] File %fileName% does not exists >> scanToMaarch.log
 cmd /k
)

REM ====================================================================
REM Base64 encode file

echo [%date% %time%] Base64 Encode start >> scanToMaarch.log
certutil -encodehex -f %fileName% content.json 1
echo [%date% %time%] Base64 Encode end >> scanToMaarch.log

REM ====================================================================
REM Create Body content

echo [%date% %time%] Create Body content start >> scanToMaarch.log
echo {"name": "%file_name%%fileextension%"^, "base64": ^"> Adatascan.json

echo ^"^, "context": "scan"} > Cdatascan.json

copy /b Adatascan.json+content.json+Cdatascan.json datascan.json
echo [%date% %time%] Create Body content end >> scanToMaarch.log

REM ====================================================================
REM Send file to Maarch Courrier tmp
set websiteVariable=%URL%rest/convertedFile
echo [%date% %time%] Curl call Url: %websiteVariable% >> scanToMaarch.log

set commandCurl=curl\curl-7.66.0-win%OS%-mingw\bin\curl.exe
"%commandCurl%" -H "Accept: application/json" -H "Content-Type:application/json" --insecure ^
 -X POST -d @datascan.json "%websiteVariable%" > response.json

REM Parse curl response
FOR /F "delims=" %%i in ('type response.json ^| jq\jq-win%OS%.exe -r .tmpFilename') DO SET tmpFilename=%%i
FOR /F "delims=" %%i in ('type response.json ^| jq\jq-win%OS%.exe -r .errors') DO SET errors=%%i

if "%tmpFilename%"=="null" (
 echo [%date% %time%] Curl error: %errors% >> scanToMaarch.log
 cmd /k
)

REM ====================================================================
REM Open browser
set OPENURL=https://cchaplin:maarch@courrier.xelians.fr/arnage_mc/dist/index.html#/indexing/%GROUPID%?tmpfilename=%tmpFilename%
echo Open url in browser: "%OPENURL%" >> scanToMaarch.log

start "" "%OPENURL%"

Avec la modification de l'url en bas du fichier .bat, on arrive maintenant à ouvrir la bonne url mais pas le fichier tmp qui ne semble pas avoir été créé.


set OPENURL=https://cchaplin:maarch@courrier.xelians.fr/arnage_mc/dist/index.html#/indexing/%GROUPID%?tmpfilename=%tmpFilename%)

puis

set OPENURL=https://courrier.xelians.fr/arnage_mc/dist/index.html#/indexing/%GROUPID%?tmpfilename=%tmpFilename%)

Ci-dessous la log :

[01/07/2021 11:03:11,73] Windows OS: 64 
[01/07/2021 11:03:11,73] URL Protocole:  
[01/07/2021 11:03:11,73] URL after password:  
[01/07/2021 11:03:11,73] File: C:\Maarch\scantomaarch-1.0\dummy.pdf 
[01/07/2021 11:03:11,74] File name: dummy 
[01/07/2021 11:03:11,74] File extension: .pdf 
[01/07/2021 11:03:11,74] Base64 Encode start 
[01/07/2021 11:03:11,78] Base64 Encode end 
[01/07/2021 11:03:11,78] Create Body content start 
[01/07/2021 11:03:11,79] Create Body content end 
[01/07/2021 11:03:11,79] Curl call Url: rest/convertedFile 
Open url in browser: "https://cchaplin:maarch@courrier.xelians.fr/arnage_mc/dist/index.html#/indexing/1?tmpfilename=" 

J'ai testé un ensemble d'url:

set OPENURL=https://courrier.xelians.fr/arnage_mc/dist/index.html#/indexing/%GROUPID%?tmpfilename=%tmpFilename%
set OPENURL=https://courrier.xelians.fr/arnage_mc/dist/index.html?scanGroupId=%GROUPID%^&tmpfilename=%tmpFilename%
set OPENURL=https://courrier.xelians.fr/arnage_mc/dist/index.html/indexing/%GROUPID%?tmpfilename=%tmpFilename%
set OPENURL=%proto%://%posturl%/index.php?scanGroupId=%GROUPID%^&tmpfilename=%tmpFilename%
set OPENURL=%proto%://%posturl%dist/index.html#/indexing/%GROUPID%?tmpfilename=%tmpFilename%
set OPENURL=%proto%://%posturl%dist/index.html/indexing/%GROUPID%?tmpfilename=%tmpFilename%

J'ai le même comportement sur mon poste


Fichiers

arnage(.bat_fichier.jpg (112 ko) arnage(.bat_fichier.jpg Support Maarch, 03/06/2021 11:26
scan2.jpg (56,7 ko) scan2.jpg Support Maarch, 01/07/2021 11:05
scan.jpg (109 ko) scan.jpg Support Maarch, 01/07/2021 11:05
scan2.jpg (56,7 ko) scan2.jpg Support Maarch, 01/07/2021 11:19
scan.jpg (109 ko) scan.jpg Support Maarch, 01/07/2021 11:19
Actions

Formats disponibles : Atom PDF