use of com.runwaysdk.business.ValueObjectDTO in project geoprism-registry by terraframe.
the class TermController method getClassifierSuggestions.
@Endpoint(error = ErrorSerialization.JSON)
public ResponseIF getClassifierSuggestions(ClientRequestIF request, @RequestParamter(name = "mdAttributeId", required = true) String mdAttributeId, @RequestParamter(name = "text") String text, @RequestParamter(name = "limit") Integer limit) throws JSONException {
JSONArray response = new JSONArray();
ValueQueryDTO query = ClassifierDTO.getClassifierSuggestions(request, mdAttributeId, text, limit);
List<ValueObjectDTO> results = query.getResultSet();
for (ValueObjectDTO result : results) {
JSONObject object = new JSONObject();
object.put("label", result.getValue(ClassifierDTO.DISPLAYLABEL));
object.put("value", result.getValue(ClassifierDTO.OID));
response.put(object);
}
return new RestBodyResponse(response);
}
Aggregations