# # File: mkScriptLib.ini # # Function: Makes a whack of HTML Pages # by reading STH:WebScripts # # External files: The following "pattern files" are used # # [Main] Server = $ ENV, ArsSvr $ Port = $ ENV, ArsPort $ User = $ ENV, ArsUsr $ Password = $ ENV, ArsPwd $ ArgNm = Fpfx PrmReq = 1, . PrmReq = . PrmReq = . Function: PrmReq = . This builds Meta-Update Script Library Web pages for PrmReq = . individual scripts pointed to by a filename in the record. PrmReq = . We read STH:WebStr and generate an html page for each record PrmReq = . as well as the index.html with the link table to each of PrmReq = . the built pages. PrmReq = . PrmReq = . Usage: PrmReq = . SthMupd.exe -v $CTL, ScriptFx$ -p Fpfx PrmReq = . where: PrmReq = . Fpfx output file prefix (w/ path) eg: x42_ or /m/k/x42_ PrmReq = . PrmReq = . Notes: PrmReq = . PrmReq = . #--- Do ----------------------------------------------------------------.do++ [Do] # This is the main entry point of this script. This section is # specified on the command line. # # We do an AssignInit to allow for some script configurations # then we query our form of WebScripts in Remedy # specifying a sort order. # AssignInit = asg-Cfg Query = Scr, & STH:WebScr, & @sort(Complexity, Sort, Category, Type, Item), & 'Status' = "Active" AssignPre = DoOnePgEg-asgInit Launch = DoOnePgEg Launch = DoOnePg Launch = DoIndex [DoOnePgEg] # # This queries a dependent form, building an inner string of examples # a la
text
[
.. ] # AssignInit = DoOnePgEg-asgInit Query = Eg, & STH:WebScrEg, & 'WebScriptId' = "$Scr, 1$" AssignPre = DoOnePgEg-asgPre AssignTerm = DoOnePgEg-asgTerm [DoOnePgEg-asgInit] @Cmd = Ref, ScrV, Eg, "" [DoOnePgEg-asgTerm] @Cmd = @if("$ScrV, Eg$" != "") & Ref, ScrV, Eg, "$ScrV, Eg$ " [DoOnePgEg-asgPre] @Cmd = @if("$ScrV, Eg$" == "") @Cmd = Ref, ScrV, Eg, "
"
@Cmd       = else
  @Cmd       = Ref, ScrV, Eg,                "$ScrV, Eg$\n"
@Cmd       = endif
@Cmd       = Ref, ScrV, Eg,                "$ScrV, Eg$ SthMupd.exe  $Eg, Text$ "


[DoOnePg]
Output       = F2,   F-scr_detail,   $Arg, Fpfx$scr_$Scr,  Fnm$.html
Assign       = F-OnePg-asg
###  Double Output= caused a blow up here!
###  Output       = F2,   F-index,   $Arg, Fpfx$scr_$Scr,  Fnm$.html


[F-OnePg-asg]
#            init some fields
@Cmd       = Ref, ScrV, Demonstrates,      ""
@Cmd       = Ref, ScrV, Loading,           ""
@Cmd       = Ref, ScrV, LoadingNA,         ""
@Cmd       = Ref, ScrV, icotext,                 "                             &
                                                            &
                                      &
                                                 "


#            handle the ico and img attachments ...
@Cmd       = @if("$Scr, ico$" != "")
  @Cmd       = Ref,   V2,    @rc,           0
  @Cmd       = Ref,   V2,    extension,     ""
  # extracts the file path, name, extension, from the attachment name
  # caution!  the $Scr, outp$ reference in the next line, causes a get of the attachment val
  #           really, the val IS the name (only) unless being assigned to an attachment field
  #                   esp now that we have AttachSave ..
  @Cmd       = Ref,   V2,    F-split,   @regex,   @(.*)[/\\\\](.*)\\.(.*)@,  $Scr, ico$
  @Cmd       = @if(! "$V2, @rc$")
    @Cmd       = Msg,  W, regex no match:   @(.*)[/\\\\](.*)\\.(.*)@ against: $Scr, ico$
    @Cmd       = Msg,  W,                   File not extracted
  @Cmd       = else
    @Cmd       = Ref,  V2,  icoR,   "scr_$Scr, Fnm$-ico.$V2, extension$"
    @Cmd       = Ref,  V2,  ico,    "$Arg, Fpfx$$V2, icoR$"
    @Cmd       = AttachSave,   Scr,  ico,  "$V2, ico$"
    @Cmd       = @if("$Scr, img$" != "")
      @Cmd       = Ref,   V3,    @rc,           0
      @Cmd       = Ref,   V3,    extension,     ""
      @Cmd       = Ref,   V3,    F-split,   @regex,   @(.*)[/\\\\](.*)\\.(.*)@,  $Scr, img$
      @Cmd       = @if(! "$V3, @rc$")
        @Cmd       = Msg,  W, regex no match:   @(.*)[/\\\\](.*)\\.(.*)@ against: $Scr, img$
        @Cmd       = Msg,  W,                   File not extracted
        @Cmd       = Ref, ScrV, icotext,           "                           &
                

& \"Sample &

& &

& Sample Output &

& " @Cmd = else @Cmd = Ref, V3, imgR, "scr_$Scr, Fnm$-img.$V2, extension$" @Cmd = Ref, V3, img, "$Arg, Fpfx$$V3, imgR$" @Cmd = AttachSave, Scr, img, "$V3, img$" @Cmd = Ref, ScrV, X, 1012 @Cmd = Ref, ScrV, Y, 588 @Cmd = @if("$Scr, ImgWinszH$" != "") & Ref, ScrV, X, $Scr, ImgWinszH$ @Cmd = @if("$Scr, ImgWinszV$" != "") & Ref, ScrV, Y, $Scr, ImgWinszV$ @Cmd = Ref, ScrV, icotext, " &

& & \"Sample &

&

& Click the & & Sample Output & & to open a
new window with an enlarged image. &

& " @Cmd = endif @Cmd = else @Cmd = Ref, ScrV, icotext, " & \"Sample & &

& Sample Output &

& " @Cmd = endif @Cmd = endif @Cmd = endif # handle line fields in the long description and Demonstrates # xlate all into

##@Cmd = Ref, ScrV, F-OnePg-asg-RegexFlds, @regex, @(.*)@, $Scr, DescriptionLong$ # get rid of any terminating line feeds ##@Cmd = Ref, ScrV, F-OnePg-asg-RegexFlds, @regex, @(.*)\<\\p\>\$@, $ScrV, DescLong$ @Cmd = Ref, ScrV, DescLong, $Scr, DescriptionLong$ # ditto for Demonstrates ##@Cmd = Ref, ScrV, F-OnePg-asg-RegexDemo, @regex, @(.*)@, $Scr, Demonstrates$ ##@Cmd = Ref, ScrV, F-OnePg-asg-RegexDemo, @regex, @(.*)\<\\p\>\$@, $ScrV, Demonstrates$ # handle the text of Demonstrates @Cmd = Ref, ScrV, Demonstrates, $Scr, Demonstrates$ @Cmd = Ref, ScrV, Demonstrates2, @F-OnePg-asg-Demonstrates @Cmd = Ref, ScrV, Demonstrates, $ScrV, Demonstrates2$ @Cmd = Ref, ScrV, Demonstrates2, /del # ditto for loading ##@Cmd = Ref, ScrV, F-OnePg-asg-RegexLoad, @regex, @(.*)@, $Scr, Loading$ ##@Cmd = Ref, ScrV, F-OnePg-asg-RegexLoad, @regex, @(.*)\<\\p\>\$@, $ScrV, Loading$ @Cmd = Ref, ScrV, Loading, $Scr, Loading$ # handle the text of Loading @Cmd = Ref, ScrV, Loading, @F-OnePg-asg-Loading # handle the text of Downloading the zip @Cmd = Ref, ScrV, Dnld, @F-OnePg-asg-Dnld # eh bien, build the file easy peasy File = ptn2\\dtl.ptn [F-OnePg-asg-Dnld] # # This is a "called" assignment. # It checks out the availble download files and builds the download links # text and saves the download files .. @Cmd = Ref, V, gotul, 0 String = "

" String = " " String = " " String = " " String = " " @Cmd = @if("$Scr, zip$" != "") @Cmd = @if(! "$V, gotul$") Include, F-OnePg-asg-Dnld-ul String = "

Save the zip, expand in your samples or scripts directory. " String = " The zip file may contain different versions of the script " String = " and a tutorial document. " String = "

" String = "
  • zip
  • " @Cmd = AttachSave, Scr, zip, "$Arg, Fpfx$scr_$Scr, Fnm$.zip" @Cmd = endif @Cmd = @if("$Scr, ini$" != "") @Cmd = @if(! "$V, gotul$") Include, F-OnePg-asg-Dnld-ul String = "
  • Script Source
  • " @Cmd = AttachSave, Scr, ini, "$Arg, Fpfx$scr_$Scr, Fnm$.ini" @Cmd = endif @Cmd = @if("$Scr, outp$" != "") # get rid of anoying error msg - change Mupd's SkipIf!!!! # extracts the file path, name, extension, from the attachment name # caution! the $Scr, outp$ reference in the next line, causes a get of the attachment val # really, the val IS the name (only) unless being assigned to an attachment field # esp now that we have AttachSave .. @Cmd = Ref, VV, F-split, @regex, @(.*)[/\\\\](.*)\\.(.*)@, $Scr, outp$ @Cmd = @if(! "$VV, @rc$") @Cmd = Msg, W, regex no match: @(.*)[/\\\\](.*)\\.(.*)@ against: $Scr, outp$ @Cmd = Msg, W, File not extracted @Cmd = else @Cmd = @if(! "$V, gotul$") Include, F-OnePg-asg-Dnld-ul @Cmd = Ref, VV, outp, "$Arg, Fpfx$scr_$Scr, Fnm$.$VV, extension$" @Cmd = Ref, VV, outpR, "scr_$Scr, Fnm$.$VV, extension$" String = "
  • Output Example
  • " @Cmd = AttachSave, Scr, outp, "$VV, outp$" @Cmd = endif @Cmd = endif @Cmd = @if(! "$V, gotul$") Include, F-OnePg-asg-Dnld-ul String = "
    Downloads
    " String = "
    " [F-OnePg-asg-Dnld-ul] # This assignment section is referenced by [F-OnePg-asg-Dnld] when # we're handling the first of the Dnld files; it adds the opening #