}
public static Service getService(BusinessService businessService, LifeCycleManager lifeCycleManager)
throws JAXRException
{
Service serve = new ServiceImpl(lifeCycleManager);
String keystr = businessService.getServiceKey();
if (keystr != null)
{
serve.setKey(lifeCycleManager.createKey(keystr));
}
List<Name> namesList = businessService.getName();
List<Description> descriptionList = businessService.getDescription();
InternationalString is = null;
for (Name n : namesList) {
if (is == null) {
is = lifeCycleManager.createInternationalString(getLocale(n.getLang()), n.getValue());
} else {
is.setValue(getLocale(n.getLang()), n.getValue());
}
}
serve.setName(is);
InternationalString dis = null;
for (Description desc : descriptionList) {
if (dis == null) {
dis = lifeCycleManager.createInternationalString(getLocale(desc.getLang()), desc.getValue());
} else {
dis.setValue(getLocale(desc.getLang()), desc.getValue());
}
}
for (int i = 0; i < namesList.size(); i++) {
}
serve.setDescription(dis);
//Populate the ServiceBindings for this Service
BindingTemplates bts = businessService.getBindingTemplates();
List<BindingTemplate> bindingTemplateList = bts.getBindingTemplate();
for (BindingTemplate bindingTemplate : bindingTemplateList) {
serve.addServiceBinding(getServiceBinding(bindingTemplate, lifeCycleManager));
}
serve.addClassifications(getClassifications(businessService.getCategoryBag(), lifeCycleManager));
return serve;
}