try {
if (service != null) {
WebServicePublisher servicePublisher = new WebServicePublisher(service);
servicePublisher.publish(Repository.Instance().LANG, true);
logger.info("Service model has successfully been published to repository: " + service.getId());
return new UpdateContainer(new InfoUpdate(
"Service model has successfully been published to repository: " + service.getId()));
} else { //if (source != null) {
DataSourcePublisher sourcePublisher = new DataSourcePublisher(source, workspace.getFactory(), wk.getMetadataContainer().getSourceInformation());
sourcePublisher.publish(Repository.Instance().LANG, true);
logger.info("Source model has successfully been published to repository: " + source.getId());
return new UpdateContainer(new InfoUpdate(
"Source model has successfully been published to repository: " + source.getId()));
}
} catch (IOException e) {
logger.error("Error occured while publishing the source/service ", e);