org.pentaho.platform.plugin.action.jfreereport.helper
Class PentahoResourceLoader

java.lang.Object
  extended by org.pentaho.platform.plugin.action.jfreereport.helper.PentahoResourceLoader
All Implemented Interfaces:
org.pentaho.reporting.libraries.resourceloader.ResourceLoader
Direct Known Subclasses:
PentahoResourceLoader

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

Field Summary
static String PATH_SEPARATOR
           
static String SCHEMA_SEPARATOR
           
static String SOLUTION_SCHEMA_NAME
           
static String WIN_PATH_SEPARATOR
           
 
Constructor Summary
PentahoResourceLoader()
          default constructor
 
Method Summary
 org.pentaho.reporting.libraries.resourceloader.ResourceKey createKey(Object value, Map factoryKeys)
          create a new key based on the values provided
 org.pentaho.reporting.libraries.resourceloader.ResourceKey deriveKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey parent, String path, Map data)
          derive a key from an existing key, used when a relative path is given.
 org.pentaho.reporting.libraries.resourceloader.ResourceKey deserialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey, String stringKey)
           
 org.pentaho.reporting.libraries.resourceloader.ResourceManager getManager()
          get the resource manager
 String getSchema()
          get the schema name, in this case it's always "solution"
 boolean isSupportedDeserializer(String data)
           
 boolean isSupportedKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
          see if the pentaho resource loader can support the content key path
 org.pentaho.reporting.libraries.resourceloader.ResourceData load(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
          create a resource data object
 String serialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey resourceKey, org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
           
 void setResourceManager(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager)
          set the resource manager
 URL toURL(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOLUTION_SCHEMA_NAME

public static final String SOLUTION_SCHEMA_NAME
See Also:
Constant Field Values

SCHEMA_SEPARATOR

public static final String SCHEMA_SEPARATOR
See Also:
Constant Field Values

PATH_SEPARATOR

public static final String PATH_SEPARATOR
See Also:
Constant Field Values

WIN_PATH_SEPARATOR

public static final String WIN_PATH_SEPARATOR
See Also:
Constant Field Values
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