use of org.akaza.openclinica.dao.login.UserAccountDAO in project OpenClinica by OpenClinica.
the class TechAdminServlet method processRequest.
/*
* (non-Javadoc)
*
* @see org.akaza.openclinica.control.core.SecureController#processRequest()
*/
@Override
protected void processRequest() throws Exception {
// find last 5 modifed studies
StudyDAO sdao = new StudyDAO(sm.getDataSource());
// ArrayList studies = (ArrayList) sdao.findAllByLimit(true);
// request.setAttribute("studies", studies);
ArrayList allStudies = (ArrayList) sdao.findAll();
// request.setAttribute("allStudyNumber", new
// Integer(allStudies.size()));
UserAccountDAO udao = new UserAccountDAO(sm.getDataSource());
// ArrayList users = (ArrayList) udao.findAllByLimit(true);
// request.setAttribute("users", users);
ArrayList allUsers = (ArrayList) udao.findAll();
// request.setAttribute("allUserNumber", new Integer(allUsers.size()));
SubjectDAO subdao = new SubjectDAO(sm.getDataSource());
// ArrayList subjects = (ArrayList) subdao.findAllByLimit(true);
// request.setAttribute("subjects", subjects);
ArrayList allSubjects = (ArrayList) subdao.findAll();
// request.setAttribute("allSubjectNumber", new
// Integer(allSubjects.size()));
CRFDAO cdao = new CRFDAO(sm.getDataSource());
// ArrayList crfs = (ArrayList) cdao.findAllByLimit(true);
// request.setAttribute("crfs", subjects);
ArrayList allCrfs = (ArrayList) cdao.findAll();
// request.setAttribute("allCrfNumber", new Integer(allCrfs.size()));
resetPanel();
panel.setStudyInfoShown(false);
panel.setOrderedData(true);
setToPanel(resword.getString("in_the_application"), "");
if (allSubjects.size() > 0) {
setToPanel(resword.getString("subjects"), new Integer(allSubjects.size()).toString());
}
if (allUsers.size() > 0) {
setToPanel(resword.getString("users"), new Integer(allUsers.size()).toString());
}
if (allStudies.size() > 0) {
setToPanel(resword.getString("studies"), new Integer(allStudies.size()).toString());
}
if (allCrfs.size() > 0) {
setToPanel(resword.getString("CRFs"), new Integer(allCrfs.size()).toString());
}
forwardPage(Page.TECH_ADMIN_SYSTEM);
}
use of org.akaza.openclinica.dao.login.UserAccountDAO in project OpenClinica by OpenClinica.
the class AccountController method getUserAccount.
private UserAccountBean getUserAccount(String userName) {
udao = new UserAccountDAO(dataSource);
UserAccountBean userAccountBean = (UserAccountBean) udao.findByUserName(userName);
return userAccountBean;
}
use of org.akaza.openclinica.dao.login.UserAccountDAO in project OpenClinica by OpenClinica.
the class AccountController method getAccount3.
/**
* @api {get} /pages/accounts/study/:studyOid/studysubject/:studySubjectId Retrieve a user account - participant
* @apiName getAccount3
* @apiPermission Module participate - enabled & admin
* @apiVersion 3.8.0
* @apiParam {String} studyOid Study Oid.
* @apiParam {String} studySubjectId Study Subject Id .
* @apiGroup User Account
* @apiDescription Retrieves the participant user account with the given studySubjectId and studyOid
* @apiParamExample {json} Request-Example:
* {
* "studyOid": " S_BL101",
* "studySubjectId": "Sub100"
* }
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "lName": "",
* "mobile": "JTaa7WGRdH5dGs42XyTrgA==",
* "accessCode": "5s02UFpiMBijWuzaxSOojg==",
* "password": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
* "email": "XzJadh3l3V7uUoPCggbSoIfoNW8IQU3qsvrtHfJH7J0=",
* "userName": "S_BL101.SS_SUB100",
* "studySubjectId": null,
* "fName": "pdyGCN1CdAKIGOUEERz/yQ=="
* }
*/
@RequestMapping(value = "/study/{studyOid}/studysubject/{studySubjectId}", method = RequestMethod.GET)
public ResponseEntity<UserDTO> getAccount3(@PathVariable("studyOid") String studyOid, @PathVariable("studySubjectId") String studySubjectId) throws Exception {
ResourceBundleProvider.updateLocale(new Locale("en_US"));
uDTO = null;
System.out.println("I'm in getAccount3");
StudyBean parentStudy = getParentStudy(studyOid);
String oid = parentStudy.getOid();
StudySubjectBean studySubjectBean = getStudySubject(studySubjectId, parentStudy);
if (isStudyASiteLevelStudy(studyOid))
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.NOT_ACCEPTABLE);
if (!mayProceed(oid, studySubjectBean))
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.NOT_ACCEPTABLE);
if (isStudyDoesNotExist(oid))
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.NOT_ACCEPTABLE);
if (isStudySubjectDoesNotExist(studySubjectBean))
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.NOT_ACCEPTABLE);
// build UserName
HashMap<String, String> mapValues = buildParticipantUserName(studySubjectBean);
// Participant User Name
String pUserName = mapValues.get("pUserName");
udao = new UserAccountDAO(dataSource);
UserAccountBean userAccountBean = (UserAccountBean) udao.findByUserName(pUserName);
if (!userAccountBean.isActive()) {
uDTO = new UserDTO();
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.OK);
} else {
buildUserDTO(userAccountBean);
return new ResponseEntity<UserDTO>(uDTO, org.springframework.http.HttpStatus.OK);
}
}
use of org.akaza.openclinica.dao.login.UserAccountDAO in project OpenClinica by OpenClinica.
the class AccountController method getAccessCodeAccount.
private UserAccountBean getAccessCodeAccount(String accessCode) {
udao = new UserAccountDAO(dataSource);
UserAccountBean userAccountBean = (UserAccountBean) udao.findByAccessCode(accessCode);
return userAccountBean;
}
use of org.akaza.openclinica.dao.login.UserAccountDAO in project OpenClinica by OpenClinica.
the class AccountController method getUserAccountByStudy.
private ArrayList<UserAccountBean> getUserAccountByStudy(String userName, ArrayList allStudies) {
udao = new UserAccountDAO(dataSource);
ArrayList<UserAccountBean> userAccountBeans = udao.findStudyByUser(userName, allStudies);
return userAccountBeans;
}
Aggregations