msgBroker.addSuccessMessage("catalog.publication.success.validated");
} else {
// publish the document
EditorRequest request = new EditorRequest(context,publisher,sXml);
request.getPublicationRecord().setUuid(getOpenDocumentUuid());
if (asDraft) {
request.getPublicationRecord().setApprovalStatus(MmdEnums.ApprovalStatus.draft.toString());
}
request.publish();
setOpenDocumentUuid(request.getPublicationRecord().getUuid());
if (asDraft) {
msgBroker.addSuccessMessage("catalog.publication.success.draftSaved");
} else {
if (request.getPublicationRecord().getWasDocumentReplaced()) {
msgBroker.addSuccessMessage("catalog.publication.success.replaced");
} else {
msgBroker.addSuccessMessage("catalog.publication.success.created");
}
}