org.jpublish
Class RepositoryWrapper
java.lang.Object
|
+--org.jpublish.RepositoryWrapper
- public class RepositoryWrapper
- extends java.lang.Object
A wrapper around any repository. This wrapper is used to expose the
Repository to the Velocity engine. The current context is stored when
the wrapper is created.
- Author:
- Anthony Eden
Constructor Summary |
RepositoryWrapper(Repository repository,
org.apache.velocity.VelocityContext context)
Construct a new RepositoryWrapper over the given repository using
the given context for merging. |
Method Summary |
java.lang.String |
get(java.lang.String path)
Get the content at the given path. |
java.lang.String |
get(java.lang.String path,
boolean merged)
Get the content at the given path, optinally merging it with the
associated VelocityContext. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RepositoryWrapper
public RepositoryWrapper(Repository repository,
org.apache.velocity.VelocityContext context)
- Construct a new RepositoryWrapper over the given repository using
the given context for merging.
- Parameters:
repository
- The repositorycontext
- The VelocityContext
get
public java.lang.String get(java.lang.String path)
- Get the content at the given path. The content will be merged
with the associated VelocityContext.
- Parameters:
path
- The content path- Returns:
- The content as a String
get
public java.lang.String get(java.lang.String path,
boolean merged)
- Get the content at the given path, optinally merging it with the
associated VelocityContext. If merge is true then merging will
occur. Errors will be caught and the error message will be returned
in place of the content.
- Parameters:
path
- The content pathmerge
- True to merge- Returns:
- The content as a String
Copyright (C) 2001 Anthony Eden. All Rights Reserved.