Search in sources :

Example 1 with EventCRFSDVFilter

use of org.akaza.openclinica.dao.EventCRFSDVFilter in project OpenClinica by OpenClinica.

the class SDVUtil method getEventCRFSDVFilter.

protected EventCRFSDVFilter getEventCRFSDVFilter(Limit limit, Integer studyId) {
    EventCRFSDVFilter eventCRFSDVFilter = new EventCRFSDVFilter(studyId);
    FilterSet filterSet = limit.getFilterSet();
    Collection<Filter> filters = filterSet.getFilters();
    for (Filter filter : filters) {
        String property = filter.getProperty();
        String value = filter.getValue();
        eventCRFSDVFilter.addFilter(property, value);
    }
    return eventCRFSDVFilter;
}
Also used : FilterSet(org.jmesa.limit.FilterSet) EventCRFSDVFilter(org.akaza.openclinica.dao.EventCRFSDVFilter) Filter(org.jmesa.limit.Filter) EventCRFSDVFilter(org.akaza.openclinica.dao.EventCRFSDVFilter)

Example 2 with EventCRFSDVFilter

use of org.akaza.openclinica.dao.EventCRFSDVFilter in project OpenClinica by OpenClinica.

the class SDVUtil method setDataAndLimitVariables.

public void setDataAndLimitVariables(TableFacade tableFacade, int studyId, HttpServletRequest request) {
    Limit limit = tableFacade.getLimit();
    EventCRFSDVFilter eventCRFSDVFilter = getEventCRFSDVFilter(limit, studyId);
    WebContext context = tableFacade.getWebContext();
    String restore = request.getAttribute(limit.getId() + "_restore") + "";
    if (!limit.isComplete()) {
        int totalRows = getTotalRowCount(eventCRFSDVFilter, studyId);
        tableFacade.setTotalRows(totalRows);
    } else if (restore != null && "true".equalsIgnoreCase(restore)) {
        int totalRows = getTotalRowCount(eventCRFSDVFilter, studyId);
        int pageNum = limit.getRowSelect().getPage();
        int maxRows = limit.getRowSelect().getMaxRows();
        tableFacade.setMaxRows(maxRows);
        tableFacade.setTotalRows(totalRows);
        limit.getRowSelect().setPage(pageNum);
    }
    EventCRFSDVSort eventCRFSDVSort = getEventCRFSDVSort(limit);
    int rowStart = limit.getRowSelect().getRowStart();
    int rowEnd = limit.getRowSelect().getRowEnd();
    // Collection<StudySubjectBean> items = getStudySubjectDAO().getWithFilterAndSort(getStudyBean(),
    // studySubjectSDVFilter, subjectSort, rowStart, rowEnd);
    Collection<SubjectSDVContainer> items = getFilteredItems(eventCRFSDVFilter, eventCRFSDVSort, rowStart, rowEnd, studyId, request);
    tableFacade.setItems(items);
/*
         * Limit limit = tableFacade.getLimit();
         * FilterSet filterSet = limit.getFilterSet();
         * int totalRows = getTotalRowCount(filterSet, studyId);
         * 
         * tableFacade.setTotalRows(totalRows);
         * SortSet sortSet = limit.getSortSet();
         * int rowStart = limit.getRowSelect().getRowStart();
         * int rowEnd = limit.getRowSelect().getRowEnd();
         * Collection<SubjectSDVContainer> items = getFilteredItems(filterSet, sortSet, rowStart, rowEnd, studyId,
         * request);
         * 
         * tableFacade.setItems(items);
         */
}
Also used : WebContext(org.jmesa.web.WebContext) EventCRFSDVSort(org.akaza.openclinica.dao.EventCRFSDVSort) Limit(org.jmesa.limit.Limit) EventCRFSDVFilter(org.akaza.openclinica.dao.EventCRFSDVFilter) SubjectSDVContainer(org.akaza.openclinica.controller.helper.table.SubjectSDVContainer)

Aggregations

EventCRFSDVFilter (org.akaza.openclinica.dao.EventCRFSDVFilter)2 SubjectSDVContainer (org.akaza.openclinica.controller.helper.table.SubjectSDVContainer)1 EventCRFSDVSort (org.akaza.openclinica.dao.EventCRFSDVSort)1 Filter (org.jmesa.limit.Filter)1 FilterSet (org.jmesa.limit.FilterSet)1 Limit (org.jmesa.limit.Limit)1 WebContext (org.jmesa.web.WebContext)1