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

Examples of org.pentaho.reporting.engine.classic.core.ParameterMapping


      report.setQueryLimit(dataDefinition.getQueryLimit());
      report.setQueryTimeout(dataDefinition.getQueryTimeout());
      final ParameterMapping[] inputMapping = dataDefinition.getImportParameters();
      for (int i = 0; i < inputMapping.length; i++)
      {
        final ParameterMapping mapping = inputMapping[i];
        report.addInputParameter(mapping.getName(), mapping.getAlias());
      }
      final ParameterMapping[] exportMapping = dataDefinition.getExportParameters();
      for (int i = 0; i < exportMapping.length; i++)
      {
        final ParameterMapping mapping = exportMapping[i];
        report.addExportParameter(mapping.getName(), mapping.getAlias());
      }

      final Expression[] expressions = dataDefinition.getExpressions();
      if (expressions != null)
      {
View Full Code Here


  public ParameterMapping[] getMappings()
  {
    final ArrayList<ParameterMapping> list = new ArrayList<ParameterMapping>(backend.size());
    for (int i = 0; i < backend.size(); i++)
    {
      final ParameterMapping mapping = backend.get(i);
      final String sourceColumn = mapping.getName();
      final String alias = mapping.getAlias();
      if (StringUtils.isEmpty(sourceColumn) == false)
      {
        if (StringUtils.isEmpty(alias))
        {
          list.add(new ParameterMapping(sourceColumn, sourceColumn));
        }
        else
        {
          list.add(new ParameterMapping(sourceColumn, alias));
        }
      }
    }

    return list.toArray(new ParameterMapping[list.size()]);
View Full Code Here

    fireTableDataChanged();
  }

  public void addRow()
  {
    backend.add(new ParameterMapping("", ""));
    fireTableDataChanged();
  }
View Full Code Here

   * @param columnIndex the column whose value is to be queried
   * @return the value Object at the specified cell
   */
  public Object getValueAt(final int rowIndex, final int columnIndex)
  {
    final ParameterMapping mapping = backend.get(rowIndex);
    switch (columnIndex)
    {
      case 0:
        return mapping.getName();
      case 1:
        return mapping.getAlias();
      default:
        throw new IndexOutOfBoundsException();
    }
  }
View Full Code Here

   * @param columnIndex column of cell
   */
  @Override
  public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex)
  {
    final ParameterMapping mapping = backend.get(rowIndex);
    switch (columnIndex)
    {
      case 0:
      {
        final String name;
        if (aValue == null)
        {
          name = "";
        }
        else
        {
          name = (String) aValue;
        }
        final String alias = mapping.getAlias();
        backend.set(rowIndex, new ParameterMapping(name, alias));
        fireTableCellUpdated(rowIndex, columnIndex);
        break;
      }
      case 1:
      {
        final String name = mapping.getName();
        final String alias;
        if (aValue == null)
        {
          alias = "";
        }
        else
        {
          alias = (String) aValue;
        }
        backend.set(rowIndex, new ParameterMapping(name, alias));
        fireTableCellUpdated(rowIndex, columnIndex);
        break;
      }
      default:
        throw new IndexOutOfBoundsException();
View Full Code Here

    {
      final SubReport report = (SubReport) element;
      final ParameterMapping[] parameterMappings = report.getInputMappings();
      for (int i = 0; i < parameterMappings.length; i++)
      {
        final ParameterMapping mapping = parameterMappings[i];
        if ("*".equals(mapping.getName()))
        {
          continue;
        }

        if (isValidField(mapping.getName(), columnNames) == false)
        {
          String message = Messages.getString("InvalidFieldReferenceInspection.SubReportInvalidField",
              report.getName(), mapping.getName());
          InspectionResult ir = new InspectionResult(this, Severity.WARNING, message, new LocationInfo(report));
          resultHandler.notifyInspectionResult(ir);
        }
      }
    }
View Full Code Here

  public ParameterMapping[] getMappings()
  {
    final ArrayList<ParameterMapping> list = new ArrayList<ParameterMapping>(backend.size());
    for (int i = 0; i < backend.size(); i++)
    {
      final ParameterMapping mapping = backend.get(i);
      final String sourceColumn = mapping.getName();
      final String alias = mapping.getAlias();
      if (StringUtils.isEmpty(sourceColumn) == false)
      {
        if (StringUtils.isEmpty(alias))
        {
          list.add(new ParameterMapping(sourceColumn, sourceColumn));
        }
        else
        {
          list.add(new ParameterMapping(sourceColumn, alias));
        }
      }
    }

    return list.toArray(new ParameterMapping[list.size()]);
View Full Code Here

    fireTableDataChanged();
  }

  public void addRow()
  {
    backend.add(new ParameterMapping("", ""));
    fireTableDataChanged();
  }
View Full Code Here

   * @param columnIndex the column whose value is to be queried
   * @return the value Object at the specified cell
   */
  public Object getValueAt(final int rowIndex, final int columnIndex)
  {
    final ParameterMapping mapping = backend.get(rowIndex);
    switch (columnIndex)
    {
      case 0:
        return mapping.getName();
      case 1:
        return mapping.getAlias();
      default:
        throw new IndexOutOfBoundsException();
    }
  }
View Full Code Here

   * @param rowIndex    row of cell
   * @param columnIndex column of cell
   */
  public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex)
  {
    final ParameterMapping mapping = backend.get(rowIndex);
    switch (columnIndex)
    {
      case 0:
      {
        final String name;
        if (aValue == null)
        {
          name = "";
        }
        else
        {
          name = (String) aValue;
        }
        final String alias = mapping.getAlias();
        backend.set(rowIndex, new ParameterMapping(name, alias));
        fireTableCellUpdated(rowIndex, columnIndex);
        break;
      }
      case 1:
      {
        final String name = mapping.getName();
        final String alias;
        if (aValue == null)
        {
          alias = "";
        }
        else
        {
          alias = (String) aValue;
        }
        backend.set(rowIndex, new ParameterMapping(name, alias));
        fireTableCellUpdated(rowIndex, columnIndex);
        break;
      }
      default:
        throw new IndexOutOfBoundsException();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.ParameterMapping

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.