Package org.pentaho.reporting.engine.classic.core.util

Examples of org.pentaho.reporting.engine.classic.core.util.PropertyLookupParser


    {
      return resultSet;
    }

    // Parameter parser to replace parameters in strings
    final PropertyLookupParser parameterParser = new PropertyLookupParser()
    {
      private static final long serialVersionUID = -7264648195698966110L;

      @Override
      protected String lookupVariable(final String property)
      {
        return parameters.get(property).toString();
      }
    };

    // Replace parameterized filters with values from parameters
    if (configFilters != null)
    {
      for (final OpenERPFilterInfo filter : configFilters)
      {
        // You could have set a filter without using the Designer.  Then the filter could be any data type that should not be converted to a String.
        if (filter.getValue() instanceof String)
        {
          try
          {
            final String realFilterValue = filter.getValue().toString();

            // If you specify the filter on its own, try in get the object value
            // Not all parameter values are a string.  Could be an Object[] of ids for example in a multi-select parameter
            final Object filterValue;
            if (realFilterValue.length() >= 4
                && realFilterValue.substring(0, 2).equals("${")
                && realFilterValue.endsWith("}"))
            {

              final String parameterName = realFilterValue.substring(2, realFilterValue.length() - 1);
              filterValue = parameters.get(parameterName);
            }
            // Cater for cases where users specify compound filer: "name" "like" "some${post_fix}"
            else
            {
              filterValue = parameterParser.translateAndLookup(realFilterValue, parameters);
            }

            // If the value is null, this may be a dependent query and it is waiting for a parameter.
            // just return and wait
            if (filterValue == null)
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.PropertyLookupParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.