Create Reference Attribute
The sample use case is to create a reference attribute with the with the following properties:
- •The custom reference attribute must be named Contact.
- •The custom reference attribute projects the name of an ISP user into the Contact attribute field of an object.
- •If the name of the ISP user changes, all the Contact custom reference attribute fields must be updated.
- •The Contact custom reference attribute can be associated with any class.
- •Provide the description for the custom reference attribute as Person to contact for more information.
- •You must be able to search in the catalog using the custom reference attribute.
You can use the REST API and create the custom reference attribute in one of the following ways:
- Using Java code and the Bundled Java Client
public void createContactReferenceAttribute() throws ApiException {
this.api.catalogModelsReferenceAttributesPost(new RefAttributesPost()
.addItemsItem(new RefAttributePost()
.name("Contact")
.refDataTypeId("com.infa.ldm.isp.UserDatatype")
.description("Person to contact for more information.")
.searchable(false)
.addClassesItem(new ModelRefRequest().id("core.IClass"))));
}
}
- Using Curl
curl -X POST --header "Accept: application/json" --header "Content-Type: application/json" -d "{
\"items\": [
{
\"refDataTypeId\": \"com.infa.ldm.isp.UserDatatype\",
\"name\": \"Contact\",
\"description\": \"Person to contact for more information.\",
\"searchable\": false,
\"classes\": [
{
\"id\": \"core.IClass\"
}
]
}
]
}" "http://localhost:13000/2/catalog/models/referenceAttributes"