/**
* Saves/exports the specified metrics to the specified file
*/
public boolean save(List<String> metricIDs, File exportFile) {
ConfigurationDocument confDoc = ConfigurationDocument.Factory.newInstance(xmlOptions);
confDoc.addNewConfiguration();
confDoc.getConfiguration().addNewVariables();
confDoc.getConfiguration().addNewAlgorithms();
confDoc.getConfiguration().addNewAlgorithmGroups();
for(String metricID : metricIDs){
if(isVariable(metricID)){
confDoc.getConfiguration().getVariables().addNewVariable();
confDoc.getConfiguration().getVariables().setVariableArray(
confDoc.getConfiguration().getVariables().sizeOfVariableArray() - 1,
variablesMap.get(metricID));
}
else if(isAlgorithm(metricID)){
confDoc.getConfiguration().getAlgorithms().addNewAlgorithm();
confDoc.getConfiguration().getAlgorithms().setAlgorithmArray(
confDoc.getConfiguration().getAlgorithms().sizeOfAlgorithmArray() - 1,
algorithmsMap.get(metricID));
}
}
try {
confDoc.save(exportFile);
} catch (IOException e) {
e.printStackTrace();
return false;
}