It's all about the answers!

Ask a question

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


Pooja Karda (13711) | asked Jul 01 '13, 4:55 a.m.
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()]); }

Comments
Surya Tripathi commented Jul 15 '13, 4:40 p.m.

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

Be the first one to answer this question!


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.