This can be achieved via a computed attribute.
ControlUI/EclipseUI corrently passes the current asset as the first object in the init method invoked. Using the asset and the relationship you can retrieve the value of the other asset.
Sample Code Snippet
public class CustomComputedAttributeImpl extends implements ComputedAttribute {
private CentraSiteRegistryObject csRo;
public AttributeDescriptor getAttributeDescriptor() {
CustomComputedAttributeDescriptorImpl attrDesc = new CustomComputedAttributeDescriptorImpl();
attrDesc.setDataType(Constants.DATA_TYPE_STRING);
attrDesc.setMaxOccurs(ProfileAttribute.MAXOCCURS_UNBOUNDED);
attrDesc.setMinOccurs(ProfileAttribute.MINOCCURS_0);
attrDesc.setReadOnly(true);
return attrDesc;
}
public void init(Collection objects, Locale locale) {
if (objects != null) {
Iterator iterator = objects.iterator();
csRo = (CentraSiteRegistryObject) iterator.next();
}
}
public Collection getValue() throws JAXRException {
Collection<String> values = getRelatedAssetAttributeValues();
return values;
}
public Collection getValue() throws JAXRException {
//Fetching value logic shouldbe handled here. The following two lines are sample code snippet.
// CentraSiteRegistryObject relatedAsset = getRelateadAsset(AssociationType.Managed_by);
// Collection value = relatedAsset.getSlot(“UserEmail”)
}
}
Kindly let me know if you need more info.
Thanks and Regards,
Malligarjunan S.
#API-Management#webMethods#CentraSite