Package org.pentaho.platform.api.engine

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


      }
      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
View Full Code Here


           * contextual information, including the root cause. Allowing unchecked exceptions to pass through would
           * prevent valuable feedback in the log or response.
           */
        } catch ( Throwable ex ) {
          ActionDefinition actionDefinition = new ActionDefinition( (Element) actionDef.getNode(), null );
          throw new ActionValidationException( Messages.getInstance().getErrorString(
              "RuntimeContext.ERROR_0009_COULD_NOT_CREATE_COMPONENT", actionDef.getComponentName().trim() ), ex, //$NON-NLS-1$
              session.getName(), instanceId, getActionSequence().getSequenceName(), actionDefinition.getDescription(),
              actionDefinition.getComponentName() );
        }

        int validateResult = IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_OK;
        try {
          validateResult = component.validate();
          /*
           * We need to catch checked and unchecked exceptions here so we can create an ActionSequeceException with
           * contextual information, including the root cause. Allowing unchecked exceptions to pass through would
           * prevent valuable feedback in the log or response.
           */
        } catch ( Throwable t ) {
          throw new ActionValidationException( Messages.getInstance().getErrorString(
              "RuntimeContext.ERROR_0035_ACTION_VALIDATION_FAILED" ), t, //$NON-NLS-1$
              session.getName(), instanceId, getActionSequence().getSequenceName(), component.getActionDefinition() );
        }

        if ( validateResult != IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_OK ) {
          throw new ActionValidationException( Messages.getInstance().getErrorString(
              "RuntimeContext.ERROR_0035_ACTION_VALIDATION_FAILED" ), //$NON-NLS-1$
              session.getName(), instanceId, getActionSequence().getSequenceName(), component.getActionDefinition() );
        }

        paramManager.addOutputParameters( actionDef );
View Full Code Here

    List actionDefinitions = actionSequence.getActionDefinitionsAndSequences();
    if ( actionDefinitions == null ) {
      audit( MessageTypes.ACTION_SEQUENCE_FAILED, MessageTypes.VALIDATION, Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0011_NO_VALID_ACTIONS" ), 0 ); //$NON-NLS-1$
      status = IRuntimeContext.RUNTIME_STATUS_FAILURE;
      throw new ActionValidationException( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0011_NO_VALID_ACTIONS" ), //$NON-NLS-1$
          session.getName(), instanceId, getActionSequence().getSequenceName(), null );
    }

    setLoggingLevel( loggingLevel );
View Full Code Here

TOP

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

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.