Search in sources :

Example 1 with UIExtensionManager

use of org.xwiki.uiextension.UIExtensionManager in project xwiki-platform by xwiki.

the class UIExtensionScriptService method getExtensions.

/**
 * Retrieves all the {@link UIExtension}s for a given Extension Point.
 *
 * @param extensionPointId The ID of the Extension Point to retrieve the {@link UIExtension}s for
 * @return the list of {@link UIExtension} for the given Extension Point
 */
public List<UIExtension> getExtensions(String extensionPointId) {
    UIExtensionManager manager = this.uiExtensionManager;
    ComponentManager componentManager = contextComponentManagerProvider.get();
    if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) {
        try {
            // Look for a specific UI extension manager for the given extension point
            manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId);
        } catch (ComponentLookupException e) {
            this.logger.error("Failed to initialize UI extension manager", e);
        }
    }
    return manager.get(extensionPointId);
}
Also used : ComponentManager(org.xwiki.component.manager.ComponentManager) UIExtensionManager(org.xwiki.uiextension.UIExtensionManager) ComponentLookupException(org.xwiki.component.manager.ComponentLookupException)

Aggregations

ComponentLookupException (org.xwiki.component.manager.ComponentLookupException)1 ComponentManager (org.xwiki.component.manager.ComponentManager)1 UIExtensionManager (org.xwiki.uiextension.UIExtensionManager)1