To: Neal From: Steve Subject: Mass Checkout Neal-- I added a front end to the multi check out utility. Thought you might like to get a copy. Please note this is a developer utility and is not as clean as it could be but it seems to work. Also, I am sending the stchkoui.i routine with the modifications Imade to allow this to run. Talk to you later..... ---S /****** beegin mchkui.p *****************/ define var fildir as char format "x(30)" label " Source directory" no-undo. define var fil as char format "x(15)" no-undo. define var prob like smprob.prob-number no-undo. define var to-dir as char format "x(40)" no-undo. define var reason as char format "x(10)" no-undo. def var btn-pressed as int initial 0 no-undo. define temp-table fillst field tmpfil as char format "x(15)" label " File Name". define query q-fil for fillst scrolling. define browse b-fil query q-fil display tmpfil with centered row 6 10 down overlay. define query q-prob for smprob scrolling. define browse b-prob query q-prob display prob-number prob-desc[1] with 8 down. define frame prob-fr b-prob with row 8 overlay centered. define query q-res for smreason scrolling. define browse b-res query q-res display reason with 4 down. define frame res-fr b-res with row 11 overlay centered. define button fil-btn label "Files". define button lv-btn label "Exit". define button pr-btn label "Probs". define button res-btn label "Reasons". define button ok-btn label "OK". define frame fil-fr b-fil with centered overlay. define frame dirframe fildir view-as editor size 30 by 1 fil-btn skip(1) space(6) fil label " Input file" skip(1) space(4) prob label " Issue Number" space(15) pr-btn skip(1) space(10) reason label " Reason" space(10) res-btn skip(1) to-dir label " Check out to dir" skip(1) space(20) ok-btn space(10) lv-btn with centered side-labels. assign fildir = os-getenv("HOME") to-dir = fildir. on choose of fil-btn do: btn-pressed = 1. input through ls -F value(fildir). repeat: create fillst. import tmpfil. if substr(tmpfil,length(tmpfil),1) = "/" or substr(tmpfil,length(tmpfil),1) = "*" then do: delete fillst. next. end. end. input close. open query q-fil for each fillst. enable b-fil with frame fil-fr. apply "next-frame" to frame dirframe. end. on return of browse b-fil do: run chklst.p. display fil with frame dirframe. end. on choose of pr-btn do: btn-pressed = 2. run problst.p. end. on return of browse b-prob do: prob = smprob.prob-number. apply "prev-frame" to frame prob-fr. apply "close" to frame prob-fr. hide frame prob-fr. display prob with frame dirframe. end. on choose of res-btn do: btn-pressed = 3. run reason.p. display reason with frame dirframe. end. on return of b-res do: reason = smreason.reason. apply "prev-frame" to frame res-fr. apply "close" to frame res-fr. hide frame res-fr. display reason with frame dirframe. end. on choose of ok-btn do: fil = fildir + "/" + fil. run mchkout.p( fil, to-dir, reason, prob). end. display fildir to-dir with frame dirframe. enable fildir fil-btn pr-btn res-btn to-dir ok-btn lv-btn with frame = dirframe. case btn-pressed: when 1 then apply "next-tab-item" to pr-btn. when 2 then apply "entry" to res-btn. when 3 then apply "entry" to to-dir. otherwise apply "entry" to fildir. end case. wait-for choose of lv-btn. procedure chklst.p: apply "next-frame" to frame dirframe. fil = fillst.tmpfil. apply "prev-frame" to frame fil-fr. apply "close" to frame fil-fr. hide frame fil-fr. end procedure. procedure problst.p. open query q-prob for each smprob where smprob.prob-user = os-getenv("LOGNAME") no-lock. enable b-prob with frame prob-fr. apply "next-frame" to frame dirframe. end procedure. procedure reason.p. open query q-res for each smreason no-lock. enable b-res with frame res-fr. apply "next-frame" to frame dirframe. end procedure. /************end mckhui.p ************************/ /****************** begin mchkout.p ****************/ def input parameter infil as char format "x(30)" no-undo. def input parameter chkout-dir as char format "x(40)" no-undo. def input parameter reason as char format "x(10)" no-undo. def input parameter problem like smprob.prob-number no-undo. def var filin as char format "x(30)" no-undo. def var filroot as char format "x(10)" no-undo. def var filext as char initial "a.p,u.p,l.p,d.p,fr.i" no-undo. def var cnt as int no-undo. def var tmpnm as char format "x(10)" no-undo. def var pass-fld as char. def var chs_recs as char no-undo. {smgrglob.i} {strevvar.i} input through cat value(infil). define temp-table lstfils field filnm as char format "x(30)". for each lstfils: delete lstfils. end. repeat: import filin. create lstfils. assign filnm = filin. end. for each lstfils: display lstfils. assign scat = "" tmpnm = "". assign scat = substr(filnm,1,index(lstfils.filnm,"/") - 1) tmpnm = substr(lstfils.filnm,index(lstfils.filnm,"/") + 1). assign srev = "" sfile = tmpnm. find first stsadm where cat = scat and file = sfile exclusive-lock no-wait no-error. if not available stsadm then next. display scat sfile with frame a down. down with frame a. pause 0 before-hide. {stchkoui.i} end. /************** end mchkout.p ******************/ /* begin stchkoui.i ***/ FORM "@(#) stchkoui.i 1.7 95/06/29 " WITH FRAME sccsid. /*END_OF_RESERVED_STS_DATA*/ def var last-rev like srev no-undo. /* Last revision found */ def var period-pos as int no-undo. SMGR-COMMAND: do with centered 1 down 1 column row 6 title " Checkout Options " overlay frame checkout-foo on endkey undo,leave on error = undo,retry: if retry then do: find first stsadm where cat = scat and file = sfile = exclusive-lock no-error. if available stsadm then inuse-cnt = 1. create stsinuse. assign stsinuse.cat = stsadm.cat stsinuse.file = stsadm.file stsinuse.rev = srev stsinuse.new-rev = snew-rev stsinuse.directory = snormal-pathname stsinuse.prob-number = sprob-number stsinuse.reason = sreason stsinuse.checkout-date = today stsinuse.author = "steve" stsinuse.branch = no. leave SMGR-COMMAND. end. /* update sfile scat . */ find last stsrev where stsrev.file = sfile and stsrev.cat = = scat no-lock. message "looking for most current rev". last-rev = stsrev.rev. if srev = "" then srev = last-rev. /* update srev. */ display srev. {strevcnv.i &rev = "srev"} /* find stsadm where stsadm.file = sfile and stsadm.cat = = scat. */ snormal-pathname = "/fsg/lroberts/work3". if inuse-cnt > 0 and not sallow-multiple-checkouts then do: for each stsinuse where stsinuse.file = sfile and stsinuse.cat = scat no-lock: display stsinuse.rev new-rev stsinuse.author stsinuse.reason = stsinuse.prob-number checkout-date with row 7 centered overlay 5 down frame other-checkouts. end. message "other versions already checked out". /* undo, retry. */ undo SMGR-COMMAND, leave SMGR-COMMAND. end. if srev = last-rev then sbranch = false. else sbranch = yes. display sbranch. /* update sbranch help "Do we force a split in the revision tree = here?".*/ /* OK, what do we do here? Could be blank, whatever. old rev branch new rev = action 1.4 n blank = new-rev=1.5 1.4 y blank = new-rev=1.4.1.1 1.4 n 1.6 Invalid 1.4 n 2 new-rev=2.1 */ find stsrev where stsrev.file = sfile and stsrev.cat = scat = and stsrev.rev = srev no-lock no-error. if not available stsrev then do: message "Sorry, rev " srev " does not appear to = exist". undo, retry. end. if sbranch then snew-rev = srev + ".1.01". else do: /* find number after last period. Tear off change to integer, increment, plunk back on = */ period-pos = r-index(srev, "." ). snew-rev = substring(srev, 1, period-pos) + string(integer( substring(srev, (period-pos + = 1))) + 1, "99"). end. if substring(srev,1,1) = "4" then snew-rev = = "5.01". /* update snew-rev. */ display snew-rev. {strevcnv.i &rev = "snew-rev"} display sreason label "Reason Code". /* do: {choose.i "smreason" "re" "reason" " " "6" "10" "50" "Reasons" " " = "sreason" "checkout-foo" "NORMAL" "smreason.reason" "WHERE TRUE " "*" " " " " " " = }. END. */ sreason = "enhance". display sprob-number snormal-pathname. /* assign sreason. */ /* set sprob-number snormal-pathname help "The subdirectory, if any, in which to place the = file" . */ sprob-number = 184. {stchkoex.i} if check-status = "OK" then message "writable copy of file " sfile " created.". else message "command failed". end. hide frame checkout-foo. /*********** end stchkoui.i *************/