Changeset 20960
- Timestamp:
- 2009-11-18T16:12:06+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
r20924 r20960 118 118 static final public int SCHEDULING = 7; 119 119 120 /** To store the path to the perl scripts. In the case of local Greenstone servers, 121 * this will be the local bin/script folder. */ 122 static private String scriptPath = ""; 120 123 121 124 /** Constructor. */ … … 135 138 System.err.println("Done."); 136 139 new File(Gatherer.getCollectDirectoryPath()).mkdirs(); 140 141 scriptPath = ""; // remote greenstone: scriptPath will be determined on remote server side 142 } 143 else { // local greenstone case: scripts are inside bin/script 144 scriptPath = LocalGreenstone.getBinScriptDirectoryPath(); 137 145 } 138 146 } … … 170 178 171 179 if (Configuration.fedora_info.isActive()) { 172 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "g2f-buildcol.pl");180 command_parts_list.add(scriptPath + "g2f-buildcol.pl"); 173 181 174 182 command_parts_list.add("-hostname"); … … 191 199 192 200 if ( !CollectionDesignManager.isCompleteBuild() && CollectionDesignManager.index_manager.isLucene() ) { 193 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "incremental-buildcol.pl");201 command_parts_list.add(scriptPath + "incremental-buildcol.pl"); 194 202 CollectionDesignManager.setBuildcolWasFull(false); 195 203 } else { 196 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "full-buildcol.pl");204 command_parts_list.add(scriptPath + "full-buildcol.pl"); 197 205 CollectionDesignManager.setBuildcolWasFull(true); 198 206 } … … 202 210 command_parts_list.add("-language"); 203 211 command_parts_list.add(Configuration.getLanguage()); 204 command_parts_list.add("-collectdir"); 205 command_parts_list.add(getCollectDirectory()); 212 if(!Gatherer.isGsdlRemote) { 213 command_parts_list.add("-collectdir"); 214 command_parts_list.add(getCollectDirectory()); 215 } 206 216 207 217 String[] build_options = collection.build_options.getValues(); … … 228 238 229 239 ArrayList sched_list = new ArrayList(); 230 if ( (Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {240 if (!Gatherer.isGsdlRemote) { 231 241 sched_list.add(Configuration.perl_path); 232 242 sched_list.add("-S"); 233 243 } 234 sched_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "schedule.pl");244 sched_list.add(scriptPath + "schedule.pl"); 235 245 sched_list.add("-colname"); 236 246 sched_list.add(collection.getName()); … … 240 250 // Generate the import.pl command 241 251 ArrayList import_list = new ArrayList(); 242 if ( (Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {252 if (!Gatherer.isGsdlRemote) { 243 253 import_list.add(Configuration.perl_path); 244 254 import_list.add("-S"); … … 246 256 247 257 String cmdPrefix = CollectionDesignManager.isCompleteBuild() ? "full-" : "incremental-"; 248 import_list.add(LocalGreenstone.getBinScriptDirectoryPath()+ cmdPrefix + "import.pl");258 import_list.add(scriptPath + cmdPrefix + "import.pl"); 249 259 import_list.add("-language"); 250 260 import_list.add(Configuration.getLanguage()); 251 import_list.add("-collectdir"); 252 import_list.add(getCollectDirectory()); 261 if(!Gatherer.isGsdlRemote) { 262 import_list.add("-collectdir"); 263 import_list.add(getCollectDirectory()); 264 } 253 265 254 266 String[] import_options = collection.import_options.getValues(); … … 275 287 276 288 // i'm not doing this in schedule.pl right now - should i be? 277 if ( (Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {289 if (!Gatherer.isGsdlRemote) { 278 290 build_list.add(Configuration.perl_path); 279 291 build_list.add("-S"); … … 282 294 String buildType = (new CollectionMeta( CollectionDesignManager.collect_config.getBuildType() )).getValue(CollectionMeta.TEXT); 283 295 if ( !CollectionDesignManager.isCompleteBuild() && buildType.equals( BuildTypeManager.BUILD_TYPE_LUCENE ) ) { 284 build_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "incremental-buildcol.pl");296 build_list.add(scriptPath + "incremental-buildcol.pl"); 285 297 } else { 286 build_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "full-buildcol.pl");298 build_list.add(scriptPath + "full-buildcol.pl"); 287 299 } 288 300 289 301 build_list.add("-language"); 290 302 build_list.add(Configuration.getLanguage()); 291 build_list.add("-collectdir"); 292 build_list.add(getCollectDirectory()); 303 if(!Gatherer.isGsdlRemote) { 304 build_list.add("-collectdir"); 305 build_list.add(getCollectDirectory()); 306 } 293 307 294 308 String[] build_options = collection.build_options.getValues(); … … 1023 1037 // Generate the import.pl command 1024 1038 ArrayList command_parts_list = new ArrayList(); 1025 if ( (Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {1039 if (!Gatherer.isGsdlRemote) { 1026 1040 command_parts_list.add(Configuration.perl_path); 1027 1041 command_parts_list.add("-S"); … … 1029 1043 1030 1044 if (Configuration.fedora_info.isActive()) { 1031 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "g2f-import.pl");1045 command_parts_list.add(scriptPath + "g2f-import.pl"); 1032 1046 1033 1047 command_parts_list.add("-hostname"); … … 1047 1061 } 1048 1062 else { 1049 1050 1051 1052 1053 1054 1055 1056 1057 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");1063 String cmdPrefix = null; 1064 if ( CollectionDesignManager.isCompleteBuild() ) { 1065 cmdPrefix = "full-"; 1066 CollectionDesignManager.setImportWasFull( true ); 1067 } else { 1068 cmdPrefix = "incremental-"; 1069 CollectionDesignManager.setImportWasFull( false ); 1070 } 1071 command_parts_list.add(scriptPath + cmdPrefix + "import.pl"); // scriptPath already set according to local or remote case 1058 1072 } 1059 1073 … … 1061 1075 command_parts_list.add("-language"); 1062 1076 command_parts_list.add(Configuration.getLanguage()); 1063 command_parts_list.add("-collectdir"); 1064 command_parts_list.add(getCollectDirectory()); 1077 if(!Gatherer.isGsdlRemote) { 1078 command_parts_list.add("-collectdir"); 1079 command_parts_list.add(getCollectDirectory()); 1080 } 1065 1081 1066 1082 String[] import_options = collection.import_options.getValues(); … … 1448 1464 // Generate the mkcol.pl command 1449 1465 ArrayList command_parts_list = new ArrayList(); 1450 if ( Utility.isWindows() && (!Gatherer.isGsdlRemote)) {1466 if (!Gatherer.isGsdlRemote) { 1451 1467 command_parts_list.add(Configuration.perl_path); 1452 1468 command_parts_list.add("-S"); 1453 1469 } 1454 command_parts_list.add( LocalGreenstone.getBinScriptDirectoryPath()+ "mkcol.pl");1470 command_parts_list.add(scriptPath + "mkcol.pl"); 1455 1471 if(Gatherer.GS3) { 1456 1472 command_parts_list.add(Utility.GS3MODE_ARGUMENT); // add '-gs3mode' 1457 1473 } 1458 1459 command_parts_list.add("-collectdir");1460 command_parts_list.add(getDefaultCollectDirectory());1461 1474 if(!Gatherer.isGsdlRemote) { 1475 command_parts_list.add("-collectdir"); 1476 command_parts_list.add(getDefaultCollectDirectory()); 1477 } 1462 1478 command_parts_list.add("-win31compat"); 1463 1479 command_parts_list.add((Gatherer.isGsdlRemote) ? "false" : "true");
Note:
See TracChangeset
for help on using the changeset viewer.