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

Could anyone please provide sample OSLC code with a where clause for the service class?

The code that i have tried, but it is not giving records on basis of filter where condition.


@GET
@Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON}) public Project[] getChangeRequests(@QueryParam("oslc.where") final String where, @QueryParam("oslc.prefix") final String prefix) { final List< Project> results = new ArrayList<Project>(); Map<String, String> prefixMap; try { QueryUtils.parseSearchTerms(where); prefixMap = QueryUtils.parsePrefixes(prefix); WhereClause whereClause = QueryUtils.parseWhere(where, prefixMap); } catch (ParseException e) { e.printStackTrace(); } final Project[] changeRequests = Persistence.getChangeRequestsForProject(); for (final Project changeRequest : changeRequests) { changeRequest.setServiceProvider(ServiceProviderSingleton.getServiceProviderURI()); results.add(changeRequest); } return results.toArray(new Project[results.size()]); }

1 vote

Comments

This question is tagged for development investigation. An immediate response is not available.


Be the first one to answer this question!

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
× 62

Question asked: Jul 01 '13, 4:55 a.m.

Question was seen: 1,452 times

Last updated: Jul 15 '13, 4:40 p.m.

Confirmation Cancel Confirm