org.jpublish
Interface Repository

All Superinterfaces:
Configurable
All Known Implementing Classes:
AbstractRepository

public interface Repository
extends Configurable

A common interface which all repositories must implement. A Repository represents a data store which contains content.

Author:
Anthony Eden

Method Summary
 java.lang.String get(java.lang.String path)
          Get the content from the given path.
 java.lang.String get(java.lang.String path, org.apache.velocity.VelocityContext context)
          Get the content from the given path and merge it with the given context.
 long getLastModified(java.lang.String path)
          Get the last modified time in milliseconds for the given path.
 java.lang.String getName()
          Get the name of the repository.
 void setSiteContext(SiteContext siteContext)
          Set the SiteContext.
 
Methods inherited from interface org.jpublish.Configurable
loadConfiguration
 

Method Detail

getName

public java.lang.String getName()
Get the name of the repository. This name is used to expose the Repository in the Velocity engine.
Returns:
The Repository name

get

public java.lang.String get(java.lang.String path)
                     throws java.lang.Exception
Get the content from the given path. Implementations of this method should NOT merge the content using Velocity.
Parameters:
path - The relative content path
Returns:
The content as a String
Throws:
java.lang.Exception - Any Exception

get

public java.lang.String get(java.lang.String path,
                            org.apache.velocity.VelocityContext context)
                     throws java.lang.Exception
Get the content from the given path and merge it with the given context.
Parameters:
path - The content path
context - The VelocityContext
Returns:
The content as a String
Throws:
java.lang.Exception - Any Exception

getLastModified

public long getLastModified(java.lang.String path)
                     throws java.lang.Exception
Get the last modified time in milliseconds for the given path.
Parameters:
path - The content path
Returns:
The last modified time in milliseconds
Throws:
java.lang.Exception - Any Exception

setSiteContext

public void setSiteContext(SiteContext siteContext)
Set the SiteContext. The repository can then get information about the site through the context.
Parameters:
siteContext - The siteContext


Copyright (C) 2001 Anthony Eden. All Rights Reserved.