コード例 #1
0
  @Override
  protected void processGetRecordsRequest(CatalogGetRecordsRequest request)
      throws IllegalParameterFault {
    logger.debug("Process...");

    TextInfo textInfo = request.getCatalogFinder().getTextInfo();
    if (textInfo != null) {
      String searchText = textInfo.getText();
      boolean searchTitle = textInfo.isSearchTitle();
      boolean searchAbstract = textInfo.isSearchAbstract();
      boolean searchSubjects = textInfo.isSearchSubjects();
      if (searchText != null) {
        if (!searchTitle && !searchAbstract && !searchSubjects) {
          throw new IllegalParameterFault(
              "You need to specify where to search \"" + searchText + "\" text");
        }

        logger.debug("\n+++ Search text: \"{}\" +++", searchText);

        String constraint =
            this.createCQLTextPredicate(searchText, searchTitle, searchAbstract, searchSubjects);

        logger.trace("\n+++ Text CQL constraint: \"{}\" +++", request.getConstraint());
        super.addCQLConstraint(request, constraint);
      }
    }
  }