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

java.lang.Object
  extended by org.pentaho.platform.plugin.action.jfreereport.helper.PentahoResourceLoader
Direct Known Subclasses:
PentahoResourceLoader

public class PentahoResourceLoader
extends Object

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
 ResourceKey createKey(Object value, Map factoryKeys)
          create a new key based on the values provided
 ResourceKey deriveKey(ResourceKey parent, String path, Map data)
          derive a key from an existing key, used when a relative path is given.
 ResourceManager getManager()
          get the resource manager
 String getSchema()
          get the schema name, in this case it's always "solution"
 boolean isSupportedKey(ResourceKey key)
          see if the pentaho resource loader can support the content key path
 ResourceData load(ResourceKey key)
          create a resource data object
 void setResourceManager(ResourceManager manager)
          set the resource manager
 URL toURL(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(ResourceManager manager)
set the resource manager

Parameters:
manager - resource manager

getManager

public 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 ResourceData load(ResourceKey key)
                  throws ResourceLoadingException
create a resource data object

Parameters:
key - resource key
Returns:
resource data
Throws:
ResourceLoadingException

isSupportedKey

public boolean isSupportedKey(ResourceKey key)
see if the pentaho resource loader can support the content key path

Parameters:
values - map of values to look in
Returns:
true if class supports the content key.

createKey

public ResourceKey createKey(Object value,
                             Map factoryKeys)
                      throws ResourceKeyCreationException
create a new key based on the values provided

Parameters:
values - map of values
Returns:
new resource key
Throws:
ResourceKeyCreationException

deriveKey

public ResourceKey deriveKey(ResourceKey parent,
                             String path,
                             Map data)
                      throws ResourceKeyCreationException
derive a key from an existing key, used when a relative path is given.

Parameters:
parent - the parent key
data - the new data to be keyed
Returns:
derived key
Throws:
ResourceKeyCreationException

toURL

public URL toURL(ResourceKey key)