Search in sources :

Example 1 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 2 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 3 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 4 with AuditBean

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;
}
Also used : AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 5 with AuditBean

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;
}
Also used : AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Aggregations

AuditBean (org.akaza.openclinica.bean.admin.AuditBean)19 ArrayList (java.util.ArrayList)16 Iterator (java.util.Iterator)15 HashMap (java.util.HashMap)13 AuditDAO (org.akaza.openclinica.dao.admin.AuditDAO)3 Collection (java.util.Collection)2 List (java.util.List)2 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)2 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)2 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)2 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)2 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)2 SubjectBean (org.akaza.openclinica.bean.submit.SubjectBean)2 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)2 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)2 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)2 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)2 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)2 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)2 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)2