Index: /trunk/gsdl/bin/script/gti.pl
===================================================================
--- /trunk/gsdl/bin/script/gti.pl	(revision 13945)
+++ /trunk/gsdl/bin/script/gti.pl	(revision 13946)
@@ -56,14 +56,14 @@
 
       # GLI dictionary
-      # { 'key' => "glidict",
-	# 'file_type' => "resource_bundle",
-	# 'source_file' => "gli/classes/dictionary.properties",
-	# 'target_file' => "gli/classes/dictionary_{target_language_code}.properties" },
+      { 'key' => "glidict",
+	'file_type' => "resource_bundle",
+	'source_file' => "gli/classes/dictionary.properties",
+	'target_file' => "gli/classes/dictionary_{target_language_code}.properties" },
 
       # GLI help
-      # { 'key' => "glihelp",
-	# 'file_type' => "greenstone_xml",
-	# 'source_file' => "gli/help/en/help.xml",
-	# 'target_file' => "gli/help/{target_language_code}/help.xml" },
+      { 'key' => "glihelp",
+	'file_type' => "greenstone_xml",
+	'source_file' => "gli/help/en/help.xml",
+	'target_file' => "gli/help/{target_language_code}/help.xml" },
 
       # Greenstone Perl modules
@@ -76,12 +76,12 @@
       # { 'key' => "tutorials",
 	# 'file_type' => "greenstone_xml",
-	# 'source_file' => "gsdl-tutorials/tutorial_en.xml",
-	# 'target_file' => "gsdl-tutorials/tutorial_{target_language_code}.xml" },
+	# 'source_file' => "gsdl-documentation/tutorials/xml-source/tutorial_en.xml",
+	# 'target_file' => "gsdl-documentation/tutorials/xml-source/tutorial_{target_language_code}.xml" },
 
       # Greenstone.org
-      # { 'key' => "greenorg",
-	# 'file_type' => "macrofile",
-	# 'source_file' => "greenorg/macros/english.dm",
-	# 'target_file' => "greenorg/macros/{iso_639_1_target_language_name}.dm" }
+      { 'key' => "greenorg",
+	'file_type' => "macrofile",
+	'source_file' => "greenorg/macros/english.dm",
+	'target_file' => "greenorg/macros/{iso_639_1_target_language_name}.dm" }
     ];
 
@@ -107,7 +107,4 @@
 
     # Process the command
-    if ($gti_command =~ /^get-all-chunks$/i) {
-	print &get_all_chunks(@gti_command_arguments);
-    }
     if ($gti_command =~ /^get-first-n-chunks-requiring-work$/i) {
 	print &get_first_n_chunks_requiring_work(@gti_command_arguments);
@@ -149,78 +146,4 @@
     my $log_message = shift(@_);
     print GTI_LOG time() . " -- " . $log_message . "\n";
-}
-
-
-sub get_all_chunks
-{
-    # The code of the target language (ensure it is lowercase)
-    my $target_language_code = lc(shift(@_));
-    # The key of the file to translate (ensure it is lowercase)
-    my $translation_file_key = lc(shift(@_));
-
-    # Check that the necessary arguments were supplied
-    if (!$target_language_code || !$translation_file_key) {
-	&throw_fatal_error("Missing command argument.");
-    }
-
-    # Get (and check) the translation configuration
-    my ($source_file, $target_file, $translation_file_type)
-	= &get_translation_configuration($target_language_code, $translation_file_key);
-
-    # Parse the source language and target language files
-    my $source_file_path = &util::filename_cat($gsdl_root_directory, $source_file);
-    my @source_file_lines = &read_file_lines($source_file_path);
-    my %source_file_key_to_line_mapping = &build_key_to_line_mapping(\@source_file_lines, $translation_file_type);
-
-    my $target_file_path = &util::filename_cat($gsdl_root_directory, $target_file);
-    my @target_file_lines = &read_file_lines($target_file_path);
-    my %target_file_key_to_line_mapping = &build_key_to_line_mapping(\@target_file_lines, $translation_file_type);
-
-    # Filter out any automatically translated chunks
-    foreach my $chunk_key (keys(%source_file_key_to_line_mapping)) {
-	if (&is_chunk_automatically_translated($chunk_key, $translation_file_type)) {
-	    delete $source_file_key_to_line_mapping{$chunk_key};
-	    delete $target_file_key_to_line_mapping{$chunk_key};
-	}
-    }
-
-    my %source_file_key_to_text_mapping = &build_key_to_text_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);
-    my %target_file_key_to_text_mapping = &build_key_to_text_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
-    &log_message("Number of source chunks: " . scalar(keys(%source_file_key_to_text_mapping)));
-    &log_message("Number of target chunks: " . scalar(keys(%target_file_key_to_text_mapping)));
-
-    my %source_file_key_to_last_update_date_mapping = &build_key_to_last_update_date_mapping($source_file, \@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);
-    my %target_file_key_to_last_update_date_mapping = &build_key_to_last_update_date_mapping($target_file, \@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
-
-    # Form an XML response to the command
-    my $xml_response = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
-    $xml_response .= "<GTIResponse>\n";
-    $xml_response .= "  <TranslationFile"
-	. " key=\"" . $translation_file_key . "\""
-	. " target_file_path=\"" . $target_file . "\"\/>\n";
-
-    # Do all the chunks
-    $xml_response .= "  <Chunks size=\"" . scalar(keys(%source_file_key_to_text_mapping)) . "\">\n";
-    foreach my $chunk_key (keys(%source_file_key_to_text_mapping)) {
-	my $source_file_chunk_date = $source_file_key_to_last_update_date_mapping{$chunk_key};
-	my $source_file_chunk_text = &make_text_xml_safe($source_file_key_to_text_mapping{$chunk_key});
-
-	$xml_response .= "    <Chunk key=\"" . &make_text_xml_safe($chunk_key) . "\">\n";
-	$xml_response .= "      <SourceFileText date=\"$source_file_chunk_date\">$source_file_chunk_text</SourceFileText>\n";
-	if (defined($target_file_key_to_text_mapping{$chunk_key})) {
-	    my $target_file_chunk_date = $target_file_key_to_last_update_date_mapping{$chunk_key};
-	    my $target_file_chunk_text = &make_text_xml_safe($target_file_key_to_text_mapping{$chunk_key});
-	    $xml_response .= "      <TargetFileText date=\"$target_file_chunk_date\">$target_file_chunk_text</TargetFileText>\n";
-	}
-	else {
-	    $xml_response .= "      <TargetFileText></TargetFileText>\n";
-	}
-
-	$xml_response .= "    </Chunk>\n";
-    }
-    $xml_response .= "  </Chunks>\n";
-
-    $xml_response .= "</GTIResponse>\n";
-    return $xml_response;
 }
 
@@ -588,5 +511,5 @@
 
 	# Make sure the submitted source chunk matches the source file chunk
-	if ($source_file_key_to_submission_mapping{$chunk_key} ne $source_file_key_to_text_mapping{$chunk_key}) {
+	if ($source_file_key_to_submission_mapping{$chunk_key} ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
 	    &log_message("Warning: Source chunk $chunk_key has changed (ignoring submission).");
 	    &log_message("Submission source: $source_file_key_to_submission_mapping{$chunk_key}");
