return tm;
}
public static TModel getTModelFromJAXRConcept(Concept scheme)
throws JAXRException {
TModel tm = TModel.Factory.newInstance();
if (scheme == null)
return null;
try {
Key key = scheme.getKey();
if (key != null && key.getId() != null)
tm.setTModelKey(key.getId());
Slot sl1 = scheme.getSlot("authorizedName");
if (sl1 != null && sl1.getName() != null)
tm.setAuthorizedName(sl1.getName());
Slot sl2 = scheme.getSlot("operator");
if (sl2 != null && sl2.getName() != null)
tm.setOperator(sl2.getName());
InternationalString iname = ((RegistryObject) scheme).getName();
for (LocalizedString locName : iname.getLocalizedStrings()) {
Name name = tm.addNewName();
name.setStringValue(locName.getValue());
name.setLang(locName.getLocale().getLanguage());
}
InternationalString idesc = ((RegistryObject) scheme).getDescription();
if (idesc != null) {
for (LocalizedString locName : idesc.getLocalizedStrings()) {
Description desc = tm.addNewDescription();
desc.setStringValue(locName.getValue());
desc.setLang(locName.getLocale().getLanguage());
}
}
// External Links
Collection<ExternalLink> externalLinks = scheme.getExternalLinks();
if(externalLinks != null && externalLinks.size() > 0)
{
tm.setOverviewDoc(getOverviewDocFromExternalLink((ExternalLink)externalLinks.iterator().next()));
}
IdentifierBag idBag = getIdentifierBagFromExternalIdentifiers(scheme.getExternalIdentifiers());
if (idBag!=null) {
tm.setIdentifierBag(idBag);
}
CategoryBag catBag = getCategoryBagFromClassifications(scheme.getClassifications());
if (catBag!=null) {
tm.setCategoryBag(catBag);
}
} catch (Exception ud) {
throw new JAXRException("Apache JAXR Impl:", ud);
}