use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.
the class EnketoUrlService method getRedirectUrl.
private String getRedirectUrl(String studySubjectOid, String studyOid) {
String portalURL = CoreResources.getField("portalURL");
String url = "";
if (portalURL != null && !portalURL.equals("")) {
ParticipantPortalRegistrar registrar = new ParticipantPortalRegistrar();
Authorization pManageAuthorization = registrar.getAuthorization(studyOid);
try {
URL pManageUrl = new URL(portalURL);
if (pManageAuthorization != null && pManageAuthorization.getStudy() != null && pManageAuthorization.getStudy().getHost() != null && !pManageAuthorization.getStudy().getHost().equals("")) {
url = pManageUrl.getProtocol() + "://" + pManageAuthorization.getStudy().getHost() + "." + pManageUrl.getHost() + ((pManageUrl.getPort() > 0) ? ":" + String.valueOf(pManageUrl.getPort()) : "");
}
} catch (MalformedURLException e) {
logger.error("Error building redirect URL: " + e.getMessage());
logger.error(ExceptionUtils.getStackTrace(e));
return "";
}
}
if (!url.equals(""))
url = url + "/#/event/" + studySubjectOid + "/dashboard";
return url;
}
use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.
the class ListStudySubjectTableFactory method viewParticipateBuilder.
private String viewParticipateBuilder(StudySubjectBean studySubject) throws Exception {
participantPortalRegistrar = new ParticipantPortalRegistrar();
StudyBean study = (StudyBean) studyDAO.findByPK(studySubject.getStudyId());
StudyBean pStudy = getParentStudy(study.getOid());
String url = participantPortalRegistrar.getStudyHost(pStudy.getOid());
HtmlBuilder actionLink = new HtmlBuilder();
// actionLink.a().href("url?id=" + studySubject.getId());
actionLink.a().href(url + "?ssid=" + URLEncoder.encode(studySubject.getLabel(), "UTF-8"));
actionLink.append("onMouseDown=\"javascript:setImage('bt_Participate1','images/bt_Ocui_d.gif');\"");
actionLink.append("onMouseUp=\"javascript:setImage('bt_Participate1','images/bt_Ocui.gif');\"").close();
actionLink.img().name("bt_Participate1").src("images/bt_Ocui.gif").border("0").alt(resword.getString("connect_participant")).title(resword.getString("connect_participant")).append("hspace=\"2\"").end().aEnd();
actionLink.append(" ");
return actionLink.toString();
}
use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.
the class ListStudySubjectTableFactory method pManageStatus.
private String pManageStatus(StudySubjectBean studySubjectBean) throws Exception {
participantPortalRegistrar = new ParticipantPortalRegistrar();
StudyBean study = (StudyBean) studyDAO.findByPK(studySubjectBean.getStudyId());
StudyBean pStudy = getParentStudy(study.getOid());
// ACTIVE
String pManageStatus = participantPortalRegistrar.getCachedRegistrationStatus(pStudy.getOid(), session).toString();
return pManageStatus;
}
use of org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar in project OpenClinica by OpenClinica.
the class EditFormController 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 EditFormController method getRedirectUrl.
private String getRedirectUrl(String studySubjectOid, String studyOid) {
String portalURL = CoreResources.getField("portalURL");
String url = "";
if (portalURL != null && !portalURL.equals("")) {
ParticipantPortalRegistrar registrar = new ParticipantPortalRegistrar();
Authorization pManageAuthorization = registrar.getAuthorization(studyOid);
try {
URL pManageUrl = new URL(portalURL);
if (pManageAuthorization != null && pManageAuthorization.getStudy() != null && pManageAuthorization.getStudy().getHost() != null && !pManageAuthorization.getStudy().getHost().equals("")) {
url = pManageUrl.getProtocol() + "://" + pManageAuthorization.getStudy().getHost() + "." + pManageUrl.getHost() + ((pManageUrl.getPort() > 0) ? ":" + String.valueOf(pManageUrl.getPort()) : "");
}
} catch (MalformedURLException e) {
logger.error("Error building redirect URL: " + e.getMessage());
logger.error(ExceptionUtils.getStackTrace(e));
return "";
}
}
if (!url.equals(""))
url = url + "/#/event/" + studySubjectOid + "/dashboard";
return url;
}
Aggregations