List of usage examples for javax.xml.registry.infomodel ExternalIdentifier getValue
public String getValue() throws JAXRException;
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
public List<SelectItem> getExternalIdentifiers() throws JAXRException { ArrayList<SelectItem> list = new ArrayList<SelectItem>(); Collection<?> externalIdentifiers = (Collection<?>) getCurrentRegistryObjectBean().getFields() .get("externalIdentifiers"); Iterator<?> iter = externalIdentifiers.iterator(); while (iter.hasNext()) { ExternalIdentifier anItem = (ExternalIdentifier) iter.next(); list.add(new SelectItem(anItem.getValue())); }/* w w w . ja v a2s . c o m*/ return list; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
private String checkExternalIdentifier(String status, RegistryObject ro) { StringBuffer eiFields = new StringBuffer(); ExternalIdentifier tempEI = (ExternalIdentifier) ro; try {/*from w w w . j a v a 2 s .co m*/ if (tempEI.getIdentificationScheme() == null) { status = "failure"; eiFields.append(WebUIResourceBundle.getInstance().getString("classificationScheme")); } if (tempEI.getValue() == null || tempEI.getValue().length() <= 0) { status = "failure"; if (eiFields.toString().length() != 0) { eiFields.append("," + WebUIResourceBundle.getInstance().getString("classificationValueLabel")); } else { eiFields.append(WebUIResourceBundle.getInstance().getString("classificationValueLabel")); } } if (eiFields.toString().length() != 0) { append(WebUIResourceBundle.getInstance().getString("message.CouldNotCreateExternalIdentifier") + eiFields.toString()); return status; } } catch (Throwable t) { status = "failure"; log.error( WebUIResourceBundle.getInstance().getString("message.FaildToValidateExternalIdentifierFields"), t); append(WebUIResourceBundle.getInstance().getString("validationEIROError") + t.getLocalizedMessage()); } return status; }
From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java
/** * Adds the objects identifiers from JAXR's external identifier collection * /* www . j a v a2 s . c o m*/ * @param identifiers external identifiers to turn into identifiers * @throws JAXRException */ public static IdentifierBag getIdentifierBagFromExternalIdentifiers(Collection identifiers) throws JAXRException { try { if (identifiers == null || identifiers.size() == 0) return null; // Identifiers IdentifierBag ibag = objectFactory.createIdentifierBag(); Iterator iditer = identifiers.iterator(); while (iditer.hasNext()) { ExternalIdentifier extid = (ExternalIdentifier) iditer.next(); if (extid != null) { KeyedReference keyr = objectFactory.createKeyedReference(); ibag.getKeyedReference().add(keyr); InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) extid).getName(); String value = extid.getValue(); ClassificationScheme scheme = extid.getIdentificationScheme(); String name = iname.getValue(); if (name != null) keyr.setKeyName(name); if (value != null) keyr.setKeyValue(value); if (scheme != null) { Key key = scheme.getKey(); if (key != null && key.getId() != null) keyr.setTModelKey(key.getId()); } } } return ibag; } catch (Exception ud) { throw new JAXRException("Apache JAXR Impl:", ud); } }