Changeset 10215
- Timestamp:
- 2005-07-06T15:20:33+12:00 (19 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r9903 r10215 45 45 use gsprintf; 46 46 use printusage; 47 use parse2; 47 48 48 49 my $mode_list = … … 79 80 'desc' => "{buildcol.collectdir}", 80 81 'type' => "string", 81 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 82 # parsearg left "" as default 83 #'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 82 84 'reqd' => "no", 83 85 'hiddengli' => "yes" }, … … 95 97 'desc' => "{buildcol.faillog}", 96 98 'type' => "string", 97 'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 99 # parsearg left "" as default 100 #'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 98 101 'reqd' => "no", 99 102 'modegli' => "4" }, … … 122 125 'type' => "enum", 123 126 'list' => $mode_list, 124 'deft' => "all", 127 # parsearg left "" as default 128 # 'deft' => "all", 125 129 'reqd' => "no", 126 130 'modegli' => "4" }, … … 144 148 'desc' => "{buildcol.verbosity}", 145 149 'type' => "int", 146 'deft' => "2", 147 'reqd' => "no", 148 'modegli' => "4" } ]; 150 # parsearg left "" as default 151 #'deft' => "2", 152 'reqd' => "no", 153 'modegli' => "4" }, 154 { 'name' => "gli", 155 'desc' => "", 156 'type' => "flag", 157 'reqd' => "no", 158 'hiddengli' => "yes" }, 159 { 'name' => "xml", 160 'desc' => "", 161 'type' => "flag", 162 'reqd' => "no", 163 'hiddengli' => "yes" } ]; 149 164 150 165 my $options = { 'name' => "buildcol.pl", … … 168 183 $no_strip_html, $no_text, $faillog, $gli); 169 184 170 # ***** 11-04-03 - John Thompson *****171 185 my $xml = 0; 172 # ************************************ 173 174 # note that no defaults are passed for most options as they're set 175 # later (after we check the collect.cfg file) 176 if (!parsargv::parse(\@ARGV, 177 'language/.*/', \$language, 178 'verbosity/\d+/', \$verbosity, 179 'archivedir/.*/', \$archivedir, 180 'cachedir/.*/', \$cachedir, # UNDOCUMENTED 181 'builddir/.*/', \$builddir, 182 'maxdocs/^\-?\d+/', \$maxdocs, 183 'debug', \$debug, 184 'mode/^(all|compress_text|build_index|infodb)$/', \$mode, 185 'index/.*/', \$indexname, 186 'no_text', \$no_text, 187 'keepold', \$keepold, 188 'remove_empty_classifications', \$remove_empty_classifications, 189 'create_images', \$create_images, 190 'collectdir/.*/', \$collectdir, 191 'out/.*/STDERR', \$out, 192 'no_strip_html', \$no_strip_html, 193 'faillog/.*/', \$faillog, 194 'gli', \$gli, 195 q^xml^, \$xml)) { 186 187 my $hashParsingResult = {}; 188 my $blnParseFailed = "false"; 189 # general options available to all plugins 190 $intArgLeftinAfterParsing = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options"); 191 # If there are more than one argument left after parsing, it mean user input too many arguments. 192 # Error occoured will return 0 193 if($intArgLeftinAfterParsing != 1) 194 { 195 $blnParseFailed = "true"; 196 } 197 if($blnParseFailed eq "true") 198 { 199 print ""; 196 200 &PrintUsage::print_txt_usage($options, "{buildcol.params}"); 197 201 die "\n"; 202 } 203 foreach my $strVariable (keys %$hashParsingResult) 204 { 205 eval "\$$strVariable = \$hashParsingResult->{\"\$strVariable\"}"; 198 206 } 199 207 … … 410 418 $builder->set_strip_html(0); 411 419 } 412 420 413 421 if ($mode =~ /^all$/i) { 414 422 $builder->compress_text($textindex); -
trunk/gsdl/bin/script/import.pl
r10162 r10215 49 49 use gsprintf 'gsprintf'; 50 50 use printusage; 51 use parse2; 51 52 52 53 my $oidtype_list = … … 85 86 'desc' => "{import.collectdir}", 86 87 'type' => "string", 87 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 88 # parsearg left "" as default 89 #'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 90 'deft' => "", 88 91 'reqd' => "no", 89 92 'hiddengli' => "yes" }, … … 96 99 'desc' => "{import.faillog}", 97 100 'type' => "string", 98 'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 101 # parsearg left "" as default 102 #'deft' => &util::filename_cat("<collectdir>", "colname", "etc", "fail.log"), 103 'deft' => "", 99 104 'reqd' => "no", 100 105 'modegli' => "4" }, … … 129 134 'type' => "int", 130 135 'reqd' => "no", 136 # parsearg left "" as default 137 #'deft' => "-1", 131 138 'range' => "1,", 132 139 'modegli' => "1" }, … … 135 142 'type' => "enum", 136 143 'list' => $oidtype_list, 137 'deft' => "hash", 144 # parsearg left "" as default 145 #'deft' => "hash", 138 146 'reqd' => "no", 139 147 'modegli' => "3" }, … … 158 166 { 'name' => "sortmeta", 159 167 'desc' => "{import.sortmeta}", 160 'type' => "metadatum", 168 # 'type' => "metadatum", 169 'type' => "string", 161 170 'reqd' => "no", 162 171 'modegli' => "3" }, … … 182 191 'desc' => "{import.verbosity}", 183 192 'type' => "int", 184 'range' => "0,3", 185 'deft' => "2", 186 'reqd' => "no", 187 'modegli' => "4" }]; 193 'range' => "0,", 194 # parsearg left "" as default 195 #'deft' => "2", 196 'reqd' => "no", 197 'modegli' => "4" }, 198 { 'name' => "gli", 199 'desc' => "", 200 'type' => "flag", 201 'reqd' => "no", 202 'hiddengli' => "yes" }, 203 { 'name' => "xml", 204 'desc' => "", 205 'type' => "flag", 206 'reqd' => "no", 207 'hiddengli' => "yes" }]; 188 208 189 209 my $options = { 'name' => "import.pl", … … 203 223 $archive_info, $processor, $out, $faillog, $collectdir, $gli); 204 224 205 # ***** 11-04-03 - John Thompson *****206 225 my $xml = 0; 207 # ************************************ 226 208 227 my $service = "import"; 209 228 210 # note that no defaults are passed for most options as they're set 211 # later (after we check the collect.cfg file) 212 if (!parsargv::parse(\@ARGV, 213 'language/.*/', \$language, 214 'verbosity/\d+/', \$verbosity, 215 'importdir/.*/', \$importdir, 216 'archivedir/.*/', \$archivedir, 217 'keepold', \$keepold, 218 'removeold', \$removeold, 219 'saveas/^(GA|METS|DSpace)$/GA', \$saveas, 220 'version/.*/', \$version, 221 'gzip', \$gzip, 222 'groupsize/\d+/1', \$groupsize, 223 'OIDtype/^(hash|incremental|assigned|dirname)$/', \$OIDtype, 224 'sortmeta/.*/', \$sortmeta, 225 'removeprefix/.*/', \$removeprefix, 226 'removesuffix/.*/', \$removesuffix, 227 'debug', \$debug, 228 'maxdocs/^\-?\d+/', \$maxdocs, 229 'collectdir/.*/', \$collectdir, 230 'out/.*/STDERR', \$out, 231 'statsfile/.*/STDERR', \$statsfile, 232 'faillog/.*/', \$faillog, 233 'gli', \$gli, 234 q^xml^, \$xml)) { 229 my $hashParsingResult = {}; 230 my $blnParseFailed = "false"; 231 # general options available to all plugins 232 $intArgLeftinAfterParsing = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options"); 233 # If there are more than one argument left after parsing, it mean user input too many arguments. 234 # Error occoured will return 0 235 if($intArgLeftinAfterParsing != 1) 236 { 237 $blnParseFailed = "true"; 238 } 239 if($blnParseFailed eq "true") 240 { 235 241 &PrintUsage::print_txt_usage($options, "{import.params}"); 236 242 die "\n"; 243 } 244 foreach my $strVariable (keys %$hashParsingResult) 245 { 246 eval "\$$strVariable = \$hashParsingResult->{\"\$strVariable\"}"; 237 247 } 238 248 … … 277 287 (&gsprintf(STDERR, "{import.cannot_open_fail_log}\n", $faillog) && die); 278 288 289 279 290 my $faillogname = $faillog; 280 291 $faillog = 'import::FAILLOG'; … … 287 298 $sortmeta = undef; 288 299 } 289 290 300 # dynamically load 'docsave' module so it can pick up on a collection 291 301 # specific docsave.pm is specified. … … 382 392 $gli = 1; 383 393 } 394 384 395 385 396 # global plugin stuff
Note:
See TracChangeset
for help on using the changeset viewer.