Package org.pentaho.platform.api.engine

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


      warn( Messages.getInstance().getErrorString( "RuntimeContext.ERROR_0023_INVALID_OUTPUT_STREAM", outputName ) ); //$NON-NLS-1$
      return null;
    }

    try {
      IContentOutputHandler output = PentahoSystem.getOutputDestinationFromContentRef( contentName, session );
      if ( output != null ) {
        // TODO get this info
        output.setInstanceId( instanceId );
        output.setSolutionPath( filePath );
        output.setMimeType( mimeType );
        output.setSession( session );
        IContentItem contentItem = output.getFileOutputContentItem();
        setOutputValue( outputName, contentItem );
        return contentItem;
      }
    } catch ( Exception e ) {
      //ignored
View Full Code Here


       */
      responseExpected = true;

      return outputContent;
    } else {
      IContentOutputHandler output = null;

      // this code allows us to stay backwards compatible
      if ( ( contentName != null ) && ( contentName.indexOf( ":" ) == -1 ) ) { //$NON-NLS-1$
        output = PentahoSystem.getOutputDestinationFromContentRef( objectName + ":" + contentName, session ); //$NON-NLS-1$
      } else {
        output = PentahoSystem.getOutputDestinationFromContentRef( contentName, session );
        if ( output == null ) {
          output = PentahoSystem.getOutputDestinationFromContentRef( objectName + ":" + contentName, session ); //$NON-NLS-1$
        }
      }
      if ( output != null ) {
        output.setInstanceId( instanceId );

        String filePath = "~/workspace/" + contentName; //$NON-NLS-1$
        if ( contentName.startsWith( "/" ) ) {
          filePath = contentName;
        }
        output.setSolutionPath( filePath );
        output.setMimeType( mimeType );
        output.setSession( session );
        return output.getFileOutputContentItem();
      }
    }
    return null;
  }
View Full Code Here

    }
    String key = outputName + "." + contentName; //$NON-NLS-1$
    if ( outputs.get( key ) != null ) {
      return outputs.get( key );
    } else {
      IContentOutputHandler output = PentahoSystem.getOutputDestinationFromContentRef( contentName, session );
      // If the output handler wasn't found with just the content name. Try to look it up with the output name as
      // well.
      // (This mirrors HttpOutputHandler's lookup logic)
      if ( output == null ) {
        output = PentahoSystem.getOutputDestinationFromContentRef( outputName + ":" + contentName, session ); //$NON-NLS-1$
      }
      if ( output != null ) {
        output.setInstanceId( instanceId );
        output.setMimeType( localMimeType );
        output.setContentRef( contentName );
        if ( contentName.indexOf( ":" ) != -1 ) {
          output.setSolutionPath( contentName.substring( contentName.indexOf( ":" ) + 1 ) );
        } else {
          output.setSolutionPath( null );
        }
        return output.getFileOutputContentItem();
      }
    }
    return null;
  }
View Full Code Here

          "PentahoSystem.ERROR_0029_OUTPUT_HANDLER_NOT_SPECIFIED", contentTag ) ); //$NON-NLS-1$
      return null;
    }
    String handlerId = contentTag.substring( 0, pos );
    String contentRef = contentTag.substring( pos + 1 );
    IContentOutputHandler output = PentahoSystem.get( IContentOutputHandler.class, handlerId, session );
    if ( output != null ) {
      output.setHandlerId( handlerId );
      output.setSession( session );
      output.setContentRef( contentRef );
    }
    return output;
  }
View Full Code Here

      } else {
        outputContentItem = new RepositoryFileContentItem( outputStream );
      }
      responseExpected = true;
    } else {
      IContentOutputHandler output = PentahoSystem.getOutputDestinationFromContentRef( contentName, session );
      // If the output handler wasn't found with just the content name. Try to look it up with the output name as
      // well.
      // (This mirrors HttpOutputHandler's lookup logic)
      if ( output == null ) {
        output = PentahoSystem.getOutputDestinationFromContentRef( outputName + ":" + contentName, session ); //$NON-NLS-1$
      }
      if ( output != null ) {
        output.setSession( PentahoSessionHolder.getSession() );
        output.setInstanceId( instanceId );
        String filePath = "~/workspace/" + contentName; //$NON-NLS-1$
        if ( contentName.startsWith( "/" ) ) {
          filePath = contentName;
        }
        output.setSolutionPath( filePath );
        output.setMimeType( localMimeType );
        outputContentItem = output.getFileOutputContentItem();
      }
    }
    return outputContentItem;
  }
View Full Code Here

TOP

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

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.