IBindingFactory bfact = BindingDirectory.getFactory(Site.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
uctx.setDocument(new FileInputStream(m_configFile), m_configFile.getName(), null);
uctx.pushObject(this);
Object obj = uctx.unmarshalElement();
VelocityContext vctx = new VelocityContext();
List actives = new ArrayList();
vctx.put("actives", actives);
if (obj instanceof Menu) {
// handle basic linkages with source relative to configuration file
Menu menu = (Menu)obj;
menu.setLinkages("");
menu.loadContent(m_configFile.getAbsoluteFile().getParentFile());
// generate single-menu site image
vctx.put("menu", menu);
addValues(menu.getValues(), vctx);
recurseChildren(menu.getChildren(), vctx, actives);
} else {
// generate multiple-menu site image
Site site = (Site)obj;
ArrayList menus = site.getChildren();
site.initialize(m_sourceRoot);
vctx.put("site", site);
addValues(site.getValues(), vctx);
for (int i = 0; i < menus.size(); i++) {
Menu menu = (Menu)menus.get(i);
vctx.put("menu", menu);
String[] priors = addValues(menu.getValues(), vctx);
recurseChildren(menu.getChildren(), vctx, actives);
if (priors != null) {
restoreValues(menu.getValues(), priors, vctx);
}