Search in sources :

Example 1 with ListParameter

use of org.pentaho.reporting.engine.classic.core.parameters.ListParameter in project head by mifos.

the class PentahoParamParser method parseParam.

private AbstractPentahoParameter parseParam(ParameterDefinitionEntry paramDefEntry, ParameterContext paramContext, Map<String, AbstractPentahoParameter> selectedValues, boolean update) throws ReportDataFactoryException {
    AbstractPentahoParameter result = null;
    if (paramDefEntry instanceof PlainParameter) {
        result = parsePlainParameter((PlainParameter) paramDefEntry);
    } else if (paramDefEntry instanceof ListParameter) {
        result = parseListParameter((ListParameter) paramDefEntry, paramContext, selectedValues, update);
    } else {
        return null;
    }
    result.setMandatory(paramDefEntry.isMandatory());
    result.setParamName(paramDefEntry.getName());
    if (null != paramDefEntry.getParameterAttribute(paramDefEntry.getParameterAttributeNamespaces()[0], "label", paramContext)) {
        result.setLabelName(paramDefEntry.getParameterAttribute(paramDefEntry.getParameterAttributeNamespaces()[0], "label", paramContext).replace(":", ""));
    } else {
        result.setLabelName(paramDefEntry.getName());
    }
    return result;
}
Also used : AbstractPentahoParameter(org.mifos.reports.pentaho.params.AbstractPentahoParameter) DefaultListParameter(org.pentaho.reporting.engine.classic.core.parameters.DefaultListParameter) ListParameter(org.pentaho.reporting.engine.classic.core.parameters.ListParameter) PlainParameter(org.pentaho.reporting.engine.classic.core.parameters.PlainParameter)

Aggregations

AbstractPentahoParameter (org.mifos.reports.pentaho.params.AbstractPentahoParameter)1 DefaultListParameter (org.pentaho.reporting.engine.classic.core.parameters.DefaultListParameter)1 ListParameter (org.pentaho.reporting.engine.classic.core.parameters.ListParameter)1 PlainParameter (org.pentaho.reporting.engine.classic.core.parameters.PlainParameter)1