Changeset 4873 for trunk/gsdl/bin/script
- Timestamp:
- 2003-07-03T15:59:04+12:00 (21 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r4776 r4873 46 46 my $mode_list = 47 47 [ { 'name' => "all", 48 'desc' => " Do everything." },48 'desc' => "{buildcol.mode.all}" }, 49 49 { 'name' => "compress_text", 50 'desc' => " Just compress the text." },50 'desc' => "{buildcol.mode.compress_text}" }, 51 51 { 'name' => "build_index", 52 'desc' => " Just index the text." },52 'desc' => "{buildcol.mode.build_index}" }, 53 53 { 'name' => "infodb", 54 'desc' => " Just build the metadata database." } ];54 'desc' => "{buildcol.mode.infodb}" } ]; 55 55 56 56 my $arguments = 57 57 [ { 'name' => "archivedir", 58 'desc' => " Where the archives live.",58 'desc' => "{buildcol.archivedir}", 59 59 'type' => "string", 60 60 'reqd' => "no" }, 61 61 { 'name' => "verbosity", 62 'desc' => " 0=none, 3=lots",62 'desc' => "{buildcol.verbosity}", 63 63 'type' => "int", 64 64 'deft' => "2", 65 65 'reqd' => "no" }, 66 66 { 'name' => "builddir", 67 'desc' => " Where to put the built indexes.",68 'type' => "string", 69 'reqd' => "no" }, 70 71 'desc' => "?",72 'type' => "string",73 'reqd' => "no" },67 'desc' => "{buildcol.builddir}", 68 'type' => "string", 69 'reqd' => "no" }, 70 # { 'name' => "cachedir", 71 # 'desc' => "{buildcol.cachedir}", 72 # 'type' => "string", 73 # 'reqd' => "no" }, 74 74 { 'name' => "maxdocs", 75 'desc' => " Maximum number of documents to build.",75 'desc' => "{buildcol.maxdocs}", 76 76 'type' => "int", 77 77 'reqd' => "no" }, 78 78 { 'name' => "debug", 79 'desc' => " Print output to STDOUT.",79 'desc' => "{buildcol.debug}", 80 80 'type' => "flag", 81 81 'reqd' => "no" }, 82 82 { 'name' => "mode", 83 'desc' => " The parts of the building process to carry out.",83 'desc' => "{buildcol.mode}", 84 84 'type' => "enum", 85 85 'list' => $mode_list, … … 87 87 'reqd' => "no" }, 88 88 { 'name' => "index", 89 'desc' => " Index to build (will build all in config file if not set).",89 'desc' => "{buildcol.index}", 90 90 'type' => "string", 91 91 'reqd' => "no" }, 92 92 { 'name' => "keepold", 93 'desc' => " Will not destroy the current contents of the building directory.",93 'desc' => "{buildcol.keepold}", 94 94 'type' => "flag", 95 95 'reqd' => "no" }, 96 { 'name' => "no_text", 97 'desc' => " Don't store compressed text. This option is useful for minimizing the size of the built indexes if you intend always to display the original documents at run time (i.e. you won't be able to retrieve the compressed text version).",96 { 'name' => "no_text", 97 'desc' => "{buildcol.no_text}", 98 98 'type' => "flag", 99 99 'reqd' => "no" }, 100 100 { 'name' => "allclassifications", 101 'desc' => " Don't remove empty classifications.",101 'desc' => "{buildcol.allclassifications}", 102 102 'type' => "flag", 103 103 'reqd' => "no" }, 104 104 { 'name' => "create_images", 105 'desc' => " Attempt to create default images for new collection. This relies on the Gimp being installed along with relevant perl modules to allow scripting from perl.",105 'desc' => "{buildcol.create_images}", 106 106 'type' => "flag", 107 107 'reqd' => "no" }, 108 108 { 'name' => "collectdir", 109 'desc' => " Collection directory.",109 'desc' => "{buildcol.collectdir}", 110 110 'type' => "string", 111 111 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 112 112 'reqd' => "no" }, 113 113 { 'name' => "out", 114 'desc' => " Filename or handle to print output status to.",114 'desc' => "{buildcol.out}", 115 115 'type' => "string", 116 116 'deft' => "STDERR", 117 117 'reqd' => "no" }, 118 118 { 'name' => "no_strip_html", 119 'desc' => " Do not strip the html tags from the indexed text (only used for mgpp collections).",119 'desc' => "{buildcol.no_strip_html}", 120 120 'type' => "flag", 121 121 'reqd' => "no" }, 122 122 { 'name' => "faillog", 123 'desc' => " Fail log filename. This log receives the filenames of any files which fail to be processed.",123 'desc' => "{buildcol.faillog}", 124 124 'type' => "string", 125 125 'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 126 'reqd' => "no" }, 127 { 'name' => "language", 128 'desc' => "{scripts.language}", 129 'type' => "string", 126 130 'reqd' => "no" } ]; 127 131 … … 133 137 sub print_xml_usage 134 138 { 139 local $language = shift(@_); 140 135 141 &PrintUsage::print_xml_header(); 136 142 … … 140 146 print STDERR " <Arguments>\n"; 141 147 if (defined($options->{'args'})) { 142 &PrintUsage::print_options_xml($ options->{'args'});148 &PrintUsage::print_options_xml($language, $options->{'args'}); 143 149 } 144 150 print STDERR " </Arguments>\n"; … … 149 155 sub print_txt_usage 150 156 { 157 local $language = shift(@_); 158 151 159 local $programname = $options->{'name'}; 152 160 local $programargs = $options->{'args'}; … … 169 177 170 178 # Display the program options 171 &PrintUsage::print_options_txt($ programargs, $optiondescoffset);179 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset); 172 180 } 173 181 } … … 222 230 $debug, $mode, $indexname, $keepold, $allclassifications, 223 231 $create_images, $collectdir, $out, $buildtype, $textindex, 224 $no_strip_html, $no_text, $faillog );232 $no_strip_html, $no_text, $faillog, $language); 225 233 226 234 # ***** 11-04-03 - John Thompson ***** … … 231 239 # later (after we check the collect.cfg file) 232 240 if (!parsargv::parse(\@ARGV, 241 'language/.*/', \$language, 233 242 'verbosity/\d+/', \$verbosity, 234 243 'archivedir/.*/', \$archivedir, 235 'cachedir/.*/', \$cachedir, 244 'cachedir/.*/', \$cachedir, # UNDOCUMENTED 236 245 'builddir/.*/', \$builddir, 237 246 'maxdocs/^\-?\d+/', \$maxdocs, … … 248 257 'faillog/.*/', \$faillog, 249 258 q^xml^, \$xml)) { 250 &print_txt_usage( );259 &print_txt_usage($language); 251 260 die "\n"; 252 261 } 253 262 254 263 if ($xml) { 255 &print_xml_usage( );264 &print_xml_usage($language); 256 265 die "\n"; 257 266 } … … 268 277 # get and check the collection 269 278 if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") { 270 &print_txt_usage( );279 &print_txt_usage($language); 271 280 die "\n"; 272 281 } -
trunk/gsdl/bin/script/classinfo.pl
r4779 r4873 42 42 print STDERR "\n"; 43 43 print STDERR "classinfo.pl: Prints information about a classifier.\n\n"; 44 print STDERR " usage: $0 [options] classifier\n\n"; 45 print STDERR " options:\n"; 46 print STDERR " -collect collection-name Giving a collection name will make\n"; 47 print STDERR " classinfo.pl look in collect/collection-name/perllib/classify\n"; 48 print STDERR " first. If it doesn't find it there it will look in the general\n"; 49 print STDERR " perllib/classify directory.\n\n"; 50 print STDERR " -xml Produces the information in an xml form, without\n"; 51 print STDERR " 'pretty' comments but with much more detail.\n"; 44 print STDERR " usage: $0 [options] classifier\n\n"; 45 print STDERR " options:\n"; 46 print STDERR " -collect collection-name Giving a collection name will make classinfo.pl\n"; 47 print STDERR " look in collect/collection-name/perllib/classify\n"; 48 print STDERR " first. If the classifier is not found there it will\n"; 49 print STDERR " look in the general perllib/classify directory.\n\n"; 50 print STDERR " -xml Produces the information in an xml form, without\n"; 51 print STDERR " 'pretty' comments but with much more detail.\n\n"; 52 print STDERR " -language language-code Language to display plugin options in (eg. 'en_US'\n"; 53 print STDERR " specifies American English). Requires translations\n"; 54 print STDERR " of the option descriptions to exist in the\n"; 55 print STDERR " perllib/strings_language-code.rb file.\n"; 52 56 } 53 57 … … 57 61 my $collect = ""; 58 62 my $xml = 0; 63 my $language = ""; # Will display in the default language if not set 59 64 60 65 # Parse command line 61 if (!parsargv::parse(\@ARGV, q^collect/.*/^, \$collect, q^xml^, \$xml )) 66 if (!parsargv::parse(\@ARGV, 67 q^collect/.*/^, \$collect, 68 q^xml^, \$xml, 69 q^language/.*/^, \$language)) 62 70 { 63 71 &print_usage(); … … 84 92 85 93 if ($xml) { 86 $classobj->print_xml_usage( );94 $classobj->print_xml_usage($language); 87 95 } 88 96 else { … … 101 109 print STDERR "General options are inherited from parent classes of the classifer.\n\n"; 102 110 103 $classobj->print_txt_usage( );111 $classobj->print_txt_usage($language); 104 112 } 105 113 } -
trunk/gsdl/bin/script/import.pl
r4776 r4873 50 50 my $oidtype_list = 51 51 [ { 'name' => "hash", 52 'desc' => " Hashes the contents of the file. Document identifier will be the same every time the collection is imported." },52 'desc' => "{import.OIDtype.hash}" }, 53 53 { 'name' => "incremental", 54 'desc' => " A simple document count that is significantly faster than \"hash\". It is not guaranteed to always assign the same identifier to a given document though and does not allow further documents to be added to existing xml archives." } ];54 'desc' => "{import.OIDtype.incremental}" } ]; 55 55 56 56 my $arguments = 57 57 [ { 'name' => "archivedir", 58 'desc' => " Where the converted material ends up.",58 'desc' => "{import.achivedir}", 59 59 'type' => "string", 60 60 'reqd' => "no" }, 61 61 { 'name' => "collectdir", 62 'desc' => " Collection directory.",62 'desc' => "{import.collectdir}", 63 63 'type' => "string", 64 64 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 65 65 'reqd' => "no" }, 66 66 { 'name' => "debug", 67 'desc' => " Print imported text to STDOUT.",67 'desc' => "{import.debug}", 68 68 'type' => "flag", 69 69 'reqd' => "no" }, 70 70 { 'name' => "faillog", 71 'desc' => " Fail log filename. This log receives the filenames of any files which fail to be processed.",71 'desc' => "{import.faillog}", 72 72 'type' => "string", 73 73 'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 74 74 'reqd' => "no" }, 75 75 { 'name' => "groupsize", 76 'desc' => " Number of import documents to group into one XML file.",76 'desc' => "{import.groupsize}", 77 77 'type' => "int", 78 78 'deft' => "1", 79 79 'reqd' => "no" }, 80 80 { 'name' => "gzip", 81 'desc' => " Use gzip to compress resulting xml documents (don't forget to include ZIPPlug in your plugin list when building from compressed documents).",81 'desc' => "{import.gzip}", 82 82 'type' => "flag", 83 83 'reqd' => "no" }, 84 84 { 'name' => "importdir", 85 'desc' => " Where the original material lives.",85 'desc' => "{import.importdir}", 86 86 'type' => "string", 87 87 'reqd' => "no" }, 88 88 { 'name' => "keepold", 89 'desc' => " Will not destroy the current contents of the archives directory (the default).",89 'desc' => "{import.keepold}", 90 90 'type' => "flag", 91 91 'reqd' => "no" }, 92 92 { 'name' => "maxdocs", 93 'desc' => " Maximum number of documents to import.",93 'desc' => "{import.maxdocs}", 94 94 'type' => "int", 95 95 'reqd' => "no" }, 96 96 { 'name' => "OIDtype", 97 'desc' => " The method to use when generating unique identifiers for each document.",97 'desc' => "{import.OIDtype}", 98 98 'type' => "enum", 99 99 'list' => $oidtype_list, … … 101 101 'reqd' => "no" }, 102 102 { 'name' => "out", 103 'desc' => " Filename or handle to print output status to.",103 'desc' => "{import.out}", 104 104 'type' => "string", 105 105 'deft' => "STDERR", 106 106 'reqd' => "no" }, 107 107 { 'name' => "removeold", 108 'desc' => " Will remove the old contents of the archives directory -- use with care.",108 'desc' => "{import.removeold}", 109 109 'type' => "flag", 110 110 'reqd' => "no" }, 111 111 { 'name' => "sortmeta", 112 'desc' => " Sort documents alphabetically by metadata for building. This will be disabled if groupsize > 1.",112 'desc' => "{import.sortmeta}", 113 113 'type' => "string", 114 114 'reqd' => "no" }, 115 115 { 'name' => "statsfile", 116 'desc' => " Filename or handle to print import statistics to.",116 'desc' => "{import.statsfile}", 117 117 'type' => "string", 118 118 'deft' => "STDERR", 119 119 'reqd' => "no" }, 120 120 { 'name' => "verbosity", 121 'desc' => " 0=none, 3=lots",121 'desc' => "{import.verbosity}", 122 122 'type' => "int", 123 123 'deft' => "2", 124 'reqd' => "no" }, 125 { 'name' => "language", 126 'desc' => "{scripts.language}", 127 'type' => "string", 124 128 'reqd' => "no" } ]; 125 129 … … 131 135 sub print_xml_usage 132 136 { 137 local $language = shift(@_); 138 133 139 &PrintUsage::print_xml_header(); 134 140 … … 138 144 print STDERR " <Arguments>\n"; 139 145 if (defined($options->{'args'})) { 140 &PrintUsage::print_options_xml($ options->{'args'});146 &PrintUsage::print_options_xml($language, $options->{'args'}); 141 147 } 142 148 print STDERR " </Arguments>\n"; … … 147 153 sub print_txt_usage 148 154 { 155 local $language = shift(@_); 156 149 157 local $programname = $options->{'name'}; 150 158 local $programargs = $options->{'args'}; … … 167 175 168 176 # Display the program options 169 &PrintUsage::print_options_txt($ programargs, $optiondescoffset);177 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset); 170 178 } 171 179 } … … 224 232 $maxdocs, $collection, $configfilename, $collectcfg, 225 233 $pluginfo, $sortmeta, $archive_info_filename, $statsfile, 226 $archive_info, $processor, $out, $faillog, $collectdir );234 $archive_info, $processor, $out, $faillog, $collectdir, $language); 227 235 228 236 # ***** 11-04-03 - John Thompson ***** … … 233 241 # later (after we check the collect.cfg file) 234 242 if (!parsargv::parse(\@ARGV, 243 'language/.*/', \$language, 235 244 'verbosity/\d+/', \$verbosity, 236 245 'importdir/.*/', \$importdir, … … 249 258 'faillog/.*/', \$faillog, 250 259 q^xml^, \$xml)) { 251 &print_txt_usage( );260 &print_txt_usage($language); 252 261 die "\n"; 253 262 } 254 263 255 264 if ($xml) { 256 &print_xml_usage( );265 &print_xml_usage($language); 257 266 die "\n"; 258 267 } … … 271 280 # get and check the collection name 272 281 if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") { 273 &print_txt_usage( );282 &print_txt_usage($language); 274 283 die "\n"; 275 284 } -
trunk/gsdl/bin/script/mkcol.pl
r4776 r4873 46 46 my $arguments = 47 47 [ { 'name' => "creator", 48 'desc' => " The collection creator's e-mail address.",48 'desc' => "{mkcol.creator}", 49 49 'type' => "string", 50 50 'reqd' => "yes" }, 51 51 { 'name' => "optionfile", 52 'desc' => " Get options from file, useful on systems where long command lines may cause problems.",52 'desc' => "{mkcol.optionfile}", 53 53 'type' => "string", 54 54 'reqd' => "no" }, 55 55 { 'name' => "maintainer", 56 'desc' => " The collection maintainer's email address (if different from the creator).",56 'desc' => "{mkcol.maintainer}", 57 57 'type' => "string", 58 58 'reqd' => "no" }, 59 59 { 'name' => "collectdir", 60 'desc' => " Directory where new collection will be created.",60 'desc' => "{mkcol.collectdir}", 61 61 'type' => "string", 62 62 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 63 63 'reqd' => "no" }, 64 64 { 'name' => "public", 65 'desc' => " If this collection has anonymous access (true/false).",65 'desc' => "{mkcol.public}", 66 66 'type' => "string", 67 67 'deft' => "true", 68 68 'reqd' => "no" }, 69 69 { 'name' => "title", 70 'desc' => " The title of the collection.",70 'desc' => "{mkcol.title}", 71 71 'type' => "string", 72 72 'reqd' => "no" }, 73 73 { 'name' => "about", 74 'desc' => " The about text for the collection.",74 'desc' => "{mkcol.about}", 75 75 'type' => "string", 76 76 'reqd' => "no" }, 77 77 { 'name' => "plugin", 78 'desc' => " Perl plugin module to use (there may be multiple plugin entries).",78 'desc' => "{mkcol.plugin}", 79 79 'type' => "string", 80 80 'reqd' => "no" }, 81 81 { 'name' => "quiet", 82 'desc' => " Operate quietly.",82 'desc' => "{mkcol.quiet}", 83 83 'type' => "flag", 84 'reqd' => "no" }, 85 { 'name' => "language", 86 'desc' => "{scripts.language}", 87 'type' => "string", 84 88 'reqd' => "no" } ]; 85 89 … … 91 95 sub print_xml_usage 92 96 { 97 local $language = shift(@_); 98 93 99 &PrintUsage::print_xml_header(); 94 100 … … 98 104 print STDERR " <Arguments>\n"; 99 105 if (defined($options->{'args'})) { 100 &PrintUsage::print_options_xml($ options->{'args'});106 &PrintUsage::print_options_xml($language, $options->{'args'}); 101 107 } 102 108 print STDERR " </Arguments>\n"; … … 107 113 sub print_txt_usage 108 114 { 115 local $language = shift(@_); 116 109 117 local $programname = $options->{'name'}; 110 118 local $programargs = $options->{'args'}; … … 127 135 128 136 # Display the program options 129 &PrintUsage::print_options_txt($ programargs, $optiondescoffset);137 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset); 130 138 } 131 139 } … … 221 229 my ($argref) = @_; 222 230 if (!&parsargv::parse($argref, 231 'language/.*/', \$language, 223 232 'optionfile/.*/', \$optionfile, 224 233 'collectdir/.*/', \$collectdir, … … 232 241 q^xml^, \$xml 233 242 )) { 234 &print_txt_usage( );243 &print_txt_usage($language); 235 244 die "\n"; 236 245 } … … 242 251 243 252 if ($xml) { 244 &print_xml_usage( );253 &print_xml_usage($language); 245 254 die "\n"; 246 255 } … … 255 264 close OPTIONS; 256 265 &parse_args ($options); 257 258 266 } 259 267 … … 268 276 if (!defined($collection)) { 269 277 print STDOUT "ERROR: no collection name was specified\n"; 270 &print_txt_usage( );278 &print_txt_usage($language); 271 279 die "\n"; 272 280 } -
trunk/gsdl/bin/script/pluginfo.pl
r4779 r4873 44 44 print STDERR "\n"; 45 45 print STDERR "pluginfo.pl: Prints information about a plugin.\n\n"; 46 print STDERR " usage: $0 [options] plugin\n\n"; 47 print STDERR " options:\n"; 48 print STDERR " -collect collection-name Giving a collection name will make pluginfo.pl\n"; 49 print STDERR " look in collect/collection-name/perllib/plugins\n"; 50 print STDERR " for plugin first. If it doesn't find it there\n"; 51 print STDERR " it will look in the general perllib/plugins\n"; 52 print STDERR " directory\n"; 53 print STDERR " -xml Produces the information in an xml form, without\n"; 54 print STDERR " 'pretty' comments but with much more detail.\n"; 46 print STDERR " usage: $0 [options] plugin\n\n"; 47 print STDERR " options:\n"; 48 print STDERR " -collect collection-name Giving a collection name will make pluginfo.pl\n"; 49 print STDERR " look in collect/collection-name/perllib/plugins\n"; 50 print STDERR " first. If the plugin is not found there it will\n"; 51 print STDERR " look in the general perllib/plugins directory.\n\n"; 52 print STDERR " -xml Produces the information in an xml form, without\n"; 53 print STDERR " 'pretty' comments but with much more detail.\n\n"; 54 print STDERR " -language language-code Language to display plugin options in (eg. 'en_US'\n"; 55 print STDERR " specifies American English). Requires translations\n"; 56 print STDERR " of the option descriptions to exist in the\n"; 57 print STDERR " perllib/strings_language-code.rb file.\n"; 55 58 } 56 59 … … 61 64 my $collect = ""; 62 65 my $xml = 0; 66 my $language = ""; # Will display in the default language if not set 63 67 64 if (!parsargv::parse(\@ARGV, q^collect/.*/^, \$collect, q^xml^, \$xml )) 68 if (!parsargv::parse(\@ARGV, 69 q^collect/.*/^, \$collect, 70 q^xml^, \$xml, 71 q^language/.*/^, \$language)) 65 72 { 66 73 &print_usage(); … … 82 89 83 90 my $pluginfo = &plugin::load_plugins ([[$plugin]]); 84 85 91 my $plugobj = shift @$pluginfo; 86 92 87 if ($xml) { 88 $plugobj->print_xml_usage( );93 if ($xml) { 94 $plugobj->print_xml_usage($language); 89 95 } 90 96 else { 91 my $pluginfo = &plugin::load_plugins ([[$plugin]]);92 93 my $plugobj = shift @$pluginfo;94 95 97 print STDERR "\n$plugin info:\n\n"; 96 98 … … 105 107 print STDERR "General options are inherited from parent classes of the plugin.\n\n"; 106 108 107 $plugobj->print_txt_usage( );109 $plugobj->print_txt_usage($language); 108 110 109 111 # print STDERR " The default process_exp for $plugin is: ";
Note:
See TracChangeset
for help on using the changeset viewer.