Search in sources :

Example 1 with Extensions

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;
}
Also used : Query(org.xwiki.query.Query) Extensions(org.xwiki.extension.repository.xwiki.model.jaxb.Extensions) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Extensions (org.xwiki.extension.repository.xwiki.model.jaxb.Extensions)1 Query (org.xwiki.query.Query)1