use of org.xwiki.extension.repository.xwiki.model.jaxb.Extensions in project xwiki-platform by xwiki.
the class ExtensionsRESTResource method getExtensions.
@GET
public Extensions getExtensions(@QueryParam(Resources.QPARAM_LIST_START) @DefaultValue("0") Integer offset, @QueryParam(Resources.QPARAM_LIST_NUMBER) @DefaultValue("-1") int number, @QueryParam(Resources.QPARAM_LIST_REQUIRETOTALHITS) @DefaultValue("true") boolean requireTotalHits) throws QueryException {
Extensions extensions = this.extensionObjectFactory.createExtensions();
if (requireTotalHits) {
Query countQuery = createExtensionsCountQuery(null, null);
extensions.setTotalHits((int) getExtensionsCountResult(countQuery));
} else {
extensions.setTotalHits(-1);
}
extensions.setOffset(offset);
Query query = createExtensionsSummariesQuery(null, null, offset, number, false);
getExtensionSummaries(extensions.getExtensionSummaries(), query);
return extensions;
}
Aggregations