/** * Updates values in InputElementAttributes to the given report parameter. * * @param elementAttrs the latest input element attributes * @param cachedElementAttrs the cached input element attributes * @param reportParam the report parameter * @param setHandle the ROM data set that has the corresponding data set parameter * @throws SemanticException */ protected void updateInputElementAttrsToReportParam( InputElementAttributes elementAttrs, InputElementAttributes cachedElementAttrs, AbstractScalarParameterHandle reportParam, OdaDataSetHandle setHandle) throws SemanticException { if (elementAttrs == null) return; // update default values. updateDefaultValueToReportParam(elementAttrs, cachedElementAttrs, reportParam); // update isOptional value Boolean isOptional = Boolean.valueOf(elementAttrs.isOptional()); Boolean cachedIsOptional = cachedElementAttrs == null ? null : Boolean.valueOf(cachedElementAttrs.isOptional()); if (!CompareUtil.isEquals(cachedIsOptional, isOptional)) setReportParamIsRequired(reportParam, ALLOW_BLANK_PROP_NAME, isOptional.booleanValue()); // update selection choices updateROMSelectionList( elementAttrs.getStaticValueChoices(), cachedElementAttrs == null ? null : cachedElementAttrs.getStaticValueChoices(), reportParam); // update dynamic list DynamicValuesQuery valueQuery = elementAttrs.getDynamicValueChoices(); AdapterUtil.updateROMDyanmicList( valueQuery, cachedElementAttrs == null ? null : cachedElementAttrs.getDynamicValueChoices(), reportParam, setHandle); // for dynamic parameter, the flag is in DynamicValuesQuery is true // for static parameter, the DynamicValuesQuery is null or the flag is // false DynamicValuesQuery cachedValueQuery = cachedElementAttrs == null ? null : cachedElementAttrs.getDynamicValueChoices(); boolean isEnabled = (valueQuery == null) ? false : valueQuery.isEnabled(); if (reportParam.getContainer() != null && reportParam.getContainer() instanceof CascadingParameterGroupHandle) isEnabled = true; if (cachedValueQuery == null || cachedValueQuery.isEnabled() != isEnabled) { if (isEnabled) reportParam.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC); else reportParam.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC); } }