{
log.error("getParameterNames Exception", e);
throw new ProviderException(e.toString());
}
IGetParameterDefinitionTask task = engine
.createGetParameterDefinitionTask(design);
Collection<IParameterDefnBase> params = task.getParameterDefns(true);
ArrayList<ReportParameter> parameters = new ArrayList<ReportParameter>();
Iterator<IParameterDefnBase> iter = params.iterator();
// Iterate over all parameters
while (iter.hasNext())
{
IParameterDefnBase param = iter.next();
// Group section found
if (param instanceof IParameterGroupDefn)
{
// Get Group Name
IParameterGroupDefn group = (IParameterGroupDefn) param;
// Get the parameters within a group
Iterator<IScalarParameterDefn> i2 = group.getContents().iterator();
while (i2.hasNext())
{
IScalarParameterDefn scalar = i2.next();
ReportParameter rp = new ReportParameter();
rp.setClassName("java.lang.String");
rp.setDescription(scalar.getName());
rp.setName(scalar.getName());
rp.setType(ReportParameter.TEXT_PARAM);
parameters.add(rp);
}
}
else
{
// Parameters are not in a group
IScalarParameterDefn scalar = (IScalarParameterDefn) param;
ReportParameter rp = new ReportParameter();
rp.setClassName("java.lang.String");
rp.setDescription(scalar.getName());
rp.setName(scalar.getName());
rp.setType(ReportParameter.TEXT_PARAM);
parameters.add(rp);
}
}
task.close();
return parameters;
}