use of org.alfresco.web.config.WizardsConfigElement in project acs-community-packaging by Alfresco.
the class AlfrescoNavigationHandler method getWizardConfig.
/**
* Returns the wizard configuration object for the given wizard name.
* If there is a node in the dispatch context a lookup is performed using
* the node otherwise the global config section is used.
*
* @param name The name of wizard being launched
* @param dispatchContext The node being acted upon
* @return The WizardConfig for the wizard or null if no config could be found
*/
protected WizardConfig getWizardConfig(FacesContext context, String name, Node dispatchContext) {
WizardConfig wizardConfig = null;
ConfigService configSvc = Application.getConfigService(context);
Config config = null;
if (dispatchContext != null) {
if (logger.isDebugEnabled())
logger.debug("Using dispatch context for wizard lookup: " + dispatchContext.getType().toString());
// use the node to perform the lookup (this will include the global section)
config = configSvc.getConfig(dispatchContext);
} else {
if (logger.isDebugEnabled())
logger.debug("Looking up wizard in global config");
// just use the global
config = configSvc.getGlobalConfig();
}
if (config != null) {
WizardsConfigElement wizardsCfg = (WizardsConfigElement) config.getConfigElement(WizardsConfigElement.CONFIG_ELEMENT_ID);
if (wizardsCfg != null) {
wizardConfig = wizardsCfg.getWizard(name);
}
}
return wizardConfig;
}
Aggregations