org.pentaho.platform.api.repository
Interface ISolutionRepository

All Superinterfaces:
ILogger
All Known Implementing Classes:
DbBasedSolutionRepository, ExtensionDbBasedSolutionRepository, ExtensionFileBasedSolutionRepository, FileBasedSolutionRepository, SolutionRepositoryBase

public interface ISolutionRepository
extends ILogger

Defines methods for getting information out of a location holding the Pentaho solutions.

Author:
jdixon

Field Summary
static int ACTION_ADMIN
           
static int ACTION_CREATE
           
static int ACTION_DELETE
           
static int ACTION_EXECUTE
           
static int ACTION_SHARE
           
static int ACTION_SUBSCRIBE
           
static int ACTION_UPDATE
           
static int FILE_ADD_FAILED
           
static int FILE_ADD_INVALID_PUBLISH_PASSWORD
           
static int FILE_ADD_INVALID_USER_CREDENTIALS
           
static int FILE_ADD_SUCCESSFUL
           
static int FILE_EXISTS
           
static String INDEX_FILENAME
           
static String REPOSITORY_SERVICE_CACHE_REGION
           
static char SEPARATOR
           
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Method Summary
 void addPermission(ISolutionFile aFile, IPermissionRecipient recipient, IPermissionMask permission)
          Adds to the ACL associated with aFile.
 int addSolutionFile(String baseUrl, String path, String fileName, byte[] data, boolean overwrite)
          Adds a solution to the solution repository defined by the url that is built by concatenating baseUrl, path, and fileName.
 int addSolutionFile(String baseUrl, String path, String fileName, File f, boolean overwrite)
          Adds a solution to the solution repository defined by the url that is built by concatenating baseUrl, path, and fileName.
 ISolutionFile createFolder(File newFolder)
          This method creates a new folder in the Repository
 IActionSequence getActionSequence(String solutionName, String actionPath, String actionName, int loggingLevel, int actionOperation)
          Retrieves the action sequence from the repository.
 String[] getAllActionSequences()
          Deprecated. 
 String[] getAllActionSequences(int actionOperation)
          An array of Strings where each string is the fully qualified path of every *.xaction contained in the repository.
 ClassLoader getClassLoader(String path)
          Returns an appropriate class loader for a specific path
 Map<IPermissionRecipient,IPermissionMask> getEffectivePermissions(ISolutionFile aFile)
          Returns the ACL for the given file.
 ISolutionFile getFileByPath(String path)
          Deprecated. use getSolutionFile(String, int)
 org.dom4j.Document getFullSolutionTree(int actionOperation, ISolutionFilter filter)
           
 org.dom4j.Document getFullSolutionTree(int actionOperation, ISolutionFilter filter, ISolutionFile startFile)
           
 String getLocalizedFileProperty(ISolutionFile resourceFile, String key)
          Deprecated. 
 String getLocalizedFileProperty(ISolutionFile resourceFile, String key, int actionOperation)
          This method retrieves a locale aware value given a key and a file.
 List getMessages()
          Return the message list, if any, that all log messages generated by this Solution Repository are being appended to
 org.dom4j.Document getNavigationUIDocument(String solution, String path, int actionOperation)
          Get an XML document that describes the structure of the solution repository.
 Map<IPermissionRecipient,IPermissionMask> getPermissions(ISolutionFile aFile)
          Returns the ACL for the given file.
 String getRepositoryName()
           
 byte[] getResourceAsBytes(IActionSequenceResource actionResource, boolean getLocalizedResource)
          Deprecated. 
 byte[] getResourceAsBytes(IActionSequenceResource actionResource, boolean getLocalizedResource, int actionOperation)
          See getResourceInputBytes(String solutionPath).
 byte[] getResourceAsBytes(String solutionPath, boolean getLocalizedResource)
          Deprecated. 
 byte[] getResourceAsBytes(String solutionPath, boolean getLocalizedResource, int actionOperation)
          See getResourceInputBytes(String solutionPath).
 org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionResource)
          Deprecated. 
 org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionResource, int actionOperation)
          See getResourceInputStream(IActionResource actionResource).
 org.dom4j.Document getResourceAsDocument(String solutionPath)
          Deprecated. 
 org.dom4j.Document getResourceAsDocument(String solutionPath, int actionOperation)
          See getResourceInputStream(String solutionPath).
 String getResourceAsString(IActionSequenceResource actionResource)
          Deprecated. 
 String getResourceAsString(IActionSequenceResource actionResource, int actionOperation)
          See getResourceInputStream(IActionResource actionResource).
 String getResourceAsString(String solutionPath)
          Deprecated. 
 String getResourceAsString(String solutionPath, int actionOperation)
          See getResourceInputStream(String solutionPath).
 org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource)
          Deprecated. 
 org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource, int actionOperation)
          See getResourceInputStream(IActionResource actionResource).
 org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(String solutionPath)
          Deprecated. 
 org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(String solutionPath, int actionOperation)
          See getResourceInputStream(String solutionPath).
 InputStream getResourceInputStream(IActionSequenceResource actionResource, boolean getLocalizedResource)
          Deprecated. 
 InputStream getResourceInputStream(IActionSequenceResource actionResource, boolean getLocalizedResource, int actionOperation)
          Given a IActionResource this method returns a InputStream that references the content of the actionResource.
 InputStream getResourceInputStream(String solutionPath, boolean getLocalizedResource)
          Deprecated. 
 InputStream getResourceInputStream(String solutionPath, boolean getLocalizedResource, int actionOperation)
          Returns an InputStream that contains the data of the resource defined by the solutionPath.
 Reader getResourceReader(IActionSequenceResource actionResource)
          Deprecated. 
 Reader getResourceReader(IActionSequenceResource actionResource, int actionOperation)
          See getResourceInputStream(IActionResource actionResource).
 Reader getResourceReader(String solutionPath)
          Deprecated. 
 Reader getResourceReader(String solutionPath, int actionOperation)
          See getResourceInputStream(String solutionPath).
 ISolutionFile getRootFolder(int actionOperation)
           
 ISolutionFile getSolutionFile(IActionSequenceResource actionResource)
          Deprecated. 
 ISolutionFile getSolutionFile(IActionSequenceResource actionResource, int actionOperation)
           
 ISolutionFile getSolutionFile(String path)
          Deprecated. 
 ISolutionFile getSolutionFile(String path, int actionOperation)
           
 long getSolutionFileLastModified(String path)
          Deprecated. 
 long getSolutionFileLastModified(String path, int actionOperation)
          Returns a long that represents the last time this file was modified
 org.dom4j.Document getSolutions(int actionOperation)
          Gets an XML Document representing all the solutions and all the files within all the solutions
 org.dom4j.Document getSolutions(String solutionName, String pathName, int actionOperation, boolean visibleOnly)
          Gets an XML Document representing all the files within a certain path within a solution
 org.dom4j.Document getSolutionStructure(int actionOperation)
          Returns an XML document that represents the parent/child relationship of the current solution repository
 org.dom4j.Document getSolutionTree(int actionOperation)
          Returns an XML document that defines the entire solution tree.
 org.dom4j.Document getSolutionTree(int actionOperation, ISolutionFilter filter)
           
 String getXSLName(org.dom4j.Document doc, String solution, String inputXSLName)
          Interprets the XSL name coming in against the document to see if there are any repository-specific changes based on display type associated with the XSL name
 boolean hasAccess(ISolutionFile aFile, int actionOperation)
          Checks permission.
 void init(IPentahoSession session)
          Initializes the solution repository with the user session
 void localizeDoc(org.dom4j.Node document, ISolutionFile file)
           
 int publish(String baseUrl, String path, String fileName, byte[] data, boolean overwrite)
          Put a file into the solution repo.
 int publish(String baseUrl, String path, String fileName, File f, boolean overwrite)
          Put a file into the solution repo.
 void reloadSolutionRepository(IPentahoSession session, int loggingLevel)
          Loads or reloads a solution repository after a structure change.
 boolean removeSolutionFile(String solutionPath)
           
 boolean removeSolutionFile(String solution, String path, String fileName)
          Removes the file (fileName) from the path defined by the solution and path.
 void resetRepository()
          This method resets the caches used by the solution repository.
 boolean resourceExists(String solutionPath)
          Returns a true if the specified resource exists.
 boolean resourceExists(String solutionPath, int actionOperation)
          Returns a true if the specified resource exists.
 long resourceSize(String solutionPath)
          Returns the size of the specfied resource.
 long resourceSize(String solutionPath, int actionOperation)
          Returns the size of the specfied resource.
 void setMessages(List messages)
          Allows the caller to provide a List that will contain all log messages generated by the Solution Repository represented by this interface
 void setPermissions(ISolutionFile aFile, Map<IPermissionRecipient,IPermissionMask> acl)
          Replaces the ACL on aFile.
 void share(ISolutionFile aFile, List<IPermissionRecipient> shareRecipients)
          Share file with recipient.
 boolean solutionSynchronizationSupported()
           
 boolean supportsAccessControls()
           
 boolean synchronizeSolutionWithSolutionSource(IPentahoSession session)
          For ISolutionRepository implementations that have a source and a destination (for example, DBBasedSolutionRepository which has a file-system source and a DB destination) this is the entry point that allows synchronization.
 
Methods inherited from interface org.pentaho.platform.api.engine.ILogger
debug, debug, error, error, fatal, fatal, getLoggingLevel, info, info, setLoggingLevel, trace, trace, warn, warn
 

Field Detail

ACTION_EXECUTE

static final int ACTION_EXECUTE
See Also:
Constant Field Values

ACTION_ADMIN

static final int ACTION_ADMIN
See Also:
Constant Field Values

ACTION_SUBSCRIBE

static final int ACTION_SUBSCRIBE
See Also:
Constant Field Values

ACTION_CREATE

static final int ACTION_CREATE
See Also:
Constant Field Values

ACTION_UPDATE

static final int ACTION_UPDATE
See Also:
Constant Field Values

ACTION_DELETE

static final int ACTION_DELETE
See Also:
Constant Field Values

ACTION_SHARE

static final int ACTION_SHARE
See Also:
Constant Field Values

FILE_EXISTS

static final int FILE_EXISTS
See Also:
Constant Field Values

FILE_ADD_FAILED

static final int FILE_ADD_FAILED
See Also:
Constant Field Values

FILE_ADD_SUCCESSFUL

static final int FILE_ADD_SUCCESSFUL
See Also:
Constant Field Values

FILE_ADD_INVALID_PUBLISH_PASSWORD

static final int FILE_ADD_INVALID_PUBLISH_PASSWORD
See Also:
Constant Field Values

FILE_ADD_INVALID_USER_CREDENTIALS

static final int FILE_ADD_INVALID_USER_CREDENTIALS
See Also:
Constant Field Values

INDEX_FILENAME

static final String INDEX_FILENAME
See Also:
Constant Field Values

SEPARATOR

static final char SEPARATOR
See Also:
Constant Field Values

REPOSITORY_SERVICE_CACHE_REGION

static final String REPOSITORY_SERVICE_CACHE_REGION
See Also:
Constant Field Values
Method Detail

getActionSequence

IActionSequence getActionSequence(String solutionName,
                                  String actionPath,
                                  String actionName,
                                  int loggingLevel,
                                  int actionOperation)
Retrieves the action sequence from the repository. Should return null if the requested action seqeuence is not found.

Parameters:
solutionName - The name of the solution - like the root folder
actionPath - The relative path (from the solution) of where the file is stored
actionName - The name of the action sequence
loggingLevel - The level at which to log messages
actionOperation - Whether the action sequence is being retrieved for administration or execution
Returns:

init

void init(IPentahoSession session)
Initializes the solution repository with the user session

Parameters:
session - The current user session

getSolutions

org.dom4j.Document getSolutions(int actionOperation)
Gets an XML Document representing all the solutions and all the files within all the solutions

Parameters:
actionOperation - Indicates what the list will be used for - execution or administration
Returns:
Document

getSolutions

org.dom4j.Document getSolutions(String solutionName,
                                String pathName,
                                int actionOperation,
                                boolean visibleOnly)
Gets an XML Document representing all the files within a certain path within a solution

Parameters:
solutionName - The name of the solution to get
pathName - The path from which to retrieve
actionOperation - Indicates what the list will be used for - execution or administration
Returns:
Document

getSolutionStructure

org.dom4j.Document getSolutionStructure(int actionOperation)
Returns an XML document that represents the parent/child relationship of the current solution repository

Parameters:
actionOperation -
Returns:
an XML document

reloadSolutionRepository

void reloadSolutionRepository(IPentahoSession session,
                              int loggingLevel)
Loads or reloads a solution repository after a structure change.

Parameters:
session - - The session associated with this solution repository
loggingLevel - - The requested level of logging

getRepositoryName

String getRepositoryName()

removeSolutionFile

boolean removeSolutionFile(String solution,
                           String path,
                           String fileName)
Removes the file (fileName) from the path defined by the solution and path.

Parameters:
solution -
path -
fileName -
Returns:
- boolean indicating success

removeSolutionFile

boolean removeSolutionFile(String solutionPath)

addSolutionFile

int addSolutionFile(String baseUrl,
                    String path,
                    String fileName,
                    File f,
                    boolean overwrite)
Adds a solution to the solution repository defined by the url that is built by concatenating baseUrl, path, and fileName. The fileName that is added has its data populated by the data from File (on disk).

Parameters:
baseUrl -
path -
fileName -
fi -
overwrite -
Returns:
- int indicating status of return

addSolutionFile

int addSolutionFile(String baseUrl,
                    String path,
                    String fileName,
                    byte[] data,
                    boolean overwrite)
Adds a solution to the solution repository defined by the url that is built by concatenating baseUrl, path, and fileName. The fileName that is added has its data populated by the data.

Parameters:
baseUrl -
path -
fileName -
data -
overwrite -
Returns:
- int indicating status of return

getSolutionFileLastModified

@Deprecated
long getSolutionFileLastModified(String path)
Deprecated. 

Returns a long that represents the last time this file was modified Defaults to Action Operation of execute

Parameters:
path -

getSolutionFileLastModified

long getSolutionFileLastModified(String path,
                                 int actionOperation)
Returns a long that represents the last time this file was modified

Parameters:
path -
actionOperation - - Type of action operation to be performed

getClassLoader

ClassLoader getClassLoader(String path)
Returns an appropriate class loader for a specific path

Parameters:
path -
Returns:
- A ClassLoader

getFullSolutionTree

org.dom4j.Document getFullSolutionTree(int actionOperation,
                                       ISolutionFilter filter)

getFullSolutionTree

org.dom4j.Document getFullSolutionTree(int actionOperation,
                                       ISolutionFilter filter,
                                       ISolutionFile startFile)

getSolutionTree

org.dom4j.Document getSolutionTree(int actionOperation)
Returns an XML document that defines the entire solution tree. This general purpose method return all files/folders in the solution in an easily understood XML document.

Parameters:
actionOperation -
Returns:

getSolutionTree

org.dom4j.Document getSolutionTree(int actionOperation,
                                   ISolutionFilter filter)
Parameters:
actionOperation -
filter - an implementation of a ISolutionFilter that determines which files will be returned
Returns:
Document representing the solution tree

resourceExists

boolean resourceExists(String solutionPath)
Returns a true if the specified resource exists. Default action operation to execute

Parameters:
solutionPath - - path to the resource
Returns:
- boolean true if resource exists

resourceExists

boolean resourceExists(String solutionPath,
                       int actionOperation)
Returns a true if the specified resource exists.

Parameters:
solutionPath - - path to the resource
actionOperation - - Type of action operation to be performed
Returns:
- boolean true if resource exists

resourceSize

long resourceSize(String solutionPath)
Returns the size of the specfied resource. If resource doesn't exit a -1 is returned Default action operation of execute

Parameters:
solutionPath - - path to the resource
Returns:
- long value of the size

resourceSize

long resourceSize(String solutionPath,
                  int actionOperation)
Returns the size of the specfied resource. If resource doesn't exit a -1 is returned

Parameters:
solutionPath - - path to the resource
actionOperation - - Type of action operation to be performed
Returns:
- long value of the size

getResourceInputStream

@Deprecated
InputStream getResourceInputStream(IActionSequenceResource actionResource,
                                              boolean getLocalizedResource)
                                   throws FileNotFoundException
Deprecated. 

Given a IActionResource this method returns a InputStream that references the content of the actionResource. Defaults action operation to execute

Parameters:
actionResource - - resource to create a stream for.
getLocalizedResource - - flag to use to check if we should attempt to get a localized version of the resource
Returns:
- InputStream that contains the data of the actionResource
Throws:
FileNotFoundException

getResourceInputStream

InputStream getResourceInputStream(IActionSequenceResource actionResource,
                                   boolean getLocalizedResource,
                                   int actionOperation)
                                   throws FileNotFoundException
Given a IActionResource this method returns a InputStream that references the content of the actionResource.

Parameters:
actionResource - - resource to create a stream for.
getLocalizedResource - - flag to use to check if we should attempt to get a localized version of the resource
actionOperation - - Type of action operation to be performed
Returns:
- InputStream that contains the data of the actionResource
Throws:
FileNotFoundException

getResourceInputStream

@Deprecated
InputStream getResourceInputStream(String solutionPath,
                                              boolean getLocalizedResource)
                                   throws FileNotFoundException
Deprecated. 

Returns an InputStream that contains the data of the resource defined by the solutionPath. Defaults action operation to execute

Parameters:
solutionPath - - location of a resource.
Returns:
- InputStream that represents the data of the resource.
Throws:
FileNotFoundException

getResourceInputStream

InputStream getResourceInputStream(String solutionPath,
                                   boolean getLocalizedResource,
                                   int actionOperation)
                                   throws FileNotFoundException
Returns an InputStream that contains the data of the resource defined by the solutionPath.

Parameters:
solutionPath - - location of a resource.
actionOperation - - Type of action operation to be performed
Returns:
- InputStream that represents the data of the resource.
Throws:
FileNotFoundException

getResourceReader

@Deprecated
Reader getResourceReader(IActionSequenceResource actionResource)
                         throws FileNotFoundException,
                                IOException
Deprecated. 

See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a Reader. Exceptions are thrown if io error or file is not found. Defults action operation to execute

Parameters:
actionResource -
Returns:
Throws:
FileNotFoundException
IOException

getResourceReader

Reader getResourceReader(IActionSequenceResource actionResource,
                         int actionOperation)
                         throws FileNotFoundException,
                                IOException
See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a Reader. Exceptions are thrown if io error or file is not found.

Parameters:
actionResource -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
FileNotFoundException
IOException

getResourceReader

@Deprecated
Reader getResourceReader(String solutionPath)
                         throws FileNotFoundException,
                                IOException
Deprecated. 

See getResourceInputStream(String solutionPath). Identical method except returns results as a Reader. Exceptions are thrown if io error or file is not found. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
FileNotFoundException
IOException

getResourceReader

Reader getResourceReader(String solutionPath,
                         int actionOperation)
                         throws FileNotFoundException,
                                IOException
See getResourceInputStream(String solutionPath). Identical method except returns results as a Reader. Exceptions are thrown if io error or file is not found.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
FileNotFoundException
IOException

getResourceAsString

@Deprecated
String getResourceAsString(IActionSequenceResource actionResource)
                           throws IOException
Deprecated. 

See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a String. Exception is thrown if io error. Defaults action operation to execute

Parameters:
actionResource -
Returns:
Throws:
IOException

getResourceAsString

String getResourceAsString(IActionSequenceResource actionResource,
                           int actionOperation)
                           throws IOException
See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a String. Exception is thrown if io error.

Parameters:
actionResource -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceAsString

@Deprecated
String getResourceAsString(String solutionPath)
                           throws IOException
Deprecated. 

See getResourceInputStream(String solutionPath). Identical method except returns results as a String. Exception is thrown if io error. Default action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
IOException

getResourceAsString

String getResourceAsString(String solutionPath,
                           int actionOperation)
                           throws IOException
See getResourceInputStream(String solutionPath). Identical method except returns results as a String. Exception is thrown if io error.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceAsBytes

@Deprecated
byte[] getResourceAsBytes(String solutionPath,
                                     boolean getLocalizedResource)
                          throws IOException
Deprecated. 

See getResourceInputBytes(String solutionPath). Identical method except returns results as a byte array. Exception is thrown if io error. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
IOException

getResourceAsBytes

byte[] getResourceAsBytes(String solutionPath,
                          boolean getLocalizedResource,
                          int actionOperation)
                          throws IOException
See getResourceInputBytes(String solutionPath). Identical method except returns results as a byte array. Exception is thrown if io error.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceAsBytes

@Deprecated
byte[] getResourceAsBytes(IActionSequenceResource actionResource,
                                     boolean getLocalizedResource)
                          throws IOException
Deprecated. 

See getResourceInputBytes(String solutionPath). Identical method except returns results as a byte array. Exception is thrown if io error. Defaults action operation to execute

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceAsBytes

byte[] getResourceAsBytes(IActionSequenceResource actionResource,
                          boolean getLocalizedResource,
                          int actionOperation)
                          throws IOException
See getResourceInputBytes(String solutionPath). Identical method except returns results as a byte array. Exception is thrown if io error.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceDataSource

@Deprecated
org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(String solutionPath)
                                                                          throws FileNotFoundException
Deprecated. 

See getResourceInputStream(String solutionPath). Identical method except returns results as a DataSource. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
FileNotFoundException

getResourceDataSource

org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(String solutionPath,
                                                                          int actionOperation)
                                                                          throws FileNotFoundException
See getResourceInputStream(String solutionPath). Identical method except returns results as a DataSource.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
FileNotFoundException

getResourceDataSource

@Deprecated
org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource)
                                                                          throws FileNotFoundException
Deprecated. 

See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a DataSource. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
FileNotFoundException

getResourceDataSource

org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource,
                                                                          int actionOperation)
                                                                          throws FileNotFoundException
See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a DataSource.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
FileNotFoundException

getResourceAsDocument

@Deprecated
org.dom4j.Document getResourceAsDocument(String solutionPath)
                                         throws IOException
Deprecated. 

See getResourceInputStream(String solutionPath). Identical method except returns results as a Document. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
IOException

getResourceAsDocument

org.dom4j.Document getResourceAsDocument(String solutionPath,
                                         int actionOperation)
                                         throws IOException
See getResourceInputStream(String solutionPath). Identical method except returns results as a Document.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getResourceAsDocument

@Deprecated
org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionResource)
                                         throws IOException
Deprecated. 

See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a Document. Defaults action operation to execute

Parameters:
solutionPath -
Returns:
Throws:
IOException

getResourceAsDocument

org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionResource,
                                         int actionOperation)
                                         throws IOException
See getResourceInputStream(IActionResource actionResource). Identical method except returns results as a Document.

Parameters:
solutionPath -
actionOperation - - Type of action operation to be performed
Returns:
Throws:
IOException

getAllActionSequences

@Deprecated
String[] getAllActionSequences()
Deprecated. 

Defaults action operation to execute

Returns:
An array of Strings where each string is the fully qualified path of every *.xaction contained in the repository.

getAllActionSequences

String[] getAllActionSequences(int actionOperation)
An array of Strings where each string is the fully qualified path of every *.xaction contained in the repository.

Parameters:
actionOperation - - Type of action operation to be performed
Returns:

setMessages

void setMessages(List messages)
Allows the caller to provide a List that will contain all log messages generated by the Solution Repository represented by this interface

Parameters:
messages - a List that String messages will be appended to

getMessages

List getMessages()
Return the message list, if any, that all log messages generated by this Solution Repository are being appended to

Returns:
List of String messages

getNavigationUIDocument

org.dom4j.Document getNavigationUIDocument(String solution,
                                           String path,
                                           int actionOperation)
Get an XML document that describes the structure of the solution repository. Returns the document used to construct the navigation UI. Also used by WAQR and jpivot to construct the repository browswer

Parameters:
solution - String The name of the solution. If this is empty (null or ""), and path is empty, return the root of the document. Otherwise return a document that starts at the node specified by the solution and path in the solution
path - String The path of the interested folder. See notes for parameter solution.
actionOperation - - Type of action operation to be performed
Returns:
Document XML document that describes the structure of the solution repository.

getXSLName

String getXSLName(org.dom4j.Document doc,
                  String solution,
                  String inputXSLName)
Interprets the XSL name coming in against the document to see if there are any repository-specific changes based on display type associated with the XSL name

Parameters:
doc -
inputXSLName -
Returns:
Actual XSL name to use

resetRepository

void resetRepository()
This method resets the caches used by the solution repository.


getRootFolder

ISolutionFile getRootFolder(int actionOperation)
Parameters:
actionOperation - - Type of action operation to be performed
Returns:
the ISolutionFile for the root of the repository

localizeDoc

void localizeDoc(org.dom4j.Node document,
                 ISolutionFile file)

supportsAccessControls

boolean supportsAccessControls()
Returns:
whether or not the concrete versions of this interface support access controls

getSolutionFile

@Deprecated
ISolutionFile getSolutionFile(String path)
Deprecated. 

Parameters:
path -
actionOperation - - Type of action operation to be performed Defaults action operation to execute
Returns:

getSolutionFile

ISolutionFile getSolutionFile(String path,
                              int actionOperation)
Parameters:
path -
actionOperation - - Type of action operation to be performed
Returns:

getSolutionFile

@Deprecated
ISolutionFile getSolutionFile(IActionSequenceResource actionResource)
Deprecated. 

Defaults action operation to execute

Parameters:
path -
Returns:

getSolutionFile

ISolutionFile getSolutionFile(IActionSequenceResource actionResource,
                              int actionOperation)
Parameters:
actionResource -
actionOperation - - Type of action operation to be performed
Returns:

createFolder

ISolutionFile createFolder(File newFolder)
                           throws IOException
This method creates a new folder in the Repository

Parameters:
newFolder - The File that points to the new folder to create
Returns:
The RepositoryFile object created
Throws:
IOException

hasAccess

boolean hasAccess(ISolutionFile aFile,
                  int actionOperation)
Checks permission. Although implementations should enforce permissions, some clients may want to see beforehand whether or not an operation will succeed. An example is enabling/disable UI controls based on access.

Parameters:
aFile - domain instance to check
actionOperation - permission requested (A constant from ISolutionRepository.)
Returns:
true if actionOperation is allowed for this aFile

share

void share(ISolutionFile aFile,
           List<IPermissionRecipient> shareRecipients)
Share file with recipient. This version is appropriate for sharing with a particular role. The semantics of share are encapsulated in the implementation. (The sharer comes from the IPentahoSession.)

Parameters:
aFile - file to share
shareRecipients - the users or roles with which to share (aka share-ees)

publish

int publish(String baseUrl,
            String path,
            String fileName,
            byte[] data,
            boolean overwrite)
            throws PentahoAccessControlException
Put a file into the solution repo. This method differs from addSolutionFile. Only Pentaho administrators can successfully execute addSolutionFile. addSolutionFile is a low-level operation. There is potentially more logic in the implementation of this method than in the implementation of addSolutionFile.

Parameters:
baseUrl -
path -
fileName -
data -
overwrite -
Returns:
Throws:
PentahoAccessControlException

publish

int publish(String baseUrl,
            String path,
            String fileName,
            File f,
            boolean overwrite)
            throws PentahoAccessControlException
Put a file into the solution repo. This method differs from addSolutionFile. Only Pentaho administrators can successfully execute addSolutionFile. addSolutionFile is a low-level operation. There is potentially more logic in the implementation of this method than in the implementation of addSolutionFile.

Parameters:
baseUrl -
path -
fileName -
f -
overwrite -
Returns:
constant from ISolutionRepository
Throws:
PentahoAccessControlException

addPermission

void addPermission(ISolutionFile aFile,
                   IPermissionRecipient recipient,
                   IPermissionMask permission)
Adds to the ACL associated with aFile.

Parameters:
aFile - file whose ACL is to be modified
recipient - recipient of the permission
permission - right to an action on this file by this user

setPermissions

void setPermissions(ISolutionFile aFile,
                    Map<IPermissionRecipient,IPermissionMask> acl)
                    throws PentahoAccessControlException
Replaces the ACL on aFile.

Parameters:
aFile - file whose ACL is to be modified
acl - new ACL
Throws:
PentahoAccessControlException

getPermissions

Map<IPermissionRecipient,IPermissionMask> getPermissions(ISolutionFile aFile)
Returns the ACL for the given file.

Parameters:
aFile - file whose ACL is to be returned
Returns:
ACL

getEffectivePermissions

Map<IPermissionRecipient,IPermissionMask> getEffectivePermissions(ISolutionFile aFile)
Returns the ACL for the given file. If there are no access control entries for the given file, return the access control entries of an ancestor file.

Parameters:
aFile - file whose ACL is to be returned
Returns:
ACL

synchronizeSolutionWithSolutionSource

boolean synchronizeSolutionWithSolutionSource(IPentahoSession session)
                                              throws UnsupportedOperationException
For ISolutionRepository implementations that have a source and a destination (for example, DBBasedSolutionRepository which has a file-system source and a DB destination) this is the entry point that allows synchronization. Implementors should throw an UnsupportedOperationException if there is no synchronization necessary (for example, the FileBasedSolutionRepository).

Parameters:
session -
Returns:
boolean true if the synchronization succeeded
Throws:
UnsupportedOperationException

solutionSynchronizationSupported

boolean solutionSynchronizationSupported()
Returns:
True if solution synchronization is supported by this implementor

getLocalizedFileProperty

@Deprecated
String getLocalizedFileProperty(ISolutionFile resourceFile,
                                           String key)
Deprecated. 

This method retrieves a locale aware value given a key and a file. The intention is to allow the repository to be used as an API, so we can ask it for the "title" or "description" or "author" of a given file with localization in effect. Defaults action operation to execute

Parameters:
path - the solution path to the desired resource
Returns:
the String value found for the given key

getLocalizedFileProperty

String getLocalizedFileProperty(ISolutionFile resourceFile,
                                String key,
                                int actionOperation)
This method retrieves a locale aware value given a key and a file. The intention is to allow the repository to be used as an API, so we can ask it for the "title" or "description" or "author" of a given file with localization in effect.

Parameters:
resourceFile -
key -
actionOperation - - Type of action operation to be performed
Returns:
the String value found for the given key

getFileByPath

@Deprecated
ISolutionFile getFileByPath(String path)
Deprecated. use getSolutionFile(String, int)

Parameters:
path - the solution path to the desired resource
Returns:
the ISolutionFile for the given path