Changeset 9305


Ignore:
Timestamp:
2005-03-08T10:06:45+13:00 (19 years ago)
Author:
davidb
Message:

Code used to that GAPlug can never be removed. This has been relaxed to
allow library system specialist and above to do this on the grounds that
they know what they're doing (!). An example use is substituting METSPlug
for GAPlug and setting the -saveas option for import.pl to METS.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

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

    r9134 r9305  
    10351035                }
    10361036                else {
    1037                 // don't let people remove GAPlug
    1038                 if (plugin_name.equals(StaticStrings.GAPLUG_STR)) {
    1039                     remove.setEnabled(false);
    1040                 } else {
    1041                     remove.setEnabled(true);
     1037                // don't let people remove special plugins such GAPlug an METSPlug,
     1038                // unless they are in systems mode or above
     1039                int mode = Configuration.getMode();
     1040                for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) {
     1041                    if ((plugin_name.equals(StaticStrings.KEEP_PLUG[i])) &&
     1042                    (mode < Configuration.SYSTEMS_MODE)) {
     1043                    remove.setEnabled(false);
     1044                    break;
     1045                    } else {
     1046                    remove.setEnabled(true);
     1047                    }
    10421048                }
    10431049                   
     
    11691175                    if(selected_index < findSeparatorIndex()) {
    11701176                        plugin_list.setSelectedIndex(selected_index);
    1171                         // don't allow removal of GAPlug
    1172                         if (((Plugin)plugin_list.getSelectedValue()).getName().equals(StaticStrings.GAPLUG_STR)) {
    1173                             remove.setEnabled(false);
    1174                         } else {
    1175                             remove.setEnabled(true);
    1176                         }
     1177
     1178                        // don't let people remove special plugins such GAPlug an METSPlug,
     1179                        // unless they are in systems mode or above
     1180                        int mode = Configuration.getMode();
     1181                        for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) {
     1182                            String selected_plugin_name
     1183                            = ((Plugin)plugin_list.getSelectedValue()).getName();
     1184                            if ((selected_plugin_name.equals(StaticStrings.KEEP_PLUG[i])) &&
     1185                            (mode < Configuration.SYSTEMS_MODE)) {
     1186                            remove.setEnabled(false);
     1187                            break;
     1188                            } else {
     1189                            remove.setEnabled(true);
     1190                            }
     1191                        }                   
    11771192                    }
    11781193                    // Otherwise select the first non-removable plugin
  • trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r9055 r9305  
    111111    static final public String FORMAT_ELEMENT                             = "Format";
    112112    static final public String FORMAT_STR                                 = "format";
    113     static final public String GAPLUG_STR                                 = "GAPlug";
    114113    static final public String GLI_ATTRIBUTE                              = "gli";
    115114    static final public String GREATER_THAN_CHARACTER                     = ">";
     
    137136    static final public String INDEXES_ELEMENT                            = "Indexes";
    138137    static final public String INT_STR                                    = "int";
     138    static final public String[] KEEP_PLUG                                = { "GAPlug", "METSPlug" };
     139
    139140    static final public String LANGUAGE_ARGUMENT                          = "l=";
    140141    static final public String LANGUAGE_ATTRIBUTE                         = "language";
Note: See TracChangeset for help on using the changeset viewer.