contentbox.models.ui

Class WidgetService

lucee.Component
    extended by contentbox.models.ui.WidgetService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Manages ContentBox Widgets

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any coldbox


    • access = public
    • returntype = any
    • inject = coldbox
    true false
    struct coreWidgetsMap
          The core widgets map.

    • access = public
    • returntype = any
    true false
    string coreWidgetsPath
          The core widgets location path.

    • access = public
    • returntype = any
    true false
    struct customWidgetsMap
          The custom widgets map.

    • access = public
    • returntype = any
    true false
    string customWidgetsPath
          The custom widgets location path.

    • access = public
    • returntype = any
    true false
    any loadedWidgets
          The loaded widgets in the entire system: core, custom, theme, modules.

    • access = public
    • returntype = any
    true false
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any moduleService


    • access = public
    • returntype = any
    • inject = ModuleService@contentbox
    true false
    any moduleSettings


    • access = public
    • returntype = any
    • inject = coldbox:setting:modules
    true false
    any settingService


    • access = public
    • returntype = any
    • inject = id:settingService@contentbox
    true false
    any themeService


    • access = public
    • returntype = any
    • inject = themeService@contentbox
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    string discoverWidgetType(any name)
         Discover the type of widget, either custom or core.
    string getColdbox()
    string getCoreWidgetsMap()
    string getCoreWidgetsPath()
    string getCustomWidgetsMap()
    string getCustomWidgetsPath()
    string getLoadedWidgets()
    string getLog()
    string getModuleService()
    string getModuleSettings()
    string getSettingService()
    string getThemeService()
    any getWidget(any name, string type='core')
         Get a widget by name and type (defaults to `core|custom`).
    any getWidgetByDiscovery(any name)
         Get a widget instance by name convention discovery.
    query getWidgetCategories()
         Get unique, sorted widget categories from main widget query.
    string getWidgetCategory(any name, string type='core')
         Get a widget category.
    string getWidgetIcon(any name, string type='core')
         Get a widget icon representation.
    any getWidgetRenderArgs(any udf, any widget, any type)
         Get widget rendering arguments.
    query getWidgets([boolean reload='false'])
         Get all installed widgets in ContentBox by looking at the following locations:.
    private query getWidgetsFromPath(any path)
         Get a query listing of widgets in a path.
    array getWidgetsList()
         Get installed widgets as an array of names.
    string getWirebox()
    any onDIComplete()
         onDIComplete.
    WidgetService processModuleWidgets([query qRecords='[runtime expression]'])
         Discover modules widgets and attach records to incoming widget records.
    WidgetService processThemeWidgets([query qRecords='[runtime expression]'])
         Discover active theme widgets and attach records to incoming widget records.
    WidgetService processWidgets([query qRecords='[runtime expression]'], [any type])
         Discover the custom location widgets.
    boolean removeWidget(any widgetFile)
         Remove a widget from the custom locations.
    any ripExtension(any filename)
         Rip Extensions from file name.
    any setColdbox(any coldbox)
    any setCoreWidgetsMap(struct coreWidgetsMap)
    any setCoreWidgetsPath(string coreWidgetsPath)
    any setCustomWidgetsMap(struct customWidgetsMap)
    any setCustomWidgetsPath(string customWidgetsPath)
    any setLoadedWidgets(any loadedWidgets)
    any setLog(any log)
    any setModuleService(any moduleService)
    any setModuleSettings(any moduleSettings)
    any setSettingService(any settingService)
    any setThemeService(any themeService)
    any setWirebox(any wirebox)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    coldbox

    property any coldbox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox
    serializable - true

    coreWidgetsMap

    property struct coreWidgetsMap

    The core widgets map

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    coreWidgetsPath

    property string coreWidgetsPath

    The core widgets location path

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    customWidgetsMap

    property struct customWidgetsMap

    The custom widgets map

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    customWidgetsPath

    property string customWidgetsPath

    The custom widgets location path

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    loadedWidgets

    property any loadedWidgets

    The loaded widgets in the entire system: core, custom, theme, modules

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    moduleService

    property any moduleService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ModuleService@contentbox
    serializable - true

    moduleSettings

    property any moduleSettings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:setting:modules
    serializable - true

    settingService

    property any settingService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - id:settingService@contentbox
    serializable - true

    themeService

    property any themeService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - themeService@contentbox
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    discoverWidgetType

    public string discoverWidgetType(any name)

    Discover the type of widget, either custom or core. The lookup order is: custom, theme, core

    Parameters:
    name - The name of the widget

    getColdbox

    public string getColdbox()


    getCoreWidgetsMap

    public string getCoreWidgetsMap()


    getCoreWidgetsPath

    public string getCoreWidgetsPath()


    getCustomWidgetsMap

    public string getCustomWidgetsMap()


    getCustomWidgetsPath

    public string getCustomWidgetsPath()


    getLoadedWidgets

    public string getLoadedWidgets()


    getLog

    public string getLog()


    getModuleService

    public string getModuleService()


    getModuleSettings

    public string getModuleSettings()


    getSettingService

    public string getSettingService()


    getThemeService

    public string getThemeService()


    getWidget

    public any getWidget(any name, string type='core')

    Get a widget by name and type (defaults to `core|custom`)

    Parameters:
    name - The name of the widget
    type - This can be one of the following: core, custom, theme, module
    Throws:
    WidgetNotFoundException

    getWidgetByDiscovery

    public any getWidgetByDiscovery(any name)

    Get a widget instance by name convention discovery - ~name = Layout - name@module = Module - name = Custom or Core

    Parameters:
    name - The convention name

    getWidgetCategories

    public query getWidgetCategories()

    Get unique, sorted widget categories from main widget query returns Query


    getWidgetCategory

    public string getWidgetCategory(any name, string type='core')

    Get a widget category

    Parameters:
    name - The name of the widget or the actual widget object
    type - This can be one of the following: core, theme, module

    getWidgetIcon

    public string getWidgetIcon(any name, string type='core')

    Get a widget icon representation

    Parameters:
    name - The name of the widget or the widget instance
    type - This can be one of the following: core, theme, module

    getWidgetRenderArgs

    public any getWidgetRenderArgs(any udf, any widget, any type)

    Get widget rendering arguments

    Parameters:
    udf - The target UDF to render out arguments for
    widget - The widget name
    type - The widget type
    Returns:
    The argument metadata structure

    getWidgets

    public query getWidgets([boolean reload='false'])

    Get all installed widgets in ContentBox by looking at the following locations: - core - custom - active theme - registered modules

    Parameters:
    reload - Widgets are lazy loaded, or you can force a reload

    getWidgetsFromPath

    private query getWidgetsFromPath(any path)

    Get a query listing of widgets in a path

    Parameters:
    path - The path to check

    getWidgetsList

    public array getWidgetsList()

    Get installed widgets as an array of names


    getWirebox

    public string getWirebox()


    onDIComplete

    public any onDIComplete()

    onDIComplete


    processModuleWidgets

    public WidgetService processModuleWidgets([query qRecords='[runtime expression]'])

    Discover modules widgets and attach records to incoming widget records

    Parameters:
    qRecords - The records query to attach yourself to

    processThemeWidgets

    public WidgetService processThemeWidgets([query qRecords='[runtime expression]'])

    Discover active theme widgets and attach records to incoming widget records

    Parameters:
    qRecords - The records query to attach yourself to

    processWidgets

    public WidgetService processWidgets([query qRecords='[runtime expression]'], [any type])

    Discover the custom location widgets

    Parameters:
    qRecords - The records query to attach yourself to
    type - The type to process

    removeWidget

    public boolean removeWidget(any widgetFile)

    Remove a widget from the custom locations

    Parameters:
    widgetFile - The location of the widget to remove

    ripExtension

    public any ripExtension(any filename)

    Rip Extensions from file name

    Parameters:
    filename - The target to rip

    setColdbox

    public any setColdbox(any coldbox)

    Parameters:
    coldbox

    setCoreWidgetsMap

    public any setCoreWidgetsMap(struct coreWidgetsMap)

    Parameters:
    coreWidgetsMap

    setCoreWidgetsPath

    public any setCoreWidgetsPath(string coreWidgetsPath)

    Parameters:
    coreWidgetsPath

    setCustomWidgetsMap

    public any setCustomWidgetsMap(struct customWidgetsMap)

    Parameters:
    customWidgetsMap

    setCustomWidgetsPath

    public any setCustomWidgetsPath(string customWidgetsPath)

    Parameters:
    customWidgetsPath

    setLoadedWidgets

    public any setLoadedWidgets(any loadedWidgets)

    Parameters:
    loadedWidgets

    setLog

    public any setLog(any log)

    Parameters:
    log

    setModuleService

    public any setModuleService(any moduleService)

    Parameters:
    moduleService

    setModuleSettings

    public any setModuleSettings(any moduleSettings)

    Parameters:
    moduleSettings

    setSettingService

    public any setSettingService(any settingService)

    Parameters:
    settingService

    setThemeService

    public any setThemeService(any themeService)

    Parameters:
    themeService

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox