Ignore:
Timestamp:
2010-12-09T22:27:33+13:00 (13 years ago)
Author:
ak19
Message:

GLI now has a gs.FilenameEncoding metadata field which appears like all the others in GLI's EnrichPane, but is unique in that this metadata (once set, changed or removed) must be applied to the affected filenames in the Collection Tree. More importantly, the changes made for this are to allow GLI's java code to interact with the recent changes to Perl where strings were made unicode-aware (for proper regex matching) but which required other changes elsewhere. To still support filenames with different encodings Perl used URL encoded versions of filenames representing characters' code point values in URL encoding. This required that GLI write out URL encoded filenames to the metadata.xml files that are associated with each folder level of a collection, so that Perl can read them. In this way, they can both speak of the same filenames. Only works on unicode 16 (such as latin-1), non-UTF8 systems. The latter is a requirement since Java uses the filesystem encoding from startup. If it is UTF8, non-recognised characters are replaced by the invalid char for UTF8. This process being destructive, we can't get the original filenames' bytecodes back. The changes made to GLI will work on Windows which is UTF-16 (windows codepage 1252), presumably also Macs (some kind of UTF-16) and also works on Native Latin 1 Linux systems. UTF-8 Linux systems need to be reconfigured to Native Latin-1, or if not installed, an administrator can install it easily.

File:
1 edited

Legend:

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

    r13398 r23433  
    139139
    140140    MetadataValueTableEntry metadata_value_table_entry = (MetadataValueTableEntry) metadata_value_table_entries.get(row);
     141   
     142    if(metadata_value_table_entry == null) {
     143        System.err.println("\n@@@@@ MetadataValueTableModel.getValueAt(): metadata_value_table_entry is unexpectedly null!\n");
     144        return null;
     145    }
     146   
    141147    if (col == 0 && metadata_value_table_entry.isInheritedMetadata()) {
    142148        return metadata_value_table_entry.getFolderMetadataInheritedFrom();
     
    213219    {
    214220    MetadataValueTableEntry metadata_value_table_entry = getMetadataValueTableEntry(row);
    215 
     221    if(metadata_value_table_entry == null) {
     222        System.err.println("\n@@@@@ MetadataValueTableModel.setValueAt(): metadata_value_table_entry is unexpectedly null!\n");
     223        return;
     224    }
     225   
    216226    // If nothing has changed no action is necessary
    217227    String old_metadata_value = metadata_value_table_entry.getFullValue();
     
    252262        MetadataValueTreeNode metadata_value_tree_node = metadata_element.addMetadataValue((String) new_metadata_value);
    253263        MetadataValue metadata_value = new MetadataValue(metadata_element, metadata_value_tree_node);
    254         metadata_value.setIsAccumulatingMetadata(true);
     264        metadata_value.setIsAccumulatingMetadata(true);     
    255265        (new AppendMetadataTask(metadata_value)).run();
    256266    }
Note: See TracChangeset for help on using the changeset viewer.