Package org.pentaho.platform.api.engine

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


  // IRuntimeContext input and output methods

  public Object getInputParameterValue( final String name ) {
    Object value = null;
    IActionParameter actionParameter = paramManager.getCurrentInput( name );
    if ( actionParameter == null ) {
      // TODO need to know from the action definition if this is ok or not
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0019_INVALID_INPUT_REQUEST", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    } else {
      value = actionParameter.getValue();
    }
    return value;
  }
View Full Code Here


    return value;
  }

  public String getInputParameterStringValue( final String name ) {
    String value = null;
    IActionParameter actionParameter = paramManager.getCurrentInput( name );
    if ( actionParameter == null ) {
      // TODO need to know from the action definition if this is ok or not
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0019_INVALID_INPUT_REQUEST", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    } else {
      value = actionParameter.getStringValue();
    }
    return value;
  }
View Full Code Here

    return value;
  }

  // TODO Add to Param Manager - Need spcial case to grab loop param only from sequence inputs
  private IActionParameter getLoopParameter( final String name ) {
    IActionParameter actionParameter = paramManager.getLoopParameter( name );
    if ( actionParameter == null ) {
      // TODO need to know from the action definition if this is ok or not
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0020_INVALID_LOOP_PARAMETER", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }
View Full Code Here

    }
    return actionParameter;
  }

  public IActionParameter getInputParameter( final String name ) {
    IActionParameter actionParameter = paramManager.getCurrentInput( name );
    if ( actionParameter == null ) {
      // TODO need to know from the action definition if this is ok or not
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0019_INVALID_INPUT_REQUEST", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }
View Full Code Here

    }
    return actionParameter;
  }

  public IActionParameter getOutputParameter( final String name ) {
    IActionParameter actionParameter = paramManager.getCurrentOutput( name );
    if ( actionParameter == null ) {
      // TODO need to know from the action definition if this is ok or not
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0021_INVALID_OUTPUT_REQUEST", name, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
    }
View Full Code Here

  public void addTempParameter( final String name, final IActionParameter param ) {
    paramManager.addToCurrentInputs( name, param );
  }

  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 ) {
      runtimeData.setStringProperty( name, (String) output );
    } else if ( output instanceof Date ) {
      runtimeData.setDateProperty( name, (Date) output );
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;
      inputStream = contentItem.getInputStream();
    }
    return inputStream;
View Full Code Here

  public String setupQueryParameters( String query ) {
    Set inputNames = getInputNames();
    Iterator iter = inputNames.iterator();
    while ( iter.hasNext() ) {
      String inputName = (String) iter.next();
      final IActionParameter inputParameter = getInputParameter( inputName );
      final Object value = inputParameter.getValue();
      if ( ( value instanceof String ) == false ) {
        continue;
      }
      String paramValue = (String) value;
      String param = "\\{" + inputName + "\\}"; //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

          solutionEngine.execute( actionSeqPath, processId, false, true, instanceId, false, parameterProviders,
              outputHandler, null, null, messages );

      if ( listSource != null ) {
        if ( context.getOutputNames().contains( listSource ) ) {
          IActionParameter output = context.getOutputParameter( listSource );
          IPentahoResultSet results = output.getValueAsResultSet();
          if ( results != null ) {
            results = results.memoryCopy();
          }
          return results;
        } else {
          // this is an error
          return null;
        }
      } else {
        // return the first list that we find...
        Iterator it = context.getOutputNames().iterator();
        while ( it.hasNext() ) {
          IActionParameter output = (IActionParameter) it.next();
          if ( output.getType().equalsIgnoreCase( IActionParameter.TYPE_RESULT_SET ) ) {
            IPentahoResultSet results = output.getValueAsResultSet();
            if ( results != null ) {
              results = results.memoryCopy();
            }
            return results;
          }
View Full Code Here

      // noinspection unchecked
      final Map<String, IActionParameter> params =
          actionSequence.getInputDefinitionsForParameterProvider( IParameterProvider.SCOPE_REQUEST );
      for ( final Map.Entry<String, IActionParameter> entry : params.entrySet() ) {
        final String paramName = entry.getKey();
        final IActionParameter paramDef = entry.getValue();
        final String value = paramDef.getStringValue();
        final Class type;
        // yes, the actual type-code uses equals-ignore-case and thus allows the user
        // to specify type information in a random case. sTrInG is equal to STRING is equal to the value
        // defined as constant (string)
        if ( IActionParameter.TYPE_LIST.equalsIgnoreCase( paramDef.getType() ) ) {
          type = String[].class;
        } else {
          type = String.class;
        }
        final String label = paramDef.getSelectionDisplayName();

        final String[] values;
        if ( StringUtils.isEmpty( value ) ) {
          values = new String[0];
        } else {
View Full Code Here

TOP

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

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.