Changeset 4512


Ignore:
Timestamp:
2003-06-09T11:48:54+12:00 (21 years ago)
Author:
jmt12
Message:

2030108: Fixed collectionmeta disappearing.

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r4494 r4512  
    217217            value = ct.nextToken();
    218218            }
    219             // Check if the key is an index, an if so retrieve it.
     219            // Check if the key is an index, and if so retrieve it.
    220220            if(((String)key).startsWith(".")) {
     221            ///ystem.err.println("Detected '.' prefix.");
    221222            String key_str = (String)key;
    222223            key_str = key_str.substring(1);
    223224            key = manager.indexes.getIndex(key_str);
     225            // If that didn't work, then it might be a subindex so have a bash at retrieving that instead.
     226            if(key == null) {
     227                key = manager.subcollections.getSubIndex(key_str);
     228                //if(key != null) {
     229                ///ystem.err.println("Its a subindex.");
     230                //}
     231                //else {
     232                ///ystem.err.println("Error Will Robinson.");
     233                //}
     234            }
     235            //else {
     236                ///ystem.err.println("Its an index.");
     237            //}
    224238            }
    225239            // An if we have a language code, retrieve its object too.
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r4494 r4512  
    169169    return (Subcollection) subcollections.get(name);
    170170    }
     171
     172    /** Retrieve a certain subindex given its name.
     173     * @param name the String representation of a subindex.
     174     * @return the SubIndex requested or null if no such subindex.
     175     */
     176    public SubIndex getSubIndex(String name) {
     177    for(int i = 0; i < subindexes.size(); i++) {
     178        SubIndex subindex = (SubIndex) subindexes.get(i);
     179        if(subindex.toString().equals(name)) {
     180        return subindex;
     181        }
     182    }
     183    return null;
     184    }
     185
    171186    /** Method to get all of the subindexes set.
    172187      * @return A <strong>SubIndexes</strong> object containing all the defined indexes.
Note: See TracChangeset for help on using the changeset viewer.