Ignore:
Timestamp:
04/26/13 18:30:12 (8 years ago)
Author:
ak19
Message:

Adding in 2 basic JSON examples for the metadata-server.pl help/usage string that can be pasted in the browser. Still to add help strings for other metadata-server actions that take a JSON parameter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/baseaction.pm

    r27159 r27261  
    8787        $err_mess .= "\n";
    8888        }
     89
     90        my @help_examples = ();
     91        if(defined $action_table->{$a}->{'help-string'}) {
     92        push(@help_examples, @{$action_table->{$a}->{'help-string'}});
     93        }
     94        if (scalar(@help_examples)>0) {
     95
     96        if (scalar(@help_examples)>1) {
     97            $err_mess .= "    Example(s)  :\n";
     98        } else {
     99            $err_mess .= "    Example  :\n";
     100        }
     101        $err_mess .= join(", \n\n", @help_examples);
     102        $err_mess .= "\n\nTo be strictly CGI-compliant special chars like double-quotes,&,?,<,> must be URL encoded.\n";
     103        }
     104
    89105        $err_mess .= "\n";
    90106    }
     
    203219
    204220
    205 
    206 
    207221sub authenticate_user
    208222{
     
    449463
    450464
    451 
    452 
    453465sub run_script
    454466{
     
    493505}
    494506
    495 
    496 
    497 
    4985071;
Note: See TracChangeset for help on using the changeset viewer.