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

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


          stream.close();
        }
      }
      catch (final Exception e)
      {
        throw new ReportDataFactoryException("The Specified XMI File is invalid: " + xmiFile, e);
      }
    }
View Full Code Here


        final DataPreviewDialog previewDialog = new DataPreviewDialog(OpenERPDataSourceEditor.this);

        final OpenERPPreviewWorker worker = new OpenERPPreviewWorker(dataFactory, txtQueryName.getText());
        previewDialog.showData(worker);

        final ReportDataFactoryException factoryException = worker.getException();
        if (factoryException != null)
        {
          ExceptionDialog.showExceptionDialog(OpenERPDataSourceEditor.this, "Error",
              "An Error Occured during preview", factoryException);
        }
View Full Code Here

      throw new NullPointerException("Query is null."); //$NON-NLS-1$
    }
    final String realQuery = scriptingSupport.computeQuery(query, parameters);
    if (realQuery == null)
    {
      throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
    }

    return queryDataInternal(realQuery, parameters);
  }
View Full Code Here

      }

      final String realQuery = scriptingSupport.computeQuery(query, parameter);
      if (realQuery == null)
      {
        throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
      }

      String[] referencedFieldsInternal = getReferencedFieldsInternal(realQuery, parameter);
      if (referencedFieldsInternal == null)
      {
View Full Code Here

    try
    {
      final String realQuery = scriptingSupport.computeQuery(query, parameter);
      if (realQuery == null)
      {
        throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
      }

      Object queryHashInternal = getQueryHashInternal(realQuery, parameter);
      if (queryHashInternal == null)
      {
View Full Code Here


    final ScriptEngine maybeInvocableEngine = new ScriptEngineManager().getEngineByName(globalScriptLanguage);
    if (maybeInvocableEngine == null)
    {
      throw new ReportDataFactoryException(String.format
          ("DataFactoryScriptingSupport: Failed to locate scripting engine for language '%s'.", globalScriptLanguage));
    }
    if (maybeInvocableEngine instanceof Invocable == false)
    {
      return;
    }
    this.globalScriptEngine = (Invocable) maybeInvocableEngine;


    maybeInvocableEngine.setContext(globalScriptContext);
    try
    {
      maybeInvocableEngine.eval(globalScript);
    }
    catch (ScriptException e)
    {
      throw new ReportDataFactoryException("DataFactoryScriptingSupport: Failed to execute datafactory init script.", e);
    }
  }
View Full Code Here

        this.globalScriptEngine.invokeFunction("init", parameter);
      }
    }
    catch (ScriptException e)
    {
      throw new ReportDataFactoryException("DataFactoryScriptingSupport: Failed to invoke global init method.", e);
    }
    catch (NoSuchMethodException e)
    {
      // ignored ..
      logger.debug("Global script does not contain an 'init' function");
View Full Code Here

          new ScriptHelper(this.context, scriptLanguage, resourceManager, contextKey), ScriptContext.ENGINE_SCOPE);

      this.scriptEngine = new ScriptEngineManager().getEngineByName(scriptLanguage);
      if (scriptEngine instanceof Invocable == false)
      {
        throw new ReportDataFactoryException(String.format("Query script language '%s' is not usable.", scriptLanguage));
      }
      this.invocableEngine = (Invocable) scriptEngine;
      this.scriptEngine.setContext(this.context);
      try
      {
        this.scriptEngine.eval(script);
      }
      catch (ScriptException e)
      {
        throw new ReportDataFactoryException
            ("DataFactoryScriptingSupport: Failed to initialize local query script: " + queryName, e);
      }

      try
      {
        this.invocableEngine.invokeFunction("initQuery");
      }
      catch (ScriptException e)
      {
        throw new ReportDataFactoryException
            ("DataFactoryScriptingSupport: Failed to invoke local init method: " + queryName, e);
      }
      catch (NoSuchMethodException e)
      {
        // ignored ..
View Full Code Here

      {
        final Object computeQuery = this.invocableEngine.invokeFunction("computeQuery", query, queryName, parameter);
        final Object translated = convert(computeQuery);
        if (translated == null)
        {
          throw new ReportDataFactoryException("DataFactoryScriptingSupport: computeQuery method did not return a valid query.");
        }
        return String.valueOf(translated);
      }
      catch (ScriptException e)
      {
        throw new ReportDataFactoryException("DataFactoryScriptingSupport: Failed to invoke computeQuery method.", e);
      }
      catch (NoSuchMethodException e)
      {
        // ignored ..
        logger.debug("Query script does not contain an 'computeQuery' function");
View Full Code Here

        final Object computeQuery =
            this.invocableEngine.invokeFunction("postProcessResult", query, queryName, parameter, dataSet);
        final Object translated = convert(computeQuery);
        if (translated instanceof TableModel == false)
        {
          throw new ReportDataFactoryException("DataFactoryScriptingSupport: postProcessResult method did not return a valid query.");
        }
        return (TableModel) translated;
      }
      catch (ScriptException e)
      {
        throw new ReportDataFactoryException("DataFactoryScriptingSupport: Failed to invoke postProcessResult method.", e);
      }
      catch (NoSuchMethodException e)
      {
        // ignored ..
        logger.debug("Query script does not contain an 'postProcessResult' function");
View Full Code Here

TOP

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

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.