Class UIExtensionScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("uix")
    @Singleton
    public class UIExtensionScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Allows scripts to easily access Interface Extensions APIs.
    Since:
    4.2M3
    Version:
    $Id: faf41b009484088f69cddfa5c1c88c4d9dd6c7f6 $
    • Constructor Detail

      • UIExtensionScriptService

        public UIExtensionScriptService()
    • Method Detail

      • getExtensions

        public List<UIExtension> getExtensions​(String extensionPointId)
        Retrieves all the UIExtensions for a given Extension Point.
        Parameters:
        extensionPointId - The ID of the Extension Point to retrieve the UIExtensions for
        Returns:
        the list of UIExtension for the given Extension Point
      • getExtensions

        public List<UIExtension> getExtensions​(String extensionPointId,
                                               Map<String,​String> filters)
        Retrieves the list of UIExtension for a given Extension Point. Examples:
        • Get only the UIExtensions with the given IDs for the Extension Point "platform.example"
          $services.uix.getExtensions('platform.example', {'select' : 'id1, id2, id3'})
        • Get all the UIExtensions for the Extension Point "platform.example" except the UIExtensions with the IDs "id2" and "id3"
          $services.uix.getExtensions('platform.example', {'exclude' : 'id2, id3'})
        • Get all the UIExtensions for the Extension Point "platform.example" and order them by one of their parameter
          $services.uix.getExtensions('platform.example', {'sortByParameter' : 'parameterKey'})
        • Get only the UIExtensions with the given IDs for the Extension Point "platform.example" and order them by one of their parameter
          $services.uix.getExtensions('platform.example',
           {'select' : 'id1, id2, id3', 'sortByParameter' : 'parameterKey'})
        Parameters:
        extensionPointId - The ID of the Extension Point to retrieve the UIExtensions for
        filters - Optional filters to apply before retrieving the list
        Returns:
        the list of UIExtension for the given Extension Point