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;
}
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);
}
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);
}
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();
}
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;
}
Aggregations