Changeset 16023 for gli/trunk


Ignore:
Timestamp:
2008-06-16T14:08:57+12:00 (16 years ago)
Author:
kjdon
Message:

added a bit of code to convert old plugin names to new ones, for backwards compatibility

File:
1 edited

Legend:

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

    r15031 r16023  
    13311331                // The next token is the type
    13321332                String type = tokenizer.nextToken ();
     1333        type = ensureNewPluginName(type);
    13331334                command_element.setAttribute (StaticStrings.TYPE_ATTRIBUTE, type);
    13341335                // Now we parse out the remaining arguments into a hashmapping from name to value
     
    38873888        return skeleton;
    38883889    }
     3890
     3891  static private HashMap plugin_map = null;
     3892 
     3893  private void setUpPluginNameMap() {
     3894    plugin_map = new HashMap();
     3895    plugin_map.put("RecPlug", "DirectoryPlugin");
     3896    plugin_map.put("ArcPlug","ArchivesInfPlugin");
     3897    plugin_map.put("TEXTPlug","TextPlugin");
     3898    plugin_map.put("EMAILPlug","EmailPlugin");
     3899    plugin_map.put("SRCPlug","SourceCodePlugin");
     3900    plugin_map.put("NULPlug","NulPlugin");
     3901    plugin_map.put("W3ImgPlug","W3ImagePlugin");
     3902    plugin_map.put("PagedImgPlug","PagedImagePlugin");
     3903  }
     3904
     3905  private String ensureNewPluginName(String plugin) {
     3906    if (plugin.endsWith("Plugin")) return plugin;
     3907    if (plugin_map == null) {
     3908      setUpPluginNameMap();
     3909    }
     3910    String new_name = (String)plugin_map.get(plugin);
     3911    if (new_name != null) return new_name;
     3912    new_name = plugin.replace("Plug", "Plugin");
     3913    return new_name;
     3914  }
     3915   
     3916
    38893917    ///*********************************************************************************************************///
    38903918}
     3919
Note: See TracChangeset for help on using the changeset viewer.