// language iteration below
Translator pageTranslator = new PackageTranslator(bundleName, I18nModule.getDefaultLocale());
// Open velocity page for this help page
String pagePath = bundleName.replace('.', '/') + ContextHelpModule.CHELP_DIR + page;
VelocityContainer container = new VelocityContainer("contextHelpPageVC", pagePath, pageTranslator, null);
Context ctx = container.getContext();
GlobalSettings globalSettings = new GlobalSettings() {
public int getFontSize() { return 100;}
public AJAXFlags getAjaxFlags() { return new EmptyAJAXFlags();}
public ComponentRenderer getComponentRendererFor(Component source) {
return null;
}
public boolean isIdDivsForced() { return false; }
};
Renderer renderer = Renderer.getInstance(container, pageTranslator, new EmptyURLBuilder(), null, globalSettings);
// Add render decorator with helper methods
VelocityRenderDecorator vrdec = new VelocityRenderDecorator(renderer, container);
ctx.put("r", vrdec);
// Add empty static dir url - only used to not generate error messages
ctx.put("chelpStaticDirUrl", "");
// Create document for each language using the velocity context
for (String langCode : languages) {
Locale locale = I18nManager.getInstance().getLocaleOrNull(langCode);
String relPagePath = langCode + "/" + bundleName + "/" + page;
if (log.isDebug()) log.debug("Indexing help page with path::" + relPagePath);