Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Complete Jazz API or building it

Hi,

Sorry for such a stupid question, but I am pretty new to Jazz and want to write a plugin that works on work items. My problem is that I cannot find any documentation showing which plugins and extension point or functions can be used to achieve this goal.

For example:
I want to fetch all WorkItem of the ProjectArea. How can I do this?

When trying to generate the JavaDoc from the source package I get about 100 errors. So this seems to be no solution either.

Again, Sorry for such a greenhorn question but I am a bit stuck.

Kim

0 votes



3 answers

Permanent link
Hi Kim,

I struggled also with the missing documentation. My source of information was a Book: Eclipse. Building Commercial-Quality Plug-Ins (Eclipse (Addison-Wesley)). The rest was reverse engineering. Without this background information you are lost in space...

Regards,

Stef

0 votes


Permanent link
Hi Kim

Our Work Item API documentation is currently quite scarce, so your
question is absolutely legitimate.

A good first step is to familiarize yourself with the general Jazz terms
and programming model that the individual components like Work Item
adhere to:
https://jazz.net/learn/LearnItem.jsp?href=content/docs/platform-overview/index.html

Each component typically provides access to its functionality by its
Client Library. For Work Items, this is IWorkItemClient and
IAuditableClient.


For example:
I want to fetch all WorkItem of the ProjectArea. How can I do this?

Here's a snippet that queries all work items of a project area (this can
be a huge number of work items...):

Assuming that you have a project area handle:

IProjectAreaHandle projectArea= ...

Access the client libraries:

ITeamRepository repository= (ITeamRepository) projectArea.getOrigin();
IAuditableClient auditableClient= (IAuditableClient)
repository.getClientLibrary(IAuditableClient.class);

Create the query:

WorkItemQueryModel model= WorkItemQueryModel.ROOT;
IItemQuery query= IItemQuery.FACTORY.newInstance(model);
IPredicate predicate= model.projectArea()._eq(query.newItemHandleArg());
query.filter(predicate);

Execute the query:

ItemQueryIterator<IWorkItemHandle> iterator= new
ItemQueryIterator<IWorkItemHandle>(auditableClient, query, new Object[]
{ projectArea });

List<IWorkItem> workItems=
auditableClient.resolveAuditables(iterator.toList(monitor),
IWorkItem.SMALL_PROFILE, monitor);


This leaves you with a list of resolved work items which contain the
most commonly used attributes. If you need all attributes, use
IWorkItem.FULL_PROFILE instead (there is a performance penalty as more
data needs to be resolved and transferred).

If you need more information about writing Eclipse plug-ins, I would
highly recommend
"Contributing to Eclipse - Principles, Patterns and Plug-Ins" by Erich
Gamma and Kent Beck (Addison Wesley)

HTH,
Patrick

0 votes


Permanent link
Thanks Patrik. That's an awesome post!
Thank your very much.


Kim

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jan 14 '08, 8:09 a.m.

Question was seen: 7,878 times

Last updated: Jan 14 '08, 8:09 a.m.

Confirmation Cancel Confirm