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

how to use ITEM_TYPE

hi,everyone.in the following part
public class TicketService extends AbstractService implements ITicketService{

public ITicket createTicket(int id,int stillrest)
throws TeamRepositoryException{

ITicket ticket = (ITicket)ITicket.ITEM_TYPE.createItem();
ticket.setId(id);
ticket.setStillrest(stillrest);

return ticket;

}
}
it tells me that ITicket.ITEM_TYPE cannot be resolved.what should i do with the interface ITicket

0 votes



One answer

Permanent link
You can add a ITEM_TYPE field to your interface by using something like
the code below. The references to 'RepositoryPackage' would need to be
changed to your models package, and the 'getContributor().getName()'
would need to be changed to your item types name.

public static final IItemType ITEM_TYPE =
IItemType.IRegistry.INSTANCE
.getItemType(
RepositoryPackage.eINSTANCE.getContributor().getName(),
RepositoryPackage.eNS_URI);

-
Matt Lavin
Jazz Server Team


On Fri, 2009-05-29 at 04:07 +0000, conan2840100 wrote:
hi,everyone.in the following part
public class TicketService extends AbstractService implements
ITicketService{

public ITicket createTicket(int id,int stillrest)
throws TeamRepositoryException{

ITicket ticket = (ITicket)ITicket.ITEM_TYPE.createItem();
ticket.setId(id);
ticket.setStillrest(stillrest);

return ticket;

}
}
it tells me that ITicket.ITEM_TYPE cannot be resolved.what should i do
with the interface ITicket

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

Question asked: May 28 '09, 11:59 p.m.

Question was seen: 4,726 times

Last updated: May 28 '09, 11:59 p.m.

Confirmation Cancel Confirm