use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method findAll.
/*
* Find All Audit Beans
*
* @see org.akaza.openclinica.dao.core.DAOInterface#findAll()
*/
public Collection findAll() {
this.setTypesExpected();
ArrayList alist = this.select(digester.getQuery("findAll"));
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method findStudySubjectAuditEvents.
/*
* Find audit log events for a study subject
*
*/
public Collection findStudySubjectAuditEvents(int studySubjectId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studySubjectId));
String sql = digester.getQuery("findStudySubjectAuditEvents");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method findStudyEventAuditEvents.
/*
* Find audit log events type for an Study Event
*
*/
public Collection findStudyEventAuditEvents(int studyEventId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studyEventId));
String sql = digester.getQuery("findStudyEventAuditEvents");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method getEntityFromHashMap.
/**
* <p>
* getEntityFromHashMap, the method that gets the object from the database
* query.
*/
public Object getEntityFromHashMap(HashMap hm) {
AuditBean eb = new AuditBean();
// AUDIT_ID AUDIT_DATE AUDIT_TABLE USER_ID ENTITY_ID
// REASON_FOR_CHANGE
eb.setId(((Integer) hm.get("audit_id")).intValue());
eb.setAuditDate((java.util.Date) hm.get("audit_date"));
eb.setAuditTable((String) hm.get("audit_table"));
eb.setUserId(((Integer) hm.get("user_id")).intValue());
eb.setEntityId(((Integer) hm.get("entity_id")).intValue());
eb.setEntityName((String) hm.get("entity_name"));
eb.setReasonForChange((String) hm.get("reason_for_change"));
if (eb.getAuditTable().equalsIgnoreCase("item_data")) {
eb.setOldValue(convertedItemDataValue((String) hm.get("old_value"), this.locale));
eb.setNewValue(convertedItemDataValue((String) hm.get("new_value"), this.locale));
} else {
eb.setOldValue((String) hm.get("old_value"));
eb.setNewValue((String) hm.get("new_value"));
}
eb.setEventCRFId(((Integer) hm.get("event_crf_id")).intValue());
eb.setAuditEventTypeId(((Integer) hm.get("audit_log_event_type_id")).intValue());
eb.setUserName((String) hm.get("user_name"));
eb.setAuditEventTypeName((String) hm.get("name"));
return eb;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method getEntityFromHashMapWithItemDataType.
public Object getEntityFromHashMapWithItemDataType(HashMap hm) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap(hm);
eb.setItemDataTypeId((Integer) hm.get("item_data_type_id"));
return eb;
}
Aggregations