Added possibility to get the whole item instead of just the name
This commit is contained in:
parent
0d194a28a3
commit
2b551f0ee1
|
@ -486,6 +486,16 @@ public class CKANPackage extends CKAN implements Moderated {
|
||||||
|
|
||||||
ArrayNode results = (ArrayNode) result.get(RESULTS_KEY);
|
ArrayNode results = (ArrayNode) result.get(RESULTS_KEY);
|
||||||
|
|
||||||
|
boolean allFields = false;
|
||||||
|
MultivaluedMap<String,String> queryParameters = uriInfo.getQueryParameters();
|
||||||
|
if(queryParameters.containsKey(GCatConstants.ALL_FIELDS_QUERY_PARAMETER)) {
|
||||||
|
allFields = Boolean.parseBoolean(queryParameters.get(GCatConstants.ALL_FIELDS_QUERY_PARAMETER).get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(allFields) {
|
||||||
|
return getAsString(results);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayNode arrayNode = mapper.createArrayNode();
|
ArrayNode arrayNode = mapper.createArrayNode();
|
||||||
for(JsonNode node : results) {
|
for(JsonNode node : results) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue