Changeset 20007

Show
Ignore:
Timestamp:
17.07.2009 18:59:12 (10 years ago)
Author:
ak19
Message:

Adjusted the code to deal with 1. semicolons and commas separating metadata fieldnames, 2. Greenstone extracted metadata fieldnames being referred to with the ex. prefix.

Files:
1 modified

Legend:

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

    r18686 r20007  
    15461546     
    15471547    // final true arg to return delims as tokens 
    1548     StringTokenizer string_tokenizer = new StringTokenizer (value_str, ",", true); 
     1548    StringTokenizer string_tokenizer = new StringTokenizer (value_str, ",;", true); 
    15491549    StringBuffer value_buffer = new StringBuffer (); 
    15501550    while (string_tokenizer.hasMoreElements ()) { 
     
    15531553      boolean modified_token = false; 
    15541554      // not a delimiter token 
    1555       if (!raw_token.equals(",")) { 
     1555      if (!raw_token.equals(",") && !raw_token.equals(";")) { 
    15561556    MetadataElement metadata_element = MetadataTools.getMetadataElementWithDisplayName (token); 
    15571557    if (metadata_element != null) { 
     
    21792179                if (!value_str.equals ("") && name_str.equals (StaticStrings.METADATA_STR)) { 
    21802180                    // The metadata argument must be the fully qualified name of a metadata element, so if it doesn't yet have a namespace, append the extracted metadata namespace. 
    2181                     String[] values = value_str.split (StaticStrings.COMMA_CHARACTER); 
    2182                     value_str = ""; 
     2181            String[] values = value_str.split (StaticStrings.COMMA_CHARACTER); 
     2182            value_str = ""; 
    21832183                    for (int k=0; k<=values.length-1; k++) { 
    21842184                        if (values[k].indexOf (StaticStrings.NS_SEP) == -1) { 
     
    27622762                     
    27632763                    // The metadata argument is the fully qualified name of a metadata element, so if it contains a namespace, remove the extracted metadata namespace as the build process doesn't know about it. 
    2764                     String[] values = value_str.split (StaticStrings.COMMA_CHARACTER); 
    2765                     value_str = ""; 
     2764            String[] values = value_str.split (StaticStrings.COMMA_CHARACTER); 
     2765            value_str = ""; 
    27662766                    for (int k=0; k<=values.length-1; k++) { 
    27672767                        if(values[k].startsWith (StaticStrings.EXTRACTED_NAMESPACE)) {