Examples of MdxQueryAction


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

  }

  @Override
  protected boolean validateAction() {
    boolean actionValidated = true;
    MdxQueryAction queryAction = null;
    MdxConnectionAction connAction = null;

    try {
      if ( getActionDefinition() instanceof MdxQueryAction ) {
        queryAction = (MdxQueryAction) getActionDefinition();
        actionValidated = isConnectionInfoSpecified( queryAction );

        if ( actionValidated ) {
          if ( queryAction.getQuery() == ActionInputConstant.NULL_INPUT ) {
            error( Messages.getInstance().getErrorString(
              "MDXBaseComponent.ERROR_0001_QUERY_NOT_SPECIFIED", getActionName() ) ); //$NON-NLS-1$
            actionValidated = false;
          }
        }

        if ( actionValidated ) {
          if ( ( queryAction.getOutputResultSet() == null ) && ( queryAction.getOutputPreparedStatement() == null ) ) {
            error( Messages.getInstance().getErrorString(
              "MDXBaseComponent.ERROR_0003_OUTPUT_NOT_SPECIFIED", getActionName() ) ); //$NON-NLS-1$
            actionValidated = false;
          }
        }
View Full Code Here

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

     *
     * In the query section you can either execute the query right away or prepare it to be used later by a sub report.
     */
    try {
      if ( getActionDefinition() instanceof MdxQueryAction ) {
        MdxQueryAction queryAction = (MdxQueryAction) getActionDefinition();
        // if there is a prepared component specified as an input, use its connection
        // instead of creating our own.
        if ( queryAction.getMdxConnection() != ActionInputConstant.NULL_INPUT ) {
          if ( queryAction.getMdxConnection().getValue() != null ) {
            connectionOwner = false;
            IPreparedComponent component = (IPreparedComponent) queryAction.getMdxConnection().getValue();
            IPentahoConnection conn = component.shareConnection();
            if ( conn.getDatasourceType() == IPentahoConnection.MDX_DATASOURCE ) {
              connection = conn;
            } else {
              error( Messages.getInstance().getErrorString(
                  "IPreparedComponent.ERROR_0001_INVALID_CONNECTION_TYPE", getActionName() ) ); //$NON-NLS-1$           
            }
          } else {
            error( Messages.getInstance().getErrorString(
                "IPreparedComponent.ERROR_0002_CONNECTION_NOT_AVAILABLE", getActionName() ) ); //$NON-NLS-1$
          }
        } else {
          dispose();
          connection = getDatasourceConnection();
        }

        if ( connection != null ) {
          String query = queryAction.getQuery().getStringValue();
          if ( queryAction.getOutputPreparedStatement() != null ) {
            // prepare the query for execution, but don't execute quite yet.
            prepareQuery( query );
            // set the output as self, which will be used later by another component.
            setOutputValue( IPreparedComponent.PREPARED_COMPONENT_NAME, this );
            value = true;
View Full Code Here

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

        }
        ( (MDXResultSet) resultSet ).setFormattedCellValues( formattedCellValues );
      }
      rSet = resultSet;
      if ( resultSet != null ) {
        MdxQueryAction mdxQueryAction = (MdxQueryAction) getActionDefinition();
        IActionOutput actionOutput = mdxQueryAction.getOutputResultSet();
        if ( actionOutput != null ) {
          actionOutput.setValue( resultSet );
        }
        return true;
      } else {
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.