- Timestamp:
- 2009-04-22T15:52:31+12:00 (15 years ago)
- Location:
- gli/trunk/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/collection/Collection.java
r19041 r19197 177 177 } 178 178 179 /** Retrieve the short name for this collection. 179 /** Retrieve the short name for this collection. Always qualified by the collectionGroup, if any. 180 180 * @return The name as a <strong>String</strong>. 181 181 */ 182 182 public String getName() { 183 return getGroupQualifiedName(true); 184 } 185 186 /** @return just the sub-name of the collection: without any collection group prefix */ 187 public String getCollectionSubName() { 183 188 return file.getParentFile().getName(); 184 189 } … … 186 191 /** @return just the name of the collection group if any, else returns "" */ 187 192 public String getCollectionGroupName() { 188 String groupAndColName = getGroup WithName(true);193 String groupAndColName = getGroupQualifiedName(true); 189 194 190 195 int slash = groupAndColName.indexOf('/'); … … 204 209 * @return collection-group-name/collection-name 205 210 */ 206 public String getGroup WithName(boolean url) {211 public String getGroupQualifiedName(boolean url) { 207 212 // Subtracting collect dir's path from the current collection's path 208 213 … … 216 221 // shouldn't happen, but in case it does, just return the collection name. 217 222 System.err.println("Current collection " + currentCollDir + " is not located inside collectdir " + "collectDir"); 218 groupAndCol = get Name();223 groupAndCol = getCollectionSubName(); 219 224 } 220 225 -
gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
r19041 r19197 906 906 907 907 /** Returns the name of the loaded collection. 908 * Returns the "collectionGroupName/collectionName" or just the collectionName 909 * depending on whether the collection is part of a collection group or not. 908 910 */ 909 911 static public String getLoadedCollectionName() … … 911 913 if (collection != null) { 912 914 return collection.getName(); 915 } 916 917 return null; 918 } 919 920 /** @return the subname of any collection (stripped of any collection-group). */ 921 static public String getLoadedCollectionSubName() 922 { 923 if (collection != null) { 924 return collection.getCollectionSubName(); 913 925 } 914 926 … … 922 934 * (\ or /, depending on the OS). 923 935 */ 924 static public String getLoaded ColNameWithGroup(boolean url)936 static public String getLoadedGroupQualifiedCollectionName(boolean url) 925 937 { 926 938 if (collection != null) { 927 return collection.getGroup WithName(url);939 return collection.getGroupQualifiedName(url); 928 940 } 929 941 -
gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java
r19041 r19197 77 77 // so getting a collection-name may have a collection group prefix 78 78 // This means CollectionManager.getLoadedCollectionName() is no longer sufficient 79 String collGroupWithName = CollectionManager.getLoadedCol NameWithGroup(true);79 String collGroupWithName = CollectionManager.getLoadedCollectionName(); 80 80 81 81 // set up the home page for the current collection
Note:
See TracChangeset
for help on using the changeset viewer.