public static Name getName(List<Name> entityList, String lang) { if (entityList.size()==0) { Name name = new Name(); name.setValue(""); name.setLang(lang); entityList.add(name); } if (lang==null) return entityList.get(0); for (Name entity : entityList) { if (lang.equalsIgnoreCase(entity.getLang())) { return entity; } } return entityList.get(0); }
static Name[] mapNamePatterns(Collection namePatterns) throws JAXRException { if (namePatterns == null) return null; Name[] result = new Name[namePatterns.size()]; int currLoc = 0; for (Iterator i = namePatterns.iterator(); i.hasNext();) { Object obj = i.next(); Name name = objectFactory.createName(); if (obj instanceof String) { name.setValue((String)obj); } else if (obj instanceof LocalizedString) { LocalizedString ls = (LocalizedString)obj; name.setValue(ls.getValue()); name.setLang(ls.getLocale().getLanguage()); } result[currLoc] = name; currLoc++; } return result; }
public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList, List<org.uddi.api_v3.Name> apiNameList) throws DispositionReportFaultMessage { apiNameList.clear(); for (org.apache.juddi.model.BusinessName modelName : modelNameList) { org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setLang(modelName.getLangCode()); apiName.setValue(modelName.getName()); apiNameList.add(apiName); } }
public static void mapServiceNames(List<org.apache.juddi.model.ServiceName> modelNameList, List<org.uddi.api_v3.Name> apiNameList) throws DispositionReportFaultMessage { apiNameList.clear(); for (org.apache.juddi.model.ServiceName modelName : modelNameList) { org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setLang(modelName.getLangCode()); apiName.setValue(modelName.getName()); apiNameList.add(apiName); } }
public static void mapServiceNames(List<org.apache.juddi.model.ServiceName> modelNameList, List<org.uddi.api_v3.Name> apiNameList) throws DispositionReportFaultMessage { apiNameList.clear(); for (org.apache.juddi.model.ServiceName modelName : modelNameList) { org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setLang(modelName.getLangCode()); apiName.setValue(modelName.getName()); apiNameList.add(apiName); } }
public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList, List<org.uddi.api_v3.Name> apiNameList) throws DispositionReportFaultMessage { apiNameList.clear(); for (org.apache.juddi.model.BusinessName modelName : modelNameList) { org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setLang(modelName.getLangCode()); apiName.setValue(modelName.getName()); apiNameList.add(apiName); } }
private static void addNames(List<Name> names, InternationalString iname) throws JAXRException { for (Object o : iname.getLocalizedStrings()) { LocalizedString locName = (LocalizedString) o; Name name = objectFactory.createName(); name.setValue(locName.getValue()); name.setLang(locName.getLocale().getLanguage()); names.add(name); } }
private static void addNames(List<Name> names, InternationalString iname) throws JAXRException { for (Object o : iname.getLocalizedStrings()) { LocalizedString locName = (LocalizedString) o; Name name = objectFactory.createName(); name.setValue(locName.getValue()); name.setLang(locName.getLocale().getLanguage()); names.add(name); } }
private static Name getFirstName(InternationalString iname) throws JAXRException { for (Object o : iname.getLocalizedStrings()) { LocalizedString locName = (LocalizedString) o; Name name = objectFactory.createName(); name.setValue(locName.getValue()); name.setLang(locName.getLocale().getLanguage()); return name; } return null; }
private static Name getFirstName(InternationalString iname) throws JAXRException { for (Object o : iname.getLocalizedStrings()) { LocalizedString locName = (LocalizedString) o; Name name = objectFactory.createName(); name.setValue(locName.getValue()); name.setLang(locName.getLocale().getLanguage()); return name; } return null; } private static void addNames(List<Name> names, InternationalString iname) throws JAXRException {
Name name = new Name(); name.setValue(serviceName.getLocalPart()); findTModel.setName(name); CategoryBag categoryBag = new CategoryBag();
/** * Builds a finder to find the portType tModels for a portType. * * @param portTypeName * @param namespace * @return tModel info */ public static FindTModel createFindPortTypeTModelForPortType(String portTypeName, String namespace) { FindTModel findTModel = new FindTModel(); Name name = new Name(); name.setLang("en"); name.setValue(portTypeName); findTModel.setName(name); CategoryBag categoryBag = new CategoryBag(); if (namespace != null && namespace.length() != 0) { KeyedReference namespaceReference = newKeyedReference( "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace); categoryBag.getKeyedReference().add(namespaceReference); } KeyedReference bindingReference = newKeyedReference( "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType"); categoryBag.getKeyedReference().add(bindingReference); findTModel.setCategoryBag(categoryBag); if (log.isDebugEnabled()) { log.debug(new PrintUDDI<FindTModel>().print(findTModel)); } return findTModel; }
bsIn.getName().get(0).setValue(serviceName + "-" + i); bsIn.setBusinessKey(parentBusinessKey +"-" + businessInt); bsIn.setServiceKey(serviceKey + "-" + businessInt + "-" + i);
protected boolean publishTestBusiness() { try { SaveBusiness sb1 = new SaveBusiness(); //List<BusinessEntity> biz = new ArrayList<BusinessEntity>(); BusinessEntity e = new BusinessEntity(); e.setBusinessKey("uddi:org:miloss:fgsms:test"); Name n = new Name(); n.setValue("Test Business Entity"); n.setLang(PublicationConstants.lang); e.getName().add(n); // biz.add(e); sb1.getBusinessEntity().add(e); sb1.setAuthInfo(loginWrapper()); publication.saveBusiness(sb1); return true; } catch (DispositionReportFaultMessage ex) { log.log(Level.ERROR, "error publising test business entity", ex); log.log(Level.ERROR, "error publising test business entity" + dispositionReportFaultMessageToString(ex), ex); return false; } catch (Exception ex) { log.log(Level.ERROR, "error publising test business entity", ex); return false; } } ///
public static void mapTModelInfo(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModelInfo apiTModelInfo) throws DispositionReportFaultMessage { apiTModelInfo.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModelInfo.setName(apiName); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModelInfo.getDescription()); }
public static void mapTModelInfo(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModelInfo apiTModelInfo) throws DispositionReportFaultMessage { apiTModelInfo.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModelInfo.setName(apiName); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModelInfo.getDescription()); }
protected boolean publishTestPublisher() { try { SaveBusiness sb1 = new SaveBusiness(); //List<BusinessEntity> biz = new ArrayList<BusinessEntity>(); BusinessEntity e = new BusinessEntity(); e.setBusinessKey("uddi:org.miloss.fgsms:test"); Name n = new Name(); n.setValue("Test Business Entity"); n.setLang(PublicationConstants.lang); e.getName().add(n); // biz.add(e); sb1.getBusinessEntity().add(e); sb1.setAuthInfo(loginWrapper()); publication.saveBusiness(sb1); return true; } catch (DispositionReportFaultMessage ex) { log.log(Level.ERROR, "error publising test business entity", ex); log.log(Level.ERROR, "error publising test business entity" + dispositionReportFaultMessageToString(ex), ex); return false; } catch (Exception ex) { log.log(Level.ERROR, "error publising test business entity", ex); return false; } }
public static void mapTModel(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModel apiTModel) throws DispositionReportFaultMessage { apiTModel.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModel.setName(apiName); apiTModel.setDeleted(modelTModel.getDeleted()); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription()); mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel); apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag())); mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel); mapSignature(modelTModel.getSignatures(), apiTModel.getSignature()); }
public static void mapTModel(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModel apiTModel) throws DispositionReportFaultMessage { apiTModel.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModel.setName(apiName); apiTModel.setDeleted(modelTModel.getDeleted()); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription()); mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel); apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag())); mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel); mapSignature(modelTModel.getSignatures(), apiTModel.getSignature()); }