@ECHO OFF

rem *******************************************************************************
rem  Platform:      NT                                                            *
rem  Printstream:   PostScript                                                    *
rem  Application:   SPL Field Order Print                                         *
rem ==============================================================================*
rem  Master Command File called to execute DOC1 for SPL Field Order Print         *
rem ==============================================================================*

rem do not change the following line
SET   SPLFOP-CALLED-SWITCH=Y

rem *******************************************************************************
rem    Modify the following file paths for each installation                      *
rem ==============================================================================*
rem      D1HOST                                                                   *
rem              - Names root directory where the DOC1 Generate was installed     *
rem              - Typical value:                                                 *
rem                D1HOST=C:\Program Files\DOC1 Suite\Production Engines          *
rem      D1APPATH                                                                 *
rem              - Names directory containing HIP, OPS, INI, CTL, ETS             *
rem              - Sample coding:                                                 *
rem                D1APPATH=C:\Program Files\DOC1 Suite\Designer\resource\fop     *
rem      PRODPATH                                                                 *
rem              - Names directory for output files from Sort and DOC1            *
rem              - Sample coding: PRODPATH=C:\Doc1 Production Files               *
rem      WEBPATH                                                                  *
rem              - Names directory for final output PDF from where it will viewed *
rem              - Needed only for FOP-on-Demand                                  *
rem              - Sample coding: WEBPATH=C:\Doc1 Production Files                *
rem      FLNAME                                                                   *
rem              - Needed only for FOP-on-Demand                                  *
rem              - Filename (w/o extension) of PDF to be created                  *
rem              - Sample value: FLNAME=bwilson_012347890                         *
rem              - This process will create FLNAME.pdf in the WEBPATH directory   *
rem      XTRCTPTH                                                                 *
rem              - Names directory containing Field Order Print Extract           *
rem              - Sample coding: XTRCTPTH=C:\SPL\EXTRACT                         *
rem      PADDR-PRTOUT-01                                                          *
rem              - IP Address where Field Orders in Print File 01 will be printed *
rem              - Sample coding: PADDR-PRTOUT-01=186.240.132.132                 *
rem      PADDR-PRTOUT-02                                                          *
rem              - IP Address where Field Orders in Print File 02 will be printed *
rem              - Sample coding: PADDR-PRTOUT-02=186.240.132.132                 *
rem      PADDR-PRTOUT-03                                                          *
rem              - IP Address where Field Orders in Print File 03 will be printed *
rem              - Sample coding: PADDR-PRTOUT-03=186.240.132.132                 *
rem      PADDR-PRTOUT-04                                                          *
rem              - IP Address where Field Orders in Print File 04 will be printed *
rem              - Sample coding: PADDR-PRTOUT-04=186.240.132.132                 *
rem      PADDR-PRTOUT-05                                                          *
rem              - IP Address where Field Orders in Print File 05 will be printed *
rem              - Sample coding: PADDR-PRTOUT-05=186.240.132.132                 *
rem      PADDR-PRTOUT-06                                                          *
rem              - IP Address where Field Orders in Print File 06 will be printed *
rem              - Sample coding: PADDR-PRTOUT-06=186.240.132.132                 *
rem      PADDR-PRTOUT-07                                                          *
rem              - IP Address where Field Orders in Print File 07 will be printed *
rem              - Sample coding: PADDR-PRTOUT-07=186.240.132.132                 *
rem      PADDR-PRTOUT-08                                                          *
rem              - IP Address where Field Orders in Print File 08 will be printed *
rem              - Sample coding: PADDR-PRTOUT-08=186.240.132.132                 *
rem      PADDR-PRTOUT-09                                                          *
rem              - IP Address where Field Orders in Print File 09 will be printed *
rem              - Sample coding: PADDR-PRTOUT-09=186.240.132.132                 *
rem      PADDR-PRTOUT-10                                                          *
rem              - IP Address where Field Orders in Print File 10 will be printed *
rem              - Sample coding: PADDR-PRTOUT-10=186.240.132.132                 *
rem *******************************************************************************

SET   "D1HOST=%DOC1HOSTDIR%\generate"
SET   "D1APPATH=%DOC1HOSTDIR%\AppFiles"
SET   "PRODPATH=%SPLEBASE%\splapp\billView"
SET   "WEBPATH=%SPLEBASE%\splapp\billView\"
SET   "XTRCTPTH=%SPLOUTPUT%"
SET   "SORTPATH=%WINDIR%\system32"
SET   "PADDR-PRTOUT-01=63.162.50.9"
SET   "PADDR-PRTOUT-02=63.162.50.9"
SET   "PADDR-PRTOUT-03=63.162.50.9"
SET   "PADDR-PRTOUT-04=63.162.50.9"
SET   "PADDR-PRTOUT-05=63.162.50.9"
SET   "PADDR-PRTOUT-06=63.162.50.9"
SET   "PADDR-PRTOUT-07=63.162.50.9"
SET   "PADDR-PRTOUT-08=63.162.50.9"
SET   "PADDR-PRTOUT-09=63.162.50.9"
SET   "PADDR-PRTOUT-10=63.162.50.9"
SET   "FLNAME=fdillon_012347890"

rem *******************************************************************************
rem    The following switches which enable certain steps to be bypassed           *
rem ==============================================================================*
rem      PRINTFILES                                                               *
rem              - May be:  Y or N                                                *
rem              - "N" prevents files from being sent to PADDR printer            *
rem      DELETEFILES                                                              *
rem              - May be:  Y or N                                                *
rem              - "N" prevents intermediate work files from being deleted        *
rem *******************************************************************************

SET   PRINTFILES=N
SET   DELETEFILES=Y

rem *******************************************************************************
rem    The following symbols are used for controls                                *
rem ==============================================================================*
rem      PSTREAM                                                                  *
rem              - Identifies the type of print description language for output   *
rem              - Possible values are AFP, PDF, or PostScript                    *
rem      RUN_TYPE                                                                 *
rem              - Distinguishes between online production vs batch production    *
rem              - Possible values are ONLINE and BATCH                           *
rem *******************************************************************************

SET   PSTREAM=PDF
SET   RUN_TYPE=ONLINE

rem *******************************************************************************
rem    The symbols identify application resource files for DOC1.  These values of *
rem    the file names should not be changed unless the files are either renamed   *
rem    or replaced.                                                               *
rem ==============================================================================*
rem   L O G F I L E                                                               *
rem   =============                                                               *
rem      LOGFILE                                                                  *
rem              - Name of a log file to be created by this process               *
rem              - Previous version of file will be replaced                      *
rem              - File will be written to %PRODPATH% directory                   *
rem              - Sample coding:  LOGFILE=spl-fop.log                            *
rem                                                                               *
rem    D O C 1   R E S O U R C E   F I L E S                                      *
rem    =====================================                                      *
rem      GEN_OPS                                                                  *
rem              - Names DOC1GEN Initialization file for Format step              *
rem              - Sample value: GEN_OPS=splfop_s5_v3_doc1gen.ops                 *
rem              - File must be present in the %D1APPATH% directory               *
rem      GEN_HIP                                                                  *
rem              - Names DOC1GEN Application Rules (.HIP)                         *
rem              - Sample value: GEN_HIP=splfop_s5_v3_doc1gen.hip                 *
rem              - File must be present in the %D1APPATH% directory               *
rem      GEN_ETS                                                                  *
rem              - Names Lookup file                                              *
rem              - Sample value: GEN_ETS=splfop_s5_v3_doc1gen.ops                 *
rem              - File must be present in the %D1APPATH% directory               *
rem      FOP_PCE_INI                                                              *
rem              - Names DOC1PCE Initialization file                              *
rem              - Sample value: FOP_PCE_INI=splfop_s5_v3_postp_pce.ini           *
rem              - File must be present in the %D1APPATH% directory               *
rem      FOP_PCE_CTL                                                              *
rem              - Names DOC1PCE Rules file                                       *
rem              - Sample value: FOP_PCE_CTL=splfop_s5_v3_postp_pce.ctl           *
rem              - File must be present in the %D1APPATH% directory               *
rem      LOGOXML                                                                  *
rem              - Names XML file that identifies the bitmap used for a company   *
rem                logo and contains sizing attributes of the bitmap              *
rem              - Sample value: LOGOXML=splfop_s5_v3_doc1gen_logo.xml            *
rem              - File must be present in the %D1APPATH% directory               *
rem                                                                               *
rem    F I E L D   O R D E R   P R I N T   F I L E                                *
rem    ===========================================                                *
rem      SPL_UNSORTED_EXTRACT                                                     *
rem              - Names Field Order Print Extract                                *
rem              - Typical coding SPL_UNSORTED_EXTRACT=fopxtr01.dat               *
rem                                                                               *
rem *******************************************************************************

SET   "LOGFILE=%OUTPUTBASENAME%.log"
IF .%OUTPUTBASENAME% == .                                          SET   "LOGFILE=spl-fop.log"

SET   "FOP_PCE_INI=splfop_s5_v3_postp_pce.ini"
SET   "FOP_PCE_CTL=splfop_s5_v3_postp_pce.ctl"
SET   "LOGOXML=splfop_s5_v3_doc1gen_logo.xml"

SET   "GEN_HIP=splfop_s5_v3_doc1gen_pdf.hip"
SET   "GEN_OPS=splfop_s5_v3_doc1gen.ops"
SET   "GEN_ETS=splfop_s5_v3_doc1gen.ets"

SET   "SPL_UNSORTED_EXTRACT=%INPUTBASENAME%.DAT"
IF .%INPUTBASENAME% == .                                           SET   "SPL_UNSORTED_EXTRACT=FOPXTR01.DAT"

SET   "FNP="

IF    EXIST "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%"                    GOTO    HAVE-SPL-EXTRACT
ECHO No SPL Extract found "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%" - process bypassed
ECHO No SPL Extract found "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%" - process bypassed                    >> "%PRODPATH%\%LOGFILE%"
ECHO Process Ended with Completion Code 200                                                         >> "%PRODPATH%\%LOGFILE%"
GOTO  FOP-RUN-END

:HAVE-SPL-EXTRACT
CALL "%D1APPATH%\splfop_s5_v3_called_jobsteps.bat"

:FOP-RUN-END