protected Map getMdbeansMap(List moduleDateBeans) { if ((moduleDateBeans == null) || (moduleDateBeans.size() == 0)) return null; Map mdbeansMap = new LinkedHashMap<Integer, ModuleDateBean>(); for (Iterator itr = moduleDateBeans.listIterator(); itr.hasNext(); ) { ModuleDateBean mdbean = (ModuleDateBean) itr.next(); mdbeansMap.put(mdbean.getModuleId(), mdbean); } return mdbeansMap; }
/** * Method that triggers when all modules are selected * * @param event ValueChangeEvent object * @throws AbortProcessingException */ public void selectAllModules(ValueChangeEvent event) throws AbortProcessingException { ModuleDateBean mdbean = null; selectAllFlag = true; int k = 0; if (selectedModIds == null) { selectedModIds = new ArrayList(); } if ((moduleDateBeans != null) && (moduleDateBeans.size() > 0)) { for (ListIterator i = moduleDateBeans.listIterator(); i.hasNext(); ) { mdbean = (ModuleDateBean) i.next(); mdbean.setSelected(true); selectedModIds.add(new Integer(mdbean.getModuleId())); } count = moduleDateBeans.size(); if (count == 1) selectedModId = mdbean.getModuleId(); moduleSelected = true; } return; }
/** * Method to expand or collapse individual modules' sections * * @return list_auth_modules */ public String showHideSections() { resetSelectedLists(); if (getExpandAllFlag() == true) { setShowModuleId(-1); setExpandAllFlag(false); } else { FacesContext ctx = FacesContext.getCurrentInstance(); UIViewRoot root = ctx.getViewRoot(); UIData table = (UIData) root.findComponent("listauthmodulesform").findComponent("table"); ModuleDateBean mdbean = (ModuleDateBean) table.getRowData(); if (getShowModuleId() != mdbean.getModuleId()) { setShowModuleId(mdbean.getModuleId()); } else { setShowModuleId(-1); setExpandAllFlag(false); } } saveModuleDates(); return "list_auth_modules"; }
public void specialAccessAction(ActionEvent evt) { resetSelectedLists(); if (!saveModuleDates()) return; FacesContext ctx = FacesContext.getCurrentInstance(); UIViewRoot root = ctx.getViewRoot(); UIData table = (UIData) root.findComponent("listauthmodulesform").findComponent("table"); ModuleDateBean mdbean = (ModuleDateBean) table.getRowData(); Integer selModId = mdbean.getModuleId(); try { ctx.getExternalContext().redirect("list_special_access.jsf?editmodid=" + selModId.toString()); } catch (Exception e) { return; } }
protected Map getSecObjMap(List moduleDateBeans) { if ((moduleDateBeans == null) || (moduleDateBeans.size() == 0)) return null; Map secobjMap = new LinkedHashMap<Integer, SecModObj>(); for (Iterator itr = moduleDateBeans.listIterator(); itr.hasNext(); ) { ModuleDateBean mdbean = (ModuleDateBean) itr.next(); List sectionBeans = mdbean.getSectionBeans(); if ((sectionBeans != null) && (sectionBeans.size() > 0)) { int moduleId = mdbean.getModuleId(); for (Iterator sItr = sectionBeans.listIterator(); sItr.hasNext(); ) { SectionBean secbean = (SectionBean) sItr.next(); secobjMap.put( secbean.getSection().getSectionId(), new SecModObj(moduleId, secbean, mdbean)); } } } return secobjMap; }