Examples of MQLAction


Examples of org.pentaho.actionsequence.dom.actions.MQLAction

          "ComponentBase.ERROR_0001_UNKNOWN_ACTION_TYPE", getActionDefinition().getElement().asXML() ) ); //$NON-NLS-1$
      result = false;
    } else if ( !initialize() ) {
      result = false;
    } else {
      MQLAction mqlAction = (MQLAction) getActionDefinition();
      IActionInput query = mqlAction.getQuery();
      result = ( query != ActionInputConstant.NULL_INPUT );
    }

    return result;
  }
View Full Code Here

Examples of org.pentaho.actionsequence.dom.actions.MQLAction

    // For backwards compatibility, call into the new metadata query component
    //

    MetadataQueryComponent component = new MetadataQueryComponent();
    // setup component
    MQLAction actionDefinition = (MQLAction) getActionDefinition();

    String mql = actionDefinition.getQuery().getStringValue();

    component.setQuery( mql );

    if ( actionDefinition.getMaxRows() != ActionInputConstant.NULL_INPUT ) {
      component.setMaxRows( actionDefinition.getMaxRows().getIntValue() );
    }

    if ( actionDefinition.getQueryTimeout() != ActionInputConstant.NULL_INPUT ) {
      component.setTimeout( actionDefinition.getQueryTimeout().getIntValue() );
    }

    if ( actionDefinition.getReadOnly() != ActionInputConstant.NULL_INPUT ) {
      component.setReadOnly( actionDefinition.getReadOnly().getBooleanValue() );
    }

    // log the sql to info if set
    if ( isDefinedInput( "logSql" ) ) { //$NON-NLS-1$
      component.setLogSql( "true".equals( actionDefinition.getInput( "logSql" ).getStringValue() ) ); //$NON-NLS-1$ //$NON-NLS-2$
    }

    // TODO: We also need to pass in the component definitions
    Set<String> inputNames = getInputNames();
    if ( inputNames != null ) {
      Map<String, Object> inputMap = new HashMap<String, Object>();
      for ( String inputName : inputNames ) {
        inputMap.put( ActionDefinitionEncoder.decodeBlankSpaces( inputName ), getInputValue( inputName ) );
      }
      component.setInputs( inputMap );
    }

    boolean success = component.execute();

    if ( success ) {
      IActionOutput actionOutput = actionDefinition.getOutputResultSet();
      if ( actionOutput != null ) {
        actionOutput.setValue( component.getResultSet() );
      }
    }
View Full Code Here

Examples of org.pentaho.actionsequence.dom.actions.MQLAction

    }

    IActionSequenceOutput outputStreamOutput = actionSequenceDocument.createOutput( "outputstream", CONTENT_TYPE ); //$NON-NLS-1$
    outputStreamOutput.addDestination( RESPONSE_OUTPUT_DESTINATION, "content" ); //$NON-NLS-1$

    MQLAction mqlAction = (MQLAction) actionSequenceDocument.addAction( MQLAction.class );
    mqlAction.setActionInputValue( "query", queryInput ); //$NON-NLS-1$

    // add inputs from parameterNameSet to this action
    for ( String parameterName : parameterNameSet ) {
      mqlAction.addInput( ActionDefinitionEncoder.encodeBlankSpaces( parameterName ), STRING_TYPE );
    }

    mqlAction.setOutputResultSet( "chartdata" ); //$NON-NLS-1$
    mqlAction.setComponentDefinition( "live", Boolean.TRUE.toString() ); //$NON-NLS-1$
    mqlAction.setComponentDefinition( "display-names", Boolean.FALSE.toString() ); //$NON-NLS-1$

    ActionDefinition pojoAction = (ActionDefinition) actionSequenceDocument.addAction( ActionDefinition.class );
    pojoAction.setComponentName( "ChartBeansComponent" ); //$NON-NLS-1$
    if ( contentLinkingTemplate != null ) {
      pojoAction.setComponentDefinition( "contentLinkingTemplate", contentLinkingTemplate );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.