Changeset 27261 for main/trunk/greenstone2/perllib/cgiactions
- Timestamp:
- 2013-04-26T18:30:12+12:00 (11 years ago)
- Location:
- main/trunk/greenstone2/perllib/cgiactions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/baseaction.pm
r27159 r27261 87 87 $err_mess .= "\n"; 88 88 } 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 89 105 $err_mess .= "\n"; 90 106 } … … 203 219 204 220 205 206 207 221 sub authenticate_user 208 222 { … … 449 463 450 464 451 452 453 465 sub run_script 454 466 { … … 493 505 } 494 506 495 496 497 498 507 1; -
main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
r27222 r27261 90 90 "set-metadata-array" => { 91 91 'compulsory-args' => [ "where", "json" ], 92 'optional-args' => [ ] }, 92 'optional-args' => [ ], 93 'help-string' => [ 94 'A simple example: metadata-server.pl?a=set-metadata-array&where=archives|index|import&c=demo&json=[{"docid":"HASHc5bce2d6d3e5b04e470ec9","metaname":"Title","metavalue":"Tralalala","metamode":"accumulate"},{"docid":"HASHbe483fa4df4e096335d1c8","metaname":"Title","metavalue":"Lala was here","metapos":0, "metamode":"override"}]', 95 96 'A more complex example: metadata-server.pl?a=set-metadata-array&where=archives|index&c=demo&json=[{"docid":"HASHc5bce2d6d3e5b04e470ec9.1","metatable":[{"metaname":"Title","metavals":["Transformers","Robots in disguise","Autobots"]}],"metamode":"override"},{"docid":"HASHbe483fa4df4e096335d1c8.2","metaname":"Title","metavalue":"Pinky was here","metamode":"accumulate"}]' ] }, 97 98 # The same examples rewritten for when running the metadata-server.pl script from the commandline: 99 100 # the simple example: metadata-server.pl a="set-metadata-array" where="archives|index|import" c="demo" json="[{\"docid\":\"HASHc5bce2d6d3e5b04e470ec9\",\"metaname\":\"Title\",\"metavalue\":\"Tralalala\",\"metamode\":\"accumulate\"},{\"docid\":\"HASHbe483fa4df4e096335d1c8\",\"metaname\":\"Title\",\"metavalue\":\"Lala was here\",\"metapos\":0, \"metamode\":\"override\"}]", 101 102 # the more complex example: metadata-server.pl a="set-metadata-array" where="archives|index" c="demo" json="[{\"docid\":\"HASHc5bce2d6d3e5b04e470ec9.1\",\"metatable\":[{\"metaname\":\"Title\",\"metavals\":[\"Transformers\",\"Robots in disguise\",\"Autobots\"]}],\"metamode\":\"override\"},{\"docid\":\"HASHbe483fa4df4e096335d1c8.2\",\"metaname\":\"Title\",\"metavalue\":\"Pinky was here\",\"metamode\":\"accumulate\"}]" 93 103 94 104 "set-archives-metadata-array" => {
Note:
See TracChangeset
for help on using the changeset viewer.