Index: /gs2-extensions/open-office/trunk/COMPILE-INSTALL.sh
===================================================================
--- /gs2-extensions/open-office/trunk/COMPILE-INSTALL.sh	(revision 23226)
+++ /gs2-extensions/open-office/trunk/COMPILE-INSTALL.sh	(revision 23226)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+source setup.bash
+
+export JOD_CONVERTER=jodconverter-core-3.0-beta-3
+
+if [ "x$GEXT_OPENOFFICE" != "x" ] ; then
+
+  javac -version
+  if [ $? != 0 ] ; then
+    echo "Unable to locate 'javac'"
+    echo "Have you set JAVA_HOME and put JAVA_HOME/bin in your path?"
+    echo "Note, this requires Java 1.5 or greater."
+    exit
+  fi
+
+  echo Compiling Code
+
+  pushd "$GEXT_OPENOFFICE/build-srcpack/packages" 
+
+  ./COMPILE-INSTALL.sh 
+
+  popd
+
+  if [ ! -d lib/java ] ; then
+    echo ""
+    echo "Creating lib/java"
+    mkdir -p lib/java
+  fi
+
+  echo ""
+  echo "Installing jodconverter.jar into lib/java"
+  /bin/cp -r $GEXT_OPENOFFICE/build-srcpack/packages/$JOD_CONVERTER/jodconverter.jar lib/java/.
+  /bin/cp -r $GEXT_OPENOFFICE/build-srcpack/packages/$JOD_CONVERTER/lib lib/java/.
+
+
+else 
+  echo "Error: Environment variable GEXT_OPENOFICE is not set"
+fi
+
Index: /gs2-extensions/open-office/trunk/README.txt
===================================================================
--- /gs2-extensions/open-office/trunk/README.txt	(revision 23226)
+++ /gs2-extensions/open-office/trunk/README.txt	(revision 23226)
@@ -0,0 +1,6 @@
+Use java 1.5 or greater.
+
+Run ./COMPILE-INSTALL.sh
+
+
+
Index: /gs2-extensions/open-office/trunk/RUN.sh
===================================================================
--- /gs2-extensions/open-office/trunk/RUN.sh	(revision 23226)
+++ /gs2-extensions/open-office/trunk/RUN.sh	(revision 23226)
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+which cygpath >/dev/null 2>&1
+
+if [ $? = "0" ] ; then
+  # Running on Cygwin
+  java -jar lib\\java\\jodconverter.jar $*
+else
+  java -jar lib/java/jodconverter.jar $*
+fi
+
+
+
Index: /gs2-extensions/open-office/trunk/START-UP.sh
===================================================================
--- /gs2-extensions/open-office/trunk/START-UP.sh	(revision 23226)
+++ /gs2-extensions/open-office/trunk/START-UP.sh	(revision 23226)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+which soffice >/dev/null 2>&1 
+if [ $? = 0 ] ; then
+
+  echo "Starting up Open Office Server (headless mode)"
+
+  soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -headless
+
+  echo "Testing to see if soffice is listening on port 8100"
+
+  netstat -an | grep 8100
+else 
+  echo ""
+  echo "Error: Unable to find 'soffice' on PATH environment variable"
+  echo ""
+fi
+
+
+
Index: /gs2-extensions/open-office/trunk/bin/script/oo2html
===================================================================
--- /gs2-extensions/open-office/trunk/bin/script/oo2html	(revision 23226)
+++ /gs2-extensions/open-office/trunk/bin/script/oo2html	(revision 23226)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+#java -jar $GEXT_OPENOFFICE/lib/java/jodconverter.jar $*
+java -jar $GEXT_OPENOFFICE/lib/java/jodconverter.jar "$1" "$2" 
Index: /gs2-extensions/open-office/trunk/bin/script/oo2html.bat
===================================================================
--- /gs2-extensions/open-office/trunk/bin/script/oo2html.bat	(revision 23226)
+++ /gs2-extensions/open-office/trunk/bin/script/oo2html.bat	(revision 23226)
@@ -0,0 +1,3 @@
+@echo off
+
+java -jar %GEXT_OPENOFFICE%\lib\java\jodconverter.jar %*
Index: /gs2-extensions/open-office/trunk/build-srcpack/packages/COMPILE-INSTALL.sh
===================================================================
--- /gs2-extensions/open-office/trunk/build-srcpack/packages/COMPILE-INSTALL.sh	(revision 23226)
+++ /gs2-extensions/open-office/trunk/build-srcpack/packages/COMPILE-INSTALL.sh	(revision 23226)
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+source ../../cascade-make/lib/cascade-lib.bash GEXT_OPENOFFICE ../../ $*
+
+if [ ! -e "$JOD_CONVERTER" ] ; then
+  echo "Unzipping JodConverter Core"
+  unzip "$JOD_CONVERTER-dist.zip"
+
+  cd "$JOD_CONVERTER" \
+   && jar xvf "$JOD_CONVERTER-sources.jar" \
+   && cd ..
+fi
+
+
+cd "$JOD_CONVERTER"
+
+if [ $GSDLOS = "windows" ] ; then
+  # Running under Cygwin or MinGW/MSys
+  cp=`ls lib/*.jar | tr '\n' ';'`
+else
+  cp=`ls lib/*.jar | tr '\n' ':'`
+fi
+
+cp_with_spaces=`ls lib/*.jar | tr '\n' ' '`
+
+javac -classpath ".:$cp" org/artofsolving/jodconverter/cli/Convert.java \
+  && \
+echo "Manifest-Version: 1.0" > Manifest.txt && \
+echo "Created-By: Greenstone Digital Library Project" >> Manifest.txt && \
+echo "Main-Class: org.artofsolving.jodconverter.cli.Convert" >> Manifest.txt && \
+echo "Class-Path: $cp_with_spaces" >> Manifest.txt \
+ && \
+jar cvfm jodconverter.jar Manifest.txt org conf document-formats.js
+
+cd ..
+
Index: /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm
===================================================================
--- /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 23226)
+++ /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 23226)
@@ -0,0 +1,262 @@
+###########################################################################
+#
+# OpenOfficeConverter - helper plugin that does office document conversion 
+#                       using jodconverter combined with OpenOffice
+#
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 2010 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+package OpenOfficeConverter;
+
+use ConvertBinaryFile;
+use BaseMediaConverter;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
+use gsprintf 'gsprintf';
+
+# these two variables mustn't be initialised here or they will get stuck 
+# at those values.
+our $openoffice_conversion_available; 
+our $no_openoffice_conversion_reason; 
+
+BEGIN {
+    @OpenOfficeConverter::ISA = ('BaseMediaConverter');
+
+    # Check that OpenOffice and jodconverter are installed and available on 
+    # the path 
+    $openoffice_conversion_available = 1;
+    $no_openoffice_conversion_reason = "";
+    
+    if (! defined $ENV{'GEXT_OPENOFFICE'}) {
+	$openoffice_conversion_available = 0;
+	$no_openoffice_conversion_reason = "gextopenofficenotinstalled";
+    }
+    else {
+	my $gextoo_home = $ENV{'GEXT_OPENOFFICE'};
+	my $jodjar = &util::filename_cat($gextoo_home,"lib","java","jodconverter.jar");
+
+	if (!-e $jodjar) {
+	    print STDERR "Failed to find $jodjar\n";
+	    $openoffice_conversion_available = 0;
+	    $no_openoffice_conversion_reason = "gextjodconverternotinstalled";
+	}
+	else {
+	    # test to see if soffice in in path
+	    my $cmd = "soffice -headless 2>&1";
+
+
+	    if ($ENV{'GSDLOS'} =~ m/^windows$/) {
+		my $ooffice_dir_guess =
+		    &util::filename_cat($ENV{'ProgramFiles'},"OpenOffice.org 3",
+					"program");
+		if (-d  $ooffice_dir_guess) {
+		    &util::envvar_append("PATH",$ooffice_dir_guess);
+		}
+		$cmd .= " >nul";
+	    }
+	    else {
+		# Windows seems to launch OpenOffice as a service (i.e.
+		# automatically puts it in the background).  
+		# For Unix putting it in the background needs to be done 
+		# explicitly
+
+		$cmd .= " >/dev/null &";
+	    }
+	    
+	    my $status = system($cmd);
+	    if ($status != 0) {
+		print STDERR "Failed to run: $cmd\n";
+		print STDERR "$!\n";
+		$openoffice_conversion_available = 0;
+		$no_openoffice_conversion_reason = "openofficenotinstalled";
+	    } 
+	}
+    }
+}
+
+my $arguments = [
+    { 'name' => "openoffice_port",
+      'desc' => "{OpenOfficeConverter.openoffice_port}",
+      'type' => "int",
+      'deft' => "8100",
+      'range' => "81,",
+      'reqd' => "no" },
+    ];
+
+
+my $options = { 'name' => "OpenOfficeConverter",
+		'desc' => "{OpenOfficeConverter.desc}",
+		'abstract' => "yes",
+		'inherits' => "yes",
+		'args' => $arguments };
+
+sub new {
+    my ($class) = shift (@_);
+    my ($pluginlist,$inputargs,$hashArgOptLists,$auxilary) = @_;
+    push(@$pluginlist, $class);
+
+    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
+    push(@{$hashArgOptLists->{"OptList"}},$options);
+
+    my $self = new BaseMediaConverter($pluginlist, $inputargs, 
+				      $hashArgOptLists, $auxilary);
+
+    if ($self->{'info_only'}) {
+	# don't worry about any options etc
+	return bless $self, $class;
+    }
+    if (!$openoffice_conversion_available) {
+	$self->{'no_openoffice_conversion_reason'} = $no_openoffice_conversion_reason;
+
+	my $outhandle = $self->{'outhandle'};
+	&gsprintf($outhandle, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$no_openoffice_conversion_reason})\n");
+    }  
+
+    $self->{'openoffice_conversion_available'} = $openoffice_conversion_available;
+    
+    return bless $self, $class;
+
+}
+
+sub init {
+    my $self = shift(@_);
+    my ($verbosity, $outhandle, $failhandle) = @_;
+
+    if ($openoffice_conversion_available) {
+	my $oo_port = $self->{'openoffice_port'};
+
+	my $launch_cmd = "soffice";
+	$launch_cmd .= " \"-accept=socket,host=localhost,port=$oo_port;urp;StarOffice.ServiceManager\"";
+	$launch_cmd .= " -headless";
+	$self->{'openoffice_launch_cmd'} = $launch_cmd;
+    }
+
+    $self->{'ootmp_file_paths'} = ();
+}
+
+sub deinit {
+    my $self = shift(@_);
+
+    $self->clean_up_temporary_files();
+}
+
+
+sub convert {
+    my $self = shift(@_);
+    my $source_file_full_path = shift(@_);
+    my $target_file_type      = shift(@_);
+    my $convert_options       = shift(@_) || "";
+    my $convert_id            = shift(@_) || "";
+    my $cache_mode            = shift(@_) || "";
+
+    return (0,undef,undef) unless $openoffice_conversion_available;
+    # check the filename
+    return (0,undef,undef) if ( !-f $source_file_full_path);
+
+    my $outhandle = $self->{'outhandle'};
+    my $verbosity = $self->{'verbosity'};
+
+    my $source_file_no_path = &File::Basename::basename($source_file_full_path);
+    # Determine the full name and path of the output file
+    my $target_file_path;
+    if ($self->{'enable_cache'}) {
+	$self->init_cache_for_file($source_file_full_path);
+	my $cache_dir = $self->{'cached_dir'};
+	my $file_root = $self->{'cached_file_root'};
+	$file_root .= "_$convert_id" if ($convert_id ne "");
+	my $target_file = "$file_root.$target_file_type";
+	$target_file_path = &util::filename_cat($cache_dir,$target_file);
+    }
+    else {
+	$target_file_path = &util::get_timestamped_tmp_filename_in_collection($source_file_full_path, $target_file_type);
+	push(@{$self->{'ootmp_file_paths'}}, $target_file_path);
+    }
+
+    # Generate and run the convert command
+
+    my $gextoo_home = $ENV{'GEXT_OPENOFFICE'};
+    my $jodjar = &util::filename_cat($gextoo_home,"lib","java","jodconverter.jar");
+
+    my $convert_cmd = "java -jar \"$jodjar\"";
+    $convert_cmd .= " \"$source_file_full_path\" \"$target_file_path\"";
+
+    if ($verbosity>2) {
+	print $outhandle "Convert command: $convert_cmd\n";
+    }
+
+    my $print_info = { 'message_prefix' => "OpenOffice Conversion",
+		       'message' => "Converting $source_file_no_path to: $target_file_type" };
+    $print_info->{'cache_mode'} = $cache_mode if ($cache_mode ne "");
+
+    my ($regenerated,$result,$had_error) 
+	= $self->autorun_general_cmd($convert_cmd,$source_file_full_path, $target_file_path,$print_info);
+    if ($had_error) {
+	return (0, $result,$target_file_path);
+    }
+    return (1, $result,$target_file_path);
+}
+
+
+sub convert_without_result {
+    my $self = shift(@_);
+
+    my $source_file_path = shift(@_);
+    my $target_file_type = shift(@_);
+    my $convert_options  = shift(@_) || "";
+    my $convert_id       = shift(@_) || "";
+
+    return $self->convert($source_file_path,$target_file_type,
+			  $convert_options,$convert_id,"without_result");
+}
+
+
+sub tmp_area_convert_fileXX {
+    my $self = shift (@_);
+    my ($output_ext, $input_filename, $textref) = @_;
+    
+    my $outhandle = $self->{'outhandle'};
+    my $convert_to = $self->{'convert_to'};
+    my $failhandle = $self->{'failhandle'};
+    my $convert_to_ext = $self->{'convert_to_ext'};
+    
+    # derive tmp filename from input filename
+    my ($tailname, $dirname, $suffix)
+	= &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
+}
+
+
+sub clean_up_temporary_files {
+    my $self = shift(@_);
+
+    foreach my $ootmp_file_path (@{$self->{'ootmp_file_paths'}}) {
+	if (-e $ootmp_file_path) {
+	    &util::rm($ootmp_file_path);
+	}
+    }
+
+    $self->{'ootmp_file_paths'} = ();
+}
+
+
+
+1;	
Index: /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficePlugin.pm
===================================================================
--- /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficePlugin.pm	(revision 23226)
+++ /gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficePlugin.pm	(revision 23226)
@@ -0,0 +1,248 @@
+###########################################################################
+#
+# OpenOfficePlugin.pm -- for processing standalone images
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+package OpenOfficePlugin;
+
+use ConvertBinaryFile;
+use OpenOfficeConverter;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+no strict 'subs';
+
+use gsprintf 'gsprintf';
+
+sub BEGIN {
+    @OpenOfficePlugin::ISA = ('ConvertBinaryFile', 'OpenOfficeConverter');
+}
+
+my $word_pe = "doc|dot|docx|odt|wpd";
+my $rtf_pe = "rtf";
+my $ppt_pe = "ppt|pptx|odp";
+my $xls_pe = "xls|xlsx|ods";
+
+my $arguments =
+    [ { 'name' => "process_exp",
+	'desc' => "{BasePlugin.process_exp}",
+	'type' => "regexp",
+	'deft' => &get_default_process_exp(),
+	'reqd' => "no" },
+      ];
+
+# This is not quite fully functional, eg doesn't do proper PowerPoint processing. So I have made it hidden in gli for now.
+my $options = { 'name'     => "OpenOfficePlugin",
+		'desc'     => "{OpenOfficePlugin.desc}",
+		'abstract' => "no",
+		'inherits' => "yes",
+		'hiddengli' => "yes",
+		'args'     => $arguments };
+
+
+sub new {
+    my ($class) = shift (@_);
+    my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
+    push(@$pluginlist, $class);
+
+    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
+    push(@{$hashArgOptLists->{"OptList"}},$options);
+
+    
+    my $ooc_self = new OpenOfficeConverter($pluginlist, $inputargs, $hashArgOptLists);
+    my $cbf_self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists);
+
+    my $self = BasePlugin::merge_inheritance($ooc_self, $cbf_self);
+
+    if ($self->{'info_only'}) {
+	# don't worry about any options etc
+	return bless $self, $class;
+    }
+    if ($OpenOfficeConverter::openoffice_conversion_available) {
+	$self->{'openoffice_ext_working'} = 1;
+    }
+    else {
+	$self->{'openoffice_ext_working'} = 0;
+    }
+    $self->{'convert_to'} = "structuredhtml";
+
+    $self = bless $self, $class;
+
+    # set convert_to_plugin and convert_to_ext
+    $self->set_standard_convert_settings();
+
+    # set up appropriate secondary plugin options here!!! 
+    my $secondary_plugin_name = $self->{'convert_to_plugin'};
+    my $secondary_plugin_options = $self->{'secondary_plugin_options'};
+
+    if (!defined $secondary_plugin_options->{$secondary_plugin_name}) {
+	$secondary_plugin_options->{$secondary_plugin_name} = [];
+    }
+    my $specific_options = $secondary_plugin_options->{$secondary_plugin_name};
+
+    $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists);
+
+    return $self;
+}
+
+sub init {
+    my $self = shift (@_);
+    my ($verbosity, $outhandle, $failhandle) = @_;
+
+    $self->SUPER::init(@_);
+    $self->OpenOfficeConverter::init();
+}
+
+sub begin {
+    my $self = shift (@_);
+    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
+
+    $self->SUPER::begin(@_);
+    $self->OpenOfficeConverter::begin(@_);
+}
+
+
+sub get_default_process_exp {
+    my $self = shift (@_);
+
+    return "(?i)\.($word_pe|$ppt_pe|$rtf_pe|$xls_pe)\$";
+}
+
+
+sub read_into_doc_obj {
+    my $self = shift (@_);  
+    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
+    
+    if (!$self->{'openoffice_ext_working'}) {
+	# use BasePlugin version to set up the doc obj, then we will do a little bit more in process
+	return $self->BasePlugin::read_into_doc_obj(@_);
+    }
+    # use convertbinaryfile version, will call tmp_area_convert_file and use 
+    # secondary plugins
+    return $self->ConvertBinaryFile::read_into_doc_obj(@_);
+
+}
+
+# override this to use our own convert method
+sub tmp_area_convert_file {
+    my $self = shift (@_);
+    my ($output_ext, $input_filename, $textref) = @_;
+
+    my ($result, $result_str, $new_filename) = $self->OpenOfficeConverter::convert($input_filename, $output_ext);
+    if ($result != 0) {
+	return $new_filename;
+    }
+    my $outhandle=$self->{'outhandle'};
+    print $outhandle "Open Office Conversion error\n";
+    print $outhandle $result_str;
+    return "";
+}
+
+# first return value is used in _iconxx_ to give a srcicon, 
+# second return value is used for FileFormat metadata
+sub get_file_type_from_extension {
+    my $self = shift (@_);
+    my ($file) = @_;
+
+    #check against the various bit of process_exp
+    if ($file =~ /$word_pe/) {
+	return ("doc", "Word");
+    }
+    if ($file =~ /$ppt_pe/) {
+	return ("ppt", "PPT");
+    }
+    if ($file =~ /$xls_pe/) {
+	return ("xls", "Excel");
+    }
+    if ($file =~ /$rtf_pe/) {
+	return ("rtf", "RTF");
+    }
+    
+    return ("unknown", "Unknown");
+}
+
+
+sub process {
+    my $self = shift (@_);
+    my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
+
+    my $cursection = $doc_obj->get_top_section();
+    
+    # store original file as associated file
+    my $filename = &util::filename_cat($base_dir, $file);
+    my $assocfilename = $doc_obj->get_assocfile_from_sourcefile();
+    $doc_obj->associate_file($filename, $assocfilename, undef, $cursection);
+
+    my ($ext, $format) = $self->get_file_type_from_extension($file);
+    # overwrite the one set by secondary plugin
+    $doc_obj->set_utf8_metadata_element($cursection, "FileFormat", $format);
+
+    $doc_obj->add_utf8_metadata ($cursection, "srclink_file", "[SourceFile]");
+    $doc_obj->add_utf8_metadata ($cursection, "srcicon",  "_icon".$ext."_"); 	
+    # if oo conversion not available, we have no text, so add some
+    if (!$self->{'openoffice_ext_working'}) {
+	if ($gli) {
+	    &gsprintf(STDERR, "<Warning p='openOfficePlugin' r='{OpenOfficeConverter.noconversionavailable}: {OpenOfficeConverter.".$self->{'no_openoffice_conversion_reason'}."}'>");
+	}
+	print STDERR "OpenOfficePlugin: no conversion available, just adding $file as is\n";
+	#we have no text - adds dummy text and NoText metadata
+	$self->add_dummy_text($doc_obj, $doc_obj->get_top_section());
+	
+    }
+}
+
+sub process_old {
+    my $self = shift (@_);
+    my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
+    # old from here
+   # need to check that not empty
+    my $doc_ext = $self->{'filename_extension'};
+    my $file_type = "unknown";
+    $file_type = $self->{'file_type'} if defined $self->{'file_type'};
+    
+    # associate original file with doc object
+    my $cursection = $doc_obj->get_top_section();
+    my $filename = &util::filename_cat($base_dir, $file);
+    my $assocfilename = "doc.$doc_ext";
+    if ($self->{'keep_original_filename'} == 1) {
+	# this should be the same filename that was used for the Source and SourceFile metadata, 
+	# as we will use [SourceFile] in the srclink
+	$assocfilename = $doc_obj->get_assocfile_from_sourcefile();
+    }
+    $doc_obj->associate_file($filename, $assocfilename, undef, $cursection);
+
+    # We use set instead of add here because we only want one value
+    $doc_obj->set_utf8_metadata_element($cursection, "FileFormat", $file_type);
+    my $srclink_filename = "doc.$doc_ext";
+    #my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/doc.$doc_ext\">";
+    if ($self->{'keep_original_filename'} == 1) {
+	$srclink_filename = "[SourceFile]";
+	#$doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">";
+    }
+    #$doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink); 
+    $doc_obj->add_utf8_metadata ($cursection, "srcicon",  "_icon".$doc_ext."_"); 
+    #$doc_obj->add_utf8_metadata ($cursection, "/srclink", "</a>"); 
+    $doc_obj->add_utf8_metadata ($cursection, "srclink_file", $srclink_filename);
+    return 1;
+
+}
Index: /gs2-extensions/open-office/trunk/perllib/strings.properties
===================================================================
--- /gs2-extensions/open-office/trunk/perllib/strings.properties	(revision 23226)
+++ /gs2-extensions/open-office/trunk/perllib/strings.properties	(revision 23226)
@@ -0,0 +1,20 @@
+#
+# Resource bundle description
+#
+
+Language.code:en
+Language.name:English
+
+OutputEncoding.unix:iso_8859_1
+OutputEncoding.windows:iso_8859_1
+
+OpenOfficeConverter.desc:Converter plugin that runs Open Office to convert various source documents to HTML.
+OpenOfficeConverter.noconversionavailable:OpenOffice Conversion is not available: 
+
+OpenOfficeConverter.gextopenofficenotinstalled:Greenstone's Open Office extension not installed.
+OpenOfficeConverter.gextjodconverternotinstalled:Jod Converter (part of Greenstone's Open Office extension) not installed.
+OpenOfficeConverter.openofficenotinstalled:Open Office not installed.
+OpenOfficeConverter.openoffice_port:Port number for...
+OpenOfficeConverter.openoffice_conversion:Use Open Office to convert the documents.
+
+OpenOfficePlugin.desc:Top level plugin that uses Open Office to convert various types of documents.
Index: /gs2-extensions/open-office/trunk/setup.bash
===================================================================
--- /gs2-extensions/open-office/trunk/setup.bash	(revision 23226)
+++ /gs2-extensions/open-office/trunk/setup.bash	(revision 23226)
@@ -0,0 +1,25 @@
+
+extdesc="the Open Office Extension"
+
+full_setup=`pwd`/${BASH_SOURCE}
+fulldir=${full_setup%/*}
+fulldir=${fulldir%/.}
+
+if [ "x$GEXT_OPENOFFICE" = "x" ] ; then
+  export GEXT_OPENOFFICE=`pwd`
+
+  export PATH=$GEXT_OPENOFFICE/bin/script:$PATH
+
+  extdir=${GEXT_OPENOFFICE##*/}
+
+  if [ "x$GSDLEXTS" = "x" ] ; then
+    export GSDLEXTS=$extdir
+  else 
+    export GSDLEXTS=$GSDLEXTS:$extdir
+  fi
+
+
+  echo "+Your environment is now setup for $extdesc"
+else
+  echo "+Your environment is already setup for $extdesc"
+fi
Index: /gs2-extensions/open-office/trunk/setup.bat
===================================================================
--- /gs2-extensions/open-office/trunk/setup.bat	(revision 23226)
+++ /gs2-extensions/open-office/trunk/setup.bat	(revision 23226)
@@ -0,0 +1,58 @@
+@echo off
+pushd "%CD%"
+CD /D "%~dp0"
+
+set extdesc=the OpenOffice Extension
+
+if "%OS%" == "Windows_NT" goto WinNT
+if "%OS%" == "" goto Win95
+if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
+if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
+if "%GSDLLANG%" == "fr" echo Echc de l'installation - votre variable PATH n'a pas t ajuste
+if "%GSDLLANG%" == "ru" echo áâ ­®¢ª  ­¥ ã€ « áì -  ­¥ ¡ë« ãáâ ­®¢«¥­
+goto End
+
+:WinNT
+set GEXT_OPENOFFICE=%CD%
+set PATH=%GEXT_OPENOFFICE%\bin\script;%PATH%
+set GS_CP_SET=yes
+goto Success
+
+:Win95
+if "%1" == "SetEnv" goto Win95Env
+REM We'll invoke a second copy of the command processor to make
+REM sure there's enough environment space
+COMMAND /E:2048 /K %0 SetEnv
+goto End
+
+:Win95Env
+set GEXT_OPENOFFICE=%CD%
+set PATH="%GEXT_OPENOFFICE%\bin\script";"%PATH%"
+set GS_CP_SET=yes
+goto Success
+
+:Success
+
+set fulldir=%~dp0
+
+:: strip off everything up to (and including) ext dir
+set extdir=%fulldir:*ext\=%
+
+:: remove trailing slash
+set extdir=%extdir:\=%
+
+if "x%GSDLEXTS%" == "x" (
+  set GSDLEXTS=%extdir%
+) else (
+  set GSDLEXTS=%GSDLEXTS%:%extdir%
+)
+
+echo +Your environment is now setup for %extdesc%
+
+:: Back to delayed expansion to avoid problems with environment
+:: variables with brackets in them, such as "Program Files (x86)"
+
+
+:End
+
+popd
