contentbox.models.modules

Class ModuleService

lucee.Component
    extended by cborm.models.BaseORMService
      extended by cborm.models.VirtualEntityService
        extended by contentbox.models.modules.ModuleService

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

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


    • access = public
    • returntype = any
    • inject = coldbox:moduleService
    true false
    any contentBoxSettings


    • access = public
    • returntype = any
    • inject = coldbox:moduleConfig:contentbox
    true false
    string coreModulesInvocationPath
          The invocation path for core modules.

    • access = public
    • returntype = any
    true false
    string coreModulesPath
          The absolute path to core module locations.

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


    • access = public
    • returntype = any
    • inject = coldbox:moduleConfig:contentbox-custom
    true false
    string customModulesInvocationPath
          The invocation path for custom modules.

    • access = public
    • returntype = any
    true false
    string customModulesPath
          The absolute path to custom module locations.

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


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    struct moduleConfigCache
          ColdBox Module Config Cache reference.

    • access = public
    • returntype = any
    true false
    struct moduleMap
          Module Map References.

    • access = public
    • returntype = any
    true false
    struct moduleRegistry
          ColdBox Module Registry reference.

    • access = public
    • returntype = any
    true false
    struct moduleWidgetCache
          The module widget cache.

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


    • access = public
    • returntype = any
    • inject = settingService@contentbox
    true false
    any widgetService


    • access = public
    • returntype = any
    • inject = provider:widgetService@contentbox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    ModuleService activateModule(any name)
         Activate a module from ContentBox.
    private ModuleService buildModuleWidgetsCache([array modules])
         Iterates over all registered, active modules and sets any found widgets into a cache in moduleservice.
    ModuleService deactivateModule(any name)
         Deactivate a module from ContentBox.
    ModuleService deleteModule(any name)
         Delete Module, should only be done on deactivated modules.
    private ModuleService detachColdBoxModuleRegistration(any name)
         Detach coldbox module configuration registrations.
    Module findModuleByEntryPoint(any entryPoint)
         Find a module in the DB by entry point.
    struct findModules([any isActive='any'], [any moduleType])
         Find modules in ContentBox using the active criteria or `any`.
    string getColdboxModuleService()
    string getContentBoxSettings()
    string getCoreModulesInvocationPath()
    string getCoreModulesPath()
    string getCustomModuleSettings()
    string getCustomModulesInvocationPath()
    string getCustomModulesPath()
    string getLog()
    string getModuleConfigCache()
    string getModuleMap()
    string getModuleRegistry()
    string getModuleWidgetCache()
    string getModuleWidgetInvocationPath(string widgetName)
         Shortcut to get the invocation path for requested widget from modules' widget cache.
    private array getModulesOnDisk(any path)
         Get a collection of directory modules on disk at a specific location.
    string getSettingService()
    string getWidgetService()
    any onDIComplete()
         Executes after DI completion.
    any populateModule([any module], [any config])
         Populate module from Module Configuration CFC and returns the module.
    Module registerNewModule(any name, any type)
         Register a new module and return the module representation, this does not activate, just registers.
    ModuleService resetModules()
         Reset all modules by deactivating all of them and cleaning our db history.
    any setColdboxModuleService(any coldboxModuleService)
    any setContentBoxSettings(any contentBoxSettings)
    any setCoreModulesInvocationPath(string coreModulesInvocationPath)
    any setCoreModulesPath(string coreModulesPath)
    any setCustomModuleSettings(any customModuleSettings)
    any setCustomModulesInvocationPath(string customModulesInvocationPath)
    any setCustomModulesPath(string customModulesPath)
    any setLog(any log)
    any setModuleConfigCache(struct moduleConfigCache)
    any setModuleMap(struct moduleMap)
    any setModuleRegistry(struct moduleRegistry)
    any setModuleWidgetCache(struct moduleWidgetCache)
    any setSettingService(any settingService)
    any setWidgetService(any widgetService)
    ModuleService startup()
         Startup the service.
     
    Methods inherited from class cborm.models.VirtualEntityService
    autoCast, convertIdValueToJavaType, convertValueToJavaType, count, countWhere, deleteAll, deleteByID, deleteByQuery, deleteWhere, evictCollection, executeQuery, exists, findAllWhere, findWhere, get, getAll, getEntityName, getKey, getOrFail, getPropertyNames, getTableName, idCast, list, new, newCriteria, onMissingMethod, setEntityName
     
    Methods inherited from class cborm.models.BaseORMService
    $transactioned, buildJavaProxy, clear, createService, delete, evict, evictQueries, findAll, findByExample, findIt, findOrFail, getBeanPopulator, getDatasource, getDefaultAsQuery, getDirtyPropertyNames, getDynamicProcessor, getEntityGivenName, getEntityMetadata, getEventHandling, getKeyValue, getLogger, getORMEventHandler, getObjectPopulator, getOrm, getPropertyValues, getQueryCacheRegion, getRestrictions, getSessionStatistics, getStringBuilder, getUseQueryCaching, getUseTransactions, getWirebox, isDirty, isSessionDirty, merge, nullValue, populate, populateFromJson, populateFromQuery, populateFromXml, populateWithPrefix, refresh, save, saveAll, sessionContains, setDatasource, setDefaultAsQuery, setEventHandling, setLogger, setORM, setORMEventHandler, setQueryCacheRegion, setUseQueryCaching, setUseTransactions, setWirebox, when
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    coldboxModuleService

    property any coldboxModuleService

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

    contentBoxSettings

    property any contentBoxSettings

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

    coreModulesInvocationPath

    property string coreModulesInvocationPath

    The invocation path for core modules

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

    coreModulesPath

    property string coreModulesPath

    The absolute path to core module locations

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

    customModuleSettings

    property any customModuleSettings

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

    customModulesInvocationPath

    property string customModulesInvocationPath

    The invocation path for custom modules

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

    customModulesPath

    property string customModulesPath

    The absolute path to custom module locations

    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

    moduleConfigCache

    property struct moduleConfigCache

    ColdBox Module Config Cache reference

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

    moduleMap

    property struct moduleMap

    Module Map References

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

    moduleRegistry

    property struct moduleRegistry

    ColdBox Module Registry reference

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

    moduleWidgetCache

    property struct moduleWidgetCache

    The module widget cache

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

    settingService

    property any settingService

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

    widgetService

    property any widgetService

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

    Method Detail

    activateModule

    public ModuleService activateModule(any name)

    Activate a module from ContentBox

    Parameters:
    name - The name of the module to activate

    buildModuleWidgetsCache

    private ModuleService buildModuleWidgetsCache([array modules])

    Iterates over all registered, active modules and sets any found widgets into a cache in moduleservice

    Parameters:
    modules - Optional passed array to use to build the module cache with, else query the database

    deactivateModule

    public ModuleService deactivateModule(any name)

    Deactivate a module from ContentBox

    Parameters:
    name - The module to deactivate

    deleteModule

    public ModuleService deleteModule(any name)

    Delete Module, should only be done on deactivated modules

    Parameters:
    name - The name of the module to delete

    detachColdBoxModuleRegistration

    private ModuleService detachColdBoxModuleRegistration(any name)

    Detach coldbox module configuration registrations

    Parameters:
    name - The name of the module to detach

    findModuleByEntryPoint

    public Module findModuleByEntryPoint(any entryPoint)

    Find a module in the DB by entry point

    Parameters:
    entryPoint - The point to find
    Returns:
    The persisted module or a new module object representing not found.

    findModules

    public struct findModules([any isActive='any'], [any moduleType])

    Find modules in ContentBox using the active criteria or `any`

    Parameters:
    isActive - The active criteria, true, false or any for all modules
    moduleType - The module type criteria
    Returns:
    struct:{ count:numeric, modules:array of objects }

    getColdboxModuleService

    public string getColdboxModuleService()


    getContentBoxSettings

    public string getContentBoxSettings()


    getCoreModulesInvocationPath

    public string getCoreModulesInvocationPath()


    getCoreModulesPath

    public string getCoreModulesPath()


    getCustomModuleSettings

    public string getCustomModuleSettings()


    getCustomModulesInvocationPath

    public string getCustomModulesInvocationPath()


    getCustomModulesPath

    public string getCustomModulesPath()


    getLog

    public string getLog()


    getModuleConfigCache

    public string getModuleConfigCache()


    getModuleMap

    public string getModuleMap()


    getModuleRegistry

    public string getModuleRegistry()


    getModuleWidgetCache

    public string getModuleWidgetCache()


    getModuleWidgetInvocationPath

    public string getModuleWidgetInvocationPath(string widgetName)

    Shortcut to get the invocation path for requested widget from modules' widget cache

    Parameters:
    widgetName - {String}
    Returns:
    The invocation path or empty if not found

    getModulesOnDisk

    private array getModulesOnDisk(any path)

    Get a collection of directory modules on disk at a specific location

    Parameters:
    path - The path to check
    Returns:
    An array of names found on disk

    getSettingService

    public string getSettingService()


    getWidgetService

    public string getWidgetService()


    onDIComplete

    public any onDIComplete()

    Executes after DI completion


    populateModule

    public any populateModule([any module], [any config])

    Populate module from Module Configuration CFC and returns the module

    Parameters:
    module
    config - The config object to populate with
    Returns:
    The module populated

    registerNewModule

    public Module registerNewModule(any name, any type)

    Register a new module and return the module representation, this does not activate, just registers

    Parameters:
    name - The name of the module to register
    type - The type of module: core or custom

    resetModules

    public ModuleService resetModules()

    Reset all modules by deactivating all of them and cleaning our db history


    setColdboxModuleService

    public any setColdboxModuleService(any coldboxModuleService)

    Parameters:
    coldboxModuleService

    setContentBoxSettings

    public any setContentBoxSettings(any contentBoxSettings)

    Parameters:
    contentBoxSettings

    setCoreModulesInvocationPath

    public any setCoreModulesInvocationPath(string coreModulesInvocationPath)

    Parameters:
    coreModulesInvocationPath

    setCoreModulesPath

    public any setCoreModulesPath(string coreModulesPath)

    Parameters:
    coreModulesPath

    setCustomModuleSettings

    public any setCustomModuleSettings(any customModuleSettings)

    Parameters:
    customModuleSettings

    setCustomModulesInvocationPath

    public any setCustomModulesInvocationPath(string customModulesInvocationPath)

    Parameters:
    customModulesInvocationPath

    setCustomModulesPath

    public any setCustomModulesPath(string customModulesPath)

    Parameters:
    customModulesPath

    setLog

    public any setLog(any log)

    Parameters:
    log

    setModuleConfigCache

    public any setModuleConfigCache(struct moduleConfigCache)

    Parameters:
    moduleConfigCache

    setModuleMap

    public any setModuleMap(struct moduleMap)

    Parameters:
    moduleMap

    setModuleRegistry

    public any setModuleRegistry(struct moduleRegistry)

    Parameters:
    moduleRegistry

    setModuleWidgetCache

    public any setModuleWidgetCache(struct moduleWidgetCache)

    Parameters:
    moduleWidgetCache

    setSettingService

    public any setSettingService(any settingService)

    Parameters:
    settingService

    setWidgetService

    public any setWidgetService(any widgetService)

    Parameters:
    widgetService

    startup

    public ModuleService startup()

    Startup the service. This iterates through all modules on disk and if it finds a module that it has not been registered, it will register it. If it loads a module that is registered and marked as active it will activate it.