return bt;
}
public static PublisherAssertion getPubAssertionFromJAXRAssociation(
Association assc) throws JAXRException {
PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
try {
if (assc.getSourceObject().getKey() != null &&
assc.getSourceObject().getKey().getId() != null) {
pa.setFromKey(assc.getSourceObject().getKey().getId());
}
if (assc.getTargetObject().getKey() != null &&
assc.getTargetObject().getKey().getId() != null) {
pa.setToKey(assc.getTargetObject().getKey().getId());
}
Concept c = assc.getAssociationType();
String v = c.getValue();
KeyedReference kr = KeyedReference.Factory.newInstance();
Key key = c.getKey();
if (key == null) {
// TODO:Need to check this. If the concept is a predefined
// enumeration, the key can be the parent classification scheme
key = c.getClassificationScheme().getKey();
}
if (key == null || key.getId() == null) {
// The parent classification scheme may not always contain the
// key. It is okay if it doesn't, since the UDDI v2 spec allows
// TModelKey to be absent.
// TODO: This setting to "" should not be needed at all.
// However, a bug in jUDDI needs it to be there. See:
// http://issues.apache.org/jira/browse/JUDDI-78
//kr.setTModelKey("");
} else {
kr.setTModelKey(key.getId());
}
kr.setKeyName("Concept");
if (v != null) {
kr.setKeyValue(v);
}
pa.setKeyedReference(kr);
} catch (Exception ud) {
throw new JAXRException("Apache JAXR Impl:", ud);
}
return pa;
}