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());
}
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());
}
Aggregations