|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pentaho.platform.engine.core.system.PentahoBase
org.pentaho.platform.engine.services.PentahoMessenger
org.pentaho.platform.repository.solution.SolutionRepositoryBase
org.pentaho.platform.repository.solution.dbbased.DbBasedSolutionRepository
public class DbBasedSolutionRepository
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.pentaho.platform.repository.solution.SolutionRepositoryBase |
|---|
SolutionRepositoryBase.ActionSequenceResourceWrapper |
| Field Summary |
|---|
| Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase |
|---|
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR |
| Fields inherited from interface org.pentaho.platform.api.repository.ISolutionRepository |
|---|
ACTION_ADMIN, ACTION_CREATE, ACTION_DELETE, ACTION_EXECUTE, ACTION_SHARE, ACTION_SUBSCRIBE, ACTION_UPDATE, FILE_ADD_FAILED, FILE_ADD_INVALID_PUBLISH_PASSWORD, FILE_ADD_INVALID_USER_CREDENTIALS, FILE_ADD_SUCCESSFUL, FILE_EXISTS, INDEX_FILENAME, 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 |
| Constructor Summary | |
|---|---|
DbBasedSolutionRepository()
|
|
| Method Summary | |
|---|---|
void |
addPermission(ISolutionFile file,
IPermissionRecipient recipient,
IPermissionMask permission)
TODO mlowery Need to throw exception if unauthorized. |
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. |
void |
contributeAttributes(ISolutionFile solutionFile,
Element childNode)
|
ISolutionFile |
createFolder(File newFolder)
This method creates a new folder in the Repository |
boolean |
deleteRepository(String repositoryNameToDelete)
|
void |
exitPoint()
|
IActionSequence |
getActionSequence(String solutionName,
String actionPath,
String sequenceName,
int localLoggingLevel,
int actionOperation)
Retrieves the action sequence from the repository. |
String[] |
getAllActionSequences()
|
List |
getChildrenFilesByParentId(String parentId)
|
ClassLoader |
getClassLoader(String path)
Returns an appropriate class loader for a specific path |
Map<IPermissionRecipient,IPermissionMask> |
getEffectivePermissions(ISolutionFile file)
TODO mlowery Need to throw exception if unauthorized. |
ISolutionFile |
getFileByPath(String path)
|
Map<IPermissionRecipient,IPermissionMask> |
getPermissions(ISolutionFile file)
TODO mlowery Need to throw exception if unauthorized. |
String |
getRepositoryName()
|
ISolutionFile |
getRootFolder()
|
RepositoryFile |
getSolutionById(String anId)
|
Document |
getSolutionDocument(String documentPath,
int actionOperation)
TODO mlowery This method trusts that actionOperation is what the caller really wants to do??? |
long |
getSolutionFileLastModified(String path)
Returns a long that represents the last time this file was modified |
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 |
Document |
getSolutionStructure(int actionOperation)
Returns an XML document that represents the parent/child relationship of the current solution repository |
Document |
getSolutionTree(int actionOperation)
Returns an XML document that defines the entire solution tree. |
Document |
getSolutionTree(int actionOperation,
ISolutionFilter filter)
|
String |
getValue(Document doc,
String xPath,
String defaultValue)
|
boolean |
hasAccess(IPermissionRecipient permRecipient,
ISolutionFile aFile,
int actionOperation)
Checks permission. |
boolean |
hasAccess(ISolutionFile aFile,
int actionOperation)
TODO mlowery Need to throw exception if unauthorized. |
void |
init()
|
boolean |
isPentahoAdministrator()
|
boolean |
keepFile(ISolutionFile solutionFile,
int actionOperation)
|
List |
loadSolutionFromFileSystem(IPentahoSession pSession,
String solutionRoot,
boolean deleteOrphans)
This method loads solution files and folders from the file system into the RDBMS repository. |
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 localSession,
int localLoggingLevel)
Loads or reloads a solution repository after a structure change. |
boolean |
removeSolutionFile(String solutionPath)
|
boolean |
removeSolutionFile(String solution,
String path,
String fileName)
this is the file based removeSolutionFile, used by subclasses |
String |
resetSolutionFromFileSystem(IPentahoSession pSession)
|
boolean |
resourceExists(String solutionPath)
Returns a true if the specified resource exists. |
long |
resourceSize(String solutionPath)
Returns the size of the specfied resource. |
void |
setPermissions(ISolutionFile file,
Map<IPermissionRecipient,IPermissionMask> acl)
TODO mlowery Need to throw exception if unauthorized. |
void |
setRepositoryName(String value)
|
void |
share(ISolutionFile file,
List<IPermissionRecipient> shareRecipients)
Share file with recipient. |
boolean |
solutionSynchronizationSupported()
|
boolean |
supportsAccessControls()
|
boolean |
synchronizeSolutionWithSolutionSource(IPentahoSession pSession)
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. |
void |
unshare(ISolutionFile file,
List<IPermissionRecipient> shareRecipients)
Undoes the share operation. |
| Methods inherited from class org.pentaho.platform.repository.solution.SolutionRepositoryBase |
|---|
getFullSolutionTree, getLocaleString, getLocalizedFile, getLocalizedFileProperty, getLogger, getNavigationUIDocument, getResourceAsBytes, getResourceAsBytes, getResourceAsDocument, getResourceAsDocument, getResourceAsString, getResourceAsString, getResourceDataSource, getResourceDataSource, getResourceInputStream, getResourceInputStream, getResourceReader, getResourceReader, getSolutionFile, getSolutions, getXSLName, init, isSystemPath, isSystemTmpPath, localizeDoc, resetRepository |
| Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger |
|---|
debug, debug, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn |
| Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase |
|---|
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, setLoggingLevel, setLogId |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.pentaho.platform.api.engine.IPentahoInitializer |
|---|
init |
| Methods inherited from interface org.pentaho.platform.api.repository.ISolutionRepository |
|---|
getMessages, setMessages |
| Methods inherited from interface org.pentaho.platform.api.engine.ILogger |
|---|
debug, debug, error, error, fatal, fatal, getLoggingLevel, info, info, setLoggingLevel, trace, trace, warn, warn |
| Constructor Detail |
|---|
public DbBasedSolutionRepository()
| Method Detail |
|---|
public void init()
init in class SolutionRepositoryBase
public IActionSequence getActionSequence(String solutionName,
String actionPath,
String sequenceName,
int localLoggingLevel,
int actionOperation)
ISolutionRepositorynull if the
requested action seqeuence is not found.
getActionSequence in interface ISolutionRepositorysolutionName - The name of the solution - like the root folderactionPath - The relative path (from the solution) of where the file is storedsequenceName - The name of the action sequencelocalLoggingLevel - The level at which to log messagesactionOperation - Whether the action sequence is being retrieved for administration or execution
public boolean hasAccess(IPermissionRecipient permRecipient,
ISolutionFile aFile,
int actionOperation)
ISolutionRepository
hasAccess in interface ISolutionRepositoryaFile - domain instance to checkactionOperation - permission requested (A constant from ISolutionRepository.)
public boolean hasAccess(ISolutionFile aFile,
int actionOperation)
hasAccess in interface ISolutionRepositoryaFile - domain instance to checkactionOperation - permission requested (A constant from ISolutionRepository.)
public boolean isPentahoAdministrator()
public Document getSolutionDocument(String documentPath,
int actionOperation)
public void reloadSolutionRepository(IPentahoSession localSession,
int localLoggingLevel)
ISolutionRepository
reloadSolutionRepository in interface ISolutionRepositorylocalSession - - The session associated with this solution repositorylocalLoggingLevel - - The requested level of logging
public Document getSolutions(String solutionName,
String pathName,
int actionOperation,
boolean visibleOnly)
ISolutionRepository
getSolutions in interface ISolutionRepositorysolutionName - The name of the solution to getpathName - The path from which to retrieveactionOperation - Indicates what the list will be used for - execution or administration
public String getValue(Document doc,
String xPath,
String defaultValue)
public Document getSolutionTree(int actionOperation)
ISolutionRepository
getSolutionTree in interface ISolutionRepository
public Document getSolutionTree(int actionOperation,
ISolutionFilter filter)
getSolutionTree in interface ISolutionRepositoryfilter - an implementation of a ISolutionFilter that determines which files will be returned
public Document getSolutionStructure(int actionOperation)
ISolutionRepository
getSolutionStructure in interface ISolutionRepositorypublic boolean synchronizeSolutionWithSolutionSource(IPentahoSession pSession)
ISolutionRepository
synchronizeSolutionWithSolutionSource in interface ISolutionRepositorypublic boolean solutionSynchronizationSupported()
solutionSynchronizationSupported in interface ISolutionRepositorypublic String resetSolutionFromFileSystem(IPentahoSession pSession)
public List loadSolutionFromFileSystem(IPentahoSession pSession,
String solutionRoot,
boolean deleteOrphans)
throws RepositoryException
pSession - Users' SessionsolutionRoot - The file system root folderdeleteOrphans - Whether to delete stranded references from RDBMS repository
RepositoryExceptionpublic ISolutionFile getRootFolder()
getRootFolder in interface ISolutionRepositorygetRootFolder in class SolutionRepositoryBasepublic RepositoryFile getSolutionById(String anId)
public List getChildrenFilesByParentId(String parentId)
public ISolutionFile getFileByPath(String path)
getFileByPath in interface ISolutionRepositorygetFileByPath in class SolutionRepositoryBasepath - the solution path to the desired resource
public ClassLoader getClassLoader(String path)
ISolutionRepository
getClassLoader in interface ISolutionRepositorypublic boolean resourceExists(String solutionPath)
ISolutionRepository
resourceExists in interface ISolutionRepositorysolutionPath - - path to the resource
public long resourceSize(String solutionPath)
ISolutionRepository
resourceSize in interface ISolutionRepositorysolutionPath - - path to the resource
public boolean removeSolutionFile(String solutionPath)
removeSolutionFile in interface ISolutionRepositoryremoveSolutionFile in class SolutionRepositoryBase
public boolean removeSolutionFile(String solution,
String path,
String fileName)
SolutionRepositoryBase
removeSolutionFile in interface ISolutionRepositoryremoveSolutionFile in class SolutionRepositoryBasepublic boolean deleteRepository(String repositoryNameToDelete)
public String getRepositoryName()
getRepositoryName in interface ISolutionRepositorypublic void setRepositoryName(String value)
repositoryName - The repositoryName to set.
public boolean keepFile(ISolutionFile solutionFile,
int actionOperation)
keepFile in interface ISolutionFilter
public void contributeAttributes(ISolutionFile solutionFile,
Element childNode)
contributeAttributes in interface ISolutionAttributeContributorpublic void exitPoint()
public int addSolutionFile(String baseUrl,
String path,
String fileName,
byte[] data,
boolean overwrite)
ISolutionRepository
addSolutionFile in interface ISolutionRepositoryaddSolutionFile in class SolutionRepositoryBase
public int addSolutionFile(String baseUrl,
String path,
String fileName,
File f,
boolean overwrite)
ISolutionRepository
addSolutionFile in interface ISolutionRepositoryaddSolutionFile in class SolutionRepositoryBasepublic String[] getAllActionSequences()
getAllActionSequences in interface ISolutionRepositorypublic long getSolutionFileLastModified(String path)
ISolutionRepository
getSolutionFileLastModified in interface ISolutionRepositorypublic boolean supportsAccessControls()
supportsAccessControls in interface ISolutionRepository
public int publish(String baseUrl,
String path,
String fileName,
byte[] data,
boolean overwrite)
throws PentahoAccessControlException
ISolutionRepository
publish in interface ISolutionRepositoryPentahoAccessControlException
public int publish(String baseUrl,
String path,
String fileName,
File f,
boolean overwrite)
throws PentahoAccessControlException
ISolutionRepository
publish in interface ISolutionRepositoryPentahoAccessControlException
public void share(ISolutionFile file,
List<IPermissionRecipient> shareRecipients)
ISolutionRepository
share in interface ISolutionRepositoryfile - file to shareshareRecipients - the users or roles with which to share (aka share-ees)
public void unshare(ISolutionFile file,
List<IPermissionRecipient> shareRecipients)
ISolutionRepository
unshare in interface ISolutionRepositoryfile - file to stop sharingshareRecipients - the users or roles with which to stop sharing
public void addPermission(ISolutionFile file,
IPermissionRecipient recipient,
IPermissionMask permission)
addPermission in interface ISolutionRepositoryfile - file whose ACL is to be modifiedrecipient - recipient of the permissionpermission - right to an action on this file by this user
public void setPermissions(ISolutionFile file,
Map<IPermissionRecipient,IPermissionMask> acl)
throws PentahoAccessControlException
setPermissions in interface ISolutionRepositoryfile - file whose ACL is to be modifiedacl - new ACL
PentahoAccessControlExceptionpublic Map<IPermissionRecipient,IPermissionMask> getPermissions(ISolutionFile file)
getPermissions in interface ISolutionRepositoryfile - file whose ACL is to be returned
public Map<IPermissionRecipient,IPermissionMask> getEffectivePermissions(ISolutionFile file)
getEffectivePermissions in interface ISolutionRepositoryfile - file whose ACL is to be returned
public ISolutionFile createFolder(File newFolder)
throws IOException
ISolutionRepository
createFolder in interface ISolutionRepositorycreateFolder in class SolutionRepositoryBasenewFolder - The File that points to the new folder to create
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||