protected void onBtnSearchClick() throws PresentationLogicException { AppUserVo appuser = new AppUserVo(); appuser.setUsername(form.txtSrhUserName().getValue()); if (form.chkActiveOnly().getValue() == true) appuser.setIsActive(Boolean.TRUE); if (form.chkLocked().getValue() == true) appuser.setLocked(Boolean.TRUE); populateAppUserGrid(domain.listAppUsers(appuser)); form.btnUpdate().setVisible(false); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.getContextMenus().getGenericGridReplaceItem().setVisible(false); }
public AppUserVo getAppUser(AppUserRefVo appUserRefVo) { if (appUserRefVo == null || appUserRefVo.getID_AppUserIsNotNull()) throw new CodingRuntimeException("Cannot get AppUserVo for null AppUserRefVo"); DomainFactory factory = getDomainFactory(); AppUser doAppUser = (AppUser) factory.getDomainObject(AppUser.class, appUserRefVo.getID_AppUser().intValue()); return AppUserVoAssembler.create(doAppUser); }
public AppUserShortVoCollection listUsers() { // Make a call to the Admin ApplicationUser list // Active only AppUserVo filter = new AppUserVo(); filter.setIsActive(new Boolean(true)); ApplicationUsers userAdmin = (ApplicationUsers)getDomainImpl(ApplicationUsersImpl.class); return userAdmin.listAppUsers(filter); }
protected void onBtnSearchClick() throws PresentationLogicException { AppUserVo appuser = new AppUserVo(); appuser.setUsername(form.txtSrhUserName().getValue()); if (form.chkActiveOnly().getValue() == true) appuser.setIsActive(Boolean.TRUE); populateAppUserGrid(domain.listAppUsers(appuser)); form.btnUpdate().setEnabled(false); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); }
protected void onBtnNewClick() throws PresentationLogicException { form.setMode(FormMode.EDIT); form.getLocalContext().setAppUserVo(new AppUserVo()); clearScreen(); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.btnUpdate().setEnabled(false); form.chkIsActive().setValue(true); form.timEffectiveFrm().setValue(new Time("00:00")); form.timEffectiveTo().setValue(new Time("00:00")); form.timPwdExp().setValue(new Time("00:00")); form.chkUseExternalAuthentication().setValue(false); updateControlsState(); }
private void setRolesAssigned(AppUserVo voAppUser) { for (int i = 0; i < form.grdRoles().getRows().size(); i++) { GenForm.grdRolesRow row = form.grdRoles().getRows().get(i); row.setAssigned(isRoleAssigned(row.getValue(), voAppUser.getRoles())); } }
protected void onGrdAppUsersSelectionChanged() throws PresentationLogicException { form.btnUpdate().setEnabled(true); if (form.grdAppUsers().getValue() != null) { AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue()); form.getGlobalContext().Admin.ApplicationUsers.setSelectedUser(user); // wdev-9034 - External Authentication, get date values from Hearts if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue() && ConfigFlag.DOM.EXTERNAL_AUTHENTICATION.getValue()) { try { UserDTOVo dtoUser = domain.getDtoAppUserByName(user.getUsername()); if (dtoUser != null) { user.setPwdExpDate(new DateTime(dtoUser.getPasswordExpiryDate())); user.setEffectiveFrom(dtoUser.getEffectiveFrom()); user.setEffectiveTo(dtoUser.getEffectiveTo()); } } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); } } form.getLocalContext().setAppUserVo(user); displayRecord(user); form.getContextMenus().getGenericGridUpdateItem().setVisible(true); } updateControlsState(); }
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException { if (menuItemID == GenForm.ContextMenus.GenericGrid.Add) { form.setMode(FormMode.EDIT); form.getLocalContext().setAppUserVo(new AppUserVo()); clearScreen(); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.btnUpdate().setEnabled(false); form.chkIsActive().setValue(true); form.timEffectiveFrm().setValue(new Time("00:00")); form.timEffectiveTo().setValue(new Time("00:00")); form.timPwdExp().setValue(new Time("00:00")); } else if (menuItemID == GenForm.ContextMenus.GenericGrid.Update) { onBtnUpdateClick(); } else if (menuItemID == GenForm.ContextMenus.GenericGrid.Remove) { AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue()); form.getLocalContext().setAppUserVo(user); form.setMode(FormMode.EDIT); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.btnUpdate().setEnabled(false); } }
public void setLoggedInRsno(int userId) { DomainFactory factory = this.getDomainFactory(); AppUser appusr = (AppUser)factory.getDomainObject(AppUser.class, userId); AppUserVo appuserVo = AppUserVoAssembler.create(appusr); String rsnoId = ""; if (appuserVo.getMosIsNotNull()) { if (appuserVo.getMos().getCodeMappingsIsNotNull()) { for (int i=0; i < appuserVo.getMos().getCodeMappings().size();i++) { TaxonomyMap taxmapVo = appuserVo.getMos().getCodeMappings().get(i); if (taxmapVo.getTaxonomyNameIsNotNull() && taxmapVo.getTaxonomyName().equals(TaxonomyType.PAS)) { rsnoId = taxmapVo.getTaxonomyCode(); break; } } CcoContextReader.setLoggedInRsno(rsnoId, ctx); } } }
public IAppUser saveLDAPCredentials(IAppUser user, String username, String password) throws StaleObjectException { DomainFactory factory = getDomainFactory(); AppUser domUser = (AppUser)factory.getDomainObject(AppUser.class, user.getUserId()); domUser.setLDAPUsername(username); domUser.setLDAPPassword(Configuration.encryptPasswordWithCloak(password)); factory.save(domUser); AppUserVo fullUser = AppUserVoAssembler.create(domUser); user = fullUser; factory.getDomainSession().setUser(user); return user; }
public AppUserVo getAppUser(AppUserRefVo appUserRef) { if (appUserRef != null) { AppUser user = (AppUser) getDomainFactory().getDomainObject(AppUser.class,appUserRef.getID_AppUser()); AppUserVo voUser = AppUserVoAssembler.create(user); return voUser; } return null; }
public void setLoggedInRsno(int userId) { DomainFactory factory = this.getDomainFactory(); AppUser appusr = (AppUser)factory.getDomainObject(AppUser.class, userId); AppUserVo appuserVo = AppUserVoAssembler.create(appusr); String rsnoId = ""; if (appuserVo.getMosIsNotNull()) { if (appuserVo.getMos().getCodeMappingsIsNotNull()) { for (int i=0; i < appuserVo.getMos().getCodeMappings().size();i++) { TaxonomyMap taxmapVo = appuserVo.getMos().getCodeMappings().get(i); if (taxmapVo.getTaxonomyNameIsNotNull() && taxmapVo.getTaxonomyName().equals(TaxonomyType.PAS)) { rsnoId = taxmapVo.getTaxonomyCode(); break; } } ContextReader.setLoggedInRsno(rsnoId, ctx); } } }
private void checkForDefaultDictionary() { AppUserVo appuser = new AppUserVo(); AppUserShortVo currentUser = new AppUserShortVo(); HcpLiteVo hcpUser = (HcpLiteVo)domain.getHcpLiteUser(); if (hcpUser != null) { appuser.setUsername(hcpUser.getIHcpName()); AppUserShortVoCollection coll = domain.listAppUsers(appuser); if(coll != null && coll.size() > 0) { currentUser = coll.get(0); UserDictionaryVoCollection dictionaryColl = domain.listUserDictionary(currentUser); UserDictionaryVo dictionary = null; if (dictionaryColl != null && dictionaryColl.size() > 0) { dictionary = dictionaryColl.get(0); GlobalDictionaryVoCollection globalsColl = domain.listGlobalDictionary(currentUser); renderDictionaryDynamicGrid(dictionary,globalsColl); } } } else { engine.showMessage("Current loggin user don't have setup an user dictionary\nDo you want to setup an User Dictionary now?","Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION); } }
protected void onBtnNewClick() throws PresentationLogicException { form.setMode(FormMode.EDIT); form.getLocalContext().setAppUserVo(new AppUserVo()); clearScreen(); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.getContextMenus().getGenericGridReplaceItem().setVisible(false); form.chkIsActive().setValue(true); form.timEffectiveFrm().setValue(new Time("00:00")); form.timEffectiveTo().setValue(new Time("00:00")); form.timPwdExp().setValue(new Time("00:00")); form.chkUseExternalAuthentication().setValue(false); updateControlsState(); }
protected void onGrdAppUsersSelectionChanged() throws PresentationLogicException { if (form.grdAppUsers().getValue() != null) { AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue()); form.getGlobalContext().Admin.ApplicationUsers.setSelectedUser(user); // wdev-9034 - External Authentication, get date values from Hearts if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue() && ConfigFlag.DOM.EXTERNAL_AUTHENTICATION.getValue()) { try { UserDTOVo dtoUser = domain.getDtoAppUserByName(user.getUsername()); if (dtoUser != null) { user.setPwdExpDate(new DateTime(dtoUser.getPasswordExpiryDate())); user.setEffectiveFrom(dtoUser.getEffectiveFrom()); user.setEffectiveTo(dtoUser.getEffectiveTo()); } } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); } } form.getLocalContext().setAppUserVo(user); displayRecord(user); form.getContextMenus().getGenericGridUpdateItem().setVisible(true); form.getContextMenus().getGenericGridReplaceItem().setText("Unlock Account"); form.getContextMenus().getGenericGridReplaceItem().setVisible(user.isLocked() ? true: false); } updateControlsState(); }
public IAppUser lockAccount(IAppUser user, boolean value) throws Exception { DomainFactory factory = getDomainFactory(); AppUser domUser = (AppUser)factory.getDomainObject(AppUser.class, user.getUserId()); domUser.setLocked(Boolean.valueOf(value)); factory.save(domUser); AppUserVo fulluser = AppUserVoAssembler.create(domUser); user = fulluser; return user; }
public AppUserVo updateAppUser(AppUserVo appUser) throws StaleObjectException { DomainFactory factory = getDomainFactory(); AppUser domUser = AppUserVoAssembler.extractAppUser(factory, appUser); factory.save(domUser); return AppUserVoAssembler.create(domUser); }