org.pentaho.platform.api.repository
Interface IContentLocation

All Known Implementing Classes:
ContentLocation

public interface IContentLocation

A Content location is analagous to a folder. It is the location of the content.

Author:
mbatchel
See Also:
IContentItem, IContentRepository

Method Summary
 IContentItem getContentItemById(String contentItemId)
          Gets a content item by its Id - this is the most efficient way to get a content item from a location
 IContentItem getContentItemByName(String name)
          Gets a child content item by name.
 IContentItem getContentItemByPath(String path)
          Returns the contentitem with the specified path
 Iterator getContentItemIterator()
          Iterates over registered content items.
 String getDescription()
           
 String getDirPath()
           
 String getId()
           
 String getName()
           
 int getRevision()
           
 String getSolutionId()
           
 File makeSubdirectory(String subDirName)
          Creates a subdirectory in the content location.
 IContentItem newContentItem(String name, String title, String extension, String mimeType, String url, int writeMode)
          Create a new ContentItem parented to this content location.
 IContentItem newContentItem(String contentId, String name, String title, String extension, String mimeType, String url, int writeMode)
          Create a new ContentItem parented to this content location.
 

Method Detail

newContentItem

IContentItem newContentItem(String name,
                            String title,
                            String extension,
                            String mimeType,
                            String url,
                            int writeMode)
                            throws ContentException
Create a new ContentItem parented to this content location.

Parameters:
name - The name of the content item
title - The title of the content item
extension - The extension (i.e. .txt or .pdf) of the content item.
mimeType - The mime type of the content item
url - Optional URL to get to the content.
writeMode - The write mode of the content item. Please see IContentItem for valid write modes
Returns:
A new IContentItem instance, parented to the ContentLocation
Throws:
ContentException

newContentItem

IContentItem newContentItem(String contentId,
                            String name,
                            String title,
                            String extension,
                            String mimeType,
                            String url,
                            int writeMode)
                            throws ContentException
Create a new ContentItem parented to this content location. This version is used when the content Id is already generated.

Parameters:
contentId - The Identifier for the new content item
name - The name of the content item
title - The title of the content item
extension - The extension (i.e. .txt or .pdf) of the content item.
mimeType - The mime type of the content item
url - Optional URL to get to the content.
writeMode - The write mode of the content item. Please see IContentItem for valid write modes
Returns:
A new IContentItem instance, parented to the ContentLocation
Throws:
ContentException

getRevision

int getRevision()
Returns:
The revision of the content item (as determined by Hibernate)

getContentItemIterator

Iterator getContentItemIterator()
Iterates over registered content items.

Returns:
Iterator of the child content

getContentItemById

IContentItem getContentItemById(String contentItemId)
Gets a content item by its Id - this is the most efficient way to get a content item from a location

Parameters:
contentItemId - The id to retrieve
Returns:
The content item

getContentItemByName

IContentItem getContentItemByName(String name)
Gets a child content item by name. Returns the ContentItem with the specified name, and a parent of the content location

Parameters:
name - The name to find
Returns:
ContentItem

getContentItemByPath

IContentItem getContentItemByPath(String path)
Returns the contentitem with the specified path

Parameters:
path - The path to look for
Returns:
The content item

makeSubdirectory

File makeSubdirectory(String subDirName)
                      throws ContentException
Creates a subdirectory in the content location.

Parameters:
subDirName - The directory name to create
Returns:
File created
Throws:
ContentException

getDirPath

String getDirPath()
Returns:
The directory path

getId

String getId()
Returns:
Returns the UUID of the content location

getName

String getName()
Returns:
The name of the content location

getSolutionId

String getSolutionId()
Returns:
The Solution Id

getDescription

String getDescription()
Returns:
The description of the Content Location