}
String action = args[0];
currentArg++;
// Execute action depending on the parameters
BasicWorker worker = null;
if ("UpdateDabWarnings".equalsIgnoreCase(action)) {
Configuration config = Configuration.getConfiguration();
String start = config.getString(null, ConfigurationValueString.LAST_DAB_WARNING);
worker = new UpdateDabWarningWorker(wiki, null, start);
} else if ("UpdateISBNWarnings".equalsIgnoreCase(action)) {
worker = new UpdateISBNWarningWorker(wiki, null, false);
} else if ("ListISBNWarnings".equalsIgnoreCase(action)) {
worker = new UpdateISBNWarningWorker(wiki, null, true);
} else if ("FixCheckWiki".equalsIgnoreCase(action)) {
List<CheckErrorAlgorithm> algorithms = new ArrayList<CheckErrorAlgorithm>();
List<CheckErrorAlgorithm> allAlgorithms = new ArrayList<CheckErrorAlgorithm>();
for (int i = 1; i < args.length; i++) {
boolean addition = false;
String algorithmNumber = args[i];
if (algorithmNumber.startsWith("+")) {
addition = true;
algorithmNumber = algorithmNumber.substring(1);
}
CheckErrorAlgorithm algorithm = CheckErrorAlgorithms.getAlgorithm(wiki, Integer.parseInt(algorithmNumber));
if (algorithm != null) {
if (!addition) {
algorithms.add(algorithm);
}
allAlgorithms.add(algorithm);
}
}
worker = new AutomaticCWWorker(
wiki, null, algorithms, 10000, allAlgorithms, null, true, false);
}
if (worker != null) {
worker.setListener(this);
worker.setTimeLimit(timeLimit);
worker.start();
}
}