Class PentahoResourceLoader
- java.lang.Object
-
- org.pentaho.platform.plugin.action.jfreereport.helper.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
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTTP_URL_PREFIX
static String
PATH_SEPARATOR
static String
SCHEMA_SEPARATOR
static String
SOLUTION_SCHEMA_NAME
static String
WIN_PATH_SEPARATOR
-
Constructor Summary
Constructors Constructor Description PentahoResourceLoader()
default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.pentaho.reporting.libraries.resourceloader.ResourceKey
createKey(Object value, Map factoryKeys)
create a new key based on the values providedorg.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 managerString
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 pathorg.pentaho.reporting.libraries.resourceloader.ResourceData
load(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
create a resource data objectString
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 managerURL
toURL(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
-
-
-
Field Detail
-
SOLUTION_SCHEMA_NAME
public static final String SOLUTION_SCHEMA_NAME
- See Also:
- Constant Field Values
-
HTTP_URL_PREFIX
public static final String HTTP_URL_PREFIX
- 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
-
-
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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Parameters:
parent
- the parent keydata
- 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 interfaceorg.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 interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
-
isSupportedDeserializer
public boolean isSupportedDeserializer(String data)
- Specified by:
isSupportedDeserializer
in interfaceorg.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 interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceException
-
-