How to read the details of all the Atribute Types in any Project Area ?
2 answers
Not quite sure why you need all the attribute types in "any" project area. Getting the type definition should be very straightforward.
When you GET the details of a requirement, you will get <oslc:instanceShape>, which I believe you have already known that. Follow the instance shape URI, you should then have some <rm:hasSystemAttribute> and <rm:hasAttribute> attributes. And finally follow the URI in these attributes, you can get the details of each individual attribute, with <dcterms:title> being the attribute name.
Do I misunderstand what you are trying to do?
Comments
Hi Donald Nong,
Thanks for the response.
I will elaborate a bit. I am developing a utility which takes "ArtifactType" name as input and returns Ids of all the Artifacts of that Artifact Type as output.
For the same I need to match the Attribute Type/ Instance Shape of any requirement object with all the available Attribute Types in the given Project Area.
So far I am able to read the Instance shape for any Requirement object but not able to retrieve Attribute Type Name from that URI.
On passing the instanceShape URI i dont get any "rm" related tags (<rm:hasSystemAttribute>,<rm:hasAttribute> as mentioned by you).
<dcterms:title> is do visible but it has many instances of it available.
Please let me know what did I miss.
Thanks
Vaibhav
Hi,
I found the code that will do the job:
ClientResponse clientResponseAttribute = client.getResource(requirement.getInstanceShape().toString(), OSLCConstants.CT_RDF);
ResourceShape resourceShape = clientResponseAttribute.getEntity(ResourceShape.class);
artifactType = resourceShape.getTitle();
Thanks
Vaibhav