It's all about the answers!

Ask a question

Complete Jazz API or building it


Kim Herzig (2612) | asked Jan 14 '08, 8:09 a.m.
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

3 answers



permanent link
Stefan Hufnagl (29411920) | answered Jan 14 '08, 1:31 p.m.
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

permanent link
Patrick Streule (4.9k21) | answered Jan 15 '08, 4:08 a.m.
JAZZ DEVELOPER
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

permanent link
Kim Herzig (2612) | answered Jan 18 '08, 3:42 a.m.
Thanks Patrik. That's an awesome post!
Thank your very much.


Kim

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.