ArrayList<String> defaultAcl = new ArrayList<String>();
defaultAcl.add(getActionCriteria().getToggleMetadataAccessPolicy());
criteria.getActionCriteria().setMetadataAccessPolicy(defaultAcl);
}
MmdActionRequest request = new MmdActionRequest(context,publisherForAction,criteria,getResult());
if (!applyToAll) {
request.execute();
} else {
if (!_queryCriteriaForAction.getIsEmpty()) {
request.execute(_queryCriteriaForAction);
}
}
// set the success message
int nModified = getActionResult().getNumberOfRecordsModified();
if (nModified > 0) {
String sKey = "catalog.publication.manageMetadata.action.success";
if (actionCriteria.getActionKey().equalsIgnoreCase("delete")) {
sKey += ".delete";
}
String[] args = new String[1];
args[0] = "" + nModified;
msgBroker.addSuccessMessage(sKey, args);
}
if (request.hadUnalteredDraftDocuments()) {
msgBroker.addErrorMessage("catalog.publication.manageMetadata.action.err.draftUnaltered");
}
}
}