Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.InvalidParameterException


    IPentahoStreamSource dataSource = null;

    // TODO Temp workaround for content repos bug
    IActionParameter actionParameter = paramManager.getCurrentInput( parameterName );
    if ( actionParameter == null ) {
      throw new InvalidParameterException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0019_INVALID_INPUT_REQUEST", parameterName, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }

    Object locObj = actionParameter.getValue();
    if ( locObj != null ) {
View Full Code Here


  }

  public void setOutputValue( final String name, final Object output ) {
    IActionParameter actionParameter = paramManager.getCurrentOutput( name );
    if ( actionParameter == null ) {
      throw new InvalidParameterException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0021_INVALID_OUTPUT_REQUEST", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }
    actionParameter.setValue( output );

    if ( output instanceof String ) {
View Full Code Here

  public InputStream getInputStream( final String parameterName ) {

    InputStream inputStream = null;
    IActionParameter inputParameter = getInputParameter( parameterName );
    if ( inputParameter == null ) {
      throw new InvalidParameterException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0019_INVALID_INPUT_REQUEST", parameterName, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }
    Object value = inputParameter.getValue();
    if ( value instanceof IContentItem ) {
      IContentItem contentItem = (IContentItem) value;
View Full Code Here

    Exception ex7 = new AuditException( "Ignored", ex ); //$NON-NLS-1$
    Exception ex8 = new AuditException( ex4 );
    ex = new ContentException( "Ignored" ); //$NON-NLS-1$
    ex = new ContentException( "Ignored", ex5 ); //$NON-NLS-1$
    ex = new ContentException( ex6 );
    ex = new InvalidParameterException();
    ex = new SQLResultSetException();
    ex = new PentahoChainedException();
    ex = new PentahoChainedException( "Ignored" ); //$NON-NLS-1$
    ex = new PentahoChainedException( "Ignored", ex7 ); //$NON-NLS-1$
    ex = new PentahoChainedException( ex8 );
View Full Code Here

      final ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
      final PluginClassLoader tempLoader = (PluginClassLoader) pm.getClassLoader(PLUGIN_ID);
      final IParameterProvider requestParams = getRequestParameters();
      OutputStream out = null;
      if( outputHandler == null ) {
        throw new InvalidParameterException( "SimpleContentGenerator.ERROR_0001_NO_OUTPUT_HANDLER" )//$NON-NLS-1$
      }

      String solutionName = null;
      if (requestParams != null){
        solutionName = requestParams.getStringParameter("solution", null); //$NON-NLS-1$
      }
      if (solutionName == null){
        solutionName = "NONE";
      }

      String filename = requestParams.getStringParameter("action", null);
      filename = filename == null ? "" : filename;
      DateFormat df = new SimpleDateFormat("yyyyMMdd-HHmmss");
      String date = df.format(new Date());
     
      filename = filename + date;
     
      String mimeType = "text/plain";

      ExporterResource ex = (ExporterResource) appContext.getBean("exporterBean");
      if (ex != null) {
        String solution = requestParams.getStringParameter("solution", null);
        String path = requestParams.getStringParameter("path", null);
        String action = requestParams.getStringParameter("action", null);
        String schedule = requestParams.getStringParameter("schedule", null);
       
       
        if (schedule != null) {
          return;
        }

        String file = (solution != null ? solution + "/" : "")
            + (path != null  ? (path + "/") : "")
            + (action != null ? action : "");

        //      String exportType = requestParams.getStringParameter("export", null);
        String exportType = "XLS";
        try {
          Thread.currentThread().setContextClassLoader(tempLoader);
          Response r = null;

          if (exportType == null || "XLS".equals(exportType.toUpperCase())) {
            r = ex.exportExcel(file, null, null);
            mimeType = "application/vnd.ms-excel";
            filename += ".xls";
           
          } else if ("CSV".equals(exportType.toUpperCase())) {
            r = ex.exportCsv(file, null, null);
            mimeType = "application/csv";
            filename += ".csv";
          }
          setInstanceId(filename);
         
          IContentItem contentItem = outputHandler.getOutputContentItem( "response", "content", solutionName, instanceId, mimeType ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          if( contentItem == null ) {
            error("SimpleContentGenerator.ERROR_0002_NO_CONTENT_ITEM"); //$NON-NLS-1$
            throw new InvalidParameterException("SimpleContentGenerator.ERROR_0002_NO_CONTENT_ITEM")//$NON-NLS-1$
          }

          contentItem.setName(filename);
//         
//          logger.error("item: " + itemName);
//          logger.error("instance: " + instanceId);
          out = contentItem.getOutputStream( itemName );
          if( out == null ) {
            error("SimpleContentGenerator.ERROR_0003_NO_OUTPUT_STREAM"); //$NON-NLS-1$
            throw new InvalidParameterException("SimpleContentGenerator.ERROR_0003_NO_OUTPUT_STREAM")//$NON-NLS-1$
          }
          if (r.getStatus() == 200) {
            out.write( ((byte[]) r.getEntity()));

            try {
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.InvalidParameterException

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.