List of usage examples for javax.xml.registry.infomodel Slot getName
public String getName() throws JAXRException;
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
public List<SelectItem> getSlots() throws JAXRException { ArrayList<SelectItem> list = new ArrayList<SelectItem>(); Collection<?> slots = (Collection<?>) getCurrentRegistryObjectBean().getFields().get("slots"); Iterator<?> iter = slots.iterator(); while (iter.hasNext()) { Slot anItem = (Slot) iter.next(); String cstr = "name=" + anItem.getName() + " type=" + anItem.getSlotType() + " values=" + anItem.getValues();//from w w w . j a v a2s .c o m list.add(new SelectItem(cstr)); } return list; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
private List<RegistryObjectBean> getSlotsSearchResultsBeans(RegistryObjectBean roBean) throws ClassNotFoundException, NoSuchMethodException, ExceptionInInitializerError, Exception { List<?> slots = roBean.getSlots(); if (slots == null) { return null; }// w w w .jav a 2 s . com int numSlotObjects = slots.size(); @SuppressWarnings("unused") List<Object> list = new ArrayList<Object>(numSlotObjects); Iterator<?> roItr = slots.iterator(); if (log.isDebugEnabled()) { log.debug("Query results: "); } String objectType = "Slot"; int numCols = 5; // Replace ObjectType with Id. TODO - formalize this convention ArrayList<RegistryObjectBean> roBeans = new ArrayList<RegistryObjectBean>(numSlotObjects); for (@SuppressWarnings("unused") int i = 0; roItr.hasNext(); i++) { Slot slot = (Slot) roItr.next(); String header = null; Object columnValue = null; @SuppressWarnings("unused") ArrayList<Object> srvbHeader = new ArrayList<Object>(numCols); List<SearchResultValueBean> searchResultValueBeans = new ArrayList<SearchResultValueBean>(numCols); header = WebUIResourceBundle.getInstance().getString("Details"); columnValue = roBean.getId() + "." + slot.hashCode(); searchResultValueBeans.add(new SearchResultValueBean(header, columnValue)); header = WebUIResourceBundle.getInstance().getString("Name"); columnValue = slot.getName(); searchResultValueBeans.add(new SearchResultValueBean(header, columnValue)); header = WebUIResourceBundle.getInstance().getString("Slot Type"); columnValue = slot.getSlotType(); searchResultValueBeans.add(new SearchResultValueBean(header, columnValue)); header = WebUIResourceBundle.getInstance().getString("Values"); columnValue = slot.getValues(); searchResultValueBeans.add(new SearchResultValueBean(header, columnValue)); RegistryObjectBean srb = new RegistryObjectBean(searchResultValueBeans, roBean.getRegistryObject(), objectType, slot, false); roBeans.add(srb); } return roBeans; }
From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java
public static TModel getTModelFromJAXRClassificationScheme(ClassificationScheme classificationScheme) throws JAXRException { TModel tm = objectFactory.createTModel(); try {/*from w w w . ja va 2 s.c om*/ /* * a fresh scheme might not have a key */ Key k = classificationScheme.getKey(); if (k != null && k.getId() != null) { tm.setTModelKey(k.getId()); } else { tm.setTModelKey(""); } /* * There's no reason to believe these are here either */ Slot s = classificationScheme.getSlot("authorizedName"); if (s != null && s.getName() != null) { tm.setAuthorizedName(s.getName()); } s = classificationScheme.getSlot("operator"); if (s != null && s.getName() != null) { tm.setOperator(s.getName()); } InternationalString iname = classificationScheme.getName(); tm.setName(getFirstName(iname)); InternationalString idesc = classificationScheme.getDescription(); addDescriptions(tm.getDescription(), idesc); IdentifierBag idBag = getIdentifierBagFromExternalIdentifiers( classificationScheme.getExternalIdentifiers()); if (idBag != null) { tm.setIdentifierBag(idBag); } CategoryBag catBag = getCategoryBagFromClassifications(classificationScheme.getClassifications()); if (catBag != null) { tm.setCategoryBag(catBag); } // ToDO: overviewDoc } catch (Exception ud) { throw new JAXRException("Apache JAXR Impl:", ud); } return tm; }
From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java
public static TModel getTModelFromJAXRConcept(Concept concept) throws JAXRException { TModel tm = objectFactory.createTModel(); if (concept == null) return null; try {//from w w w . ja va2s. c o m Key key = concept.getKey(); if (key != null && key.getId() != null) tm.setTModelKey(key.getId()); Slot sl1 = concept.getSlot("authorizedName"); if (sl1 != null && sl1.getName() != null) tm.setAuthorizedName(sl1.getName()); Slot sl2 = concept.getSlot("operator"); if (sl2 != null && sl2.getName() != null) tm.setOperator(sl2.getName()); InternationalString iname = concept.getName(); tm.setName(getFirstName(iname)); InternationalString idesc = concept.getDescription(); addDescriptions(tm.getDescription(), idesc); // External Links Collection<ExternalLink> externalLinks = concept.getExternalLinks(); if (externalLinks != null && externalLinks.size() > 0) { tm.setOverviewDoc(getOverviewDocFromExternalLink((ExternalLink) externalLinks.iterator().next())); } IdentifierBag idBag = getIdentifierBagFromExternalIdentifiers(concept.getExternalIdentifiers()); if (idBag != null) { tm.setIdentifierBag(idBag); } CategoryBag catBag = getCategoryBagFromClassifications(concept.getClassifications()); if (catBag != null) { tm.setCategoryBag(catBag); } } catch (Exception ud) { throw new JAXRException("Apache JAXR Impl:", ud); } return tm; }