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
Shivank Arya (19141) | answered Jan 03 '11, 6:54 a.m.
JAZZ DEVELOPER
Hi,

The information on project areas is available via Public REST API published in JTS' root services resource. This information contains the description as well.

An example url to access root services - https://<host>:<port>/jazz/rootservices

An example url to access project areas - https://<host>:<port>/jazz/process/project-areas

To understand the problem better, can you tell me why do you need to add parameters in a project area?

Thanks,
Shivank
Jazz Foundation


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

permanent link
Baris Erdemir (1812819) | answered Jan 03 '11, 7:43 a.m.
Hi,

Thanks for the reply.

In my build automization, I have a service user that has a dedicated repository workspace for the project. I am reading the name of that service users repository workspace.

Second one is a name of a stream of a project. That is used for build purpose as well.

Now I have third parameter which is build definition name.
The third parameter now I have is build definition name. If possible, I want to read that from a combo box. (I have another post for that)

Now I am reading that information from sumamry field of a proejct area that I want to change.

I think I can write a clientside plugin for that configuration but I dont want to extend RTC Eclipse clients.


To understand the problem better, can you tell me why do you need to add parameters in a project area?

permanent link
Baris Erdemir (1812819) | answered Jan 04 '11, 12:05 p.m.
Can you give an example for java API in order to read description attribute of a project area?
Thank you

permanent link
Shivank Arya (19141) | answered Jan 07 '11, 4:04 a.m.
JAZZ DEVELOPER
If you are planing to write a OSGI based client plugin, it will make your life easy because you can use the available JAVA SDK APIs of Jazz Foundation. You don't really have to use REST APIs in that case

Here is an example code snippet that can be used.

package com.example;


import java.net.URI;

import com.ibm.team.repository.common.TeamRepositoryException;

import com.ibm.team.repository.client.ITeamRepository;
import com.ibm.team.repository.client.TeamPlatform;

import com.ibm.team.process.common.IProjectArea;

public class Test {
private String getProjectAreaDescription(String[] args) throws TeamRepositoryException {

String repositoryURI= args[0];
final String userId= args[1];
final String password= args[2];
String projectAreaName= args[3];

ITeamRepository teamRepository= TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
teamRepository.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repo) {
return new ILoginInfo() {
public String getUserId() {
return userId;
}
public String getPassword() {
return password;
}
};
}
});
teamRepository.login(null);

IProcessClientService processClient= (IProcessClientService) teamRepository.getClientLibrary(IProcessClientService.class);
URI uri= URI.create(projectAreaName.replaceAll(" ", "%20"));
IProjectArea projectArea= (IProjectArea) processClient.findProcessArea(uri, null, null);

return projectArea.getDescription().getSummary();
}
}


Will discuss this request of storing custom attributes with a project area with my team.

Good luck.
Shivank
Jazz Foundation Development Team


Can you give an example for java API in order to read description attribute of a project area?
Thank you

permanent link
Baris Erdemir (1812819) | answered Mar 04 '11, 3:01 a.m.
Hi,
Do you have any news for adding custom attributes to project area?
I can provide more use cases that we are solving by using property files.

For the question, I need to read project area again while extending com.ibm.team.workitem.ide.ui.internal.editor.presentations.AttributePart.

Since the user is already logged in, can you provide an API that does not need to log in again?

Thanks,

permanent link
Baris Erdemir (1812819) | answered Mar 04 '11, 3:33 a.m.
I have posted this question again but we can go on discussing here:
Copying http://jazz.net/forums/viewtopic.php?t=15649:
I stated my question more clear here:

Hi,

I am extending com.ibm.team.workitem.ide.ui.internal.editor.presentations.AttributePart

In overridden setInput( Object input) method, I am initializing my WorkItemWorkingCopy:

Code:
WorkItemEditorInput workItemEditorInput = ( WorkItemEditorInput) input;
WorkItemWorkingCopy fWorkingCopy = workItemEditorInput.getWorkingCopy();


I would like to read description field of project area. Can you please help about the appropriate api?

Thanks,

permanent link
Baris Erdemir (1812819) | answered Mar 04 '11, 9:17 a.m.
Hi,
I need to read description attribute both in client and serverside plugins.
I am extending AbstractService and implementing IOperationAdvisor.
Can you please provide appropriate API fro mehre to read project ares's description a ttribute?
Thanks,

permanent link
Baris Erdemir (1812819) | answered Mar 08 '11, 10:30 a.m.
Hi Shivak,
I found IProjectArea in precondition (AbstractService, IOperationAdvisor)

I tried your reccommendation:
projectArea.getDescription().getSummary(); 

But this is giving Summary field of project area instead of description.

So to summarize all the message thread I have 2 questions here:

1) I need an example API to read description attribute of Project area in a precondition. Here I managed to obtain IProjectArea.
Precondition is a class that extends com.ibm.team.repository.service.AbstractService and implements com.ibm.team.process.common.advice.runtime.IOperationAdvisor

2)I need an example API to read description attribute of Project area in com.ibm.team.workitem.ide.ui.internal.editor.presentations.AttributePart
Here I dont have IProjectArea so I need an example from scratch.

permanent link
Philippe Krief (561155) | answered Mar 15 '11, 2:12 p.m.
JAZZ DEVELOPER
To access to the description field of a project area, instead getSummary() API, did you try getDetails() API provided by the IDescription interface?

permanent link
Baris Erdemir (1812819) | answered Apr 14 '11, 8:41 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,

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.