Changeset 8137
- Timestamp:
- 2004-09-22T17:09:18+12:00 (20 years ago)
- 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 73 73 } 74 74 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); 76 76 77 77 // 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 65 65 66 66 67 /** Returns the metadata assigned to filesoutside the collection, excluding folder-level/inherited metadata. */67 /** Returns the metadata assigned to a file outside the collection, excluding folder-level/inherited metadata. */ 68 68 static public ArrayList getMetadataAssignedDirectlyToExternalFile(File file) 69 69 { … … 101 101 102 102 103 /** This excludesfolder-level/inherited metadata. */103 /** Returns the metadata assigned to a file inside the collection, excluding folder-level/inherited metadata. */ 104 104 static public ArrayList getMetadataAssignedDirectlyToFile(File file) 105 105 { 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 124 110 for (int i = assigned_metadata.size() - 1; i >= 0; i--) { 125 111 if (((MetadataValue) assigned_metadata.get(i)).isInheritedMetadata()) { … … 132 118 133 119 120 /** Returns all the metadata assigned to a file inside the collection. */ 134 121 static public ArrayList getMetadataAssignedToFile(File file) 135 122 {
Note:
See TracChangeset
for help on using the changeset viewer.