} else if (bValidateOnly) {
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");
}
}
// handle an empty explicit url or network path
} else if (sExplicitPath.length() == 0) {
msgBroker.addErrorMessage("publication.uploadMetadata.err.file.required");
// process an explicit url or network path
} else {
FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_WARN,sExplicitPath,null);
msgBroker.addMessage(fm);
sFileName = sExplicitPath;
Publisher publisher = getSelectablePublishers().selectedAsPublisher(context,false);
HttpClientRequest httpClient = HttpClientRequest.newRequest();
ProcessingContext pContext = new ProcessingContext(context,publisher,httpClient,null,bValidateOnly);
pContext.setMessageBroker(msgBroker);
ProcessorFactory factory = new ProcessorFactory();