/** * This method reset the values of all filter criteria in UI * * @return EMPTY_STRING - empty string */ public String resetValue() { try { metricIdUI.setValue(EMPTY_STRING); metricNameUI.setValue(EMPTY_STRING); statusChoiceUI.setValue(0); delineatedPrivilegesChoiceUI.setValue(0); initialize(); if (checkForResetCount) { nextLinkUI.setDisabled(false); } OPPE_LOG.debug("METRICS.RESET_VALUES_DEBUG"); } catch (Exception exception) { OPPE_LOG.error("DATABASE_RETRIEVE_ERROR", exception); showGenericError(); } return EMPTY_STRING; }
/** * This method sets the filter criteria in OppeMetricsDTO * * @param oppeMetricsDto - instance of OppeMetricsDTO * @return oppeMetricsDto - instance of OppeMetricsDTO */ private OppeMetricsDTO setFilterCriteria(OppeMetricsDTO oppeMetricsDto) { if (checkMetricSearch && statusChoiceUI != null && metricIdUI != null && metricNameUI != null) { statusChoiceUI.setValue( statusChoiceUI.getValue() != null && (statusChoiceUI.getValue().toString().length() == 0 || statusChoiceUI.getValue().toString().equals(SELECT_ALL)) ? null : statusChoiceUI.getValue()); setdelPrivValue( getdelPrivValue() != null && (getdelPrivValue().toString().length() == 0 || getdelPrivValue().equals(SELECT_ALL)) ? null : getdelPrivValue()); metricIdUI.setValue( metricIdUI.getValue() != null && metricIdUI.getValue().toString().trim().length() == 0 ? null : metricIdUI.getValue()); metricNameUI.setValue( metricNameUI.getValue() != null && metricNameUI.getValue().toString().trim().length() == 0 ? null : metricNameUI.getValue()); if (statusChoiceUI.getValue() != null) { oppeMetricsDto.setStatusId(Long.valueOf(statusChoiceUI.getValue().toString())); } if (delPrivValue != null) { oppeMetricsDto.setDelineatedPrivilegeId(Long.valueOf(delPrivValue)); } if (metricIdUI.getValue() != null) { oppeMetricsDto.setMetricId( PERCENT + metricIdUI.getValue().toString().toUpperCase() + PERCENT); } if (metricNameUI.getValue() != null) { oppeMetricsDto.setMetricsName( PERCENT + metricNameUI.getValue().toString().toUpperCase() + PERCENT); } } oppeMetricsDto.setRangeBegin(rangeBegin); oppeMetricsDto.setRangeEnd(rangeEnd); oppeMetricsDto.setSortBy(getSortOrder()); oppeMetricsDto.setEvaluationType(getEvaluationTypeId()); oppeMetricsDto.setInstitutionId( Long.valueOf(getValueFromSessionParam(PARAMETER_INSTITUTION_ID).toString())); OPPE_LOG.debug("METRICS.SET_FILTER_CRITERIA_DEBUG"); return oppeMetricsDto; }
/** * This method is action listener for select privileges drop down * * @param valueChangeEvent - object of ValueChangeEvent */ public void selectPrivilegesListener(ValueChangeEvent valueChangeEvent) { try { String newValue = String.valueOf(valueChangeEvent.getNewValue()); if (categoryIdList.contains(newValue) && newValue != CAPMETRIC_LIST_DROPDOWN_SELECT) { RichSelectOneChoice privilegeSelectOneChoice = (RichSelectOneChoice) findComponentInRoot(DEL_PRIV_UICOMP); FacesMessage message = new FacesMessage(); message.setDetail(getValue("#{CommonResourceText['CATEGORY_NOT_CHOOSEN']}")); message.setSeverity(FacesMessage.SEVERITY_ERROR); // Reset resource area to default value FacesContext.getCurrentInstance() .addMessage( privilegeSelectOneChoice.getClientId(FacesContext.getCurrentInstance()), message); privilegeSelectOneChoice.setValue(0); privilegeSelectOneChoice.setValid(false); AdfFacesContext.getCurrentInstance().addPartialTarget(privilegeSelectOneChoice); } OPPE_LOG.debug("METRICS.VALUE_CHANE_EVENT_DEBUG"); } catch (Exception exception) { OPPE_LOG.error("DATABASE_RETRIEVE_ERROR", exception); showGenericError(); } }