It's all about the answers!

Ask a question

how to use ITEM_TYPE


Huang Lei (644) | asked May 28 '09, 11:59 p.m.
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

One answer



permanent link
Matt Lavin (2.7k2) | answered Jun 01 '09, 11:50 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
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

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.