Package com.iknowbase.api.contentservices.query.content

Provides interfaces for creating and running content queries. The main workflow follows these steps:
  • The infrastructure, using infrastructure magic, provides you with a ContentServicesEngine.
  • The ContentServicesEngine provides you with a ContentQueryService.
  • To create a query, you first ask the ContentQueryService for a ContentQueryBuilder. You use fluent methods to configure the builder, and finally build a reusable ContentQuery object.
  • To run a query, you first ask the ContentQuery for a ContentQueryRunner. You use fluent methods to configure the runner, and finally use the run() method to get a ContentQueryResult.

Example

 public class QueryTest {

    private final ContentQuery query;

    public QueryTest (ContentQueryService contentQueryService) {
       query = contentQueryService.builder()
          .where(dimensionExpression().in("SYSTEST_CONTENTQUERY_DOCUMENTTYPE"))
          .where(objectReferenceExpression("IKB$DOCUMENT_TYPE").in("SYSTEST_DOCTYPE"))
          .limit(40)
          .build();
    }

    public void runQuery(RepositoryClient client, int page) {
       ContentQueryResult result = query.runner()
          .skip(40 * page)
          .run(client);
       // Do something with result
    }
 }