/** * Creates a ODA InputParameterAttributes with the given ROM report parameter. * * @param inputParamAttrs * @param paramHandle the ROM report parameter. * @param dataSetDesign * @return the created <code>InputParameterAttributes</code>. */ protected InputParameterAttributes updateInputElementAttrs( InputParameterAttributes inputParamAttrs, AbstractScalarParameterHandle paramHandle, DataSetDesign dataSetDesign) { InputParameterAttributes retInputParamAttrs = inputParamAttrs; if (inputParamAttrs == null) retInputParamAttrs = designFactory.createInputParameterAttributes(); InputElementAttributes inputAttrs = retInputParamAttrs.getElementAttributes(); if (inputAttrs == null) inputAttrs = designFactory.createInputElementAttributes(); // update default values. updateDefaultStaticValues(inputAttrs, paramHandle); // inputAttrs.setOptional( paramHandle.allowBlank( ) ); inputAttrs.setOptional(getReportParamAllowMumble(paramHandle, ALLOW_BLANK_PROP_NAME)); ScalarValueChoices staticChoices = null; Iterator selectionList = paramHandle.choiceIterator(); while (selectionList.hasNext()) { if (staticChoices == null) staticChoices = designFactory.createScalarValueChoices(); SelectionChoiceHandle choice = (SelectionChoiceHandle) selectionList.next(); ScalarValueDefinition valueDefn = designFactory.createScalarValueDefinition(); valueDefn.setValue(choice.getValue()); String label = choice.getLabel(); String labelKey = choice.getLabelKey(); if (label != null || labelKey != null) { valueDefn.setDisplayName(label); valueDefn.setDisplayNameKey(labelKey); } staticChoices.getScalarValues().add(valueDefn); } inputAttrs.setStaticValueChoices(staticChoices); ExpressionHandle valueExpr = paramHandle.getExpressionProperty(IAbstractScalarParameterModel.VALUE_EXPR_PROP); ExpressionHandle labelExpr = paramHandle.getExpressionProperty(IAbstractScalarParameterModel.LABEL_EXPR_PROP); DynamicValuesQuery valueQuery = updateDynamicValueQuery( paramHandle.getDataSet(), valueExpr.getValue(), labelExpr.getValue(), dataSetDesign, DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC.equalsIgnoreCase( paramHandle.getValueType())); inputAttrs.setDynamicValueChoices(valueQuery); if (paramHandle.getContainer() instanceof ParameterGroupHandle) { ParameterGroupHandle groupHandle = (ParameterGroupHandle) paramHandle.getContainer(); InputParameterUIHints paramUiHints = designFactory.createInputParameterUIHints(); String text = groupHandle.getDisplayName(); String textKey = groupHandle.getDisplayNameKey(); if (text != null || textKey != null) { paramUiHints.setGroupPromptDisplayName(text); paramUiHints.setGroupPromptDisplayNameKey(textKey); } retInputParamAttrs.setUiHints(paramUiHints); } retInputParamAttrs.setElementAttributes(inputAttrs); return retInputParamAttrs; }