Changeset 15890
- Timestamp:
- 2008-06-06T11:04:57+12:00 (16 years ago)
- Location:
- gsdl/trunk/perllib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/ClassifyTreeNode.pm
r12844 r15890 4 4 use ClassifyTreePath; 5 5 use GDBMUtils; 6 use strict; 6 7 7 8 # /** Constructor … … 121 122 # and then replacing any occurance to the parents old clid with the 122 123 # parents new clid 123 $old_child_clid = $child_node->getCLID();124 my $old_child_clid = $child_node->getCLID(); 124 125 #rint STDERR "* considering: " . $old_child_clid . "\n"; 125 126 if($old_child_clid =~ /^CL/) 126 127 { 127 $new_child_clid = $new_clid . substr($old_child_clid, length($old_clid));128 my $new_child_clid = $new_clid . substr($old_child_clid, length($old_clid)); 128 129 #rint STDERR "* shifting child $old_child_clid to $new_child_clid\n"; 129 130 $child_node->changeCLID($new_child_clid); … … 407 408 # children first! 408 409 @children = reverse $self->getChildren(); 409 $offset2 = scalar(@children) + 1;410 my $offset2 = scalar(@children) + 1; 410 411 foreach my $sibling_node (@children) 411 412 { … … 432 433 $child_node->setTitle($path->getLastPathComponent()); 433 434 # Update the contains metadata for this node 434 $contains = $self->getContains();435 my $contains = $self->getContains(); 435 436 if($contains =~ /\w/) 436 437 { -
gsdl/trunk/perllib/GDBMUtils.pm
r12844 r15890 1 1 package GDBMUtils; 2 2 3 use strict; 3 4 use util; 4 5 5 $debug = 0;6 my $debug = 0; 6 7 7 8 # /** Global variable to hold a string containing the last collection a gdbmGet … … 42 43 } 43 44 # Where's the database? 44 $database = &getDatabasePath($collection);45 my $database = &getDatabasePath($collection); 45 46 # Are we in windows? Do we need .exe? 46 $exe = "";47 my $exe = ""; 47 48 $exe = ".exe" if $ENV{'GSDLOS'} =~ /^windows$/i; 48 49 # Retrieve the raw document content 49 50 print STDERR "#Get document\ncmd: gdbmget$exe \"$database\" \"$oid\"\n" if $debug; 50 $value = `gdbmget$exe "$database" "$oid"`;51 my $value = `gdbmget$exe "$database" "$oid"`; 51 52 # Tidy up the ever growing number of newlines at the end of the value 52 53 $value =~ s/(\r?\n)+/$1/g; … … 73 74 my ($collection, $oid, $value) = @_; 74 75 # Where's the database? 75 $database = &getDatabasePath($collection);76 my $database = &getDatabasePath($collection); 76 77 # Are we in windows? Do we need .exe? 77 78 my $exe = &util::get_os_exe(); … … 108 109 sub getDatabasePath() 109 110 { 110 $collection = shift(@_);111 my $collection = shift(@_); 111 112 # Find out the database extension 112 113 my $ext = ".bdb"; -
gsdl/trunk/perllib/IncrementalBuildUtils.pm
r15720 r15890 52 52 use cfgread; 53 53 use colcfg; 54 use strict; 54 55 use util; 55 56 … … 58 59 59 60 # Change debugging to 1 if you want verbose debugging output 60 $debug = 1;61 my $debug = 1; 61 62 62 63 # Ensure the collection specific binaries are on the search path … … 301 302 print STDERR "CMD: " . $cmd . "\n" unless !$debug; 302 303 # Run command 303 $result = `$cmd 2>&1`;304 my $result = `$cmd 2>&1`; 304 305 print STDERR $result unless !$debug; 305 306 } … … 362 363 print STDERR "CMD: java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1\n" unless !$debug; 363 364 # Run command 364 $result = `java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1`;365 my $result = `java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1`; 365 366 print STDERR $result unless !$debug; 366 367 } … … 423 424 print STDERR "* searching for classifier paths to be removed\n"; 424 425 425 my $metadata = $doc_obj->getAllMetadata( $section);426 my $metadata = $doc_obj->getAllMetadata(); 426 427 foreach my $pair (@$metadata) 427 428 { … … 430 431 if (defined($classifier_tree_models{$key})) 431 432 { 432 $model = $classifier_tree_models{$key};433 my $model = $classifier_tree_models{$key}; 433 434 print STDERR "* removing '" . $value . "' from classifier " . $model->getRootNode()->getCLID() . "\n"; 434 435 $model->removeDocument($value, $oid, 1);
Note:
See TracChangeset
for help on using the changeset viewer.