IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 21, 2015, 2:45:57 PM (11 years ago)
Author:
watersc1
Message:

Add schema browser parser code to render.pl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/config/render.pl

    r38869 r38936  
    8585    }
    8686    render_bottom();
    87 }
     87
     88}
     89
     90if (1) {
     91# Begin schema organization form.
     92   
     93    open(SB,"./schema_browser.vot");
     94    my $depth = 0;
     95   
     96    render_SB_start();
     97    while (<SB>) {
     98        chomp;
     99       
     100        if ($_ =~ /<RESOURCE /) {
     101            $depth++;
     102            if ($depth == 1) {
     103                render_SB_resource($_);
     104            }
     105            elsif ($depth == 2) {
     106                render_SB_table($_);
     107            }
     108        }
     109        elsif ($_ =~ /<TABLE /) {
     110            if ($depth == 1) {
     111                render_SB_table($_);
     112            }
     113        }
     114        elsif ($_ =~ /<\/RESOURCE>/) {
     115            $depth--;
     116        }
     117    }
     118    close(SB);
     119    render_SB_stop();
     120}
     121
    88122render_post();
    89123close RR;
     
    229263}
    230264
     265sub render_SB_start {
     266    pRR '\end{landscape}';
     267
     268    pRR '\newpage';
     269    pRR '\vspace*{1in}';   
     270   
     271    pRR '\setcounter{section}{0}';
     272    pRR '\renewcommand\thesection{\Alph{section}}';
     273    pRR '\section{Schema Browser Listing}';
     274    pRR '\footnotesize';
     275#    pRR '\begin{center}';
     276    pRR '\begin{longtable}{|l|l|l|}';
     277    pRR '\setlength{\LTleft}{0pt}%';
     278}
     279
     280sub render_SB_resource {
     281    my $name = $_;
     282    $name =~ s/^.*name="//;
     283    $name =~ s/">.*$//;
     284
     285    pRRx '\parbox[t][][t]{2in}{\bf ' . $name . '} & ';
     286    pRR '\parbox[t][][t]{3in}{} \\\\ ';
     287}
     288
     289sub render_SB_table {
     290    my $name = shift;
     291    $name =~ s/^.*name="//;
     292    $name =~ s/">.*$//;
     293
     294    pRRx '\parbox[t][][t]{2in}{} & ';
     295    pRR '\parbox[t][][t]{3in}{' . $name . '} \\\\ ';
     296}   
     297   
     298
     299sub render_SB_stop {
     300    pRR '\end{longtable}';
     301    pRR '\normalsize';
     302    pRR '\begin{landscape}';
     303}
     304
     305
    231306sub render_end {
    232307    pRR '\end{longtable}';
Note: See TracChangeset for help on using the changeset viewer.