org.pentaho.platform.api.repository
Interface IContentRepository

All Superinterfaces:
ISessionContainer
All Known Implementing Classes:
ContentRepository

public interface IContentRepository
extends ISessionContainer

The ContentRepository is responsible for all the DAO calls used to get content items out of a repository. This interface is used to create IContentLocation objects. The IContentLocation object can then be used to create child IContentItem objects.

Author:
mbatchel

Method Summary
 int deleteContentOlderThanDate(Date agingDate)
          This method is used to delete ContentItemFile objects that are older than the specified date.
 List getAllBackgroundExecutedContentItems(IPentahoSession session)
          Gets list of all content items in the Background Execution id list.
 List getAllContentLocations()
           
 List getBackgroundExecutedContentItemsForUser(IPentahoSession session)
          Gets list of Content Items from a users' background execution list.
 IContentItem getContentItemById(String theId)
          Gets a content item by id.
 IContentItem getContentItemByPath(String thePath)
          Gets a content item by path
 IContentLocation getContentLocationById(String theId)
          Retrieves a content location by Id.
 IContentLocation getContentLocationByPath(String thePath)
          Retrieves a content location by the path.
 IBackgroundExecutedContentId newBackgroundExecutedContentId(IPentahoSession session, String contentId)
          Returns a new background executed content object
 IContentLocation newContentLocation(String thePath, String theName, String description, String solutionId, boolean createIfNotExists)
          Creates a new Content Location.
 void removeBackgroundExecutedContentId(IPentahoSession session, String contentId)
          Removes an ID from the background executed content Id list
 List searchContentItemsForTerms(String searchTerm, int searchType)
          Content Item finder - searches for the terms amongst content items
 List searchLocationsAndItemsForTerms(String searchTerm, int searchType)
          Content Location and Item finder - Simply aggregates the output of the searchLocationsForTerms and searchContentItemsForTerms.
 List searchLocationsForTerms(String searchTerm, int searchType)
          Content Location finder - searches for the terms amongst the content locations
 void setSession(IPentahoSession session)
          Set the session for this session container.
 

Method Detail

newContentLocation

IContentLocation newContentLocation(String thePath,
                                    String theName,
                                    String description,
                                    String solutionId,
                                    boolean createIfNotExists)
                                    throws RepositoryException
Creates a new Content Location. A content location is analogous to a folder

Parameters:
thePath - The path
theName - The name of the location
description - The description of the location
solutionId - The Id of the solution
createIfNotExists - Attempt to create the physical folder on the hard drive
Returns:
The new content location
Throws:
RepositoryException

getContentLocationByPath

IContentLocation getContentLocationByPath(String thePath)
                                          throws RepositoryException
Retrieves a content location by the path.

Parameters:
thePath - The path to search for
Returns:
The content location
Throws:
RepositoryException

getContentLocationById

IContentLocation getContentLocationById(String theId)
Retrieves a content location by Id. This is the most efficient way to retrieve a content location

Parameters:
theId - The Id to retrieve
Returns:
The content location

getContentItemByPath

IContentItem getContentItemByPath(String thePath)
Gets a content item by path

Parameters:
thePath - The path of the content item to find
Returns:
The Content Item with the specified path

getContentItemById

IContentItem getContentItemById(String theId)
Gets a content item by id. This is the most efficient way to retrieve a content item.

Parameters:
id - The id of the content item to find
Returns:
The Content Item with the specified path

getAllContentLocations

List getAllContentLocations()
Returns:
A list of all content locations

searchLocationsForTerms

List searchLocationsForTerms(String searchTerm,
                             int searchType)
Content Location finder - searches for the terms amongst the content locations

Parameters:
searchTerm - The search term(s) to find
searchType -
Returns:
List of matching Content Locations.
See Also:
ISearchable

searchContentItemsForTerms

List searchContentItemsForTerms(String searchTerm,
                                int searchType)
Content Item finder - searches for the terms amongst content items

Parameters:
searchTerm - The search term(s) to find
searchType -
Returns:
List of matching Content Items.
See Also:
ISearchable

searchLocationsAndItemsForTerms

List searchLocationsAndItemsForTerms(String searchTerm,
                                     int searchType)
Content Location and Item finder - Simply aggregates the output of the searchLocationsForTerms and searchContentItemsForTerms.

Parameters:
searchTerm - The search term(s) to find
searchType -
Returns:
List of matching Content Locations first, followed by Content Items.
See Also:
ISearchable

setSession

void setSession(IPentahoSession session)
Description copied from interface: ISessionContainer
Set the session for this session container.

Specified by:
setSession in interface ISessionContainer
Parameters:
session - Sets the IPentahoSession Content Repository. This also begins the Hibernate transaction.

deleteContentOlderThanDate

int deleteContentOlderThanDate(Date agingDate)
This method is used to delete ContentItemFile objects that are older than the specified date.

Parameters:
agingDate - Date to use for selecting items for deleting. The argument is used as a "Less Than". The date is NOT inclusive. I.e., not "Less Than or Equal To".
Returns:
Count of content item files that were removed from the content repository and the file system.

newBackgroundExecutedContentId

IBackgroundExecutedContentId newBackgroundExecutedContentId(IPentahoSession session,
                                                            String contentId)
Returns a new background executed content object

Parameters:
session - Users' session object
contentId - The content id to reference.
Returns:
new BackgroundExecutedContent

getBackgroundExecutedContentItemsForUser

List getBackgroundExecutedContentItemsForUser(IPentahoSession session)
Gets list of Content Items from a users' background execution list.

Parameters:
session - The users' session
Returns:
List of IContentItem objects

getAllBackgroundExecutedContentItems

List getAllBackgroundExecutedContentItems(IPentahoSession session)
Gets list of all content items in the Background Execution id list. Should only be used in an administrative capacity

Parameters:
session - Users session
Returns:
List of IContentItem objects

removeBackgroundExecutedContentId

void removeBackgroundExecutedContentId(IPentahoSession session,
                                       String contentId)
Removes an ID from the background executed content Id list

Parameters:
session - Users' session
contentId - The content id to remove.