ValidationRequest request = new ValidationRequest(context,sFileName,sXml);
request.verify();
msgBroker.addSuccessMessage("catalog.publication.success.validated");
} else {
Publisher publisher = getSelectablePublishers().selectedAsPublisher(context,false);
UploadRequest request = new UploadRequest(context,publisher,sFileName,sXml);
request.publish();
if (request.getPublicationRecord().getWasDocumentUnchanged()) {
msgBroker.addSuccessMessage("publication.success.unchanged");
} else if (request.getPublicationRecord().getWasDocumentReplaced()) {
msgBroker.addSuccessMessage("publication.success.replaced");
} else {
msgBroker.addSuccessMessage("publication.success.created");
}
}