contentbox.model.menu

Class MenuService

railo-context.Component
        extended by coldbox.system.orm.hibernate.BaseORMService
            extended by coldbox.system.orm.hibernate.VirtualEntityService
                extended by contentbox.model.menu.MenuService
Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  

    ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Service to handle menu operations.

    Property Summary
    type property default serializable required
    any menuItemService


    • inject = id:menuItemService@cb
    true false
    any populator


    • inject = wirebox:populator
    true false
    any renderer


    • inject = provider:ColdBoxRenderer
    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)
         Find a menu object by slug, if not found it returns a new menu object.
    array getAllForExport()
         Get all data prepared for export.
    array getAllSlugs()
         Returns an array of slugs of all the content objects in the system.
    string getMenuItemService()
    string getPopulator()
    string getRenderer()
    private any getUniqueSlugHash(string slug)
         Get a unique slug hash.
    string importFromData(any importData, [boolean override='false'], [any importLog])
         Import data from an array of structures of authors or just one structure of author.
    string importFromFile(any importFile, [boolean override='false'])
         Import data from a ContentBox JSON file.
    any isSlugUnique(any slug, [any menuID=''])
         Verify an incoming slug is unique or not.
    any saveMenu(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'])
         Menu search by title or slug.
    any setMenuItemService(any menuItemService)
    any setPopulator(any populator)
    any setRenderer(any renderer)
     
    Methods inherited from class coldbox.system.orm.hibernate.VirtualEntityService
    clear, convertIDValueToJavaType, convertValueToJavaType, count, countWhere, criteriaCount, criteriaQuery, deleteAll, deleteByID, deleteByQuery, deleteWhere, evict, executeQuery, exists, findAllWhere, findWhere, get, getAll, getDatasource, getEntityName, getKey, getPropertyNames, getSessionStatistics, getTableName, isSessionDirty, list, new, newCriteria, onMissingMethod, setDatasource, setEntityName
     
    Methods inherited from class coldbox.system.orm.hibernate.BaseORMService
    $delete, $deleteAll, $deleteByID, $deleteByQuery, $deleteWhere, $save, $saveAll, $transactioned, compileHQLFromDynamicMethod, createCriteriaQuery, createService, delete, evictEntity, evictQueries, findAll, findByExample, findDynamically, findIt, getDefaultAsQuery, getEntityGivenName, getEventHandling, getHQLDynamicCache, getORM, getORMEventHandler, getQueryCacheRegion, getRestrictions, getUseQueryCaching, getUseTransactions, merge, populate, populateFromJSON, populateFromQuery, populateFromXML, populateWithPrefix, refresh, save, saveAll, sessionContains, setDefaultAsQuery, setEventHandling, setHQLDynamicCache, setORM, setORMEventHandler, setQueryCacheRegion, setUseQueryCaching, setUseTransactions
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    menuItemService

    property any menuItemService

    Attributes:
    required - false
    inject - id:menuItemService@cb
    serializable - true

    populator

    property any populator

    Attributes:
    required - false
    inject - wirebox:populator
    serializable - true

    renderer

    property any renderer

    Attributes:
    required - false
    inject - provider:ColdBoxRenderer
    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)

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

    Parameters:
    slug - The slug to search

    getAllForExport

    public array getAllForExport()

    Get all data prepared for export


    getAllSlugs

    public array getAllSlugs()

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


    getMenuItemService

    public string getMenuItemService()


    getPopulator

    public string getPopulator()


    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])

    Import data from an array of structures of authors or just one structure of author

    Parameters:
    importData
    override
    importLog

    importFromFile

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

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

    Parameters:
    importFile
    override

    isSlugUnique

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

    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

    saveMenu

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

    Save a menu and do necessary updates

    Parameters:
    menu - The menu to save or update
    originalSlug - If an original slug is passed, then we need to update hierarchy slugs.

    search

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

    Menu search by title or slug

    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

    setMenuItemService

    public any setMenuItemService(any menuItemService)

    Parameters:
    menuItemService

    setPopulator

    public any setPopulator(any populator)

    Parameters:
    populator

    setRenderer

    public any setRenderer(any renderer)

    Parameters:
    renderer