2023-07-20 17:55:45 +03:00
|
|
|
@ECHO OFF
|
|
|
|
|
|
|
|
rem Convert (dump) 1C data processor or report from binary format (*.epf, *.erf) to 1C:EDT format
|
|
|
|
rem %1 - path to 1C data processor or report (*.epf, *.erf)
|
|
|
|
rem %2 - path to folder to save data processor & report in 1C:EDT format
|
|
|
|
rem %3 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format)
|
|
|
|
rem or folder contains 1C infobase used for convertion
|
|
|
|
|
2023-07-22 11:06:53 +03:00
|
|
|
IF not defined V8_VERSION set V8_VERSION=8.3.20.2290
|
|
|
|
IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c
|
2023-07-20 17:55:45 +03:00
|
|
|
|
|
|
|
set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe"
|
|
|
|
FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO (
|
|
|
|
set RING_TOOL="%%i"
|
|
|
|
)
|
|
|
|
|
2023-07-21 21:14:52 +03:00
|
|
|
set IB_PATH=%V8_TEMP%\tmp_db
|
|
|
|
set XML_PATH=%V8_TEMP%\tmp_xml
|
|
|
|
set WS_PATH=%V8_TEMP%\edt_ws
|
2023-07-20 17:55:45 +03:00
|
|
|
set CLEAN_AFTER_EXPORT=0
|
|
|
|
|
|
|
|
set DP_FILE=%1
|
2023-07-22 11:06:53 +03:00
|
|
|
IF defined DP_FILE set DP_FILE=%DP_FILE:"=%
|
2023-07-20 17:55:45 +03:00
|
|
|
set DP_PATH=%2
|
2023-07-22 11:06:53 +03:00
|
|
|
IF defined DP_PATH set DP_PATH=%DP_PATH:"=%
|
2023-07-20 17:55:45 +03:00
|
|
|
set BASE_CONFIG=%3
|
2023-07-22 11:06:53 +03:00
|
|
|
IF defined BASE_CONFIG set BASE_CONFIG=%BASE_CONFIG:"=%
|
2023-07-20 17:55:45 +03:00
|
|
|
|
2023-07-22 11:06:53 +03:00
|
|
|
IF not defined DP_FILE (
|
2023-07-20 17:55:45 +03:00
|
|
|
echo Missed parameter 1 "path to 1C data processor or report (*.epf, *.erf)"
|
|
|
|
exit /b 1
|
|
|
|
)
|
2023-07-22 11:06:53 +03:00
|
|
|
IF not defined DP_PATH (
|
2023-07-20 17:55:45 +03:00
|
|
|
echo Missed parameter 2 "path to folder to save data processor & report in 1C:EDT format"
|
|
|
|
exit /b 1
|
|
|
|
)
|
2023-07-22 11:06:53 +03:00
|
|
|
IF not exist "%BASE_CONFIG%" (
|
2023-07-21 11:21:52 +03:00
|
|
|
echo Path "%BASE_CONFIG%" doesn't exist ^(parameter 3^), empty infobase will be used.
|
2023-07-21 11:12:23 +03:00
|
|
|
set BASE_CONFIG=
|
|
|
|
)
|
2023-07-20 17:55:45 +03:00
|
|
|
|
|
|
|
echo Set infobase for export data processor/report...
|
|
|
|
IF "%BASE_CONFIG%" equ "" (
|
|
|
|
echo Creating infobase "%IB_PATH%"...
|
|
|
|
set CLEAN_AFTER_EXPORT=1
|
|
|
|
set BASE_CONFIG_DESCRIPTION=empty configuration
|
|
|
|
%V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs
|
2023-07-22 11:06:53 +03:00
|
|
|
) ELSE (
|
2023-07-20 17:55:45 +03:00
|
|
|
set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%"
|
2023-07-21 13:38:54 +03:00
|
|
|
IF exist "%BASE_CONFIG%\DT-INF\" (
|
2023-07-20 17:55:45 +03:00
|
|
|
set CLEAN_AFTER_EXPORT=1
|
|
|
|
call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%"
|
2023-07-22 11:06:53 +03:00
|
|
|
) ELSE (
|
2023-07-20 17:55:45 +03:00
|
|
|
IF exist "%BASE_CONFIG%\Configuration.xml" (
|
|
|
|
set CLEAN_AFTER_EXPORT=1
|
|
|
|
call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%"
|
2023-07-22 11:06:53 +03:00
|
|
|
) ELSE (
|
2023-07-20 17:55:45 +03:00
|
|
|
IF exist "%BASE_CONFIG%\1cv8.1cd" (
|
|
|
|
set BASE_CONFIG_DESCRIPTION=existed configuration
|
|
|
|
set IB_PATH=%BASE_CONFIG%
|
2023-07-22 11:06:53 +03:00
|
|
|
) ELSE (
|
2023-07-20 17:55:45 +03:00
|
|
|
set CLEAN_AFTER_EXPORT=1
|
|
|
|
call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Clear temporary files...
|
2023-07-22 11:06:53 +03:00
|
|
|
IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%"
|
|
|
|
IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%"
|
|
|
|
IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%"
|
|
|
|
IF exist "%DP_PATH%" rd /S /Q "%DP_PATH%"
|
2023-07-20 17:55:45 +03:00
|
|
|
md "%XML_PATH%"
|
|
|
|
md "%WS_PATH%"
|
2023-07-21 11:12:23 +03:00
|
|
|
md "%DP_PATH%"
|
2023-07-20 17:55:45 +03:00
|
|
|
|
|
|
|
echo Export dataprocessor / report "%DP_FILE%" to 1C:Designer XML format "%XML_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%...
|
|
|
|
%V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "%XML_PATH%" "%DP_FILE%"
|
|
|
|
|
2023-07-21 11:12:23 +03:00
|
|
|
echo Export dataprocessor / report from 1C:Designer XML format "%XML_PATH%" to 1C:EDT format "%DP_PATH%"...
|
|
|
|
call %RING_TOOL% edt workspace import --project "%DP_PATH%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" --version "%V8_VERSION%"
|
2023-07-20 17:55:45 +03:00
|
|
|
|
|
|
|
echo Clear temporary files...
|
2023-07-22 11:06:53 +03:00
|
|
|
IF "%CLEAN_AFTER_EXPORT%" equ "1" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%"
|
|
|
|
IF exist "%XML_PATH%" rd /S /Q "%XML_PATH%"
|
|
|
|
IF exist "%WS_PATH%" rd /S /Q "%WS_PATH%"
|