Package org.pentaho.platform.api.engine

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


  }

  class StreamOutputErrorCallback implements ValueSetErrorCallback {
    public void failedToSetValue( Object bean, String name, Object value, String destPropertyType, Throwable cause )
      throws ActionExecutionException {
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "ActionDelegate.ERROR_0008_FAILED_TO_SET_STREAM", name, OutputStream.class.getName(), //$NON-NLS-1$
          actionBean.getClass().getSimpleName(), destPropertyType ), cause );
    }
View Full Code Here


    }

    public Object getValue( String name ) throws Exception {
      // fail early if we cannot handle stream outputs
      if ( !streamingCheckPerformed && !( actionBean instanceof IStreamingAction ) ) {
        throw new ActionExecutionException( Messages.getInstance().getErrorString(
            "ActionDelegate.ERROR_0002_ACTION_CANNOT_ACCEPT_STREAM", //$NON-NLS-1$
            name, actionBean.getClass().getSimpleName() ) );
      }
      streamingCheckPerformed = true;

      String mimeType = ( (IStreamingAction) actionBean ).getMimeType( name );
      if ( StringUtils.isEmpty( mimeType ) ) {
        throw new ActionValidationException( Messages.getInstance().getErrorString(
            "ActionDelegate.ERROR_0001_MIMETYPE_NOT_DECLARED" ) ); //$NON-NLS-1$
      }

      IContentItem contentItem = null;

      //
      // If the output is mapped publicly and has a destination associated with it, then we will be asking
      // the current IOuputHandler to create an IContentItem (OuputStream) for us. Otherwise, we will asking the
      // IContentOutputHandler impl registered to handle content destined for "contentrepo" to create
      // an IContentItem (OutputStream) for us.
      //
      if ( hasPublicDestination( curActionOutput ) ) {
        // most output handlers will manage multiple destinations for us and hand us back a MultiContentItem
        contentItem = getRuntimeContext().getOutputContentItem( curActionOutput.getPublicName(), mimeType );
      } else {
        String extension = MimeHelper.getExtension( mimeType );
        if ( extension == null ) {
          extension = ".bin"; //$NON-NLS-1$
        }
        contentItem = getRuntimeContext().getOutputItem( curActionOutput.getName(), mimeType, extension );
      }

      if ( contentItem == null ) {
        // this is the best I can do here to point users to a tangible problem without unwrapping code in
        // RuntimeEngine
        // - AP
        throw new ActionValidationException( Messages.getInstance().getErrorString(
            "ActionDelegate.ERROR_0003_OUTPUT_STREAM_NOT_AVAILABLE_1", //$NON-NLS-1$
            curActionOutput.getPublicName() ) );
      }

      // this will be a MultiOutputStream in the case where there is more than one destination for the content
      // output
      OutputStream contentOutputStream = contentItem.getOutputStream( getActionName() );
      if ( contentOutputStream == null ) {
        throw new ActionExecutionException( Messages.getInstance().getErrorString(
            "ActionDelegate.ERROR_0004_OUTPUT_STREAM_NOT_AVAILABLE_2", //$NON-NLS-1$
            actionBean.getClass().getSimpleName() ) );
      }

      // save this for later when we set the action outputs
View Full Code Here

  class ResourceCallback implements ValueSetErrorCallback {
    public void failedToSetValue( Object bean, String name, Object value, String destPropertyType, Throwable cause )
      throws ActionExecutionException {
      String className = ( value != null ) ? value.getClass().getName() : "ClassNameNotAvailable"; //$NON-NLS-1$
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "ActionDelegate.ERROR_0006_FAILED_TO_SET_RESOURCE", //$NON-NLS-1$
          name, className, actionBean.getClass().getSimpleName(), destPropertyType ), cause );
    }
View Full Code Here

    }

    public void failedToSetValue( Object bean, String name, Object value, String destPropertyType, Throwable cause )
      throws ActionExecutionException {
      String className = ( value != null ) ? value.getClass().getName() : "ClassNameNotAvailable"; //$NON-NLS-1$
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "ActionDelegate.ERROR_0005_FAILED_TO_SET_INPUT", //$NON-NLS-1$
          name, className, actionBean.getClass().getSimpleName(), destPropertyType ), cause );
    }
View Full Code Here

    // to the first record. This is to resolve multiple levels of looping on resultset.
    if ( loopSet.isScrollable() ) {
      loopSet.beforeFirst();
    }
    if ( peekOnly && !( loopSet instanceof IPeekable ) ) {
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0033_NOT_PEEKABLE" ), //$NON-NLS-1$
          session.getName(), instanceId, getActionSequence().getSequenceName(), null );
    }
    Object[] row = peekOnly ? ( (IPeekable) loopSet ).peek() : loopSet.next();
    Object[][] headerSet = loopSet.getMetaData().getColumnHeaders();
View Full Code Here

          return;
        }
      } catch ( Exception ex ) {
        currentComponent = ""; //$NON-NLS-1$
        status = IRuntimeContext.RUNTIME_STATUS_FAILURE;
        throw new ActionExecutionException( Messages.getInstance().getErrorString(
            "RuntimeContext.ERROR_0032_CONDITIONAL_EXECUTION_FAILED" ), ex, //$NON-NLS-1$
            session.getName(), instanceId, getActionSequence().getSequenceName(), null );

      }
    }
View Full Code Here

       * pass through without a wrapping exception.
       */
    } catch ( Throwable e ) {
      status = IRuntimeContext.RUNTIME_STATUS_FAILURE;
      audit( MessageTypes.COMPONENT_EXECUTE_FAILED, MessageTypes.FAILED, e.getLocalizedMessage(), 0 );
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0017_COMPONENT_EXECUTE_FAILED" ), e, //$NON-NLS-1$
          session.getName(), instanceId, getActionSequence().getSequenceName(), actionDefinition.getComponent()
              .getActionDefinition() );
    }

    if ( status != IRuntimeContext.RUNTIME_STATUS_SUCCESS ) {
      throw new ActionExecutionException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0017_COMPONENT_EXECUTE_FAILED" ), //$NON-NLS-1$
          session.getName(), instanceId, getActionSequence().getSequenceName(), actionDefinition.getComponent()
              .getActionDefinition() );
    }
  }
View Full Code Here

TOP

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

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.