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

Querying selective attributes of item

I need item info structured as per attributes. However, only some attributes need to be selected. When I use IItemQuery, item info is structured as per attributes but pulls up all attributes. So, I tried the following(IDataQuery) but it does not show the data structured around attributes. Instead it shows every thing organized as <rawData>. Can some one suggest what is to be added to the following piece?



IQueryService queryService = getService(IQueryService.class);
ContributorQueryModel queryModel = BaseContributorQueryModel.ContributorQueryModel.ROOT;
IDataQuery query = IDataQuery.FACTORY.newInstance(queryModel);
query.select(queryModel.itemId(), queryModel.name());
IDataQueryPage contributorByNamePage = queryService.queryData(query, IQueryService.EMPTY_PARAMETERS, IQueryService.ITEM_QUERY_MAX_PAGE_SIZE);

return contributorByNamePage;

0 votes



One answer

Permanent link
There is good support for querying items with desired attributes.

Example:
String [] Props ={"itemId", "name"};
IItem[] items = repositoryItemService.fetchItems(itemQueryPage.handlesAsArray(), Props);

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: Mar 12 '09, 4:35 p.m.

Question was seen: 6,322 times

Last updated: Mar 12 '09, 4:35 p.m.

Confirmation Cancel Confirm