Package org.pentaho.platform.util.web

Examples of org.pentaho.platform.util.web.SimpleUrlFactory


  public void testComponent1() {
    startTest();
    // This should succeed
    String url = "http://www.pentaho.org/demo/news.html"; //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    ArrayList messages = new ArrayList();
    HtmlComponent component = new HtmlComponent( HtmlComponent.TYPE_URL, url, "", urlFactory, messages ); //$NON-NLS-1$
    StandaloneSession session =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$
    try {
View Full Code Here


  public void testComponent2() {
    startTest();
    info( Messages.getInstance().getString( "HTMLComponentTest.USER_ERRORS_EXPECTED_CONTENT_TYPE_INVALID" ) ); //$NON-NLS-1$
    // this should fail because the requested content type is not supported
    String url = "http://www.pentaho.org/demo/news.html"; //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    ArrayList messages = new ArrayList();
    HtmlComponent component = new HtmlComponent( HtmlComponent.TYPE_URL, url, "", urlFactory, messages ); //$NON-NLS-1$
    component.setLoggingLevel( getLoggingLevel() );
    OutputStream outputStream = getOutputStream( "HTMLComponentTest.testComponent2", ".html" ); //$NON-NLS-1$//$NON-NLS-2$
    String contentType = "text/xml"; //$NON-NLS-1$
View Full Code Here

  public void testComponent3() {
    startTest();
    info( Messages.getInstance().getString( "HTMLComponentTest.USER_ERRORS_EXPECTED_URL_INVALID" ) ); //$NON-NLS-1$
    // this should fail because the url is bad
    String url = "xttp://a"; //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    ArrayList messages = new ArrayList();
    HtmlComponent component =
        new HtmlComponent( HtmlComponent.TYPE_URL, url, Messages.getInstance().getString(
          "HTML.ERROR_0001_NOT_AVAILABLE" ), urlFactory, messages ); //$NON-NLS-1$
    component.setLoggingLevel( getLoggingLevel() );
View Full Code Here

        HttpOutputHandler outputHandler = createOutputHandler( response, outputStream );
        outputHandler.setSession( userSession );

        IMimeTypeListener listener = new HttpMimeTypeListener( request, response, fileName );
        outputHandler.setMimeTypeListener( listener );
        SimpleUrlFactory urlFactory = new SimpleUrlFactory( requestContext.getContextPath() + "ViewAction?" ); //$NON-NLS-1$
        IParameterProvider requestParameters = new HttpRequestParameterProvider( request );
        HttpServletRequestHandler requestHandler =
            getRequestHandler( request, response, userSession, requestParameters, outputStream, outputHandler,
                urlFactory );
        handleActionRequest( request, response, outputHandler, requestHandler, outputStream, null );
View Full Code Here

    /*
     * execute the action sequence, providing the outputHandler created above
     */
    IRuntimeContext rc =
        solutionEngine.execute( xactionStr, actionSequenceFile, "action sequence to test the TestAction", false, true,
            null, false, new HashMap(), outputHandler, null, new SimpleUrlFactory( "" ), new ArrayList() );
    int status = rc.getStatus();
    if ( status == IRuntimeContext.PARAMETERS_FAIL || status == IRuntimeContext.RUNTIME_CONTEXT_RESOLVE_FAIL
        || status == IRuntimeContext.RUNTIME_STATUS_FAILURE || status == IRuntimeContext.RUNTIME_STATUS_INITIALIZE_FAIL
        || status == IRuntimeContext.RUNTIME_STATUS_SETUP_FAIL ) {
      throw new ActionSequenceException( "Action sequence failed!" );
View Full Code Here

              + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/content?type=" + type + "&component=" + componentName + "&"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

      response.setContentType( type );
      HttpOutputHandler outputHandler = new HttpOutputHandler( response, outputStream, true );

      SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl );

      HttpServletRequestHandler requestHandler =
          new HttpServletRequestHandler( userSession, null, request, outputHandler, urlFactory );

      requestHandler.handleUIRequest( component, type );
View Full Code Here

      }

      HashMap<String, IParameterProvider> parameterProviderMap = new HashMap<String, IParameterProvider>();
      parameterProviderMap.put( IParameterProvider.SCOPE_REQUEST, parameterProvider );

      IPentahoUrlFactory urlFactory = new SimpleUrlFactory( url );

      String processName = description;
      boolean persisted = false;
      // for now, the messages list needs to be untyped since we may put exceptions as well as strings in it
      List<?> messages = null;
View Full Code Here

   * }
   */

  public void runCategoryChartTest( int chartType, String path, String testName ) {

    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    ArrayList messages = new ArrayList();

    int chartWidth = 400;
    int chartHeight = 400;
    CategoryDatasetChartComponent categoryChartComponent =
View Full Code Here

   * }
   */

  public void runTimeSeriesChartTest( int chartType, String path, String testName ) {

    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    ArrayList messages = new ArrayList();

    int chartWidth = 400;
    int chartHeight = 400;
    TimeSeriesCollectionChartComponent timeSeriesChartComponent =
View Full Code Here

    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class );
    solutionEngine.setLoggingLevel( ILogger.ERROR );
    solutionEngine.init( session );
    String baseUrl = PentahoSystem.getApplicationContext().getBaseUrl();
    HashMap parameterProviderMap = new HashMap();
    IPentahoUrlFactory urlFactory = new SimpleUrlFactory( baseUrl );

    try {
      File file = new File( getSolutionPath() + "/samples/platform/SetGlobalOutputTest.xaction" );
      StringBuilder str = new StringBuilder();
      Reader reader = new FileReader( file );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.util.web.SimpleUrlFactory

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.