use of org.akaza.openclinica.web.bean.EntityBeanTable in project OpenClinica by OpenClinica.
the class ApplyFilterServlet method getFilterTable.
private EntityBeanTable getFilterTable() {
FormProcessor fp = new FormProcessor(request);
FilterDAO fdao = new FilterDAO(sm.getDataSource());
EntityBeanTable table = fp.getEntityBeanTable();
ArrayList filters = new ArrayList();
if (ub.isSysAdmin()) {
filters = (ArrayList) fdao.findAllAdmin();
} else {
filters = (ArrayList) fdao.findAll();
}
// TODO make findAllByProject????
ArrayList filterRows = FilterRow.generateRowsFromBeans(filters);
String[] columns = { resword.getString("filter_name"), resword.getString("description"), resword.getString("created_by"), resword.getString("created_date"), resword.getString("status"), resword.getString("actions") };
table.setColumns(new ArrayList(Arrays.asList(columns)));
table.hideColumnLink(5);
table.setQuery("ApplyFilter", new HashMap());
table.setRows(filterRows);
table.computeDisplay();
return table;
}
use of org.akaza.openclinica.web.bean.EntityBeanTable in project OpenClinica by OpenClinica.
the class CreateDatasetServlet method getFilterTable.
private EntityBeanTable getFilterTable() {
FormProcessor fp = new FormProcessor(request);
FilterDAO fdao = new FilterDAO(sm.getDataSource());
EntityBeanTable table = fp.getEntityBeanTable();
ArrayList filters = (ArrayList) fdao.findAll();
ArrayList filterRows = FilterRow.generateRowsFromBeans(filters);
String[] columns = { resword.getString("filter_name"), resword.getString("description"), resword.getString("created_by"), resword.getString("created_date"), resword.getString("status"), resword.getString("actions") };
table.setColumns(new ArrayList(Arrays.asList(columns)));
table.hideColumnLink(5);
table.setQuery("ApplyFilter", new HashMap());
table.setRows(filterRows);
table.computeDisplay();
return table;
}
use of org.akaza.openclinica.web.bean.EntityBeanTable in project OpenClinica by OpenClinica.
the class RemoveFilterServlet method getFilterTable.
private EntityBeanTable getFilterTable() {
FormProcessor fp = new FormProcessor(request);
FilterDAO fdao = new FilterDAO(sm.getDataSource());
EntityBeanTable table = fp.getEntityBeanTable();
ArrayList filters = (ArrayList) fdao.findAll();
// TODO make findAllByProject
ArrayList filterRows = FilterRow.generateRowsFromBeans(filters);
String[] columns = { resword.getString("filter_name"), resword.getString("description"), resword.getString("created_by"), resword.getString("created_date"), resword.getString("status"), resword.getString("actions") };
table.setColumns(new ArrayList(Arrays.asList(columns)));
table.hideColumnLink(5);
table.setQuery("CreateFiltersOne", new HashMap());
table.setRows(filterRows);
table.computeDisplay();
return table;
}
use of org.akaza.openclinica.web.bean.EntityBeanTable in project OpenClinica by OpenClinica.
the class RemoveFilterServlet method processRequest.
@Override
public void processRequest() throws Exception {
FormProcessor fp = new FormProcessor(request);
int filterId = fp.getInt("filterId");
FilterDAO fDAO = new FilterDAO(sm.getDataSource());
FilterBean filter = (FilterBean) fDAO.findByPK(filterId);
String action = request.getParameter("action");
if (resword.getString("remove_this_filter").equalsIgnoreCase(action)) {
filter.setStatus(Status.DELETED);
fDAO.update(filter);
addPageMessage(respage.getString("filter_removed_admin_can_access_and_reverse"));
EntityBeanTable table = getFilterTable();
request.setAttribute("table", table);
forwardPage(Page.CREATE_FILTER_SCREEN_1);
} else if (resword.getString("cancel").equalsIgnoreCase(action)) {
EntityBeanTable table = getFilterTable();
request.setAttribute("table", table);
forwardPage(Page.CREATE_FILTER_SCREEN_1);
} else {
request.setAttribute("filter", filter);
forwardPage(Page.REMOVE_FILTER);
}
}
use of org.akaza.openclinica.web.bean.EntityBeanTable in project OpenClinica by OpenClinica.
the class FormProcessor method getEntityBeanTable.
public EntityBeanTable getEntityBeanTable() {
EntityBeanTable answer = new EntityBeanTable();
String sortingColumn = request.getParameter(EBL_SORT_COLUMN);
if (sortingColumn != null && !"".equals(sortingColumn)) {
answer.setSortingColumnExplicitlySet(true);
}
answer.setCurrPageNumber(getInt(EBL_PAGE));
answer.setSortingColumnInd(getInt(EBL_SORT_COLUMN));
answer.setKeywordFilter(getString(EBL_FILTER_KEYWORD));
// this code says that for each of the boolean properties of the table,
// if no value was speified on the form or in the GET query, then
// keep the default value for that bit
// otherwise, the bits will just be forced to false
String[] blnFields = { EBL_SORT_ORDER, EBL_FILTERED, EBL_PAGINATED };
for (int i = 0; i < blnFields.length; i++) {
String value = getString(blnFields[i]);
boolean b = getBoolean(blnFields[i]);
if (!"".equals(value)) {
if (i == 0) {
answer.setAscendingSort(b);
} else if (i == 1) {
answer.setFiltered(b);
} else {
answer.setPaginated(b);
}
}
}
return answer;
}
Aggregations