Changeset 22771
- Timestamp:
- 2010-08-24T19:49:00+12:00 (14 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r22691 r22771 708 708 } 709 709 710 /** Returns the path of the Greenstone "collect"directory. */710 /** Returns the path of the current collect directory. */ 711 711 static public String getCollectDirectoryPath() 712 712 { … … 714 714 return non_standard_collect_directory_path; 715 715 } 716 717 if (!GS3) { 718 return Configuration.gsdl_path + "collect" + File.separator; 719 } 720 else { 721 return getSitesDirectoryPath() + Configuration.site_name + File.separator + "collect" + File.separator; 722 } 723 } 724 716 717 return getDefaultGSCollectDirectoryPath(); 718 719 } 720 721 /** Returns the path of the Greenstone "collect" directory. */ 722 static public String getDefaultGSCollectDirectoryPath() { 723 if (!GS3) { 724 return Configuration.gsdl_path + "collect" + File.separator; 725 } 726 else { 727 return getSitesDirectoryPath() + Configuration.site_name + File.separator + "collect" + File.separator; 728 } 729 } 725 730 726 731 /** Returns the path of the GLI directory. */ … … 833 838 // non-destructive update of gsdl(3)site.cfg (comments preserved) 834 839 String collectDir = Gatherer.getCollectDirectoryPath(); 840 //collectDir = "\"" + collectDir.substring(0, collectDir.length()-1) + "\""; // remove file separator at end 835 841 collectDir = collectDir.substring(0, collectDir.length()-1); // remove file separator at end 836 842 Utility.updatePropertyConfigFile(gsdlsitecfg, "collecthome", collectDir); -
main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r20447 r22771 410 410 411 411 // If we're using the Local Library we must release the collection before writing to the collect.cfg file 412 String collection_name = CollectionManager.getLoadedCollectionName ( );412 String collection_name = CollectionManager.getLoadedCollectionName (false); // url style slash 413 413 boolean collection_released = false; 414 414 if (Gatherer.c_man.built () && LocalLibraryServer.isRunning () == true) { -
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r22678 r22771 425 425 426 426 // If we're using the Local Library we must release the collection before writing to the collect.cfg file 427 if(Gatherer.isLocalLibrary) { 428 LocalLibraryServer.releaseCollection( collection.getName());427 if(Gatherer.isLocalLibrary) { 428 LocalLibraryServer.releaseCollection(getLoadedCollectionName()); // URL style slash //collection.getName()); 429 429 } 430 430 … … 1850 1850 // Ensure that the local library has released this collection so we can delete the index directory 1851 1851 if (LocalLibraryServer.isRunning() == true) { 1852 LocalLibraryServer.releaseCollection( collection.getName());1852 LocalLibraryServer.releaseCollection(getLoadedCollectionName()); // URL style slash //collection.getName()); 1853 1853 } 1854 1854 // deactivate it in tomcat so that windows will release the index files -
main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r22678 r22771 162 162 } 163 163 164 164 /** collection name can be a group-qualified collect name */ 165 165 static public void releaseCollection(String collection_name) 166 166 { … … 693 693 useGLISiteCfg(server_exe); 694 694 } 695 696 // We're in the constructor, so we'll be running the LLS the first time, if we're 697 // running *server.exe* and if the current collect dir at Local Lib's startup is 698 // anything other than the default GS collect dir, then use that: 699 if (isPersistentServer) { // server.exe, so we're dealing with a local GS2 700 String collectDir = Configuration.getString("general.open_collection_gs2", true); 701 702 // If opening a collection outside the standard GS collect folder, need 703 // to open the non-standard collect folder that the collection resides in 704 if (!collectDir.startsWith(Gatherer.getDefaultGSCollectDirectoryPath())) { 705 File collectFolder = null; 706 if(!collectDir.endsWith("gli.col")) { // then it's a collect folder 707 collectFolder = new File(collectDir); 708 } else { 709 // the filepath is a gli.col file. To get the collect folder: the 1st level 710 // up is collection folder, 2 two levels up is the containing collect folder 711 collectFolder = new File(collectDir).getParentFile().getParentFile(); 712 } 713 714 // Need to deal with colgroups as well: while there's an etc/collect.cfg in the current 715 // collectFolder, move one level up 716 if(new File(collectFolder.getAbsolutePath()+File.separator+Utility.CONFIG_FILE).exists()) { 717 collectFolder = collectFolder.getParentFile(); 718 } 719 collectDir = collectFolder.getAbsolutePath(); 720 721 // write out the non-standard collectDir (minus file separator at end) to the lls site conf 722 // file being used 723 if(collectDir.endsWith(File.separator)) { 724 collectDir = collectDir.substring(0, collectDir.length()); 725 } 726 put(COLLECTHOME, collectDir); 727 save(); 728 lastModified = configFile.lastModified(); 729 } 730 } // now the correct current collect dir will get loaded when the server is started up hereafter 695 731 } 696 732 … … 976 1012 977 1013 // write out the line 978 out.write(line + "\n"); 1014 out.write(line); 1015 out.newLine(); 979 1016 } 980 1017
Note:
See TracChangeset
for help on using the changeset viewer.