Search in sources :

Example 81 with UserAccountBean

use of org.akaza.openclinica.bean.login.UserAccountBean in project OpenClinica by OpenClinica.

the class UserAccountDAO method findByUserName.

public EntityBean findByUserName(String name) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), name);
    ArrayList alist = this.select(digester.getQuery("findByUserName"), variables);
    UserAccountBean eb = new UserAccountBean();
    Iterator it = alist.iterator();
    if (it.hasNext()) {
        eb = (UserAccountBean) this.getEntityFromHashMap((HashMap) it.next(), true);
    }
    return eb;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) Iterator(java.util.Iterator)

Example 82 with UserAccountBean

use of org.akaza.openclinica.bean.login.UserAccountBean in project OpenClinica by OpenClinica.

the class RuleSetAuditDAO method create.

public EntityBean create(EntityBean eb) throws OpenClinicaException {
    RuleSetBean ruleSetBean = (RuleSetBean) eb;
    UserAccountBean userAccount = new UserAccountBean();
    userAccount.setId(ruleSetBean.getUpdaterId());
    return create(eb, userAccount);
}
Also used : UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Example 83 with UserAccountBean

use of org.akaza.openclinica.bean.login.UserAccountBean in project OpenClinica by OpenClinica.

the class RuleSetRuleAuditDAO method create.

public EntityBean create(EntityBean eb) throws OpenClinicaException {
    RuleSetRuleBean ruleSetRuleBean = (RuleSetRuleBean) eb;
    UserAccountBean userAccount = new UserAccountBean();
    userAccount.setId(ruleSetRuleBean.getUpdaterId());
    return create(eb, userAccount);
}
Also used : RuleSetRuleBean(org.akaza.openclinica.bean.rule.RuleSetRuleBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean)

Example 84 with UserAccountBean

use of org.akaza.openclinica.bean.login.UserAccountBean in project OpenClinica by OpenClinica.

the class NotificationActionProcessor method runNotificationAction.

public void runNotificationAction(RuleActionBean ruleActionBean, RuleSetBean ruleSet, int studySubjectBeanId, int eventOrdinal) {
    String emailList = ((NotificationActionBean) ruleActionBean).getTo();
    String message = ((NotificationActionBean) ruleActionBean).getMessage();
    String emailSubject = ((NotificationActionBean) ruleActionBean).getSubject();
    int sed_Id = ruleSet.getStudyEventDefinitionId();
    int studyId = ruleSet.getStudyId();
    String eventName = getStudyEventDefnBean(sed_Id).getName();
    if (eventOrdinal != 1)
        eventName = eventName + "(" + eventOrdinal + ")";
    String studyName = getStudyBean(studyId).getName();
    if (message == null)
        message = "";
    if (emailSubject == null)
        emailSubject = "";
    message = message.replaceAll("\\$\\{event.name}", eventName);
    message = message.replaceAll("\\$\\{study.name}", studyName);
    emailSubject = emailSubject.replaceAll("\\$\\{event.name}", eventName);
    emailSubject = emailSubject.replaceAll("\\$\\{study.name}", studyName);
    ParticipantDTO pDTO = null;
    StudyBean studyBean = getStudyBean(studyId);
    String[] listOfEmails = emailList.split(",");
    StudySubjectBean ssBean = (StudySubjectBean) ssdao.findByPK(studySubjectBeanId);
    StudyBean parentStudyBean = getParentStudy(ds, studyBean);
    String pUserName = parentStudyBean.getOid() + "." + ssBean.getOid();
    UserAccountBean uBean = (UserAccountBean) udao.findByUserName(pUserName);
    StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(studyBean.getId(), "participantPortal");
    // enabled , disabled
    String participateStatus = pStatus.getValue().toString();
    Thread thread = new Thread(new NotificationActionProcessor(listOfEmails, uBean, studyBean, message, emailSubject, participantPortalRegistrar, mailSender, participateStatus));
    thread.start();
}
Also used : StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) ParticipantDTO(org.akaza.openclinica.bean.login.ParticipantDTO)

Example 85 with UserAccountBean

use of org.akaza.openclinica.bean.login.UserAccountBean in project OpenClinica by OpenClinica.

the class QuartzConfiguration method simpleTriggerFactoryBean.

@Bean
@Scope("prototype")
@Lazy
public SimpleTriggerFactoryBean simpleTriggerFactoryBean(String xslFile, String xmlFile, String endFilePath, String endFile, int datasetId, ExtractPropertyBean epBean, UserAccountBean userAccountBean, String locale, int cnt, String xsltPath) {
    SimpleTriggerFactoryBean triggerFactoryBean = new SimpleTriggerFactoryBean();
    triggerFactoryBean.setBeanName("trigger1");
    triggerFactoryBean.setGroup("group1");
    triggerFactoryBean.setRepeatInterval(1);
    triggerFactoryBean.setRepeatCount(0);
    //triggerFactoryBean.setStartTime(startDateTime);
    triggerFactoryBean.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW);
    // set job data map
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put(XSL_FILE_PATH, xslFile);
    jobDataMap.put(XML_FILE_PATH, endFilePath);
    jobDataMap.put(POST_FILE_PATH, endFilePath);
    jobDataMap.put(POST_FILE_NAME, endFile);
    jobDataMap.put(EXTRACT_PROPERTY, epBean.getId());
    jobDataMap.put(USER_ID, userAccountBean.getId());
    jobDataMap.put(STUDY_ID, userAccountBean.getActiveStudyId());
    jobDataMap.put(LOCALE, locale);
    jobDataMap.put(DATASET_ID, datasetId);
    jobDataMap.put(EMAIL, userAccountBean.getEmail());
    jobDataMap.put(ZIPPED, epBean.getZipFormat());
    jobDataMap.put(DELETE_OLD, epBean.getDeleteOld());
    jobDataMap.put(SUCCESS_MESSAGE, epBean.getSuccessMessage());
    jobDataMap.put(FAILURE_MESSAGE, epBean.getFailureMessage());
    jobDataMap.put(POST_PROC_DELETE_OLD, epBean.getPostProcDeleteOld());
    jobDataMap.put(POST_PROC_ZIP, epBean.getPostProcZip());
    jobDataMap.put(POST_PROC_LOCATION, epBean.getPostProcLocation());
    jobDataMap.put(POST_PROC_EXPORT_NAME, epBean.getPostProcExportName());
    jobDataMap.put(COUNT, cnt);
    jobDataMap.put(XSLT_PATH, xsltPath);
    // jobDataMap.put(DIRECTORY, directory);
    // jobDataMap.put(ExampleSpringJob.LOCALE, locale);
    jobDataMap.put(EP_BEAN, epBean);
    triggerFactoryBean.setJobDataMap(jobDataMap);
    return triggerFactoryBean;
}
Also used : JobDataMap(org.quartz.JobDataMap) SimpleTriggerFactoryBean(org.springframework.scheduling.quartz.SimpleTriggerFactoryBean) JobDetailFactoryBean(org.springframework.scheduling.quartz.JobDetailFactoryBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) SimpleTriggerFactoryBean(org.springframework.scheduling.quartz.SimpleTriggerFactoryBean) MethodInvokingJobDetailFactoryBean(org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean) ExtractPropertyBean(org.akaza.openclinica.bean.extract.ExtractPropertyBean) SchedulerFactoryBean(org.springframework.scheduling.quartz.SchedulerFactoryBean) CronTriggerFactoryBean(org.springframework.scheduling.quartz.CronTriggerFactoryBean)

Aggregations

UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)152 UserAccountDAO (org.akaza.openclinica.dao.login.UserAccountDAO)64 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)56 ArrayList (java.util.ArrayList)52 HashMap (java.util.HashMap)38 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)36 StudyUserRoleBean (org.akaza.openclinica.bean.login.StudyUserRoleBean)35 Date (java.util.Date)32 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)32 Locale (java.util.Locale)30 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)18 Iterator (java.util.Iterator)16 InsufficientPermissionException (org.akaza.openclinica.web.InsufficientPermissionException)16 ResponseEntity (org.springframework.http.ResponseEntity)16 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)15 Validator (org.akaza.openclinica.control.form.Validator)12 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 Role (org.akaza.openclinica.bean.core.Role)11 DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)10 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)10