Changeset 36189


Ignore:
Timestamp:
2022-05-16T14:45:09+12:00 (5 months ago)
Author:
kjdon
Message:

soem debuggin stuff, some stuff needed for inheritance

File:
1 edited

Legend:

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

    r12808 r36189  
    3636import org.greenstone.gatherer.Gatherer;
    3737import org.greenstone.gatherer.util.StaticStrings;
     38import org.greenstone.gatherer.util.XMLTools; // jsut for debuggin
    3839import org.w3c.dom.*;
    3940
     
    5051    DebugStream.println("CollectionMetaManager: " + getSize() + " metadata parsed.");
    5152    }
     53    // needed for SearchMetaManager inheritance
     54    public CollectionMetaManager (Element root, String tag_name, DOMProxyListEntry class_type) {
     55    super(root, tag_name, class_type);
     56    }
     57
    5258    /** Method to add a new piece of metadata.
    5359     * @param metadata the new CollectionMeta
    5460     */
    5561    public void addMetadatum(CollectionMeta metadata) {
     62      System.err.println("collmeta manager addmetadatum");
    5663    if(!contains(metadata)) {
     64
    5765        Element element = metadata.getElement();
    58         // Locate where we should insert this new metadata.
     66            System.err.println("adding a new meta, "+XMLTools.xmlNodeToString(element));        // Locate where we should insert this new metadata.
    5967        Node target_node = CollectionConfiguration.findInsertionPoint(element);
    6068        add(root, metadata, target_node);
     
    7280    TreeSet result = new TreeSet();
    7381    int size = getSize();
     82        System.err.println("get langs, size = "+size);
    7483    for(int i = 0; i < size; i++) {
    7584        CollectionMeta metadata = (CollectionMeta) getElementAt(i);
    7685        String language = metadata.getLanguage();
    77         result.add(language);
     86            if (!language.equals("")) {
     87              result.add(language);
     88            }
    7889    }
    7990    return result;
     
    8697    for(int i = 0; i < size; i++) {
    8798        CollectionMeta metadata = (CollectionMeta) getElementAt(i);
    88         if(!metadata.getName().startsWith(StaticStrings.STOP_CHARACTER)) {
     99        //      if(!metadata.hasType() && !metadata.getName().startsWith(StaticStrings.STOP_CHARACTER)) {
    89100        result.add(metadata);
    90         }
     101        //}
    91102    }
    92103    return result;
     
    105116    return result;
    106117    }
    107 
     118   
    108119    /** Retrieve the named piece of metadata, in the default language, if available. If no such metadata is available then it is created.
    109120     * @param name the name of the metadatum to retrieve as a String
Note: See TracChangeset for help on using the changeset viewer.