contentbox.model.content

Class EntryService

railo-context.Component
        extended by coldbox.system.orm.hibernate.BaseORMService
            extended by coldbox.system.orm.hibernate.VirtualEntityService
                extended by contentbox.model.content.ContentService
                    extended by contentbox.model.content.EntryService
Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • 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. Entry service for contentbox

    Property Summary
    type property default serializable required
    any contentService


    • inject = id:ContentService@cb
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any findPublishedEntries([numeric max='0'], [numeric offset='0'], [string searchTerm=''], [string category=''], [boolean asQuery='false'], [string sortOrder='publishedDate DESC'])
         Find published entries in ContentBox that have no passwords.
    any findPublishedEntriesByDate([numeric year='0'], [numeric month='0'], [numeric day='0'], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'])
         Find published entries by date filters.
    array getAllFlatEntries()
         Returns an array of [contentID, title, slug] structures of all the entries in the system.
    array getAllForExport()
         Get all content for export as flat data.
    any getArchiveReport()
         Get a query report of entries archive.
    any saveEntry(any entry, [boolean transactional='true'])
         Save an entry.
    struct search([string search=''], [string isPublished='any'], [string author='all'], [string creator='all'], [string category='all'], [numeric max='0'], [numeric offset='0'], [string sortOrder=''], [boolean searchActiveContent='true'], [boolean showInSearch='false'])
         entry search returns struct with keys [entries,count].
     
    Methods inherited from class contentbox.model.content.ContentService
    bulkPublishStatus, clearAllCaches, clearAllPageWrapperCaches, clearPageWrapper, clearPageWrapperCaches, deleteContent, findBySlug, findPublishedContent, getAllFlatContent, getAllFlatSlugs, getIDBySlug, getTopCommentedContent, getTopVisitedContent, getUniqueSlugHash, importFromData, importFromFile, inflateFromStruct, isSlugUnique, searchContent, updateHits
     
    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

    contentService

    property any contentService

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

    Method Detail

    findPublishedEntries

    public any findPublishedEntries([numeric max='0'], [numeric offset='0'], [string searchTerm=''], [string category=''], [boolean asQuery='false'], [string sortOrder='publishedDate DESC'])

    Find published entries in ContentBox that have no passwords

    Parameters:
    max - The max number of pages to return, defaults to 0=all
    offset - The pagination offset
    searchTerm - Pass a search term to narrow down results
    category - Pass a list of categories to narrow down results
    asQuery - Return results as array of objects or query, default is array of objects
    sortOrder - The sort order string, defaults to publisedDate DESC

    findPublishedEntriesByDate

    public any findPublishedEntriesByDate([numeric year='0'], [numeric month='0'], [numeric day='0'], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'])

    Find published entries by date filters

    Parameters:
    year
    month
    day
    max
    offset
    asQuery

    getAllFlatEntries

    public array getAllFlatEntries()

    Returns an array of [contentID, title, slug] structures of all the entries in the system


    getAllForExport

    public array getAllForExport()

    Get all content for export as flat data

    Overrides:
    getAllForExport in class ContentService

    getArchiveReport

    public any getArchiveReport()

    Get a query report of entries archive


    saveEntry

    public any saveEntry(any entry, [boolean transactional='true'])

    Save an entry

    Parameters:
    entry
    transactional
    Returns:
    EntryService

    search

    public struct search([string search=''], [string isPublished='any'], [string author='all'], [string creator='all'], [string category='all'], [numeric max='0'], [numeric offset='0'], [string sortOrder=''], [boolean searchActiveContent='true'], [boolean showInSearch='false'])

    entry search returns struct with keys [entries,count]

    Parameters:
    search - The search term to search on
    isPublished - Boolean bit to search if page is published or not, pass 'any' or not to ignore.
    author - The authorID to filter on, pass 'all' to ignore filter
    creator - The creatorID to filter on, don't pass or pass an empty value to ignore, defaults to 'all'
    category - The categorie(s) to filter on. You can also pass 'all' or 'none'
    max - The maximum records to return
    offset - The offset on the pagination
    sortOrder - Sorting of the results, defaults to page title asc
    searchActiveContent - If true, it searches title and content on the page, else it just searches on title
    showInSearch - If true, it makes sure content has been stored as searchable, defaults to false, which means it searches no matter what this bit says