org.sitemesh.offline
Class SiteMeshOffline

java.lang.Object
  extended by org.sitemesh.offline.SiteMeshOffline

public class SiteMeshOffline
extends Object

Tools for applying decorators to offline web pages (static content).

Example

 Directory sourceDir = new FileSystemDirectory("src/html");
 Directory dirDir = new FileSystemDirectory("build/html");
 ContentProcessor contentProcessor = // your ContentProcesor
 DecoratorSelector decoratorSelector = // your DecoratorSelector

 SiteMeshOffline siteMeshOffline = new SiteMeshOffline(
     contentProcessor, decoratorSelector, sourceDir, destinationDir);

 siteMeshOffline.process("somecontent.html");
 siteMeshOffline.process("morecontent.html");
 

Author:
Joe Walnes

Constructor Summary
SiteMeshOffline(ContentProcessor contentProcessor, DecoratorSelector<OfflineContext> decoratorSelector, Directory sourceDirectory, Directory destinationDirectory)
           
 
Method Summary
 Directory getDestinationDirectory()
          Directory the generator writes the destination (decorated) files from.
 Directory getSourceDirectory()
          Directory the generator reads the source (undecorated) files from.
 void process(String path)
          Process a file (loaded from source directory), applying decorators and returning the result as a CharBuffer.
 CharBuffer processContent(String path, CharBuffer original)
          Process content passed in, applying decorators and returning the result as a CharBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteMeshOffline

public SiteMeshOffline(ContentProcessor contentProcessor,
                       DecoratorSelector<OfflineContext> decoratorSelector,
                       Directory sourceDirectory,
                       Directory destinationDirectory)
Method Detail

getSourceDirectory

public Directory getSourceDirectory()
Directory the generator reads the source (undecorated) files from.


getDestinationDirectory

public Directory getDestinationDirectory()
Directory the generator writes the destination (decorated) files from.


process

public void process(String path)
             throws IOException
Process a file (loaded from source directory), applying decorators and returning the result as a CharBuffer.

Throws:
IOException

processContent

public CharBuffer processContent(String path,
                                 CharBuffer original)
                          throws IOException
Process content passed in, applying decorators and returning the result as a CharBuffer. The path is required as the DecoratorSelector may use this to determine which decorators should be applied.

Throws:
IOException


Copyright © 2011. All Rights Reserved.