Search in sources :

Example 6 with ResultsWithTotal

use of com.serotonin.m2m2.db.dao.ResultsWithTotal in project ma-core-public by infiniteautomation.

the class EventInstanceDwr method dojoQuery.

/**
 * Load a list of VOs
 * @return
 */
@Override
@DwrPermission(user = true)
public ProcessResult dojoQuery(Map<String, String> query, List<SortOption> sort, Integer start, Integer count, boolean or) {
    ProcessResult response = new ProcessResult();
    // Set the Export Query (HACK, but will work for now for exporting)
    this.setExportQuery(query, sort, or);
    // TODO Use the Event Manager to access Current Events since the DO NOT LOG events are only in memory
    query.put("userId", Common.getHttpUser().getId() + "");
    ResultsWithTotal results = dao.dojoQuery(query, sort, start, count, or);
    response.addData("list", results.getResults());
    response.addData("total", results.getTotal());
    return response;
}
Also used : ResultsWithTotal(com.serotonin.m2m2.db.dao.ResultsWithTotal) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

ResultsWithTotal (com.serotonin.m2m2.db.dao.ResultsWithTotal)6 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)6 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)4 User (com.serotonin.m2m2.vo.User)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)2 DataSourceVO (com.serotonin.m2m2.vo.dataSource.DataSourceVO)2 LinkedHashMap (java.util.LinkedHashMap)2