Class PentahoResourceLoader

  • All Implemented Interfaces:
    org.pentaho.reporting.libraries.resourceloader.ResourceLoader

    public class PentahoResourceLoader
    extends Object
    implements org.pentaho.reporting.libraries.resourceloader.ResourceLoader
    This class is implemented to support loading solution files from the pentaho repository into JFreeReport
    Author:
    Will Gorman
    • Constructor Detail

      • PentahoResourceLoader

        public PentahoResourceLoader()
        default constructor
    • Method Detail

      • setResourceManager

        public void setResourceManager​(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager)
        set the resource manager
        Parameters:
        manager - resource manager
      • getManager

        public org.pentaho.reporting.libraries.resourceloader.ResourceManager getManager()
        get the resource manager
        Returns:
        resource manager
      • getSchema

        public String getSchema()
        get the schema name, in this case it's always "solution"
        Returns:
        the schema name
      • load

        public org.pentaho.reporting.libraries.resourceloader.ResourceData load​(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
                                                                         throws org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
        create a resource data object
        Specified by:
        load in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Parameters:
        key - resource key
        Returns:
        resource data
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
      • isSupportedKey

        public boolean isSupportedKey​(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
        see if the pentaho resource loader can support the content key path
        Specified by:
        isSupportedKey in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Parameters:
        values - map of values to look in
        Returns:
        true if class supports the content key.
      • createKey

        public org.pentaho.reporting.libraries.resourceloader.ResourceKey createKey​(Object value,
                                                                                    Map factoryKeys)
                                                                             throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
        create a new key based on the values provided
        Specified by:
        createKey in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Parameters:
        values - map of values
        Returns:
        new resource key
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
      • deriveKey

        public org.pentaho.reporting.libraries.resourceloader.ResourceKey deriveKey​(org.pentaho.reporting.libraries.resourceloader.ResourceKey parent,
                                                                                    String path,
                                                                                    Map data)
                                                                             throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
        derive a key from an existing key, used when a relative path is given.
        Specified by:
        deriveKey in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Parameters:
        parent - the parent key
        data - the new data to be keyed
        Returns:
        derived key
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
      • toURL

        public URL toURL​(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
        Specified by:
        toURL in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
      • deserialize

        public org.pentaho.reporting.libraries.resourceloader.ResourceKey deserialize​(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey,
                                                                                      String stringKey)
                                                                               throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
        Specified by:
        deserialize in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
      • isSupportedDeserializer

        public boolean isSupportedDeserializer​(String data)
        Specified by:
        isSupportedDeserializer in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
      • serialize

        public String serialize​(org.pentaho.reporting.libraries.resourceloader.ResourceKey resourceKey,
                                org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
                         throws org.pentaho.reporting.libraries.resourceloader.ResourceException
        Specified by:
        serialize in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceException