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

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


                       final ParameterEntry[] entries) throws EvaluationException
  {
    try
    {
      final String parameter = PatternLinkCustomizer.computeParameter(formulaContext, filterEntries(entries));
      final StaticDataRow staticDataRow = new StaticDataRow
          (new String[]{"::path", "::parameter", "::config", "::entries",
              TAB_NAME_PARAMETER, TAB_ACTIVE_PARAMETER},
              new Object[]{reportPath, parameter, configIndicator, createEntryTable(entries),
                  computeMantleTabName(formulaContext, entries), computeMantleTabActive(formulaContext, entries)});
View Full Code Here


    {
      final ParameterEntry entry = parameterEntries[i];
      parameterNames[i] = entry.getParameterName();
      parameterValues[i] = entry.getParameterValue();
    }
    return new StaticDataRow(parameterNames, parameterValues);
  }
View Full Code Here

      return false;
    }

    // if we have a DataFactory and a query make sure that they are contained in cdf.
    final String queryName = reportDefinition.getQuery();
    if (cdf.isQueryExecutable(queryName, new StaticDataRow()) == false)
    {
      return false;
    }

    try
View Full Code Here

      {
        throw new NullPointerException();
      }
      this.globalAttributes = globalAttributes;
      this.entry = parameter;
      this.parameterContext = new DefaultParameterContext(new CompoundDataFactory(), new StaticDataRow(),
          ClassicEngineBoot.getInstance().getGlobalConfig(), null, null, null, reportEnvironment);
    }
View Full Code Here

    {
      final HashMap<StaticDataRow, Object> parameterCache = queryCache.get(query);
      if (parameterCache == null)
      {

        final StaticDataRow params = new StaticDataRow(parameters);
        final TableModel dataFromQuery = backend.queryData(query, params);
        if (dataFromQuery == null)
        {
          //final DefaultTableModel value = new DefaultTableModel();
          if (debugDataSources && CachingDataFactory.logger.isDebugEnabled())
          {
            CachingDataFactory.logger.debug("Query failed for query '" + query + '\'');
          }
          final HashMap<StaticDataRow, Object> paramsForQueryMap = new HashMap<StaticDataRow, Object>();
          queryCache.put(query, paramsForQueryMap);
          paramsForQueryMap.put(params, NULL_INDICATOR);
          return null;
        }
        else
        {
          if (debugDataSources && CachingDataFactory.logger.isDebugEnabled())
          {
            CachingDataFactory.printTableModelContents(dataFromQuery);
          }
          // totally new query here.
          final HashMap<StaticDataRow, Object> paramsForQueryMap = new HashMap<StaticDataRow, Object>();
          queryCache.put(query, paramsForQueryMap);
          paramsForQueryMap.put(params, dataFromQuery);
          return dataFromQuery;
        }
      }
      else
      {
        // Lookup the parameters ...
        final StaticDataRow params = new StaticDataRow(parameters);
        final Object dataObj = parameterCache.get(params);
        if (dataObj == NULL_INDICATOR)
        {
          // query is known to be null for the given parameters ...
          return null;
View Full Code Here

  private boolean isQueryExecutable(AbstractReportDefinition definition,
                                    final String query)
  {
    while (definition != null)
    {
      if (definition.getDataFactory().isQueryExecutable(query, new StaticDataRow()))
      {
        return true;
      }

      final Section parentSection = definition.getParentSection();
View Full Code Here

      else
      {
        if (FORMULA_VALUE_ROLE.equals(valueRole) && isFormulaFragment())
        {
          final GenericExpressionRuntime expressionRuntime = new GenericExpressionRuntime
              (new StaticDataRow(), new DefaultTableModel(), -1, new DefaultProcessingContext());
          final String formulaText = FormulaUtil.createEditorTextFromFormula
              (String.valueOf(value), new ReportFormulaContext(new DefaultFormulaContext(), expressionRuntime));
          textField.setText(formulaText);
          comboBox.setSelectedItem(formulaText);
        }
View Full Code Here

      resourceBundleFactory = new DefaultResourceBundleFactory();
      defaultEnvironment = new DefaultReportEnvironment(ClassicEngineBoot.getInstance().getGlobalConfig());
      defaultDocumentMetaData = new MemoryDocumentMetaData();

      final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow(defaultEnvironment);
      dataRow = new CompoundDataRow(envDataRow, new StaticDataRow());
    }
View Full Code Here

          {
            final ReportQueryNode queryNode = (ReportQueryNode) element;
            final DataFactory dataFactory = queryNode.getDataFactory().derive();
            final MasterReport report = activeContext.getContextRoot();
            dataFactory.initialize(new DesignTimeDataFactoryContext(report));
            if (dataFactory.isQueryExecutable(queryNode.getQueryName(), new StaticDataRow()) == false)
            {
              return;
            }

            final TableModel tableModel = dataFactory.queryData(queryNode.getQueryName(), new StaticDataRow());

            final TableDataFactory tableDataFactory = new TableDataFactory();
            tableDataFactory.addTable(queryNode.getQueryName(), createModel(tableModel));
            AddDataFactoryAction.addDataFactory(activeContext, tableDataFactory, new DataFactoryChange[0]);
          }
View Full Code Here

    dataFactory.setUsername("joe");
    dataFactory.setPassword("password");
    dataFactory.setQueryEntry("testQuery", new CdaQueryEntry("myQuery", "cdaId"));

    dataFactory.initialize(new DesignTimeDataFactoryContext());
    dataFactory.queryData("testQuery", new StaticDataRow());

    assertEquals("http://localhost:12345/testcase/content/cda/listParameters?outputType=xml&solution=testsolution&path=testpath&file=testcase.cda&dataAccessId=cdaId", simpleBackend.getParamUrl());
    assertEquals("http://localhost:12345/testcase/content/cda/doQuery?outputType=xml&solution=testsolution&path=testpath&file=testcase.cda&paramP4=A%3BB%3BC&dataAccessId=cdaId&paramP3=2010-12-30&paramP1=DefaultString&paramP2=10", simpleBackend.getUrl());
  }
View Full Code Here

TOP

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

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.