/** * */ public Object getParameterValue(String parameterName, boolean mustBeDeclared) throws JRScriptletException { JRFillParameter parameter = this.parametersMap.get(parameterName); if (parameter == null) { if (mustBeDeclared) { throw new JRScriptletException( EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND, new Object[]{parameterName}); } return ((Map<String,?>)this.parametersMap.get(JRParameter.REPORT_PARAMETERS_MAP).getValue()).get(parameterName); } return parameter.getValue(); }
@Override protected void customizedInit( Map<String, JRFillParameter> pars, Map<String, JRFillField> fldsm, Map<String, JRFillVariable> varsm ) throws JRException { try { interpreter.set("calculator", this); interpreter.set("fldsm", fldsm); interpreter.set("varsm", varsm); interpreter.set("parsm", pars); interpreter.eval("bshEvaluator = createBshEvaluator()"); interpreter.eval("bshEvaluator.init(calculator, parsm, fldsm, varsm)"); } catch(EvalError e) { throw new JRException( EXCEPTION_MESSAGE_KEY_INITIALIZING_REPORT_CALCULATOR, null, e); } }
/** * Return a fill parameter from the parameter map. * * @param parameterName the parameter name * @return the parameter * @deprecated {@link #getValueParameter(String) getValueParameter(String)} should be used instead */ protected JRFillParameter getParameter(String parameterName) { JRFillParameter parameter = (JRFillParameter) parametersMap.get(parameterName); if (parameter == null) { throw new JRRuntimeException( EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND, new Object[]{parameterName}); } return parameter; }
/** * */ public void setData( Map<String,JRFillParameter> parsm, Map<String,JRFillField> fldsm, Map<String,JRFillVariable> varsm, JRFillGroup[] grps ) { parametersMap = parsm; fieldsMap = fldsm; variablesMap = varsm; groups = grps; }
@Override protected void customizedInit( Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap ) throws JRException { evaluatorScope = new JavaScriptEvaluatorScope(jasperReportsContext, this, functionsUtil); evaluatorScope.init(parametersMap, fieldsMap, variablesMap); }
@Override protected void customizedInit( Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap ) throws JRException { evaluatorScope = new JavaScriptEvaluatorScope(jrContext, this, functionsUtil); evaluatorScope.init(parametersMap, fieldsMap, variablesMap); }
@Override public void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException { // NOP }
@Override public void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum resourceMissingType, boolean ignoreNPE) throws JRException { decorated.init(parametersMap, fieldsMap, variablesMap, resourceMissingType, ignoreNPE); for (BuiltinExpressionEvaluator builtinEvaluator : builtinEvaluators.values()) { builtinEvaluator.init(parametersMap, fieldsMap, variablesMap, resourceMissingType); } }
@Override public void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException { tableScriptletParam = parametersMap.get(TABLE_SCRIPTLET_NAME + JRScriptlet.SCRIPTLET_PARAMETER_NAME_SUFFIX); }
@Override public void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum resourceMissingType, boolean ignoreNPE) throws JRException { // NOP }
public ESQueryExecuter(JasperReportsContext jasperReportsContext, JRDataset dataset, Map<String, ? extends JRValueParameter> parameters, boolean directParameters) { super(jasperReportsContext, dataset, parameters); if(logger.isDebugEnabled() && parameters.get(JRFillParameter.JASPER_REPORT) != null) { JasperReport report = (JasperReport) parameters.get(JRFillParameter.JASPER_REPORT).getValue(); if ( report != null) { logger.debug("ESQueryExecuter for report: " + report.getName()); logger.debug("Report query: " + report.getQuery().getText()); } } if ( logger.isTraceEnabled() ) { for (String param: parameters.keySet()) { JRFillParameter paramVal = (JRFillParameter) parameters.get(param); logger.trace(" queryParam["+param+"]: " + paramVal.getValue()); } Map<String,String> jrCtx = jasperReportsContext.getProperties(); for ( String propName: jrCtx.keySet()) { logger.trace(" ctxParam["+propName+"]: " + jrCtx.get(propName)); } } logger.trace("Dataset Query: " + dataset.getQuery().getText()); this.directParameters = directParameters; this.reportParameters = parameters; this.parameters = new HashMap<String, Object>(); logger.debug("Started a query executer for ElasticSearch"); parseQuery(); }
@Override protected void customizedInit(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap) throws JRException { if (parametersMap!=null) { m_parameters.putAll(parametersMap); } if (fieldsMap!=null) { m_fields.putAll(fieldsMap); } if (variablesMap!=null) { m_variables.putAll(variablesMap); } }
public void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum whenResourceMissingType, boolean ignoreNPE) throws JRException { evaluator.init(parametersMap, null, variablesMap, whenResourceMissingType, ignoreNPE); }
public JSParameter(JRFillParameter parameter, ScriptableObject scope) { super(scope); this.parameter = parameter; }
void init(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum resourceMissingType) throws JRException;
@Override public void setData(Map<String, JRFillParameter> parsm, Map<String, JRFillField> fldsm, Map<String, JRFillVariable> varsm, JRFillGroup[] grps) { super.setData(parsm, fldsm, varsm, grps); reportParameters = new JasperReportParameters(this); }