* if an error occurs
*/
public void precompile(String fileName, Environment environment,
String markupLanguage, String programmingLanguage) throws Exception {
ProgramGenerator programGenerator = null;
Source source = null;
Object key = CocoonComponentManager.startProcessing(environment);
CocoonComponentManager.enterEnvironment(environment,
(ComponentManager) getComponentManager(), cocoon);
try {
if (log.isDebugEnabled()) {
log.debug("XSP generation begin:" + fileName);
}
System.out.println("Compiling " + fileName);
programGenerator = (ProgramGenerator) getComponentManager().lookup(
ProgramGenerator.ROLE);
source = sourceResolver.resolveURI(fileName);
CompiledComponent xsp = programGenerator.load(
getComponentManager(), source, markupLanguage,
programmingLanguage, environment);
System.out.println("[XSP generated] " + xsp);
if (log.isDebugEnabled()) {
log.debug("XSP generation complete:" + xsp);