It's all about the answers!

Ask a question

How to read description attribute of a project area?


Baris Erdemir (1812819) | asked Dec 23 '10, 8:02 a.m.
Hi,
I want to read 2 string parameters from a project area.
Is it possible to add parameters to project area? If not,
How can I read from description field of a project area?
Thank you

11 answers



permanent link
Thomas Yu (45183) | answered Apr 19 '11, 12:47 a.m.
To access to the description field of a project area, instead getSummary() API, did you try getDetails() API provided by the IDescription interface?

Hi Philippe,
I think your answer is about 1st part of my question. I tried it now. But that method is returning an IContent and I do not know how to get Description attribute of a project area from there.
I need the value as a string.

Plus I need the same thing for client side.
thanks,

Hi bariserdemir,

Hope following code snippets help-

ServerSide:


IContent content = projectArea.getDescription().getDetails();
ByteArrayOutputStream out = new ByteArrayOutputStream();
IContentService cs = getService(IContentService.class);//get IContentService
cs.retrieveContent(content, out);
String description = new String(out.toByteArray(),content.getCharacterEncoding());



code snippet of ClientSide:


ByteArrayOutputStream stream= new ByteArrayOutputStream();
//fTeamRepository: client side team repository
//content: project area description details
//monitor: ProgressMonitor for retrieveConent
fTeamRepository.contentManager().retrieveContent(content, stream, monitor);

Your answer


Register or to post 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.