Search in sources :

Example 1 with AllSearcher

use of org.activityinfo.shared.command.handler.search.AllSearcher in project activityinfo by bedatadriven.

the class SearchHandler method searchAll.

/**
 * Assumes the user typed a generic search term without specifying a
 * dimension. Search using all possible searchers, and return a list of
 * matched dimensions
 */
private void searchAll(final List<String> q, final ExecutionContext context, final AsyncCallback<SearchResult> callback) {
    AllSearcher allSearcher = new AllSearcher(context.getTransaction());
    allSearcher.searchAll(q, new AsyncCallback<Filter>() {

        @Override
        public void onFailure(Throwable caught) {
            callback.onFailure(caught);
        }

        @Override
        public void onSuccess(final Filter resultFilter) {
            processFilter(context, callback, resultFilter);
        }
    });
}
Also used : Filter(org.activityinfo.shared.command.Filter) AllSearcher(org.activityinfo.shared.command.handler.search.AllSearcher)

Example 2 with AllSearcher

use of org.activityinfo.shared.command.handler.search.AllSearcher in project activityinfo by bedatadriven.

the class SearchHandler method searchDimensions.

private void searchDimensions(QueryParser parser, final ExecutionContext context, final AsyncCallback<SearchResult> callback) {
    AllSearcher allSearcher = new AllSearcher(context.getTransaction());
    allSearcher.searchDimensions(parser.getUniqueDimensions(), new AsyncCallback<Filter>() {

        @Override
        public void onSuccess(Filter result) {
            processFilter(context, callback, result);
        }

        @Override
        public void onFailure(Throwable caught) {
            callback.onFailure(caught);
        }
    });
}
Also used : Filter(org.activityinfo.shared.command.Filter) AllSearcher(org.activityinfo.shared.command.handler.search.AllSearcher)

Aggregations

Filter (org.activityinfo.shared.command.Filter)2 AllSearcher (org.activityinfo.shared.command.handler.search.AllSearcher)2