Search in sources :

Example 1 with SearchSortBy

use of com.zimbra.soap.type.SearchSortBy in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doSearchConv.

private void doSearchConv(String[] args) throws ServiceException {
    if (currrentOpt()) {
        doSearchConvRedisplay();
        return;
    } else if (previousOpt()) {
        doSearchConvPrevious();
        return;
    } else if (nextOpt()) {
        doSearchConvNext();
        return;
    } else if (args.length != 2) {
        usage();
        return;
    }
    mConvSearchConvId = id(args[0]);
    mConvSearchParams = new ZSearchParams(args[1]);
    //        [limit {limit}] [sortby {sortBy}] [types {types}]
    mConvSearchParams.setLimit(getOptLimit());
    SearchSortBy sortBy = searchSortByOpt();
    mConvSearchParams.setSortBy(sortBy != null ? sortBy : SearchSortBy.dateDesc);
    String types = typesOpt();
    mConvSearchParams.setTypes(types != null ? types : ZSearchParams.TYPE_CONVERSATION);
    mIndexToId.clear();
    //stdout.println(result);
    dumpConvSearch(mMbox.searchConversation(mConvSearchConvId, mConvSearchParams), verboseOpt());
}
Also used : ZSearchParams(com.zimbra.client.ZSearchParams) SearchSortBy(com.zimbra.soap.type.SearchSortBy)

Example 2 with SearchSortBy

use of com.zimbra.soap.type.SearchSortBy in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doSearch.

private void doSearch(String[] args) throws ServiceException {
    if (currrentOpt()) {
        doSearchRedisplay();
        return;
    } else if (previousOpt()) {
        doSearchPrevious();
        return;
    } else if (nextOpt()) {
        doSearchNext();
        return;
    } else if (args.length == 0) {
        usage();
        return;
    }
    mSearchParams = new ZSearchParams(args[0]);
    //        [limit {limit}] [sortby {sortBy}] [types {types}]
    mSearchParams.setLimit(getOptLimit());
    SearchSortBy sortBy = searchSortByOpt();
    mSearchParams.setSortBy(sortBy != null ? sortBy : SearchSortBy.dateDesc);
    String types = typesOpt();
    mSearchParams.setTypes(types != null ? types : ZSearchParams.TYPE_CONVERSATION);
    mSearchParams.setInDumpster(mCommandLine.hasOption(O_DUMPSTER.getLongOpt()));
    mIndexToId.clear();
    mSearchPage = 0;
    ZSearchPagerResult pager = mMbox.search(mSearchParams, mSearchPage, false, false);
    //stdout.println(result);
    dumpSearch(pager.getResult(), verboseOpt());
}
Also used : ZSearchPagerResult(com.zimbra.client.ZSearchPagerResult) ZSearchParams(com.zimbra.client.ZSearchParams) SearchSortBy(com.zimbra.soap.type.SearchSortBy)

Aggregations

ZSearchParams (com.zimbra.client.ZSearchParams)2 SearchSortBy (com.zimbra.soap.type.SearchSortBy)2 ZSearchPagerResult (com.zimbra.client.ZSearchPagerResult)1