private void generateEprintsExecutablePlan() {
IPreservationActionRegistry registry = getMiniMeeRegistry();
Alternative recommendedAlternative = selectedPlan.getRecommendation().getAlternative();
Element eprintsPlan = new Element("eprintsPlan");
Element tool = new Element("tool");
eprintsPlan.addContent(tool);
String id = getToolIdentifier(registry);
Element toolIdentifier = new Element("toolIdentifier").setAttribute("uri", id);
tool.addContent(toolIdentifier);
String settings = selectedPlan.getRecommendation().getAlternative().getExperiment().getSettings();
String toolParameters = registry.getToolParameters(recommendedAlternative.getAction().getUrl());
if (settings != null) {
toolParameters += (" " + settings);
}
// TODO: we shouldn't need that here, this should come from the registry
// at the moment we only have the OUTFILE which is not enough. we anticipate
// that the tool can work with the structure <params> <input file> <output file>
// CB: from the minimee experience, you CANNOT always assume that!
// e.g. -i IN -o OUT etc.! or even TOOL -param IN > OUT etc.
toolParameters += (" " + "%INFILE% %OUTFILE%");
Element parameters = new Element("parameters").setAttribute("toolParameters", toolParameters);
tool.addContent(parameters);
Element targetFormat = new Element("targetFormat").setText(recommendedAlternative.getAction().getTargetFormat());
tool.addContent(targetFormat);
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
ByteArrayOutputStream byteArray = new ByteArrayOutputStream();