public static boolean addServiceContent(
OMElement info, HttpServletRequest request, ServletConfig config, HttpSession session) throws UIException {
try {
AddServicesServiceClient serviceClient = new AddServicesServiceClient(config, session);
OMElement filledService = AddServiceUIGenerator.getDataFromUI(info, request);
String newServicePath = request.getParameter("path");
if (newServicePath != null && !newServicePath.contains(SYSTEM_GOVERNANCE_TRUNK)) {
newServicePath = newServicePath.substring(0,newServicePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR));
newServicePath = newServicePath.substring(0,newServicePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR));
filledService.build();
OMFactory fac = OMAbstractFactory.getOMFactory();
Iterator it = filledService.getChildrenWithLocalName("newServicePath");
if (it.hasNext()) {
while (it.hasNext()) {
OMElement next = (OMElement) it.next();
next.setText(newServicePath);
break;
}
} else {
OMElement operation = fac.createOMElement("newServicePath", filledService.getNamespace(), filledService);
operation.setText(newServicePath);
}
}
return serviceClient.addService(filledService.toString());
} catch (Exception e) {
String msg = "Failed to get service details. " + e.getMessage();
log.error(msg, e);
throw new UIException(msg, e);
}