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;
}
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;
}
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;
}
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 + "/");
}
Aggregations