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/gui/EnrichPane.java

    r18593 r23433  
    4444import org.greenstone.gatherer.collection.CollectionTreeNode;
    4545import org.greenstone.gatherer.gui.tree.DragTree;
     46import org.greenstone.gatherer.metadata.FilenameEncoding;
    4647import org.greenstone.gatherer.metadata.MetadataElement;
    4748import org.greenstone.gatherer.metadata.MetadataValue;
     
    287288  public void valueChanged(TreeSelectionEvent event)
    288289    {
     290    if(FilenameEncoding.isRefreshRequired()) {
     291        // The CollectionTree is in the process of being re-built to deal with filename-encodings,
     292        // so don't mess up the table during that time.
     293        // (CollectionTreeNode.refreshDescendantEncodings() doesn't cope well if this method
     294        // responds on Tree selection changes while the tree is updating its encodings, resulting in lost
     295        // and misplaced metadata values in the table and thereby in the metadata.xml files themselves).
     296        return;
     297    }
     298   
     299   
    289300    // If we haven't got focus then it must have been a selection in the Gather pane, so don't bother rebuilding
    290301    if (has_focus == false) {
Note: See TracChangeset for help on using the changeset viewer.