use of org.akaza.openclinica.domain.rule.RuleSetRuleAuditBean in project OpenClinica by OpenClinica.
the class RuleSetRuleAuditDaoTest method testFindAllByRuleSet.
public void testFindAllByRuleSet() {
// RuleSetDao ruleSetDao = (RuleSetDao) getContext().getBean("ruleSetDao");
// RuleSetRuleAuditDao ruleSetRuleAuditDao = (RuleSetRuleAuditDao) getContext().getBean("ruleSetRuleAuditDao");
RuleSetBean ruleSet = ruleSetDao.findById(-1);
List<RuleSetRuleAuditBean> ruleSetRuleAudits = ruleSetRuleAuditDao.findAllByRuleSet(ruleSet);
assertNotNull("ruleSetAudits is null", ruleSetRuleAudits);
assertEquals("The size of the ruleSetRuleAudits is not 2", new Integer(2), Integer.valueOf(ruleSetRuleAudits.size()));
}
use of org.akaza.openclinica.domain.rule.RuleSetRuleAuditBean in project OpenClinica by OpenClinica.
the class UpdateRuleSetRuleServlet method createRuleSetRuleAuditBean.
private void createRuleSetRuleAuditBean(RuleSetRuleBean ruleSetRuleBean, UserAccountBean ub, Status status) {
RuleSetRuleAuditBean ruleSetRuleAuditBean = new RuleSetRuleAuditBean();
ruleSetRuleAuditBean.setRuleSetRuleBean(ruleSetRuleBean);
ruleSetRuleAuditBean.setUpdater(ub);
ruleSetRuleAuditBean.setStatus(status);
getRuleSetRuleAuditDao().saveOrUpdate(ruleSetRuleAuditBean);
}
use of org.akaza.openclinica.domain.rule.RuleSetRuleAuditBean in project OpenClinica by OpenClinica.
the class RemoveRuleSetServlet method createRuleSetRuleAuditBean.
private void createRuleSetRuleAuditBean(RuleSetRuleBean ruleSetRuleBean, UserAccountBean ub, Status status) {
RuleSetRuleAuditBean ruleSetRuleAuditBean = new RuleSetRuleAuditBean();
ruleSetRuleAuditBean.setRuleSetRuleBean(ruleSetRuleBean);
ruleSetRuleAuditBean.setUpdater(ub);
ruleSetRuleAuditBean.setStatus(status);
getRuleSetRuleAuditDao().saveOrUpdate(ruleSetRuleAuditBean);
}
use of org.akaza.openclinica.domain.rule.RuleSetRuleAuditBean in project OpenClinica by OpenClinica.
the class ViewRuleSetAuditServlet method processRequest.
@Override
public void processRequest() throws Exception {
String ruleSetId = request.getParameter(RULESET_ID);
if (ruleSetId == null) {
addPageMessage(respage.getString("please_choose_a_CRF_to_view"));
forwardPage(Page.CRF_LIST);
} else {
RuleSetBean ruleSetBean = getRuleSetService().getRuleSetById(currentStudy, ruleSetId);
List<RuleSetAuditBean> ruleSetAudits = getRuleSetAuditDao().findAllByRuleSet(ruleSetBean);
List<RuleSetRuleAuditBean> ruleSetRuleAudits = getRuleSetRuleAuditDao().findAllByRuleSet(ruleSetBean);
for (RuleSetRuleAuditBean ruleSetRuleAuditBean : ruleSetRuleAudits) {
ruleSetRuleAuditBean.setUpdater((UserAccountBean) getUserAccountDAO().findByPK(ruleSetRuleAuditBean.getUpdaterId()));
}
for (RuleSetAuditBean ruleSetAudit : ruleSetAudits) {
ruleSetAudit.setUpdater((UserAccountBean) getUserAccountDAO().findByPK(ruleSetAudit.getUpdaterId()));
}
request.setAttribute(RULESET, ruleSetBean);
request.setAttribute(RULESETAUDITS, ruleSetAudits);
request.setAttribute(RULESETRULEAUDITS, ruleSetRuleAudits);
forwardPage(Page.VIEW_RULESET_AUDITS);
}
}
use of org.akaza.openclinica.domain.rule.RuleSetRuleAuditBean in project OpenClinica by OpenClinica.
the class RuleSetRuleAuditDaoTest method testFindById.
public void testFindById() {
// RuleSetRuleAuditDao ruleSetRuleAuditDao = (RuleSetRuleAuditDao) getContext().getBean("ruleSetRuleAuditDao");
RuleSetRuleAuditBean ruleSetRuleAuditBean = ruleSetRuleAuditDao.findById(-1);
assertNotNull("ruleSetRuleAuditBean is null", ruleSetRuleAuditBean);
assertEquals("The ruleSetRuleAuditBean.getRuleSetRule.getId should be 3", new Integer(3), Integer.valueOf(ruleSetRuleAuditBean.getRuleSetRuleBean().getId()));
}
Aggregations