Index: /gs3-extensions/pharos/trunk/VSprops.properties.in
===================================================================
--- /gs3-extensions/pharos/trunk/VSprops.properties.in	(revision 21242)
+++ /gs3-extensions/pharos/trunk/VSprops.properties.in	(revision 21242)
@@ -0,0 +1,16 @@
+# video segmentation params
+
+vs.cbsewsendpoint=http://@tomcat.server@:@tomcat.port@/pharos/services/ContentBasedSearchWSProxy
+
+vs.features=margTamura-2+2+2-M-G-6-3.T3x3,margCIELAB-2+2+2-M-G.T3x3,gabor-6-4
+
+vs.path2hive=@imageishome@/bin/@iisos@/hive2_ffmpegsvn
+
+vs.path2shotMpeg7=@imageishome@/bin/@iisos@/shot_mpeg7
+
+vs.path2anntotate=@imageishome@/bin/@iisos@/annotate-1_8
+
+vs.path2ftfmpeg7=@imageishome@/bin/@iisos@/ftf_mpeg7_v4-jpg
+
+vs.workpath=@gsdlhome@/tmp/pharos-annotate/
+
Index: /gs3-extensions/pharos/trunk/bin/linux/ftf_mpeg7_v4-jpg
===================================================================
--- /gs3-extensions/pharos/trunk/bin/linux/ftf_mpeg7_v4-jpg	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/linux/ftf_mpeg7_v4-jpg	(revision 21242)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "***** Error: Not implemented!!"
Index: /gs3-extensions/pharos/trunk/bin/linux/shot_mpeg7
===================================================================
--- /gs3-extensions/pharos/trunk/bin/linux/shot_mpeg7	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/linux/shot_mpeg7	(revision 21242)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "***** Error: Not implemented!!"
Index: /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-add.pl
===================================================================
--- /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-add.pl	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-add.pl	(revision 21242)
@@ -0,0 +1,144 @@
+#!/usr/bin/perl -w
+
+###########################################################################
+#
+# pharos-imageis-add.pl --
+# 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.
+#
+###########################################################################
+
+BEGIN {
+    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
+    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
+    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
+}
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and vice versa
+no strict 'subs'; # allow barewords (eg STDERR) as function arguments
+
+
+use util;
+
+sub main
+{
+    
+    my $ARGC = scalar(@ARGV);
+    
+    
+    if (($ARGC < 2) || ($ARGC>3)) {
+	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
+	print STDERR "Usage: $progname collection file.jpg [doc-id]\n";
+	exit 1;
+    }
+
+    # docid might be undefined, in which case later on is is derived from
+    # from col and the file-name tail to srcfilename
+    my ($col,$srcfilename,$docid) = @ARGV;
+    
+    
+    if ( ! -f $srcfilename ) {
+	print STDERR "Error: failed to find $srcfilename\n";
+	exit 1;
+    }
+    
+    if ( $srcfilename !~ m/\.je?pg$/i ) {
+	print STDERR "Error: Unrecognized JPEG filename extension\n";
+	exit 1;
+    }
+    
+    if (!defined $docid) {
+	my ($fileroot,$dirname_unused,$suffix_unused) 
+	    = fileparse($srcfilename, "\\.[^\\.]+\$");
+	$docid = $fileroot;
+    }
+    
+    # make sure file extension is lowercase .jpg
+    
+    my $dstfile = "$docid.jpg";
+    
+    if ( $col ne "" ) {
+	$dstfile="$col:$dstfile";
+    }
+    
+    my $tmp_dir = &util::get_toplevel_tmp_dir();
+    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
+    if (! -d $tmp_dir) {
+	&util::mk_dir($tmp_dir);
+    }
+    my $dstfilename=&util::filename_cat($tmp_dir,$dstfile);
+    
+    &util::cp($srcfilename,$dstfilename);
+    
+    print "Generating add_file.xml\n";
+    
+    my $add_template_filename
+	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","add_file.xml");
+    my $add_this_filename = &util::filename_cat($tmp_dir,"add_file.xml");
+    
+    if (open(FIN,"<$add_template_filename")) {
+	
+	my $add_this_file_content = "";
+	
+	my $line;
+	while (defined ($line=<FIN>)) {
+	    $line =~ s@\*\*imgfile\*\*@$dstfilename@g;
+	    
+	    $add_this_file_content .= $line;
+	}
+	
+	close(FIN);
+	
+	if (open(FOUT,">$add_this_filename")) {
+	    print FOUT $add_this_file_content;
+	    close(FOUT);
+	}
+	else {
+	    print STDERR "Error: failed to write out $add_this_filename\n";
+	    print STDERR "$!\n";
+	}
+    }
+    else {
+	print STDERR "Error: failed to read $add_template_filename\n";
+	print STDERR "$!\n";
+    }
+    
+    
+    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
+    my $java_cmd = "java -jar \"$jar_filename\" \"$add_this_filename\"";
+    #my $java_cmd = "java -cp /research/kjdon/home/pharos-greenstone3/ext/pharos/decompiled:/research/kjdon/home/pharos-greenstone3/ext/pharos/cmdline-api-srcpack/ImageIS.jar:/research/kjdon/home/pharos-greenstone3/ext/pharos MyImageIS $add_this_filename";
+    print "Ingesting $dstfile\n";
+    
+    my $status = system($java_cmd);
+    
+    if ($status == 0 ) {
+	&util::rm($add_this_filename);
+    }
+    else {
+	print STDERR "Error: Failed to run:\n";
+	print STDERR "$!\n";
+	exit 1;
+    }
+}
+ 
+
+main();
Index: /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-delete.pl
===================================================================
--- /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-delete.pl	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-delete.pl	(revision 21242)
@@ -0,0 +1,118 @@
+#!/usr/bin/perl -w
+
+###########################################################################
+#
+# pharos-imageis-delete.pl --
+# 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.
+#
+###########################################################################
+
+BEGIN {
+    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
+    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
+    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
+}
+
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and vice versa
+no strict 'subs'; # allow barewords (eg STDERR) as function arguments
+
+use util;
+
+
+sub main
+{
+    
+    my $ARGC = scalar(@ARGV);
+    
+    
+    if ($ARGC != 2) {
+	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
+	print STDERR "Usage: $progname collection doc-id\n";
+	exit 1;
+    }
+
+    my ($col,$id) = @ARGV;
+            
+    my $docid = $id;
+    if ( $col ne "" ) {
+	$docid="$col:$docid";
+    }
+    
+    my $tmp_dir = &util::get_toplevel_tmp_dir();
+    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
+
+    print "Generating del_id.xml\n";
+    
+    my $del_template_filename
+	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","del_id.xml");
+    my $del_this_filename = &util::filename_cat($tmp_dir,"del_id.xml");
+    
+    if (open(FIN,"<$del_template_filename")) {
+	
+	my $del_this_file_content = "";
+	
+	my $line;
+	while (defined ($line=<FIN>)) {
+	    $line =~ s@\*\*docid\*\*@$docid@g;
+	    
+	    $del_this_file_content .= $line;
+	}
+	
+	close(FIN);
+	
+	if (open(FOUT,">$del_this_filename")) {
+	    print FOUT $del_this_file_content;
+	    close(FOUT);
+	}
+	else {
+	    print STDERR "Error: failed to write out $del_this_filename\n";
+	    print STDERR "$!\n";
+	}
+    }
+    else {
+	print STDERR "Error: failed to read $del_template_filename\n";
+	print STDERR "$!\n";
+    }
+    
+    
+    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
+    my $java_cmd = "java -jar \"$jar_filename\" \"$del_this_filename\"";
+
+    print "Deleting $docid\n";
+    
+    my $status = system($java_cmd);
+    
+    if ($status == 0 ) {
+	&util::rm($del_this_filename);
+    }
+    else {
+	print STDERR "Error: Failed to run:\n";
+	print STDERR "$!\n";
+	exit 1;
+    }
+}
+ 
+
+main();
+
Index: /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-identify.pl
===================================================================
--- /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-identify.pl	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-identify.pl	(revision 21242)
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+
+###########################################################################
+#
+# pharos-imageis-add.pl --
+# 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.
+#
+###########################################################################
+
+BEGIN {
+    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
+    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
+    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
+}
+
+
+
+print "\n";
+print "****\n";
+print "* Pharos-Greenstone3 Bridge\n";
+print "*   - Image Similarity Search\n";
+print "****\n";
+print "\n";
+
+exit 0;
Index: /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-query.pl
===================================================================
--- /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-query.pl	(revision 21242)
+++ /gs3-extensions/pharos/trunk/bin/script/pharos-imageis-query.pl	(revision 21242)
@@ -0,0 +1,158 @@
+#!/usr/bin/perl -w
+
+###########################################################################
+#
+# pharos-imageis-query.pl --
+# 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.
+#
+###########################################################################
+
+BEGIN {
+    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
+    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
+    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
+}
+
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and vice versa
+no strict 'subs'; # allow barewords (eg STDERR) as function arguments
+
+use util;
+
+sub main
+{
+    
+    my $ARGC = scalar(@ARGV);
+    
+    
+    if ($ARGC != 2) {
+	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
+	print STDERR "Usage: $progname collection doc-id\n";
+	exit 1;
+    }
+
+    my ($col,$id) = @ARGV;
+            
+    my $docid = $id;
+    if ( $col ne "" ) {
+	$docid="$col:$docid";
+    }
+    
+    my $tmp_dir = &util::get_toplevel_tmp_dir();
+    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
+
+    print "Generating query_id.xml\n";
+    
+    my $query_template_filename
+	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","query_id.xml");
+    my $query_this_filename = &util::filename_cat($tmp_dir,"query_id.xml");
+    
+    if (open(FIN,"<$query_template_filename")) {
+	
+	my $query_this_file_content = "";
+	
+	my $line;
+	while (defined ($line=<FIN>)) {
+	    $line =~ s@\*\*docid\*\*@$docid@g;
+	    
+	    $query_this_file_content .= $line;
+	}
+	
+	close(FIN);
+	
+	if (open(FOUT,">$query_this_filename")) {
+	    print FOUT $query_this_file_content;
+	    close(FOUT);
+	}
+	else {
+	    print STDERR "Error: failed to write out $query_this_filename\n";
+	    print STDERR "$!\n";
+	}
+    }
+    else {
+	print STDERR "Error: failed to read $query_template_filename\n";
+	print STDERR "$!\n";
+    }
+    
+    
+    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
+    my $java_cmd = "java -jar \"$jar_filename\" \"$query_this_filename\"";
+
+
+    print "Querying $docid\n";
+    
+    chdir($tmp_dir);
+    my $status = system($java_cmd);
+    
+    if ($status == 0 ) {
+	&util::rm($query_this_filename);
+    }
+    else {
+	print STDERR "Error: Failed to run:\n";
+	print STDERR "$!\n";
+	exit 1;
+    }
+
+    my $result_filename = &util::filename_cat($tmp_dir,"image_cbs_result.xml");
+    
+    if ( ! -f $result_filename ) {
+	print STDERR "\n";
+	print STDERR "Error: Failed to generate $result_filename.xml\n";
+	print STDERR "       Check Tomcat's catalina.out for server-side error messages\n";
+	print STDERR "\n";
+	exit 1;
+    }
+    elsif ( -s $result_filename == 0) {
+	print STDERR "\n";
+	print STDERR "Warning: Server returned zero sized file image_cbs_result.xml\n";
+	print STDERR "         Check that the doc-id used is valid\n";
+	print STDERR "\n";
+	&util::rm($result_filename);
+    }
+    else {
+	
+	if (open(FIN,"<$result_filename")) {
+	
+	    my $line;
+	    while (defined ($line=<FIN>)) {
+		print $line;
+	    }
+	    
+	    close(FIN);
+	}
+	else {
+	    print STDERR "Error: failed to read $result_filename\n";
+	    print STDERR "$!\n";
+	}
+
+	print "\n";
+	&util::rm($result_filename);
+    }
+}
+ 
+
+main();
+
+
+
+
Index: 3-extensions/pharos/trunk/cmdline-api-srcpack/VSprops.properties.in
===================================================================
--- /gs3-extensions/pharos/trunk/cmdline-api-srcpack/VSprops.properties.in	(revision 21241)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# video segmentation params
-
-vs.cbsewsendpoint=http://@tomcat.server@:@tomcat.port@/pharos/services/ContentBasedSearchWSProxy
-
-vs.features=margTamura-2+2+2-M-G-6-3.T3x3,margCIELAB-2+2+2-M-G.T3x3,gabor-6-4
-
-vs.path2hive=@imageishome@/bin/@iisos@/hive2_ffmpegsvn
-
-vs.path2shotMpeg7=@imageishome@/bin/@iisos@/shot_mpeg7
-
-vs.path2anntotate=@imageishome@/bin/@iisos@/annotate-1_8
-
-vs.path2ftfmpeg7=@imageishome@/bin/@iisos@/ftf_mpeg7_v4-jpg
-
-vs.workpath=@gsdlhome@/tmp/pharos-annotate/
-
Index: 3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-add.pl
===================================================================
--- /gs3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-add.pl	(revision 21241)
+++ 	(revision )
@@ -1,144 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# pharos-imageis-add.pl --
-# 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.
-#
-###########################################################################
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
-    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-use strict;
-no strict 'refs'; # allow filehandles to be variables and vice versa
-no strict 'subs'; # allow barewords (eg STDERR) as function arguments
-
-
-use util;
-
-sub main
-{
-    
-    my $ARGC = scalar(@ARGV);
-    
-    
-    if (($ARGC < 2) || ($ARGC>3)) {
-	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
-	print STDERR "Usage: $progname collection file.jpg [doc-id]\n";
-	exit 1;
-    }
-
-    # docid might be undefined, in which case later on is is derived from
-    # from col and the file-name tail to srcfilename
-    my ($col,$srcfilename,$docid) = @ARGV;
-    
-    
-    if ( ! -f $srcfilename ) {
-	print STDERR "Error: failed to find $srcfilename\n";
-	exit 1;
-    }
-    
-    if ( $srcfilename !~ m/\.je?pg$/i ) {
-	print STDERR "Error: Unrecognized JPEG filename extension\n";
-	exit 1;
-    }
-    
-    if (!defined $docid) {
-	my ($fileroot,$dirname_unused,$suffix_unused) 
-	    = fileparse($srcfilename, "\\.[^\\.]+\$");
-	$docid = $fileroot;
-    }
-    
-    # make sure file extension is lowercase .jpg
-    
-    my $dstfile = "$docid.jpg";
-    
-    if ( $col ne "" ) {
-	$dstfile="$col:$dstfile";
-    }
-    
-    my $tmp_dir = &util::get_toplevel_tmp_dir();
-    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
-    if (! -d $tmp_dir) {
-	&util::mk_dir($tmp_dir);
-    }
-    my $dstfilename=&util::filename_cat($tmp_dir,$dstfile);
-    
-    &util::cp($srcfilename,$dstfilename);
-    
-    print "Generating add_file.xml\n";
-    
-    my $add_template_filename
-	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","add_file.xml");
-    my $add_this_filename = &util::filename_cat($tmp_dir,"add_file.xml");
-    
-    if (open(FIN,"<$add_template_filename")) {
-	
-	my $add_this_file_content = "";
-	
-	my $line;
-	while (defined ($line=<FIN>)) {
-	    $line =~ s@\*\*imgfile\*\*@$dstfilename@g;
-	    
-	    $add_this_file_content .= $line;
-	}
-	
-	close(FIN);
-	
-	if (open(FOUT,">$add_this_filename")) {
-	    print FOUT $add_this_file_content;
-	    close(FOUT);
-	}
-	else {
-	    print STDERR "Error: failed to write out $add_this_filename\n";
-	    print STDERR "$!\n";
-	}
-    }
-    else {
-	print STDERR "Error: failed to read $add_template_filename\n";
-	print STDERR "$!\n";
-    }
-    
-    
-    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
-    my $java_cmd = "java -jar \"$jar_filename\" \"$add_this_filename\"";
-    #my $java_cmd = "java -cp /research/kjdon/home/pharos-greenstone3/ext/pharos/decompiled:/research/kjdon/home/pharos-greenstone3/ext/pharos/cmdline-api-srcpack/ImageIS.jar:/research/kjdon/home/pharos-greenstone3/ext/pharos MyImageIS $add_this_filename";
-    print "Ingesting $dstfile\n";
-    
-    my $status = system($java_cmd);
-    
-    if ($status == 0 ) {
-	&util::rm($add_this_filename);
-    }
-    else {
-	print STDERR "Error: Failed to run:\n";
-	print STDERR "$!\n";
-	exit 1;
-    }
-}
- 
-
-main();
Index: 3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-delete.pl
===================================================================
--- /gs3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-delete.pl	(revision 21241)
+++ 	(revision )
@@ -1,118 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# pharos-imageis-delete.pl --
-# 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.
-#
-###########################################################################
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
-    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-use strict;
-no strict 'refs'; # allow filehandles to be variables and vice versa
-no strict 'subs'; # allow barewords (eg STDERR) as function arguments
-
-use util;
-
-
-sub main
-{
-    
-    my $ARGC = scalar(@ARGV);
-    
-    
-    if ($ARGC != 2) {
-	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
-	print STDERR "Usage: $progname collection doc-id\n";
-	exit 1;
-    }
-
-    my ($col,$id) = @ARGV;
-            
-    my $docid = $id;
-    if ( $col ne "" ) {
-	$docid="$col:$docid";
-    }
-    
-    my $tmp_dir = &util::get_toplevel_tmp_dir();
-    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
-
-    print "Generating del_id.xml\n";
-    
-    my $del_template_filename
-	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","del_id.xml");
-    my $del_this_filename = &util::filename_cat($tmp_dir,"del_id.xml");
-    
-    if (open(FIN,"<$del_template_filename")) {
-	
-	my $del_this_file_content = "";
-	
-	my $line;
-	while (defined ($line=<FIN>)) {
-	    $line =~ s@\*\*docid\*\*@$docid@g;
-	    
-	    $del_this_file_content .= $line;
-	}
-	
-	close(FIN);
-	
-	if (open(FOUT,">$del_this_filename")) {
-	    print FOUT $del_this_file_content;
-	    close(FOUT);
-	}
-	else {
-	    print STDERR "Error: failed to write out $del_this_filename\n";
-	    print STDERR "$!\n";
-	}
-    }
-    else {
-	print STDERR "Error: failed to read $del_template_filename\n";
-	print STDERR "$!\n";
-    }
-    
-    
-    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
-    my $java_cmd = "java -jar \"$jar_filename\" \"$del_this_filename\"";
-
-    print "Deleting $docid\n";
-    
-    my $status = system($java_cmd);
-    
-    if ($status == 0 ) {
-	&util::rm($del_this_filename);
-    }
-    else {
-	print STDERR "Error: Failed to run:\n";
-	print STDERR "$!\n";
-	exit 1;
-    }
-}
- 
-
-main();
-
Index: 3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-identify.pl
===================================================================
--- /gs3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-identify.pl	(revision 21241)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# pharos-imageis-add.pl --
-# 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.
-#
-###########################################################################
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
-    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-
-print "\n";
-print "****\n";
-print "* Pharos-Greenstone3 Bridge\n";
-print "*   - Image Similarity Search\n";
-print "****\n";
-print "\n";
-
-exit 0;
Index: 3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-query.pl
===================================================================
--- /gs3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/pharos-imageis-query.pl	(revision 21241)
+++ 	(revision )
@@ -1,158 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# pharos-imageis-query.pl --
-# 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.
-#
-###########################################################################
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
-    die "IMAGEISHOME not set\n" unless defined $ENV{'IMAGEISHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-use strict;
-no strict 'refs'; # allow filehandles to be variables and vice versa
-no strict 'subs'; # allow barewords (eg STDERR) as function arguments
-
-use util;
-
-sub main
-{
-    
-    my $ARGC = scalar(@ARGV);
-    
-    
-    if ($ARGC != 2) {
-	my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
-	print STDERR "Usage: $progname collection doc-id\n";
-	exit 1;
-    }
-
-    my ($col,$id) = @ARGV;
-            
-    my $docid = $id;
-    if ( $col ne "" ) {
-	$docid="$col:$docid";
-    }
-    
-    my $tmp_dir = &util::get_toplevel_tmp_dir();
-    $tmp_dir = &util::filename_cat($tmp_dir,"pharos-imageis");
-
-    print "Generating query_id.xml\n";
-    
-    my $query_template_filename
-	= &util::filename_cat($ENV{'IMAGEISHOME'},"templates","query_id.xml");
-    my $query_this_filename = &util::filename_cat($tmp_dir,"query_id.xml");
-    
-    if (open(FIN,"<$query_template_filename")) {
-	
-	my $query_this_file_content = "";
-	
-	my $line;
-	while (defined ($line=<FIN>)) {
-	    $line =~ s@\*\*docid\*\*@$docid@g;
-	    
-	    $query_this_file_content .= $line;
-	}
-	
-	close(FIN);
-	
-	if (open(FOUT,">$query_this_filename")) {
-	    print FOUT $query_this_file_content;
-	    close(FOUT);
-	}
-	else {
-	    print STDERR "Error: failed to write out $query_this_filename\n";
-	    print STDERR "$!\n";
-	}
-    }
-    else {
-	print STDERR "Error: failed to read $query_template_filename\n";
-	print STDERR "$!\n";
-    }
-    
-    
-    my $jar_filename = &util::filename_cat($ENV{'IMAGEISHOME'},"ImageIS.jar");
-    my $java_cmd = "java -jar \"$jar_filename\" \"$query_this_filename\"";
-
-
-    print "Querying $docid\n";
-    
-    chdir($tmp_dir);
-    my $status = system($java_cmd);
-    
-    if ($status == 0 ) {
-	&util::rm($query_this_filename);
-    }
-    else {
-	print STDERR "Error: Failed to run:\n";
-	print STDERR "$!\n";
-	exit 1;
-    }
-
-    my $result_filename = &util::filename_cat($tmp_dir,"image_cbs_result.xml");
-    
-    if ( ! -f $result_filename ) {
-	print STDERR "\n";
-	print STDERR "Error: Failed to generate $result_filename.xml\n";
-	print STDERR "       Check Tomcat's catalina.out for server-side error messages\n";
-	print STDERR "\n";
-	exit 1;
-    }
-    elsif ( -s $result_filename == 0) {
-	print STDERR "\n";
-	print STDERR "Warning: Server returned zero sized file image_cbs_result.xml\n";
-	print STDERR "         Check that the doc-id used is valid\n";
-	print STDERR "\n";
-	&util::rm($result_filename);
-    }
-    else {
-	
-	if (open(FIN,"<$result_filename")) {
-	
-	    my $line;
-	    while (defined ($line=<FIN>)) {
-		print $line;
-	    }
-	    
-	    close(FIN);
-	}
-	else {
-	    print STDERR "Error: failed to read $result_filename\n";
-	    print STDERR "$!\n";
-	}
-
-	print "\n";
-	&util::rm($result_filename);
-    }
-}
- 
-
-main();
-
-
-
-
Index: /gs3-extensions/pharos/trunk/etc/templates/add_dir.xml
===================================================================
--- /gs3-extensions/pharos/trunk/etc/templates/add_dir.xml	(revision 21242)
+++ /gs3-extensions/pharos/trunk/etc/templates/add_dir.xml	(revision 21242)
@@ -0,0 +1,19 @@
+
+<Mpeg7 xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 ./davp-2005.xsd" xmlns="urn:mpeg:mpeg7:schema:2001" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <Description xsi:type="ContentEntityType">
+        <MultimediaContent xsi:type="AudioVisualType">
+            <AudioVisual>
+                <StructuralUnit href="urn:x-mpeg-7-pharos:cs:AudioVisualSegmentationCS:root"/>
+          
+                <MediaSourceDecomposition criteria="kmi image annotation segment to add">
+                    <StillRegion>
+                        <MediaLocator>
+                        <!-- URL of location of the image on the disk eg file://some/path/mycollection:myvideo:mykeyframe.jpg -->
+                            <MediaUri>file:///tmp/vsupload/**imgdir**</MediaUri>
+                        </MediaLocator>
+                    </StillRegion>
+                </MediaSourceDecomposition>
+            </AudioVisual>
+        </MultimediaContent>
+    </Description>
+</Mpeg7>
Index: /gs3-extensions/pharos/trunk/etc/templates/add_file.xml
===================================================================
--- /gs3-extensions/pharos/trunk/etc/templates/add_file.xml	(revision 21242)
+++ /gs3-extensions/pharos/trunk/etc/templates/add_file.xml	(revision 21242)
@@ -0,0 +1,19 @@
+
+<Mpeg7 xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 ./davp-2005.xsd" xmlns="urn:mpeg:mpeg7:schema:2001" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <Description xsi:type="ContentEntityType">
+        <MultimediaContent xsi:type="AudioVisualType">
+            <AudioVisual>
+                <StructuralUnit href="urn:x-mpeg-7-pharos:cs:AudioVisualSegmentationCS:root"/>
+          
+                <MediaSourceDecomposition criteria="kmi image annotation segment to add">
+                    <StillRegion>
+                        <MediaLocator>
+                        <!-- URL of location of the image on the disk eg file://some/path/mycollection:myvideo:mykeyframe.jpg -->
+                            <MediaUri>file://**imgfile**</MediaUri>
+                        </MediaLocator>
+                    </StillRegion>
+                </MediaSourceDecomposition>
+            </AudioVisual>
+        </MultimediaContent>
+    </Description>
+</Mpeg7>
Index: /gs3-extensions/pharos/trunk/etc/templates/del_id.xml
===================================================================
--- /gs3-extensions/pharos/trunk/etc/templates/del_id.xml	(revision 21242)
+++ /gs3-extensions/pharos/trunk/etc/templates/del_id.xml	(revision 21242)
@@ -0,0 +1,25 @@
+
+
+<Mpeg7 xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 ./davp-2005.xsd" xmlns="urn:mpeg:mpeg7:schema:2001" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <Description xsi:type="ContentEntityType">
+        <MultimediaContent xsi:type="AudioVisualType">
+            <AudioVisual>
+                <StructuralUnit href="urn:x-mpeg-7-pharos:cs:AudioVisualSegmentationCS:root"/>
+          
+                <MediaSourceDecomposition criteria="kmi image annotation segment to remove">
+                    <StillRegion>
+                        <MediaLocator>
+                            <!--<MediaUri>collection:video:keyframe1.jpg</MediaUri>-->
+                            <!-- or to remove the whole video -->
+                            <!--   <MediaUri>collection:video:*</MediaUri>-->
+                            <!-- or to remove the whole collection -->
+                            <!--   <MediaUri>collection:*</MediaUri>-->
+
+                            <MediaUri>**docid**</MediaUri>
+                        </MediaLocator>
+                    </StillRegion>
+                </MediaSourceDecomposition>
+            </AudioVisual>
+        </MultimediaContent>
+    </Description>
+</Mpeg7>
Index: /gs3-extensions/pharos/trunk/etc/templates/query_id.xml
===================================================================
--- /gs3-extensions/pharos/trunk/etc/templates/query_id.xml	(revision 21242)
+++ /gs3-extensions/pharos/trunk/etc/templates/query_id.xml	(revision 21242)
@@ -0,0 +1,55 @@
+
+<MpegQuery mpqfID="TestId0012-36" xmlns="urn:mpeg:mpqf:schema:2008" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2004" xsi:schemaLocation="urn:mpeg:mpqf:schema:2008 mpqfv08.xsd urn:mpeg:mpeg7:schema:2004 M7v2schema.xsd">
+    <Query>
+        <Input>
+            
+            <!-- This is used to format the output /  Result set -->
+            <OutputDescription maxItemCount="10"  freeTextUse="true" mediaResourceUse="true" outputNameSpace="urn:mpeg:mpqf:schema:2008">
+            </OutputDescription>
+            <QueryCondition>
+                <TargetMediaType>video/jpeg</TargetMediaType>
+
+                <Condition xsi:type="AND">
+
+                <!-- Image Searches -->
+
+                    <Condition xsi:type="QueryByMedia" matchType="similar" thresholdValue="0.8" preferenceValue="1">
+                        <MediaResource resourceID="id001">
+                            <MediaResource>
+                                <MediaUri>**docid**</MediaUri>
+                            </MediaResource>
+                        </MediaResource>
+                    </Condition>
+
+                    <!--START Image search query by media id -->
+            <!--        <Condition xsi:type="QueryByMedia" matchType="similar" preferenceValue="1">
+                        <MediaResource resourceID="id001">
+                            <MediaResource>
+                                <MediaUri>19734.jpg</MediaUri>
+                            </MediaResource>
+                        </MediaResource>
+                    </Condition>
+                    <Condition xsi:type="QueryByMedia" matchType="similar" preferenceValue="1">
+                        <MediaResource resourceID="id002">
+                            <MediaResource>
+                                <MediaUri>collection:video02:keyframe0123</MediaUri>
+                            </MediaResource>
+                        </MediaResource>
+                    </Condition>
+                    <Condition xsi:type="QueryByMedia" matchType="similar" preferenceValue="1">
+                        <MediaResource resourceID="id003">
+                            <MediaResource>
+                                <MediaUri>collection:video04:keyframe03</MediaUri>
+                            </MediaResource>
+                        </MediaResource>
+                    </Condition>-->
+                      <!--END Image search query by media id -->
+                </Condition>
+            </QueryCondition>
+            <ServiceSelection>
+                <ServiceID>image-search-mediaid</ServiceID>
+ 
+            </ServiceSelection>
+        </Input>
+    </Query>
+</MpegQuery>
Index: /gs3-extensions/pharos/trunk/setup.bash
===================================================================
--- /gs3-extensions/pharos/trunk/setup.bash	(revision 21241)
+++ /gs3-extensions/pharos/trunk/setup.bash	(revision 21242)
@@ -27,4 +27,6 @@
 export PHAROSOS=$GSDLOS
 
+export IMAGEISHOME=`pwd`
+
 export PATH=$PHAROSSRCHOME/bin/script:$PHAROSSRCHOME/bin/$PHAROSOS:$PATH
 
@@ -39,4 +41,8 @@
 echo "  - To start DerbyDB: pharos-start-derby.sh"
 echo "  - To stop  DerbyDB: pharos-stop-derby.sh"
+echo ""
+echo "  - To ingest image: pharos-imageis-add.pl collection file.jpg [doc-id]"
+echo "  - To delete image: pharos-imageis-delete.pl collection doc-id"
+echo "  - To ingest image: pharos-imageis-query.pl collection doc-id"
 
 cd cmdline-api-srcpack ; source setup.bash ; cd ..
