/** Generate the Sitemap class */
public void run() {
Sitemap smap = null;
String markupLanguage = "sitemap";
String programmingLanguage = "java";
ProgramGenerator programGenerator = null;
try {
/* FIXME: Workaround -- set the logger XSLTFactoryLoader used to generate source
* within the sitemap generation phase.
* Needed because we never have the opportunity to handle the lifecycle of the
* XSLTFactoryLoader, since it is created by the Xalan engine.
*/
XSLTFactoryLoader.setLogger(getLogger());
programGenerator = (ProgramGenerator)this.manager.lookup(ProgramGenerator.ROLE);
smap = (Sitemap)programGenerator.load(this.manager, this.sourceFileName, markupLanguage,
programmingLanguage, this);
if (smap instanceof AbstractLoggable) {
((AbstractLoggable)smap).setLogger(getLogger());
}
// Swap old and new sitemaps
Sitemap oldSitemap = this.sitemap;
this.sitemap = smap;
programGenerator.release((CompiledComponent)oldSitemap);
// add the source factory for the cocoon protocol
this.sourceHandler.addFactory("cocoon",
new CocoonSourceFactory(this.sitemap, this.sitemap.getComponentManager()));
getLogger().debug("Sitemap regeneration complete");