Merged searchapi (5.2.1) to 5.2.N (5.2.1)

129808 gjames: SEARCH-112: Adding SearchContext to the response


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130178 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2016-09-06 14:18:46 +00:00
parent e1bd68c17c
commit f3cb1c224d
8 changed files with 162 additions and 24 deletions

View File

@@ -61,7 +61,8 @@ public class SerializerOfCollectionWithPaging extends SerializerBase<Serializabl
jgen.writeFieldName("list");
jgen.writeStartObject();
serializePagination(pagedCol, jgen);
jgen.writeObjectField("entries", pagedCol.getCollection());
serializeContext(pagedCol, jgen);
jgen.writeObjectField("entries", pagedCol.getCollection());
serializeIncludedSource(pagedCol, jgen);
jgen.writeEndObject();
jgen.writeEndObject();
@@ -77,6 +78,15 @@ public class SerializerOfCollectionWithPaging extends SerializerBase<Serializabl
}
}
private void serializeContext(SerializablePagedCollection pagedCol, JsonGenerator jgen) throws IOException,
JsonProcessingException
{
if (pagedCol.getContext() != null)
{
jgen.writeObjectField("context",pagedCol.getContext());
}
}
private void serializePagination(SerializablePagedCollection pagedCol, JsonGenerator jgen) throws IOException,
JsonProcessingException
{