Changeset 19197

Show
Ignore:
Timestamp:
22.04.2009 15:52:31 (10 years ago)
Author:
ak19
Message:

Tentative changes for getting the collectiongroup construct to work with the RemoteGreenstoneServer?

Location:
gli/trunk/src/org/greenstone/gatherer
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/collection/Collection.java

    r19041 r19197  
    177177    } 
    178178 
    179     /** Retrieve the short name for this collection. 
     179    /** Retrieve the short name for this collection. Always qualified by the collectionGroup, if any. 
    180180     * @return The name as a <strong>String</strong>. 
    181181     */ 
    182182    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() { 
    183188    return file.getParentFile().getName(); 
    184189    } 
     
    186191    /** @return just the name of the collection group if any, else returns "" */ 
    187192    public String getCollectionGroupName() { 
    188     String groupAndColName = getGroupWithName(true); 
     193    String groupAndColName = getGroupQualifiedName(true); 
    189194 
    190195    int slash = groupAndColName.indexOf('/'); 
     
    204209     * @return collection-group-name/collection-name 
    205210     */ 
    206     public String getGroupWithName(boolean url) { 
     211    public String getGroupQualifiedName(boolean url) { 
    207212    // Subtracting collect dir's path from the current collection's path 
    208213 
     
    216221        // shouldn't happen, but in case it does, just return the collection name. 
    217222        System.err.println("Current collection " + currentCollDir + " is not located inside collectdir " + "collectDir"); 
    218         groupAndCol = getName(); 
     223        groupAndCol = getCollectionSubName(); 
    219224    } 
    220225 
  • gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java

    r19041 r19197  
    906906 
    907907    /** 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. 
    908910     */ 
    909911    static public String getLoadedCollectionName() 
     
    911913    if (collection != null) { 
    912914        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(); 
    913925    } 
    914926 
     
    922934     * (\ or /, depending on the OS). 
    923935     */ 
    924     static public String getLoadedColNameWithGroup(boolean url) 
     936    static public String getLoadedGroupQualifiedCollectionName(boolean url) 
    925937    { 
    926938    if (collection != null) { 
    927         return collection.getGroupWithName(url); 
     939        return collection.getGroupQualifiedName(url); 
    928940    } 
    929941 
  • gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java

    r19041 r19197  
    7777    // so getting a collection-name may have a collection group prefix 
    7878    // This means CollectionManager.getLoadedCollectionName() is no longer sufficient 
    79     String collGroupWithName = CollectionManager.getLoadedColNameWithGroup(true);  
     79    String collGroupWithName = CollectionManager.getLoadedCollectionName(); 
    8080 
    8181    // set up the home page for the current collection