REM #Doc: This is the Custom Refile Environ Script
REM #Doc: it Can be used to set special settings for custom before refile start's
REM #New: 09.04.2018/J.Fes
REM #LUp: 17.01.2019/J.Fes

call :ProcessDefaults
if /I "%JobMgr_NxPartUtilReplica%" equ "YES" Call :ProcessRO
if /I "%JobMgr_NxPartUtilReplica%" neq "YES" Call :ProcessSO

goto :eof

REM ----------------------------------------------------------------------------
:ProcessDefaults
 if /I "%NxPartUtilPara%" equ "%NxPartUtilPara: -update_mod_props=no=%" goto :JumbOver
   REM #Doc: 01.06.2011 Info from Phil.K
   set TC_UPDATE_MOD_PROPS=NO
 :JumbOver
 set NxPartUtilPara=-managed_mode=yes %NxPartUtilPara%
 goto :eof

REM ----------------------------------------------------------------------------
:ProcessSO
 REM set's Custom environ IF SO Side Objects is refiled
 set UGII_UGMGR_ALLOW_REFILE_REPLICA_BYPASS=
 set IMAN_UG_REFILE_REPLACE_FILE=
 REM UGII_DISABLE_PREVIEW nicht bei OwingSite Object's
 set UGII_DISABLE_PREVIEW=
 REM UGII_DISABLE_QAF_NAMED_REFS nicht bei OwingSite Object's
 set UGII_DISABLE_QAF_NAMED_REFS=
 goto :eof

REM ----------------------------------------------------------------------------
:ProcessRO
 REM #Doc: Set Multisite EnvironmentRO Replica Objects is refiled
 if /I "%NxPartUtilPara%" EQU "%NxPartUtilPara: -replica_bypass=yes=%" set NxPartUtilPara=%NxPartUtilPara% -replica_bypass=yes

 REM #Doc: 09/10/2014/J.Fes add new see: IR1996966
 if /I "%NxPartUtilPara%" EQU "%NxPartUtilPara: -replace_file=yes=%" set NxPartUtilPara=%NxPartUtilPara% -replace_file=yes
 set UGII_UGMGR_REFILE_REPLACE_FILE=yes

 set UGII_UGMGR_ALLOW_REFILE_REPLICA_BYPASS=true
 REM 18.05.2010/J.Fes ad see E-Mail David Geisler 15. Mai 2010 00:19
 set IMAN_UG_REFILE_REPLACE_FILE=true
 REM umgestellt von set UGII_DISABLE_PREVIEW=on auf set UGII_DISABLE_PREVIEW=
 set UGII_DISABLE_PREVIEW=ON
 REM umgestellt von set UGII_DISABLE_QAF_NAMED_REFS=ON auf set UGII_DISABLE_QAF_NAMED_REFS
 set UGII_DISABLE_QAF_NAMED_REFS=ON

 if /i "%JobMgr_Debug%" neq "ON"  goto :JumbOver
  Call Echo "#Debug..........................: please check"
  Call Echo "Check if NxPartUtilPara contains: [-replica_bypass=yes]"
  Call Echo "NxPartUtil Para.................: [%NxPartUtilPara%]"
  Call Echo "Process Replica.................: [%JobMgr_NxPartUtilReplica%]"
  Call Echo "UGII_UGMGR_ALLOW_REFILE_REPLICA_BYPASS: [%UGII_UGMGR_ALLOW_REFILE_REPLICA_BYPASS%]"
  Call Echo "UGII_UGMGR_REFILE_REPLACE_FILE..: [%UGII_UGMGR_REFILE_REPLACE_FILE%]"
  Call Echo "IMAN_UG_REFILE_REPLACE_FILE.....: [%IMAN_UG_REFILE_REPLACE_FILE%]"
  pause
:JumbOver
 goto :eof
