Index: /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 20959)
+++ /gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 20960)
@@ -118,4 +118,7 @@
     static final public int SCHEDULING = 7; 
 
+    /** To store the path to the perl scripts. In the case of local Greenstone servers, 
+     * this will be the local bin/script folder. */
+    static private String scriptPath = "";
   
     /** Constructor. */
@@ -135,4 +138,9 @@
 	    System.err.println("Done.");
 	    new File(Gatherer.getCollectDirectoryPath()).mkdirs();
+
+	    scriptPath = ""; // remote greenstone: scriptPath will be determined on remote server side
+	} 
+	else { // local greenstone case: scripts are inside bin/script
+	    scriptPath = LocalGreenstone.getBinScriptDirectoryPath();
 	}
     }
@@ -170,5 +178,5 @@
 
 	if (Configuration.fedora_info.isActive()) {
-	    command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-buildcol.pl");
+	    command_parts_list.add(scriptPath + "g2f-buildcol.pl");
 
 	    command_parts_list.add("-hostname");
@@ -191,8 +199,8 @@
 		
 		if ( !CollectionDesignManager.isCompleteBuild() && CollectionDesignManager.index_manager.isLucene() ) {
-			command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "incremental-buildcol.pl");
+			command_parts_list.add(scriptPath + "incremental-buildcol.pl");
 			CollectionDesignManager.setBuildcolWasFull(false);
 		} else {
-			command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "full-buildcol.pl");
+			command_parts_list.add(scriptPath + "full-buildcol.pl");
 			CollectionDesignManager.setBuildcolWasFull(true);
 		}
@@ -202,6 +210,8 @@
 	command_parts_list.add("-language");
 	command_parts_list.add(Configuration.getLanguage());
-	command_parts_list.add("-collectdir");
-	command_parts_list.add(getCollectDirectory());
+	if(!Gatherer.isGsdlRemote) {
+	    command_parts_list.add("-collectdir");
+	    command_parts_list.add(getCollectDirectory());
+	}
 
 	String[] build_options = collection.build_options.getValues();
@@ -228,9 +238,9 @@
 
 	ArrayList sched_list = new ArrayList(); 
-	if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
+	if (!Gatherer.isGsdlRemote) {
 	    sched_list.add(Configuration.perl_path);
 	    sched_list.add("-S");
 	}
-	sched_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "schedule.pl"); 
+	sched_list.add(scriptPath + "schedule.pl"); 
 	sched_list.add("-colname"); 
 	sched_list.add(collection.getName()); 
@@ -240,5 +250,5 @@
 	// Generate the import.pl command
 	ArrayList import_list = new ArrayList();
-	if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
+	if (!Gatherer.isGsdlRemote) {
 	    import_list.add(Configuration.perl_path);
 	    import_list.add("-S");
@@ -246,9 +256,11 @@
 
 	String cmdPrefix = CollectionDesignManager.isCompleteBuild() ? "full-" : "incremental-";
-    import_list.add(LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");
+	import_list.add(scriptPath + cmdPrefix + "import.pl");
 	import_list.add("-language");
 	import_list.add(Configuration.getLanguage());
-	import_list.add("-collectdir");
-	import_list.add(getCollectDirectory());
+	if(!Gatherer.isGsdlRemote) {
+	    import_list.add("-collectdir");
+	    import_list.add(getCollectDirectory());
+	}
 
 	String[] import_options = collection.import_options.getValues();
@@ -275,5 +287,5 @@
 
 	// i'm not doing this in schedule.pl right now - should i be? 
-	if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
+	if (!Gatherer.isGsdlRemote) {
 	    build_list.add(Configuration.perl_path);
 	    build_list.add("-S");
@@ -282,13 +294,15 @@
 	String buildType = (new CollectionMeta( CollectionDesignManager.collect_config.getBuildType() )).getValue(CollectionMeta.TEXT);
 	if ( !CollectionDesignManager.isCompleteBuild() && buildType.equals( BuildTypeManager.BUILD_TYPE_LUCENE ) ) {
-		build_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "incremental-buildcol.pl");
+		build_list.add(scriptPath + "incremental-buildcol.pl");
 	} else {
-		build_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "full-buildcol.pl");
+		build_list.add(scriptPath + "full-buildcol.pl");
 	}
 
 	build_list.add("-language");
 	build_list.add(Configuration.getLanguage());
-	build_list.add("-collectdir");
-	build_list.add(getCollectDirectory());
+	if(!Gatherer.isGsdlRemote) {
+	    build_list.add("-collectdir");
+	    build_list.add(getCollectDirectory());
+	}
 
 	String[] build_options = collection.build_options.getValues();
@@ -1023,5 +1037,5 @@
 	// Generate the import.pl command
 	ArrayList command_parts_list = new ArrayList();
-	if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
+	if (!Gatherer.isGsdlRemote) {
 	    command_parts_list.add(Configuration.perl_path);
 	    command_parts_list.add("-S");
@@ -1029,5 +1043,5 @@
 
 	if (Configuration.fedora_info.isActive()) {
-	    command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-import.pl");
+	    command_parts_list.add(scriptPath + "g2f-import.pl");
 
 	    command_parts_list.add("-hostname");
@@ -1047,13 +1061,13 @@
 	}
 	else {
-		String cmdPrefix = null;
-		if ( CollectionDesignManager.isCompleteBuild() ) {
-			cmdPrefix = "full-";
-			CollectionDesignManager.setImportWasFull( true );
-		} else {
-			cmdPrefix = "incremental-";
-			CollectionDesignManager.setImportWasFull( false );
-		}
-	    command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");
+	    String cmdPrefix = null;
+	    if ( CollectionDesignManager.isCompleteBuild() ) {
+		cmdPrefix = "full-";
+		CollectionDesignManager.setImportWasFull( true );
+	    } else {
+		cmdPrefix = "incremental-";
+		CollectionDesignManager.setImportWasFull( false );
+	    }
+	    command_parts_list.add(scriptPath + cmdPrefix + "import.pl"); // scriptPath already set according to local or remote case
 	}
 
@@ -1061,6 +1075,8 @@
 	command_parts_list.add("-language");
 	command_parts_list.add(Configuration.getLanguage());
-	command_parts_list.add("-collectdir");
-	command_parts_list.add(getCollectDirectory());
+	if(!Gatherer.isGsdlRemote) {
+	    command_parts_list.add("-collectdir");
+	    command_parts_list.add(getCollectDirectory());
+	}	
 
 	String[] import_options = collection.import_options.getValues();
@@ -1448,16 +1464,16 @@
 	// Generate the mkcol.pl command
 	ArrayList command_parts_list = new ArrayList();
-	if (Utility.isWindows() && (!Gatherer.isGsdlRemote)) {
+	if (!Gatherer.isGsdlRemote) {
 	    command_parts_list.add(Configuration.perl_path);
 	    command_parts_list.add("-S");
 	}
-	command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "mkcol.pl");
+	command_parts_list.add(scriptPath + "mkcol.pl");
 	if(Gatherer.GS3) {
 	    command_parts_list.add(Utility.GS3MODE_ARGUMENT); // add '-gs3mode' 
 	}
-
-	command_parts_list.add("-collectdir");
-	command_parts_list.add(getDefaultCollectDirectory());
- 	
+	if(!Gatherer.isGsdlRemote) {
+	    command_parts_list.add("-collectdir");
+	    command_parts_list.add(getDefaultCollectDirectory());
+ 	}
 	command_parts_list.add("-win31compat");
 	command_parts_list.add((Gatherer.isGsdlRemote) ? "false" : "true");
