Get attributes specific to a community and asset type using REST API
Hi, Im working on creating a C#.Net application which integrates RAM with TFS using REST API. In RAM when user submits an asset, some of the attributes change according to the community and asset type selected. I want to replicate the same functionality in my code. I want to know the query to be used in RESTClient to get list of attributes name, type(string, int, date etc) and default value if any. Please refer to the link below to understand using REST API for RAM. http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/index.jsp?topic=%2Fcom.ibm.ram.doc%2Ftopics%2Ft_using_api.html
If we do a get operation on the query http://inblr-3dvesrvqa:13080/ram/internal/communities/{Community GUID}/types on the REST Client, the response would be as below:
<atom:feed xml:base="http://inblr-3dvesrvqa:13080/ram/"> </atom:feed>
I will parse through similar responses and get the details I needed like community names etc. The above response has the attributename tag under ram:configuration. But, it is not having correct attribute name, attribute type etc. I want to know what query i can pass through RESTClient and do an GET operation so that i will get a response which has all the asset attribute information needed. The headers added in the RESTClient for the above operation are:
Oslc-Core-Version : 2.0 Accept:application/rdf+xml
OSLC-Asset-Version: 2.0
The authentication used is basic authentication.
Refer the links below to understand this further:
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r2m0/index.jsp?topic=/com.ibm.ram.doc/topics/t_upload.html http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m1/index.jsp?topic=%2Fcom.ibm.ram.doc%2Ftopics%2Fc_rest_api.html https://jazz.net/wiki/bin/view/Main/RamRestApiMain
Regards,
Kiran
|
2 answers
Rich Kulp (3.6k●3●8)
| answered Jul 17 '12, 11:18 a.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Jul 17 '12, 11:18 a.m.
It's a little confusing but it is explained in the javadocs. Assettypes are retrieved at the global level. But an asset type may have a community level override. Once you get the RAMAssetType you can get the community override using ramAssetType.getCommunityAssetType(communityInfo). If this returns null then there is no community override. If there is then this returns a CommunityAssetType.
If you don't know what community you are interested in you can use ramAssetType.getCommunityAssetTypes() and this will return an array of all community overrides. Then from either asset type or community asset type you can get the attributeConstraints() that are applicable to the assettype/community override, if any. From the attribute constraint you can see if it is required, and you can then get the RAMAssetAttribute. This is the description of the attribute definition, which is name, type, URI, values, etc. The javadocs on each these components is available in the RAM documentation. You would use the javadoc to see what methods are available on each object and what you can get from those methods. Comments
Kangkan Goswami
commented Jul 18 '12, 12:36 a.m.
@RichardKulp: The OP clearly mentions that the issue is with REST API and not the Java API that comes bundled. |
We need to do another get operation on http://serverurl: serverport/ram/internal/attributes/classif/assetTypesSchema.xmi%23AttributeName The AttributeName can be retrieved from the <ram:configuration> tag from the above xml response from the query in the question. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.