Changeset 28780
- Timestamp:
- 2013-12-19T18:27:37+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/bin/script/convert_coll_from_gs2.pl
r26343 r28780 20 20 use strict; 21 21 22 my $convert_format_stmts = 0; 23 22 24 &main(); 23 25 sub print_usage() { … … 25 27 print STDOUT "options:\n"; 26 28 27 print STDOUT " -collectdir Directory where collection lives.\n"; 28 print STDOUT " -verbosity Controls the amount of output.\n"; 29 print STDOUT " -defaultlang The language that is considered the default (for display text etc). defaults to 'en'\n\n"; 29 print STDOUT " -collectdir Directory where collection lives.\n"; 30 print STDOUT " -verbosity Controls the amount of output.\n"; 31 print STDOUT " -defaultlang The language that is considered the default (for display text etc). defaults to 'en'\n"; 32 print STDOUT " -convert_format_stmts (Deprecated.) Switch this on if you want the old behaviour of this script, which is \n"; 33 print STDOUT " to process format statements using perl regular expressions.\n"; 34 print STDOUT " This option is deprecated in favour of using 'formatconverter' which interprets \n"; 35 print STDOUT " format statements directly using the same C++ parsing code as in GS2 runtime.\n\n"; 30 36 } 31 37 … … 39 45 'verbosity/\d+/', \$verbosity, 40 46 'collectdir/.*/', \$collectdir, 41 'defaultlang/.*/', \$defaultlang)) { 47 'defaultlang/.*/', \$defaultlang, 48 'convert_format_stmts', \$convert_format_stmts)) { 42 49 &print_usage(); 43 50 die "\n"; … … 747 754 sub write_format { 748 755 my ($writer, $old_format, $node_type) = @_; 756 757 if($convert_format_stmts) { 758 749 759 # replace \' with ' 750 760 $old_format =~ s/\\\'/\'/g; … … 777 787 #put quotes around any atts 778 788 $old_format =~ s/=([a-z]+)([> ])/=\'$1\'$2/g; 789 } 790 else { # not converting format statements, leave them as GS2 format stmts, 791 # so that formatconverter can convert them and users can oversee the conversion in GLI, 792 # but nest the GS2 statements here in an xml tag that won't be processed by GS3 793 $old_format = "<gsf:format-gs2>" . $old_format . "</gsf:format-gs2>"; 794 } 779 795 780 796 if ($node_type eq "document") {
Note:
See TracChangeset
for help on using the changeset viewer.