Search in sources :

Example 1 with SidebarConfigElement

use of org.alfresco.web.config.SidebarConfigElement in project acs-community-packaging by Alfresco.

the class SidebarBean method getSidebarConfig.

// ------------------------------------------------------------------------------
// Helper methods
/**
 * Returns the SidebarConfigElement for the application
 *
 * @param context Faces context
 * @return The SidebarConfigElement object or null if it's not found
 */
public static SidebarConfigElement getSidebarConfig(FacesContext context) {
    SidebarConfigElement config = null;
    Config cfg = Application.getConfigService(context).getConfig("Sidebar");
    if (cfg != null) {
        config = (SidebarConfigElement) cfg.getConfigElement(SidebarConfigElement.CONFIG_ELEMENT_ID);
    }
    return config;
}
Also used : SidebarPluginConfig(org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig) Config(org.springframework.extensions.config.Config) SidebarConfigElement(org.alfresco.web.config.SidebarConfigElement)

Example 2 with SidebarConfigElement

use of org.alfresco.web.config.SidebarConfigElement in project acs-community-packaging by Alfresco.

the class UISidebar method setupActionGroupId.

/**
 * Sets up the corrent actions config group id on the given actions
 * component.
 *
 * @param context Faces context
 * @param actionsComponent The actions component to set the group id for
 */
protected void setupActionGroupId(FacesContext context, UIActions actionsComponent) {
    String actionsGroupId = null;
    SidebarConfigElement config = SidebarBean.getSidebarConfig(context);
    if (config != null) {
        SidebarPluginConfig plugin = config.getPlugin(getActivePlugin());
        if (plugin != null) {
            actionsGroupId = plugin.getActionsConfigId();
        }
    }
    actionsComponent.setValue(actionsGroupId);
}
Also used : SidebarPluginConfig(org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig) SidebarConfigElement(org.alfresco.web.config.SidebarConfigElement)

Aggregations

SidebarConfigElement (org.alfresco.web.config.SidebarConfigElement)2 SidebarPluginConfig (org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig)2 Config (org.springframework.extensions.config.Config)1