Index: gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm
===================================================================
--- gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm	(revision 26593)
+++ gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm	(revision 26596)
@@ -217,16 +217,16 @@
 {
     my $self = shift @_;
-    my ($x, $y, $text, $w, $attr) = @_;
-
-    my %attr_copy = %$attr; # make a private copy of 'attr'
-
-    $self->setTextDefaultAttributes(\%attr_copy);
-    my $items = $self->{'items'};
-
-    $attr_copy{'P'} = "$x $y";
-    $attr_copy{'T'} = $text;
-    $attr_copy{'w'} = "-$w" if (defined $w);
-
-    return $self->_addItem("T",\%attr_copy);
+	my ($x,$y,$text,$w,$attr) = @_;
+	
+	my %attr_copy = %$attr; #make a private copy of 'attr'
+	
+	$self->setTextDefaultAttributes(\%attr_copy);
+	my $items = $self->{'items'};
+	
+	$attr_copy{'P'} = "$x $y";
+	$attr_copy{'T'} = $text;
+	$attr_copy{'w'} = "-$w" if (defined $w);
+	
+	return $self->_addItem("T",\%attr_copy);
 }
 
@@ -422,15 +422,84 @@
 }
 
-sub saveFrame
-{
-    my $self = shift @_;
-    my ($file) = @_;
+sub saveZeroFrame
+{
+    my $self = shift @_;
+    my $file = "0.exp";
 
     my $filename = &util::filename_cat($self->{'output_dir'},$file);
 
     my $status = undef;
+
+	my $username = $self->{'username'};
+    my $fdate = getFormattedDate();
 
     if (open(FOUT,">$filename")) {
 	binmode(FOUT,":utf8");
+	
+	print FOUT <<EOT;
+	
+V 1
+p 4
+U $username
+D $fdate
+M $username
+d $fdate
+Z
+
+Z
+
+Z
+
+Z
+	
+EOT
+
+	close(FOUT);
+	$status = 1;
+    }
+    else {
+	print STDERR "ExpediteeFrameIO::saveZeroFrame() Failed to open $filename for output\n";
+	$status = 0;
+    }
+
+    return $status;
+}
+
+sub writeAssocFilePath
+{
+	my $self = shift @_;
+	my ($assoc) = @_;
+	
+	my $x = 318;
+	my $y = 123;
+	my $text = "\@assocfilepath: $assoc";
+	
+	my $attr = {};
+	
+	#add data: gsdl.Metadata: assocfilepath to this piece of text.
+	$attr->{'D'} = "gsdl.Metadata: assocfilepath";
+	
+	$self->addText($x,$y,$text,undef,$attr);
+}
+
+sub saveFrame
+{
+    my $self = shift @_;
+    my ($file,$assoc) = @_;
+
+	if ($file eq "1.exp") {
+		$self->saveZeroFrame();
+	}
+
+    my $filename = &util::filename_cat($self->{'output_dir'},$file);
+
+    my $status = undef;
+
+    if (open(FOUT,">$filename")) {
+	binmode(FOUT,":utf8");
+	
+
+	$self->writeAssocFilePath($assoc);						#write assocfilepath out to frame.
+	
 	$self->writeHeaderSection();
 	$self->writeItemsSection();
@@ -438,5 +507,7 @@
 	$self->writeConstraintsSection();
 	$self->writeStatisticsSection();
-
+	
+	
+	
 	close(FOUT);
 	$status = 1;
@@ -486,8 +557,10 @@
 	    $img_url =~ s/^http:\/\/(.*?)\/greenstone3(.*?)\///;
 	    if ($img_url =~ m/^interfaces\//) {
-		$img_url = "images/$img_url";
+		$img_url = "greenstone3-svn/web/$img_url";
 	    }
 	    elsif ($img_url =~ m/^sites\//) {
-		$img_url =~ s/^sites\/(.*?)\//images\//;
+#		if ($img_url =~ m/^sites\//) {
+#		$img_url =~ s/^sites\/(.*?)\//images\//;
+			$img_url = "greenstone3-svn/web/$img_url";
 	    }
 
@@ -546,6 +619,5 @@
 	#writes frameset name concatenated with last frame number in the set to the frame.inf file.	
         my $getFramesetName = $self->{'output_dir'};
-	print FNOUT "$getFramesetName$last_frame_number\n";
-
+		
 	
 	close(FNOUT);
Index: gs3-extensions/html-to-expeditee/trunk/src/perllib/cgiactions/HtmlToExpediteeAction.pm
===================================================================
--- gs3-extensions/html-to-expeditee/trunk/src/perllib/cgiactions/HtmlToExpediteeAction.pm	(revision 26593)
+++ gs3-extensions/html-to-expeditee/trunk/src/perllib/cgiactions/HtmlToExpediteeAction.pm	(revision 26596)
@@ -50,5 +50,5 @@
 { 
     "generate-frame"     => { 'compulsory-args' => [ "fn", "json" ],
-			      'optional-args'   => [] }, 
+			      'optional-args'   => ["assoc"] }, 
 };
 
@@ -78,4 +78,6 @@
 
     my $fn = $self->{'fn'};
+	
+	my $assoc = $self->{'assoc'};
 
     # no need to lock collection (??), the operation is read only
@@ -95,5 +97,5 @@
     $expeditee_frame_io->buildFrame($exp_frame_tree);
 
-    if ($expeditee_frame_io->saveFrame("$fn.exp")) {
+    if ($expeditee_frame_io->saveFrame("$fn.exp",$assoc)) {
 	
 	# write out next free frame num
Index: gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in
===================================================================
--- gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in	(revision 26593)
+++ gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in	(revision 26596)
@@ -1,3 +1,3 @@
- #!@FULL_PERL_EXE@ -w
+ #!/cygdrive/c/strawberry/perl/bin/perl -w
 
 # Need to specify the full path of Perl above, e.g. for Windows something like
@@ -181,6 +181,7 @@
 	      }
 	      
-	      url += "&p.showExpediteeAttributes=1";
-
+	      //url += "&p.showExpediteeAttributes=1";
+
+		  
 	      /* load iframe with document drawn from Greenstone collection */
 	      iframe.src = url;
@@ -228,4 +229,9 @@
 	      */
 
+		  //get assocfilepath from xml 
+		  var xmlUrl = iframe.src + "&o=xml";
+		  
+		  var assoc = getAssocFilePath(xmlUrl);
+
 	      var expFrameTree = htmlToExpeditee(gsContent);
 
@@ -239,13 +245,20 @@
 	      var params = "c=" + collect;
 	      if (site.match(/\\w/)) {
-		params += "&site=" + site;
+			params += "&site=" + site;
    	      }
+		  
 	      params += "&a=generate-frame&fn=" + frameID;
 	      params += "&json=" + escape(expFrame);
+		  
+		  //add an assocfilepath parameter
+		  
+		  if(assoc !== null && assoc !== undefined){
+			params += "&assoc=" + assoc;
+		  }
 
 	      var clHtml = urlPostSync(url,params);
 
 	      if (!clHtml.match(/html-to-expeditee saved frame/)) {
-		  alert("Error processing url: " + url);
+			alert("Error processing url: " + url);
 	      }
 
@@ -274,5 +287,5 @@
 	     	  }
 
-		  url += "&p.showExpediteeAttributes=1";
+		  //url += "&p.showExpediteeAttributes=1";
 
 		  iframe.src = url;
@@ -288,4 +301,35 @@
 	 
       }
+	  
+	  function getAssocFilePath(xmlUrl){
+	  var assoc = "";
+	  
+	  \$.ajax({
+			type: "GET",
+			async: false,
+			url: xmlUrl,
+			dataType: "xml",
+			success: function(xml){
+				
+								
+				\$(xml).find('metadata').each(function(){
+					
+					var name = \$(this).attr('name');
+					
+					if(name === 'assocfilepath'){
+						if(assoc === ""){
+							assoc = \$(this).text();
+							//console.log(assoc);
+						}
+						
+					}	
+				});
+				
+			}
+			
+		  });
+		  
+		  return assoc;
+	  }
 
     </script>
