contentbox.models.content

Class PageService

lucee.Component
    extended by cborm.models.BaseORMService
      extended by cborm.models.VirtualEntityService
        extended by contentbox.models.content.ContentService
          extended by contentbox.models.content.PageService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Service layer for all Page operations

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


    • access = public
    • returntype = any
    • inject = id:ContentService@contentbox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any findPublishedContent([numeric max='0'], [numeric offset='0'], [any searchTerm=''], [any category=''], [boolean asQuery='false'], [string sortOrder='publishedDate DESC'], [any parent], [string slugPrefix=''], [string siteID=''], [string properties], [string authorID=''], [boolean showInMenu], [string slugSearch=''])
         Find published pages using different filters and output formats.
    array getAllForExport(any site)
         Get all site content for export as flat data.
    any save(any page, [string originalSlug=''])
         Save a page and do necessary updates to the hierarchies if there is a slug change.
    struct search([string search=''], [string isPublished='any'], [string author='all'], [string creator='all'], [string parent], [string category='all'], [numeric max='0'], [numeric offset='0'], [string sortOrder=''], [boolean searchActiveContent='true'], [boolean showInSearch='false'], [string siteID=''], [string propertyList])
         Search for pages according to many filters.
     
    Methods inherited from class contentbox.models.content.ContentService
    addRelocation, bulkPublishStatus, clearAllCaches, clearAllCategoryCountCaches, clearAllPageWrapperCaches, clearAllSitemapCaches, clearPageWrapper, clearPageWrapperCaches, delete, findBySlug, findExpiredContent, findFuturePublishedContent, getAllFlatContent, getAllFlatSlugs, getByIdOrSlugOrFail, getIdBySlug, getLatestEdits, getServiceByType, getTopCommentedContent, getTopVisitedContent, getTotalContentCount, getUniqueSlugHash, importFromData, importFromFile, importFromStruct, isSlugUnique, searchContent, updateHits
     
    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, 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

    contentService

    property any contentService

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

    Method Detail

    findPublishedContent

    public any findPublishedContent([numeric max='0'], [numeric offset='0'], [any searchTerm=''], [any category=''], [boolean asQuery='false'], [string sortOrder='publishedDate DESC'], [any parent], [string slugPrefix=''], [string siteID=''], [string properties], [string authorID=''], [boolean showInMenu], [string slugSearch=''])

    Find published pages using different filters and output formats.

    Overrides:
    findPublishedContent in class ContentService
    Parameters:
    max - The maximum number of records to paginate
    offset - The offset in the pagination
    searchTerm - The search term to search
    category - The category to filter the content on
    asQuery - Return as query or array of objects, defaults to array of objects
    sortOrder - how we need to sort the results
    parent - The parentID or parent entity to filter on, don't pass or pass an empty value to ignore, defaults to 'all'
    slugPrefix - If passed, this will do a hierarchical search according to this slug prefix. Remember that all hierarchical content's slug field contains its hierarchy: /products/awesome/product1. This prefix will be appended with a `/`
    siteID - If passed, filter by site id
    properties - The list of properties to project on instead of giving you full object graphs
    authorID - The authorID to filter on
    showInMenu - If passed, it limits the search to this content property
    slugSearch - If passed, we will search for content items with this field as a full text search on slugs
    Returns:
    struct of { count, content }

    getAllForExport

    public array getAllForExport(any site)

    Get all site content for export as flat data

    Overrides:
    getAllForExport in class ContentService
    Parameters:
    site - The site to get the export from

    save

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

    Save a page and do necessary updates to the hierarchies if there is a slug change

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

    search

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

    Search for pages according to many filters

    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'
    parent - The parentID 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
    siteID - The site ID to filter on
    propertyList - A list of properties to retrieve as a projection instead of array of objects
    Returns:
    struct = { pages, count }