Package org.pentaho.platform.api.engine

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


      error( Messages.getInstance().getErrorString( "WidgetGrid.ERROR_0002_NO_VALUE_ITEM" ) ); //$NON-NLS-1$
    }

    // Create a document that describes the result
    Document result = DocumentHelper.createDocument();
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    Element root = result.addElement( "widgets" ); //$NON-NLS-1$

    IPentahoMetaData metaData = resultSet.getMetaData();
View Full Code Here


   * Returns the IPentahoRequestContext for the current thread
   *
   * @return thread requestContext
   */
  public IPentahoRequestContext getRequestContext() {
    IPentahoRequestContext requestContext = perThreadRequestContext.get();
    if ( requestContext == null ) {
      logger.debug( Messages.getInstance().getString(
          "PentahoRequestContextHolder.WARN_THREAD_REQUEST_CONTEXT_NULL", Thread.currentThread().getName() ) ); //$NON-NLS-1$
    }
    return requestContext;
View Full Code Here

  /**
   * Removes the IPentahoRequestContext for the current thread. It is important that the framework calls this to
   * prevent request context bleed- through between requests as threads are re-used by the server.
   */
  public void removeRequestContext() {
    IPentahoRequestContext requestContext = perThreadRequestContext.get();

    if ( requestContext != null ) {
      if ( logger.isDebugEnabled() ) {
        logger.debug( Messages.getInstance().getString( "PentahoRequestContextHolder.DEBUG_REMOVING_REQUEST_CONTEXT", //$NON-NLS-1$
            Thread.currentThread().getName(), String.valueOf( Thread.currentThread().getId() ) ) );
View Full Code Here

  @Override
  public Document getXmlContent() {

    // Create a document that describes the result
    Document result = DocumentHelper.createDocument();
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$
    Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );

    if ( chartDefinition == null ) {
View Full Code Here

    String urlDrillTemplate = parameterProvider.getStringParameter( "drill-url", null ); //$NON-NLS-1$
    String imageUrl = parameterProvider.getStringParameter( "image-url", null ); //$NON-NLS-1$

    // Very likely null; allow API users to continue to pass the dial value via parameters
    String dialValue = parameterProvider.getStringParameter( "value", null ); //$NON-NLS-1$
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    if ( imageUrl == null ) {
      imageUrl = requestContext.getContextPath(); //$NON-NLS-1$
    }

    if ( urlDrillTemplate == null ) {
      urlDrillTemplate = ""; //$NON-NLS-1$
    }
View Full Code Here

    String outerParams = parameterProvider.getStringParameter( "outer-params", null ); //$NON-NLS-1$
    String innerParam = parameterProvider.getStringParameter( "inner-param", null ); //$NON-NLS-1$

    String urlDrillTemplate = parameterProvider.getStringParameter( "drill-url", null ); //$NON-NLS-1$
    String imageUrl = parameterProvider.getStringParameter( "image-url", null ); //$NON-NLS-1$
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    if ( imageUrl == null ) {
      imageUrl = requestContext.getContextPath(); //$NON-NLS-1$
    }

    if ( urlDrillTemplate == null ) {
      urlDrillTemplate = ""; //$NON-NLS-1$
    }
View Full Code Here

      final ArrayList messages, final ILogger logger ) {

    boolean result = true;
    String linkUrl = parameterProvider.getStringParameter( "drill-url", null ); //$NON-NLS-1$
    String imageUrl = parameterProvider.getStringParameter( "image-url", null ); //$NON-NLS-1$
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    if ( imageUrl == null ) {
      imageUrl = requestContext.getContextPath(); //$NON-NLS-1$
    }

    if ( linkUrl == null ) {
      linkUrl = ""; //$NON-NLS-1$
    }
View Full Code Here

   * Messages.getString("BaseTest.USER_RUNNING_ACTION_SEQUENCE"), IRuntimeContext.RUNTIME_STATUS_SUCCESS,
   * context.getStatus()); //$NON-NLS-1$ finishTest(); }
   */
  public void testActionComponent() {
    startTest();
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    IPentahoUrlFactory urlFactory = new SimpleUrlFactory( requestContext.getContextPath() );
    ArrayList messages = new ArrayList();
    SimpleParameterProvider parameterProvider = new SimpleParameterProvider();
    parameterProvider.setParameter( "solution", "test" ); //$NON-NLS-1$ //$NON-NLS-2$
    parameterProvider.setParameter( "path", "reporting" ); //$NON-NLS-1$ //$NON-NLS-2$
    parameterProvider.setParameter( "action", "custom-parameter-page-example.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

  @Override
  public Document getXmlContent() {

    // Create a document that describes the result
    Document result = DocumentHelper.createDocument();
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();

    setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$
    Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );
    if ( chartDefinition == null ) {
      Element errorElement = result.addElement( "error" ); //$NON-NLS-1$
View Full Code Here

    if ( isDefinedInput( AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTDEFN ) ) {
      IActionParameter o = getInputParameter( AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTDEFN );
      if ( o != null ) {
        String repDef = o.getStringValue();
        ReportGenerator generator = ReportGenerator.getInstance();
        IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
        URL url = null;
        try {
          url = new URL( requestContext.getContextPath() );
        } catch ( Exception e ) {
          // a null URL is ok
          warn( Messages.getInstance().getString( "JFreeReportLoadComponent.WARN_COULD_NOT_CREATE_URL" ) ); //$NON-NLS-1$
        }
        report =
View Full Code Here

TOP

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

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.