{"id":3286,"date":"2014-10-25T00:34:01","date_gmt":"2014-10-25T00:34:01","guid":{"rendered":"http:\/\/www.fingerpost.co.uk\/wp\/programme-documentation\/ipadorachk\/"},"modified":"2014-10-25T00:34:01","modified_gmt":"2014-10-25T00:34:01","slug":"ipadorachk","status":"publish","type":"page","link":"https:\/\/www.fingerpost.co.uk\/wp\/programme-documentation\/ipadorachk\/","title":{"rendered":"ipadorachk  (Sat Oct 25 2014 01:31:01)"},"content":{"rendered":"<pre>\nipadorachk\n\nThis program is used to lookup data from a database as part of the Fip CopyFlow\nincluding :\n\t- extracting ad information from an Adora database.\n\t- matching Company information against a Ticker database.\n\n\t-Option 1 get the 'highref' for EPSF files from 'material\/matver'.\n\t\tIf the EPSF has a LowRes call embedded,\n\t\t- we extract the high-res material code from the data\n\t\t- grab the corresponding high-res id from Adora 'materialhigh'\n\t\t- replace the lowres with by the relevant high-res (actually a PCI\/OPI cal)\n\t\t- Option 1 is the default.\n\n\t-Option 2 find the 'material\/matver for each 'pictref' in materialpict for\nMediaPlanner.\n\n\t-Option 3 find the 'pictref' for a ClassFolio from uap_pv_folios\n\t\tUses ClassFolio PC and PageNumber PN inbound and QC + QP internally\n\t\tQC is PC (or half of PC for split pages)\n\t\tQP is left\/right\/full for split pages\n\n\t-Option 4 AFX symbology lookup\n\n\t-Option 5 Generic database lookup for finding metadata etc\n\t\tuse sql-line to specify the sp or sql to run\n\t\tuse -1 or -i or -h to input fiphdr info\n\t\tuse -D to just display the data or -O for an output file\n\n\t-Option 6 and 7 resolve opi calls to Adora\n\t\tuse sql-line to specify the sp or sql to run\n\t\tuse -1 or -i to input EPS file\n\t\tuse parameters\teps-start and eps-end for the template start and ends\n\t\tplus 'convert' for any file conversions to EPS\n\t\tThe difference between 6 and 7 is :\n\t\t\toption 6 - input -1 is full path\/filename\n\t\t\toption 7 - input -1 is an OPI call\n\nA parameter file for Sybasy sort of things is held in tables\/setup and defaults\nto ADORACHK.\n\nKeywords for ADORACHK parameter file are :\n\t; comment line\n\tuser: sybase user name\n\t\tuser:sa\n\tpasswd:\tSybase passwd\n\t\tpasswd:sports\n\tserver:\tSybase server name\n\t\tserver:JERRYSYB\n\tdatabase: Database name (Sybase, MSsql server and MYsql only)\n\t\tdatabase:mlt2\n\tnewname: Name of the output file\n\t\tThe default is the same as the input.\n\tsql-line: actual sql to run.\n\t\t\tFor version 1, default is :\n\t\tselect highref from materialhigh where material = PM and matver = PV\n\t\t\tFor version 2, default is :\n\t\tselect material, &quot;-&quot;, matver from materialpict where pictref = &quot;PR&quot;\n\t\t\tFor version 3, default is :\n\t\texec uap_get_folio &quot;QC&quot;, &quot;QP&quot;\n\t\t\tFor versions 5 and 6 there is no default and this MUST be specified.\n\n\tFor Version 4\n\t\tsql-line-1: first select\n\t\tsql-line-2: second select if the first does not work\n\t\t\t(ie sql-line-1 returns no rows)\n\t\texch-fiphdr: 2 letter FipHdr field containing the exchange\n\t\t\t\tie in the input FipHdr - default is J4\n\t\tsym-fiphdr: 2 letter FipHdr field containing the symbol\n\t\t\t\tie in the input FipHdr - default is J2\n\t\tv4-fiphdr-subject:\n\t\tv4-fiphdr-industry:\n\t\tv4-fiphdr-country:\n\t\t\t2 letter FipHdr field for the output file for these.\n\n\tFor Version 5\n\t\trun-all-sql-lines:yes\/no\tdefault:no\n\t\t\tif yes - run all the sql-line* that are not empty\n\t\t\tif no - stop after the first line that does not error\n\t\t\tUse this for MYSQL stored procedures eg:\nrun-all-sql-lines:yes\n\nsql-line-1:call fip_chk_pnac ('TN', 'T7', 'HR', 'TZ', '$c', @hr, @acto)\nsql-line-2:select 'Z6:', @hr, '#Z7:', @acto;\n\n\t\t\t\n\n\tFor Version 6 and 7\n\t\teps-start: (Filename)\n\t\teps-end: (Filename)\n\t\t\tTemplates for the standing postscript to start and end an Eps include\n\t\tconvert:(name)\tmagic:(magic)   script:(script)\n\t\t\tSee Below\n\t\tconvert-8bit-tiff:(script)\n\t\t\tspecial case for 8 bit grey tiffs which need to be coloured scripts\n\t\tconvert-1bit-tiff:(script)\n\t\t\tspecial case for one bit scripts\n\t\tforce-1bit-colour:0 1 0 0\n\t\t\tcmyk values for 1 bit tiff conversion that needs to be a single spot\n\t\tmangle-bitmap:yes\n\t\t\tforce image to imagemask for 1 bit TIFF conversions\n\t\treuse-converted-images:\n\t\t\tdo not convert an image which has already been converted\n\t\t\tby a previous ipadorachk run.\n\nOther keywords -\n\n\tsep:\n\tfield-sep:\n\tno-sep:\n\tno-field-sep:\n\n\ttemplate-file:\n\t\tany new data is slotted in as FipHdr field QI\n\t\t\teg\tcp \/fip\/fix\/NULL \/fip\/spool\/2go\/QI\n\n\textra-fiphdr: (FipSeq)\n\textra-fiphdr-after: (FipSeq)\n\tAdd more FipHdr information either before and\/or after processing\n\n\tlog: (FipSeq)\n\t\tV5 - replacement log line if the log input switch is ON '-L'\n\t\tNote that FipHdr fields ER and EM hold the result and any message\n\n&lt;hr&gt;\nInput Parameters are :\nMandatory :\neither\n\t-1 : filename and path of a single file \tdefault: none\n\t\tIf this does NOT start with a '\/', it is assumed under the current path.\nor\n\t-i : input queue to scroll\t\t\tdefault: none\n\t\tIf this does NOT start with a '\/', it is assumed under spool.\nor\n\t-f : FipHdr fields\t\t\t\tdefault: none\n\t\teg -h&quot;#J4:NYSE#J2:FIP&quot;\n\t\tor remembering to escape the Hashes in a perl script\n\t\t\t-h&quot;#J4:NYSE#J2:FIP&quot;\nOptional :\n\t-V : version or option number\t\t\tdefault: 1\n\t\tCan be 1 - 7 \n\t-d : done queue for a copy of the raw input\tdefault: file is deleted\n\t\tIf this does NOT start with a '\/', it is assumed under spool.\n\t-o : output or done queue\t\t\tdefault: file is deleted\n\t\tIf this does NOT start with a '\/', it is assumed under spool.\n\t-O : output filename \t\t\t\tdefault: same as input name if needed\n\t\tthis is the same as the 'newname' parameter\n\t-z : parameter file in tables\/setup\t\tdefault: tables\/stats\/ADORACHK\n\t-X : always replace\/supercede an existing file\tdefault: preserve\n\t\tof the same output name.\n\t-w : file wait for files arriving across a network.\tdef: 0 secs\n\t-l : do NOT log files in\t\t\tdefault: log\n\t-L : detail log \t\t\t\tdefault: log\n\t-h : extra FipHdr string to use\t\t\tdefault: none\n\t\tthis is the same as the 'fiphdr' parameter\n\t-H : no FipHdr on the output pls\t\tdefault: copy FipHdr\n\t-D : display data to stdout and do NOT add to a file\tdefault: only put in a\nfile\n\t-v : print version number and exit\n&lt;hr&gt;\n\nNotes - Converting NON-eps files to PostScript (v6)\n----------------------------------------------\nThe Magic number of each data file (the first 4 bytes) is checked. All\nPostScript and PostScript with Binary Header files are left 'as is' and the\nfilename noted. All other types are compared against our table of images\ndefined with the 'convert' parameter.\n\nIf the image is on that list and there is a conversion script to convert it to\nEPS then that is run and the EPS file dropped into the 'raw file path' -\nusually spool\/epsf.\n\nThe syntax of the 'convert' keyword is\n\tconvert: (name)   magic:(1st 4 chrs of file)\tscript: (script to run to\nconvert)\n\n- Use double quotes to keep the spaces\n- The script MUST generate a file in spool\/epsf with the same filename as the\ninput with an Extra extension of '.eps'.\n\nexamples of using Image Alchemy to convert TIFF files :\nconvert:tiffII\tmagic:&quot;II*00&quot; script:&quot;\/usr\/forum\/bin\/alchemy QI\/QF QO\/QN\n-Q -o -e 1400 --.&quot;\nconvert:tiffMM\tmagic:&quot;MM00*&quot; script:&quot;\/usr\/forum\/bin\/alchemy QI\/QF QO\/QN\n-Q -o -e 1400 --.&quot;\n\nThere is also a special case for converting 1bit tiffs\nconvert-1bit-tiff:&quot;\/usr\/forum\/bin\/alchemy QI\/QF QO\/QN -Q -o -e 2000 --.&quot;\n\n;There is also a special case for converting 1bit tiffs using PP-Pub and\nColour..\nconvert-8bit-tiff:&quot;\/usr\/bin\/perl \/fip\/local\/convert8bittiffs.pl pub=PP\ncolour='C0' tint=T0 in=QI\/QF out=QO\/QN&quot;\n\n- Note that even more FipHdr fields are available ONLY for the script :\n\tQI - Path\/queue\/folder where the Input file resides\n\tQF - name of the input file to be converted (no folder\/path info)\n\tQO - Path\/queue\/folder for the Output,converted files\n\t\tthis is \/fip\/spool\/epsf unless overridden\n\tQN - name of the output filename\n\t\tthis will be a made up TMP name ending with a '.eps' extension\n\nVersion 6 and 7 FipHdr fields\n-----------------------------\n% PDF-OPI-START version 2b 21feb2005\n% Level\tFL\n% Original   FO\n% Hires File FN\n% Material   FM\n% Version\tFV\n% BB\t B1 B2 B3 B4\n% Size\tD1 D2\t(D8 D9)\n% Scale\tS1 S2\n% Position   P1 P2 | P3 P4 | P5 P6 | P7 P8\n% Crop\/Mask  C1 C2 C3 C4\n% Tiff Reso  T1 T2\n% Move\tM1 M2\n% Rotate\tR1\n% Colour\tC0\n% Tint\tT0\n\nVersion Control\n;003q4\t09mar05 bugettes\/tweaks for v6\/7\n\t\tadded ALDImageColor\/ALDImageType\/ALDImageColorType\n\t;c 29mar05 color zap for bitmaps only\n\t;d 23apr05 bugette with 90% rotates\n\t;e 14may05 bugettes in filesize when converted file is &gt; 64k and orig &lt; 64k\n\t;f 17may05 added 'mangle-bitmap:yes' as option and turned OFF imagemask\nconversion\n\t\tfr use with CMYK rather than RGB\n\t;g-h xxmay05 script for 1bittiff and tweak for yMove\/Tiff for rounding errors\n\t;i 09aug05 added force-1bit-colour:\n\t;j 12oct05 added %ALDImageTint: .1 -&gt; Tint T0 and affects Colour C0 too\n\t;k 03nov05 added reuse-converted-images\n\t;l 04dec05 added different processes for 8bit grey tiffs which need to be\ncoloured.\n\t;m 09jan05 tiffs with tints generate another eps\n\t;o 21sep06 odbc version\n\t;p5 26oct07 tuned version 5 - generic (added other sql-lines) ;3 tuning ODBC\nversion\n\t;q4 28aug08 added run-all-lines: ;2 error in V4 afxcodes ;3 added log: ;4\nWINNTmysql\n;002z\t27may03 added mysql bits and version 4 ;b 2hits at db\n\t;c 23jul03 added leftpage\/rightpage to V3 for LH\n\t;d-h 25jul03 better V4 for MLT\n\t;i-j 24sep04 speedy\n\t;k-o 19nov04 added -f, -D, -V 5 and -V 6\n\t;p-y 14dec04 added -V 7 same as V6 but resolve the first\n\t\tu-w 4decpts and better crop Dims)\n\t;z 09feb05 redid scaling\/moves for Tiffconversions != 72dpi\n;001b\t10aug00 added -V 2 - todo 'dcs' and flog ?\n\t;a 14sep00 materialPICT not materialHIGH for V2\n\t;b 10may01 added V3\n\n(copyright) 2014 and previous years FingerPost Ltd.\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ipadorachk This program is used to lookup data from a database as part of the Fip CopyFlow including : &#8211; extracting ad information from an Adora database. &#8211; matching Company information against a Ticker database. -Option 1 get the &#8216;highref&#8217; for EPSF files from &#8216;material\/matver&#8217;. If the EPSF has a LowRes call embedded, &#8211; we [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":495,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"page-templates\/full-width.php","meta":[],"_links":{"self":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/3286"}],"collection":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/comments?post=3286"}],"version-history":[{"count":0,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/3286\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/495"}],"wp:attachment":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/media?parent=3286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}