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

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


  public Object getChild(final Object parent, final int index)
  {
    if (parent == getDataFactoryElement())
    {
      final CompoundDataFactory dataFactoryElement = getDataFactoryElement();
      return dataFactoryElement.getReference(index);
    }
    if (parent == reportEnvironmentDataRow)
    {
      final String[] columnNames = reportEnvironmentDataRow.getColumnNames();
      final String name = columnNames[index];
View Full Code Here


    {
      return reportEnvironmentDataRow.getColumnNames().length;
    }
    if (parent == getDataFactoryElement())
    {
      final CompoundDataFactory dataFactoryElement = getDataFactoryElement();
      return dataFactoryElement.size();
    }
    if (parent == reportFunctionNode)
    {
      return getExpressions().size();
    }
View Full Code Here

      return -1;
    }

    if (parent == getDataFactoryElement())
    {
      final CompoundDataFactory dataFactoryElement = getDataFactoryElement();
      for (int i = 0; i < dataFactoryElement.size(); i++)
      {
        final DataFactory dataFactory = dataFactoryElement.getReference(i);
        if (dataFactory == child)
        {
          return i;
        }
      }
View Full Code Here

  private void fixConfiguration(Section section, HashMap<String, String> openerp_settings, HashMap<String, String> postgres_settings, HashMap<String, ?> parameters) throws Exception {
    //If one of the datasources is an OpenERP datasource, reset the connection to the passed parameters
    if(section instanceof AbstractReportDefinition) {

      CompoundDataFactory factories = (CompoundDataFactory) ((AbstractReportDefinition) section).getDataFactory();
      for(int j = 0; j < factories.size(); j++) {
        DataFactory data_factory = factories.getReference(j);
        if(data_factory instanceof OpenERPDataFactory)
          fixOpenERPDataFactoryConfiguration((OpenERPDataFactory) data_factory, openerp_settings, parameters, section);
        else if(data_factory instanceof SQLReportDataFactory && postgres_settings != null) {
          String[] postgres_setting_names = {"host", "port", "db", "login", "password"};

          boolean custom_settings = false;
          for(String custom_setting_name : postgres_setting_names)
            custom_settings |= (postgres_settings.get(custom_setting_name) != null);

          if(custom_settings)
            factories.set(j, fixSQLDataFactoryConfiguration((SQLReportDataFactory) data_factory, postgres_settings));
        }
      }
    }

    //Go through all children and fix up their datasources too
View Full Code Here

TOP

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

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.