Changeset 8137


Ignore:
Timestamp:
2004-09-22T17:09:18+12:00 (20 years ago)
Author:
mdewsnip
Message:

Even more improvements to the new metadata code.

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

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java

    r8135 r8137  
    7373        }
    7474
    75         System.err.println(metadata_element_name_full + " -> " + target_metadata_element_name_full);
     75        // System.err.println(metadata_element_name_full + " -> " + target_metadata_element_name_full);
    7676
    7777        // Skip this element if we still don't have a loaded element for it
  • trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java

    r8131 r8137  
    6565
    6666
    67     /** Returns the metadata assigned to files outside the collection, excluding folder-level/inherited metadata. */
     67    /** Returns the metadata assigned to a file outside the collection, excluding folder-level/inherited metadata. */
    6868    static public ArrayList getMetadataAssignedDirectlyToExternalFile(File file)
    6969    {
     
    101101
    102102
    103     /** This excludes folder-level/inherited metadata. */
     103    /** Returns the metadata assigned to a file inside the collection, excluding folder-level/inherited metadata. */
    104104    static public ArrayList getMetadataAssignedDirectlyToFile(File file)
    105105    {
    106     // Build up a list of applicable metadata.xml files
    107     ArrayList applicable_metadata_xml_files = new ArrayList();
    108 
    109     // Look at each loaded metadata.xml file to see if it is potentially applicable
    110     File file_directory = (file.isDirectory() ? file : file.getParentFile());
    111     for (int i = 0; i < metadata_xml_files.size(); i++) {
    112         MetadataXMLFile metadata_xml_file = (MetadataXMLFile) metadata_xml_files.get(i);
    113 
    114         // This metadata.xml file is only applicable if it is at the same level as the file
    115         if (file_directory.getAbsolutePath().equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
    116         applicable_metadata_xml_files.add(metadata_xml_file);
    117         }
    118     }
    119 
    120     // Get the metadata assigned to the specified file from the applicable metadata.xml files
    121     ArrayList assigned_metadata = getMetadataAssignedToFile(file, applicable_metadata_xml_files);
    122 
    123     // Remove any folder-level metadata
     106    // Get all the metadata assigned to the specified file...
     107    ArrayList assigned_metadata = getMetadataAssignedToFile(file);
     108
     109    // ...then remove any folder-level metadata
    124110    for (int i = assigned_metadata.size() - 1; i >= 0; i--) {
    125111        if (((MetadataValue) assigned_metadata.get(i)).isInheritedMetadata()) {
     
    132118
    133119
     120    /** Returns all the metadata assigned to a file inside the collection. */
    134121    static public ArrayList getMetadataAssignedToFile(File file)
    135122    {
Note: See TracChangeset for help on using the changeset viewer.