Search in sources :

Example 16 with ParticipantPortalRegistrar

use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.

the class OpenRosaServices method mayProceedSubmission.

private boolean mayProceedSubmission(String studyOid, StudySubjectBean ssBean) throws Exception {
    boolean accessPermission = false;
    StudyBean study = getParentStudy(studyOid);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource);
    StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(), "participantPortal");
    participantPortalRegistrar = new ParticipantPortalRegistrar();
    // ACTIVE ,
    String pManageStatus = participantPortalRegistrar.getRegistrationStatus(studyOid).toString();
    // PENDING ,
    // INACTIVE
    // enabled , disabled
    String participateStatus = pStatus.getValue().toString();
    // available , pending , frozen , locked
    String studyStatus = study.getStatus().getName().toString();
    logger.info("pManageStatus: " + pManageStatus + "  participantStatus: " + participateStatus + "   studyStatus: " + studyStatus + "  studySubjectStatus: " + ssBean.getStatus().getName());
    if (participateStatus.equalsIgnoreCase("enabled") && studyStatus.equalsIgnoreCase("available") && pManageStatus.equalsIgnoreCase("ACTIVE") && ssBean.getStatus() == Status.AVAILABLE) {
        accessPermission = true;
    }
    return accessPermission;
}
Also used : ParticipantPortalRegistrar(org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar) StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO)

Example 17 with ParticipantPortalRegistrar

use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.

the class OpenRosaServices method mayProceedPreview.

private boolean mayProceedPreview(String studyOid) throws Exception {
    boolean accessPermission = false;
    StudyBean study = getParentStudy(studyOid);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource);
    StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(), "participantPortal");
    participantPortalRegistrar = new ParticipantPortalRegistrar();
    // ACTIVE ,
    String pManageStatus = participantPortalRegistrar.getRegistrationStatus(study.getOid()).toString();
    // PENDING ,
    // INACTIVE
    // enabled , disabled
    String participateStatus = pStatus.getValue().toString();
    // available , pending , frozen , locked
    String studyStatus = study.getStatus().getName().toString();
    logger.info("pManageStatus: " + pManageStatus + "  participantStatus: " + participateStatus + "   studyStatus: " + studyStatus);
    if (participateStatus.equalsIgnoreCase("enabled") && (studyStatus.equalsIgnoreCase("available") || studyStatus.equalsIgnoreCase("pending") || studyStatus.equalsIgnoreCase("frozen") || studyStatus.equalsIgnoreCase("locked")) && (pManageStatus.equalsIgnoreCase("ACTIVE") || pManageStatus.equalsIgnoreCase("PENDING") || pManageStatus.equalsIgnoreCase("INACTIVE"))) {
        accessPermission = true;
    }
    return accessPermission;
}
Also used : ParticipantPortalRegistrar(org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar) StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO)

Example 18 with ParticipantPortalRegistrar

use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.

the class AnonymousFormControllerV2 method mayProceed.

private boolean mayProceed(String studyOid) throws Exception {
    boolean accessPermission = false;
    StudyBean siteStudy = getStudy(studyOid);
    StudyBean study = getParentStudy(studyOid);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource);
    StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(), "participantPortal");
    participantPortalRegistrar = new ParticipantPortalRegistrar();
    // ACTIVE ,
    String pManageStatus = participantPortalRegistrar.getRegistrationStatus(study.getOid()).toString();
    // PENDING ,
    // INACTIVE
    // enabled , disabled
    String participateStatus = pStatus.getValue().toString();
    // available , pending , frozen , locked
    String studyStatus = study.getStatus().getName().toString();
    // available , pending , frozen , locked
    String siteStatus = siteStudy.getStatus().getName().toString();
    System.out.println("pManageStatus: " + pManageStatus + "  participantStatus: " + participateStatus + "   studyStatus: " + studyStatus + "   siteStatus: " + siteStatus);
    logger.info("pManageStatus: " + pManageStatus + "  participantStatus: " + participateStatus + "   studyStatus: " + studyStatus + "   siteStatus: " + siteStatus);
    if (participateStatus.equalsIgnoreCase("enabled") && studyStatus.equalsIgnoreCase("available") && siteStatus.equalsIgnoreCase("available") && pManageStatus.equalsIgnoreCase("ACTIVE")) {
        accessPermission = true;
    }
    return accessPermission;
}
Also used : ParticipantPortalRegistrar(org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar) StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO)

Example 19 with ParticipantPortalRegistrar

use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.

the class SecureController method baseUrl.

protected void baseUrl() throws MalformedURLException {
    String portalURL = CoreResources.getField("portalURL");
    URL pManageUrl = new URL(portalURL);
    ParticipantPortalRegistrar registrar = new ParticipantPortalRegistrar();
    Authorization pManageAuthorization = registrar.getAuthorization(currentStudy.getOid());
    String url = "";
    if (pManageAuthorization != null)
        url = pManageUrl.getProtocol() + "://" + pManageAuthorization.getStudy().getHost() + "." + pManageUrl.getHost() + ((pManageUrl.getPort() > 0) ? ":" + String.valueOf(pManageUrl.getPort()) : "");
    System.out.println("the url :  " + url);
    request.setAttribute("participantUrl", url + "/");
}
Also used : Authorization(org.akaza.openclinica.service.pmanage.Authorization) ParticipantPortalRegistrar(org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar) URL(java.net.URL)

Aggregations

ParticipantPortalRegistrar (org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar)19 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)12 StudyParameterValueBean (org.akaza.openclinica.bean.service.StudyParameterValueBean)9 StudyParameterValueDAO (org.akaza.openclinica.dao.service.StudyParameterValueDAO)9 URL (java.net.URL)4 Authorization (org.akaza.openclinica.service.pmanage.Authorization)4 MalformedURLException (java.net.MalformedURLException)3 ArrayList (java.util.ArrayList)3 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)3 StudyParameterValue (org.akaza.openclinica.domain.datamap.StudyParameterValue)3 HashMap (java.util.HashMap)2 MessagingException (javax.mail.MessagingException)2 UserAccountDAO (org.akaza.openclinica.dao.login.UserAccountDAO)2 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)2 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)2 Study (org.akaza.openclinica.domain.datamap.Study)2 OpenClinicaSystemException (org.akaza.openclinica.exception.OpenClinicaSystemException)2 RandomizationRegistrar (org.akaza.openclinica.service.pmanage.RandomizationRegistrar)2 SeRandomizationDTO (org.akaza.openclinica.service.pmanage.SeRandomizationDTO)2 MailException (org.springframework.mail.MailException)2