Index: /gs3-extensions/webswing/trunk/build.xml
===================================================================
--- /gs3-extensions/webswing/trunk/build.xml	(revision 38805)
+++ /gs3-extensions/webswing/trunk/build.xml	(revision 38806)
@@ -176,4 +176,6 @@
 	    <filter token="gsdl3srchome" value="${gsdl3srchome}"/>
 	    <filter token="gsdl3srchomeunix" value="${gsdl3srchome.unix}"/>
+	    <filter token="gsdl3webwritablehome" value="${web.writablehome}"/>
+	    <filter token="gsdl3webwritablehomeunix" value="${web.writablehome.unix}"/>
 	    <filter token="gsdlos" value="${gsdlos}"/>
 	    <filter token="internal-ws-webswingserver" value="${internal.ws-webswingserver}"/>
Index: /gs3-extensions/webswing/trunk/web/etc/webswing.config.in
===================================================================
--- /gs3-extensions/webswing/trunk/web/etc/webswing.config.in	(revision 38805)
+++ /gs3-extensions/webswing/trunk/web/etc/webswing.config.in	(revision 38806)
@@ -73,4 +73,64 @@
     "webHomeDir" : "@gsdl3srchomeunix@/gli",
     "goodbyeUrl" : "/"
+  },
+  "/phind" : {
+    "path" : "/phind",
+    "security" : {
+      "module" : "NONE",
+      "config" : { },
+      "classPath" : [ ]
+    },
+
+    "webFolder" : "",
+    "swingConfig" : {
+      "jreExecutable" : "${java.home}/bin/java",
+      "javaVersion" : "${java.version}",
+      "vmArgs" : "",
+      "classPathEntries" : [ "applet/*.jar" ],
+      "theme" : "Murrine",
+      "fontConfig" : {
+        "dialog" : "${webswing.configDir}/fonts/Roboto-Regular.ttf",
+        "dialoginput" : "${webswing.configDir}/fonts/RobotoMono-Regular.ttf",
+        "monospaced" : "${webswing.configDir}/fonts/RobotoMono-Regular.ttf",
+        "serif" : "${webswing.configDir}/fonts/Roboto-Regular.ttf",
+        "sansserif" : "${webswing.configDir}/fonts/Roboto-Regular.ttf"
+      },
+      "swingSessionTimeout" : 300,
+      "antiAliasText" : true,
+      "isolatedFs" : true,
+      "debug" : false,
+      "directdraw" : true,
+      "allowDelete" : false,
+      "allowDownload" : false,
+      "allowAutoDownload" : true,
+      "allowUpload" : false,
+      "allowJsLink" : true,
+      "allowLocalClipboard" : true,
+      "launcherType" : "Applet",
+      "launcherConfig" : {
+        "appletClass" : "org.greenstone.applet.phind.JPhind",
+        "parameters" : {
+		"library" : "library",
+        	"collection" : "tudor",
+		"phindcgi" : "?a=a&amp;rt=r&amp;s=PhindApplet&amp;o=xml&amp;ro=1",
+        	"classifier" : "1",
+        	"orientation" : "vertical",
+        	"depth" : "2",
+        	"resultorder" : "L,l,E,e,D,d",
+        	"backdrop" : "interfaces/default/images/phindbg1.jpg",
+        	"fontsize" : "10",
+        	"blocksize" : "10"
+        	}
+      },
+      "homeDir" : "@gsdl3webwritablehomeunix@"
+    },
+    "maxClients" : 4,
+    "maxConnections" : 4,
+    "allowStealSession" : false,
+    "name" : "Greenstone Librarian Interface",
+    "sessionMode" : "ALWAYS_NEW_SESSION",
+    "uploadMaxSize" : 1200,
+    "webHomeDir" : "@gsdl3webwritablehomeunix@",
+    "goodbyeUrl" : "/"
   }
 }
Index: /main/trunk/greenstone3/build.xml
===================================================================
--- /main/trunk/greenstone3/build.xml	(revision 38805)
+++ /main/trunk/greenstone3/build.xml	(revision 38806)
@@ -3212,8 +3212,12 @@
     It seems to have a problem with cat or </dev/null, with or without the < sign. -->
   <target name="reset-logs" description="Empties catalina.out, solr.log, greenstone.log, usage.log, server.log and contents of web/logs/tmp">
-    <echo>Truncating catalina.out, solr.log, greenstone.log, usage.log and server.log, and emptying ${web.writablehome}/logs/tmp</echo>    
+    <echo>Truncating catalina.out, catalinahome/bin/logs/webswing.log, solr.log, greenstone.log, usage.log and server.log, and emptying ${web.writablehome}/logs/tmp</echo>    
     <exec executable="rm" os="${os.unix}" dir="${catalina.home}/logs" spawn="false">
       <arg value="-f"/>
       <arg value="catalina.out"/>
+    </exec>
+    <exec executable="rm" os="${os.unix}" dir="${catalina.home}/bin/logs" spawn="false">
+      <arg value="-f"/>
+      <arg value="webswing.log"/>
     </exec>
     <exec executable="rm" os="${os.unix}" dir="${web.writablehome}/logs" spawn="false">
@@ -3706,4 +3710,5 @@
     <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
     <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
+
     <jar destfile="${build.home}/phind.jar">
       <fileset dir="${build.home}">
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-phind.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-phind.xsl	(revision 38806)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-phind.xsl	(revision 38806)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:java="http://xml.apache.org/xslt/java"
+	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+	xmlns:gslib="http://www.greenstone.org/skinning"
+	xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"	
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="java util">
+
+  <!-- This page, structurally speaking, is a hybrid of home.xsl and about.xsl -->
+  <!-- If no collection argument is explicitly given, then produces a general
+       embedded GLI, however if a collection is specified, then it produced
+       a page with a navigation area akin to an about this page, only with
+       GLI embedd in it, rather than about this collection txt   -->
+  
+	<!-- use the 'main' layout -->
+	<xsl:import href="layouts/main.xsl"/>
+
+	<!-- what is this used for??? Can it be deleted? -->
+	<xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
+
+	<!-- set page title -->
+
+	<xsl:template name="pageTitle">WebSwing Phind<!--<gslib:collectionName/><xsl:value-of select="/page/pageResponse/service/applet"/>--></xsl:template>
+
+
+	<!-- set page breadcrumbs -->
+	<xsl:template name="breadcrumbs">
+	  <xsl:choose>
+	    <xsl:when test="/page/pageRequest/paramList/param[@name='c']/@value != ''">
+              <gslib:siteLink/>
+              <gslib:rightArrow/>
+	      <xsl:if test="$groupPath != ''">
+		<gslib:groupLinks/>
+		<gslib:rightArrow/>
+	      </xsl:if>
+	      <a href="{$library_name}/collection/{$collName}/page/about">
+		<gslib:collectionName/>
+	      </a>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:choose>
+		<xsl:when test="$groupPath != ''">
+		  <a>
+		    <xsl:attribute name="href"><gslib:groupHref path="{$groupPath}"/></xsl:attribute>
+		    <xsl:attribute name="title"><gslib:groupName path="{$groupPath}"/></xsl:attribute>
+		    <gslib:groupName path="{$groupPath}"/>
+		  </a>
+		</xsl:when>
+		<xsl:otherwise>
+		  <gslib:siteLink/>
+		</xsl:otherwise>
+	      </xsl:choose>
+	      
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
+
+	<!-- the page content -->
+	<xsl:template match="/page">
+  
+		<xsl:choose>
+			<xsl:when test="$this-element/displayItemList/displayItem[@name='icon']">
+			  <img border="0">
+				<xsl:attribute name="src"><xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItemList/displayItem[@name='icon']"/></xsl:attribute>
+				<xsl:attribute name="alt">
+				  <xsl:value-of select="$this-element/displayItemList/displayItem[@name='name']"/>
+				</xsl:attribute>
+				<xsl:attribute name="title">
+				  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'webswing_glipage')"/>
+				</xsl:attribute>
+			  </img>		
+			</xsl:when>      
+		</xsl:choose>	
+  
+		<!--Display the description text of the current collection,
+		and if some services are available then create a list
+		of links for each service within a <ul id="servicelist"> element.-->
+		<xsl:call-template name="webswing-embed-phind"/>
+	</xsl:template>
+	
+	<xsl:template name="webswing-embed-phind">
+	  <link rel="stylesheet" href="/webswing-server/css/style.css" />
+
+	  <div id="webswing-phind" class="webswing-element" data-webswing-instance="webswingInstance0" style="width: 500px; height: 500px;">
+	    <div id="loading" class="ws-modal-container">
+              <div class="ws-login">
+		<div  class="ws-login-content">
+                  <div class="ws-spinner">
+		    <div class="ws-spinner-dot-1"><xsl:comment>filler</xsl:comment></div>
+		    <div class="ws-spinner-dot-2"><xsl:comment>filler</xsl:comment></div>
+		  </div>
+		</div>
+              </div>
+	    </div>
+	  </div>
+
+	  <gsf:script>
+
+    var webswingInstance0 = {
+        options: {
+            autoStart: true,
+	  
+            connectionUrl:'/webswing-server/phind',
+
+	    customization: function(injector) {
+	    injector.services.base.handleActionEvent = function(actionName, data, binaryData) {
+       	        console.log("WebSwing actionEvent callback handler: called with actionName = " + actionName);
+		/*
+		if (actionName == "previewURL") {
+	          var url = data;
+	          window.open(url, '_blank');
+		}
+	        else if (actionName == "downloadURL") {
+		  // currently the same as 'previewURL' but separate name gives this some future proofing
+	          var url = data;
+	          window.open(url, '_blank');
+		}
+	        else if (actionName == "setCursor") {
+		    var cursor_type = data;
+		    $('#webswing-phind').css("cursor",cursor_type);		    
+		}
+		else if (actionName == "javaToWebswingJSConsoleLog") {
+		    console.log("Got message from java:\n" + data);
+		}
+		*/
+		
+	      }
+            }
+
+	    
+       }
+       };
+       // Not yet working. Stick ${customArgs} at end of final param Value (BEFORE the value's closing double quote) in webswing.config.in
+       // The applet jar files can just remain in web/applet where they are compiled up
+       /*if(!webswingInstance0.options.args) {
+       webswingInstance0.options.args="";
+       }
+       if (gs.cgiParams.c) {       
+       webswingInstance0.options.args += ", -Dwebswing.appletParam_collection=" + gs.cgiParams.c;
+       }
+       webswingInstance0.options.args += ", -Dwebswing.appletParam_library=";
+       webswingInstance0.options.args+=(gs.xsltParams.library_name)?gs.xsltParams.library_name:"library";
+       */
+    function getParam(name) {
+        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
+        var results = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)").exec(location.href);
+        return results == null ? null : decodeURIComponent(results[1]);
+    }
+  </gsf:script>
+
+	  
+  <script data-webswing-global-var="webswing">
+    <xsl:text disable-output-escaping="yes">
+    (function (window, document) {
+        var loader = function () {
+            var baseUrl = '/webswing-server/phind';
+            baseUrl = baseUrl.indexOf("/", baseUrl.length - 1) !== -1 ? baseUrl : (baseUrl + "/");
+            var xmlhttp = new XMLHttpRequest();
+            xmlhttp.onreadystatechange = function () {
+                if (xmlhttp.readyState == XMLHttpRequest.DONE) {
+                    var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined";
+                    var script = document.createElement("script"),
+                        tag = document.getElementsByTagName("script")[0];
+                    script.src = baseUrl + "javascript/webswing-embed.js?version=" + version;
+                    tag.parentNode.insertBefore(script, tag);
+                }
+            };
+            xmlhttp.open("GET", baseUrl + "rest/version", true);
+            xmlhttp.send();
+        };
+        window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
+	})(window, document);
+    </xsl:text>
+  </script>
+
+
+
+	</xsl:template>
+
+</xsl:stylesheet>  
+
