contentbox.models.menu

Class MenuService

lucee.Component
    extended by cborm.models.BaseORMService
      extended by cborm.models.VirtualEntityService
        extended by contentbox.models.menu.MenuService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Service to handle menu operations.

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


    • access = public
    • returntype = any
    • inject = DateUtil@contentbox
    true false
    any menuItemService


    • access = public
    • returntype = any
    • inject = menuItemService@contentbox
    true false
    any renderer


    • access = public
    • returntype = any
    • inject = coldbox:renderer
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    string buildEditableMenu(array menu, string menuString='', [boolean inChild='false'])
         Builds editable menu for interface.
    any findBySlug(any slug, [string siteID=''])
         Find a menu object by slug, if not found it returns a new menu object.
    array getAllForExport(any site)
         Get all data prepared for export.
    array getAllSlugs([string siteID=''])
         Returns an array of slugs of all the content objects in the system.
    string getDateUtil()
    string getMenuItemService()
    string getRenderer()
    private any getUniqueSlugHash(string slug)
         Get a unique slug hash.
    string importFromData(any importData, [boolean override='false'], any importLog, [any site])
         Import data from an array of structures or a single structure of data.
    string importFromFile(any importFile, [boolean override='false'])
         Import data from a ContentBox JSON file.
    any isSlugUnique(any slug, [any menuID=''], [string siteID=''])
         Verify an incoming slug is unique or not.
    any save(any menu, [string originalSlug=''])
         Save a menu and do necessary updates.
    any search([string searchTerm=''], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [string sortOrder='title'], [string siteID=''])
         Menu search using different filters and return options.
    any setDateUtil(any dateUtil)
    any setMenuItemService(any menuItemService)
    any setRenderer(any renderer)
     
    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, 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

    dateUtil

    property any dateUtil

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

    menuItemService

    property any menuItemService

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

    renderer

    property any renderer

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

    Method Detail

    buildEditableMenu

    public string buildEditableMenu(array menu, string menuString='', [boolean inChild='false'])

    Builds editable menu for interface

    Parameters:
    menu - the menu to parse
    menuString - build-up string for menu content
    inChild - flag for whether the content item is being evaluated as itself, or as a child of another item

    findBySlug

    public any findBySlug(any slug, [string siteID=''])

    Find a menu object by slug, if not found it returns a new menu object

    Parameters:
    slug - The slug to search
    siteID - The site this slug is on
    Returns:
    The menu found or a new menu blank

    getAllForExport

    public array getAllForExport(any site)

    Get all data prepared for export

    Parameters:
    site - The site to export from

    getAllSlugs

    public array getAllSlugs([string siteID=''])

    Returns an array of slugs of all the content objects in the system.

    Parameters:
    siteID - Filter by site

    getDateUtil

    public string getDateUtil()


    getMenuItemService

    public string getMenuItemService()


    getRenderer

    public string getRenderer()


    getUniqueSlugHash

    private any getUniqueSlugHash(string slug)

    Get a unique slug hash

    Parameters:
    slug - The slug to make unique

    importFromData

    public string importFromData(any importData, [boolean override='false'], any importLog, [any site])

    Import data from an array of structures or a single structure of data

    Parameters:
    importData - A struct or array of data to import
    override - Override content if found in the database, defaults to false
    importLog - The import log buffer
    site - If passed, we use this specific site, else we discover it via content data
    Returns:
    The console log of the import

    importFromFile

    public string importFromFile(any importFile, [boolean override='false'])

    Import data from a ContentBox JSON file. Returns the import log

    Parameters:
    importFile - The json file to import
    override - Override content if found in the database, defaults to false
    Returns:
    The console log of the import
    Throws:
    InvalidImportFormat

    isSlugUnique

    public any isSlugUnique(any slug, [any menuID=''], [string siteID=''])

    Verify an incoming slug is unique or not

    Parameters:
    slug - The slug to search for uniqueness
    menuID - Limit the search to the passed menuID usually for updates
    siteID - The site to filter on

    save

    public any save(any menu, [string originalSlug=''])

    Save a menu and do necessary updates

    Overrides:
    save in class cborm.models.BaseORMService
    Parameters:
    menu - The menu to save or update
    originalSlug - If an original slug is passed, then we need to update hierarchy slugs.
    Returns:
    The saved menu

    search

    public any search([string searchTerm=''], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [string sortOrder='title'], [string siteID=''])

    Menu search using different filters and return options

    Parameters:
    searchTerm - Search in firstname, lastname and email fields
    max - The max returned objects
    offset - The offset for pagination
    asQuery - Query or objects
    sortOrder - The sort order to apply
    siteID - The site to filter on

    setDateUtil

    public any setDateUtil(any dateUtil)

    Parameters:
    dateUtil

    setMenuItemService

    public any setMenuItemService(any menuItemService)

    Parameters:
    menuItemService

    setRenderer

    public any setRenderer(any renderer)

    Parameters:
    renderer