Package org.pentaho.platform.api.engine

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


    InputStream xslIS = null;
    try {
      if ( systemId.toLowerCase().indexOf( ".dtd" ) >= 0 ) { //$NON-NLS-1$
        return resolveDTDEntity( publicId, systemId );
      }
      IActionSequenceResource resource =
          new ActionSequenceResource( "", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", //$NON-NLS-1$ //$NON-NLS-2$
              systemId );
      xslIS = resource.getInputStream( RepositoryFilePermission.READ, LocaleHelper.getLocale() );
      return new InputSource( xslIS );
    } catch ( IOException e ) {
      Logger.error( this, e.getLocalizedMessage() );
    }
    return null;
View Full Code Here


   * @see javax.xml.transform.URIResolver#resolve(java.lang.String, java.lang.String)
   */
  public Source resolve( final String href, final String base ) {
    StreamSource xslSrc = null;
    InputStream xslIS = null;
    IActionSequenceResource resource =
        new ActionSequenceResource( "", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", //$NON-NLS-1$ //$NON-NLS-2$
            href );
    xslIS = resource.getInputStream( RepositoryFilePermission.READ, LocaleHelper.getLocale() );
    xslSrc = new StreamSource( xslIS );

    return xslSrc;
  }
View Full Code Here

    return xslSrc;
  }

  public InputStream loadXsl( final String name ) {
    InputStream xslIS = null;
    IActionSequenceResource resource =
        new ActionSequenceResource( "", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", //$NON-NLS-1$ //$NON-NLS-2$
            name );
    xslIS = resource.getInputStream( RepositoryFilePermission.READ, LocaleHelper.getLocale() );

    return xslIS;
  }
View Full Code Here

    // the component-definition of the chart action.

    if ( getInputNames().contains( ChartComponent.CHART_ATTRIBUTES_PROP ) ) {
      chartAttributeString = getInputStringValue( ChartComponent.CHART_ATTRIBUTES_PROP );
    } else if ( isDefinedResource( ChartComponent.CHART_ATTRIBUTES_PROP ) ) {
      IActionSequenceResource resource = getResource( ChartComponent.CHART_ATTRIBUTES_PROP );
      chartAttributeString = getResourceAsString( resource );
    }

    // Realize chart attributes as an XML document
    if ( chartAttributeString != null ) {
View Full Code Here

    Context cx = ContextFactory.getGlobal().enterContext();
    StringBuffer buffer = new StringBuffer();
    @SuppressWarnings( "unchecked" )
    Iterator<String> iter = getResourceNames().iterator();
    while ( iter.hasNext() ) {
      IActionSequenceResource resource = getResource( iter.next().toString() );
      // If this is a javascript resource then append it to the script string
      if ( "text/javascript".equalsIgnoreCase( resource.getMimeType() ) ) { //$NON-NLS-1$
        buffer.append( getResourceAsString( resource ) );
      }
    }

    List<String> outputNames = new ArrayList<String>();
View Full Code Here

    String chartAttributeString = null;
    if ( getInputNames().contains( CHART_ATTRIBUTES ) ) {
      chartAttributeString = getInputStringValue( CHART_ATTRIBUTES );
    } else if ( isDefinedResource( CHART_ATTRIBUTES ) ) {
      IActionSequenceResource resource = getResource( CHART_ATTRIBUTES );
      chartAttributeString = getResourceAsString( resource );
    }

    Node chartNode = null;
View Full Code Here

      String location = connAction.getLocation().getStringValue();
      String role = connAction.getRole().getStringValue();
      String catalog = connAction.getCatalog().getStringValue();

      if ( ( catalog == null ) && ( connAction.getCatalogResource() != null ) ) {
        IActionSequenceResource resource = getResource( connAction.getCatalogResource().getName() );
        catalog = resource.getAddress();
        if ( ( resource.getSourceType() == IActionSequenceResource.URL_RESOURCE )
            && ( catalog.indexOf( "solution:" ) != 0 ) ) { //$NON-NLS-1$
          // Extra step to make sure that remote mondrian models
          // fully qualified aren't munged
          // MB
          if ( !catalog.startsWith( "http:" ) ) { //$NON-NLS-1$
            catalog = "solution:" + catalog; //$NON-NLS-1$
          }
        } else if ( ( resource.getSourceType() == IActionSequenceResource.SOLUTION_FILE_RESOURCE )
            || ( resource.getSourceType() == IActionSequenceResource.FILE_RESOURCE ) ) {
          if ( !catalog.startsWith( "solution:" ) ) {
            catalog = "solution:" + catalog; //$NON-NLS-1$
          }
        }
      }
View Full Code Here

          } else {
            return false;
          }
        }
      } else if ( isDefinedResource( KettleComponent.TRANSFORMFILE ) ) {
        IActionSequenceResource transformResource = getResource( KettleComponent.TRANSFORMFILE );
        String fileAddress = getActualFileName( transformResource );

        try {
          if ( fileAddress != null ) { // We have an actual loadable
            // filesystem and file
            transMeta = new TransMeta( fileAddress, repository, true );
            transMeta.setFilename( fileAddress );
          } else if ( repository != null && repository.isConnected() ) {

            fileAddress = transformResource.getAddress();
            // load transformation resource from kettle/settings.xml configured repository
            transMeta = loadTransformFromRepository( FilenameUtils.getPathNoEndSeparator( fileAddress ), FilenameUtils.getBaseName( fileAddress ), repository );
          } else {
            String jobXmlStr = getResourceAsString( getResource( KettleComponent.TRANSFORMFILE ) );
            jobXmlStr = jobXmlStr.replaceAll( "\\$\\{pentaho.solutionpath\\}", solutionPath ); //$NON-NLS-1$
View Full Code Here

    String catalog = null;
    String resAddress = null;

    if ( hibernateConfigRes != null ) {
      String resName = this.applyInputsToFormat( hibernateConfigRes.getName() );
      IActionSequenceResource resource = getResource( resName );
      resAddress = resource.getAddress();
      if ( resAddress != null ) {
        catalog = this.applyInputsToFormat( resAddress );
      }
    }
    return catalog;
View Full Code Here

  }

  public ReportSpec getReportSpec() throws FileNotFoundException {
    ReportSpec reportSpec = null;
    if ( isDefinedResource( AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTSPECINPUT ) ) {
      IActionSequenceResource resource = getResource( AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTSPECINPUT );
      reportSpec = loadFromZip( resource );
      if ( reportSpec == null ) {
        InputStream reportSpecInputStream =
            resource.getInputStream( RepositoryFilePermission.READ, LocaleHelper.getLocale() );
        reportSpec =
            (ReportSpec) CastorUtility.getInstance().readCastorObject( reportSpecInputStream, ReportSpec.class );
      }
    }
    return reportSpec;
View Full Code Here

TOP

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

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.