lucee.Componentcborm.models.BaseORMService
cborm.models.VirtualEntityService
contentbox.models.content.ContentService
ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- A generic content service for content objects
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
asyncManager
|
true
|
false
|
|
any
|
authorService
|
true
|
false
|
|
any
|
cacheBox
|
true
|
false
|
|
any
|
categoryService
|
true
|
false
|
|
any
|
commentService
|
true
|
false
|
|
any
|
commentSubscriptionService
|
true
|
false
|
|
any
|
contentStoreService
|
true
|
false
|
|
any
|
contentVersionService
|
true
|
false
|
|
any
|
customFieldService
|
true
|
false
|
|
any
|
dateUtil
|
true
|
false
|
|
any
|
entryService
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
pageService
|
true
|
false
|
|
any
|
relocationService
|
true
|
false
|
|
any
|
settingService
|
true
|
false
|
|
any
|
statsService
|
true
|
false
|
|
any
|
subscriberService
|
true
|
false
|
|
any
|
systemUtil
|
true
|
false
|
Constructor Summary | |
---|---|
init([any entityName='cbContent'])
Constructor. |
Method Summary | |
---|---|
any
|
addRelocation(BaseContent contentItem, string originalSlug)
Adds a relocation for a content item. |
any
|
bulkPublishStatus(any contentID, any status)
Bulk Publish Status Updates. |
ContentService
|
clearAllCaches([boolean async='false'])
Clear all content caches. |
ContentService
|
clearAllCategoryCountCaches([boolean async='false'])
Clear all category content counts caches. |
ContentService
|
clearAllPageWrapperCaches([boolean async='false'])
Clear all page wrapper caches. |
ContentService
|
clearAllSitemapCaches([boolean async='false'])
Clear all sitemap caches. |
ContentService
|
clearPageWrapper(any slug, [boolean async='false'])
Clear a page wrapper cache for a specific content object. |
ContentService
|
clearPageWrapperCaches(any slug, [boolean async='false'])
Clear a specific page wrapper caches according to slug prefix. |
ContentService
|
delete(any content)
Delete a content object safely via hierarchies. |
any
|
findBySlug(any slug, boolean showUnpublished='false', [string siteID=''])
Find a published content object by slug and published unpublished flags, if not found it returns. |
array
|
findExpiredContent([any author], [numeric max='0'], [numeric offset='0'], [string siteID=''])
Get all the expired content in the system by filters. |
array
|
findFuturePublishedContent([any author], [numeric max='0'], [numeric offset='0'], [string siteID=''])
Get all the future published content in the system by filters. |
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=''], [any criteria], [string slugSearch=''])
Find published content objects by different filters and output formats. |
array
|
getAllFlatContent([any sortOrder='title asc'], [boolean isPublished], [boolean showInSearch], [string siteID=''], [string contentType=''])
Returns an array of [contentID, title, slug, createdDate, modifiedDate] structures of all the content in the system. |
array
|
getAllFlatSlugs()
Returns an array of slugs of all the content objects in the system. |
array
|
getAllForExport([any inData])
Get all content for export as flat data. |
any
|
getByIdOrSlugOrFail(any id)
This utility tries to get the content type by id/slug or fails. |
any
|
getIdBySlug(any slug, [string siteID=''])
Get an id from a slug of a content object. |
array
|
getLatestEdits([any author], [boolean isPublished], [numeric max='25'], [string siteID=''])
Get latest edits according to criteria. |
private any
|
getServiceByType(any type)
Get the appropriate service by passed content type. |
array
|
getTopCommentedContent([numeric max='5'], [string siteID=''])
Get the top commented content entries. |
array
|
getTopVisitedContent([numeric max='5'], [string siteID=''])
Get the top visited content entries. |
numeric
|
getTotalContentCount([any siteID=''], [any categoryId=''])
Get the total content counts according to the passed filters. |
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
|
importFromStruct(any contentData, any importLog, [any parent], [struct newContent='[runtime expression]'], any site, [boolean override='false'])
Import a content object from a ContentBox JSON structure. |
boolean
|
isSlugUnique(any slug, [any contentID=''], [string siteID=''], [string contentType=''])
Verify an incoming slug is unique or not. |
any
|
searchContent([any searchTerm=''], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [any sortOrder='publishedDate DESC'], [any isPublished='true'], [boolean searchActiveContent='true'], [string contentTypes=''], [any excludeIDs=''], [boolean showInSearch], [string siteID=''], [string propertyList])
Searches published content with cool paramters, remember published content only. |
ContentService
|
updateHits(any content, [boolean async='true'])
Update a content's hits with some async flava. |
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 lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
entityName
- The content entity name to bind this service to.Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- coldbox:asyncManagerserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- authorService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- cacheboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- categoryService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- commentService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- CommentSubscriptionService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- contentStoreService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- contentVersionService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- customFieldService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- DateUtil@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- entryService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- pageService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- RelocationService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- id:settingService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- statsService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- subscriberService@contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- SystemUtil@contentboxserializable
- trueMethod Detail |
---|
Adds a relocation for a content item
contentItem
- the target to relocate tooriginalSlug
- the URI from which to redirectBulk Publish Status Updates
contentID
- The list or array of ID's to bulk updatestatus
- The status either 'publish' or 'draft'Clear all content caches
async
- Run it asynchronously or not, defaults to falseClear all category content counts caches
async
- Run it asynchronously or not, defaults to falseClear all page wrapper caches
async
- Run it asynchronously or not, defaults to falseClear all sitemap caches
async
- Run it asynchronously or not, defaults to falseClear a page wrapper cache for a specific content object
slug
- The slug to clearasync
- Run it asynchronously or not, defaults to falseClear a specific page wrapper caches according to slug prefix
slug
- The slug partial to clean onasync
- Run it asynchronously or not, defaults to falseDelete a content object safely via hierarchies
delete
in class
cborm.models.BaseORMService
content
- the Content object to deleteFind a published content object by slug and published unpublished flags, if not found it returns a new content object
slug
- The slug to searchshowUnpublished
- To also show unpublished content, defaults to false.siteID
- The site this slug belongs toGet all the expired content in the system by filters
author
- The author filtering if passed.max
- The maximum number of records to returnoffset
- The pagination offsetsiteID
- The site to filter onGet all the future published content in the system by filters
author
- The author filtering if passed.max
- The maximum number of records to returnoffset
- The pagination offsetsiteID
- The site to filter onFind published content objects by different filters and output formats
max
- The maximum number of records to paginateoffset
- The offset in the paginationsearchTerm
- The search term to searchcategory
- The category to filter the content onasQuery
- Return as query or array of objects, defaults to array of objectssortOrder
- how we need to sort the resultsparent
- 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 idproperties
- The list of properties to project on instead of giving you full object graphsauthorID
- The authorID to filter oncriteria
- The criteria object to use if passed, else we create a new one.slugSearch
- If passed, we will search for content items with this field as a full text search on slugsReturns an array of [contentID, title, slug, createdDate, modifiedDate] structures of all the content in the system
sortOrder
- The sort ordering of the resultsisPublished
- Show all content or true/false published contentshowInSearch
- Show all content or true/false showInSearch flagsiteID
- The site id to use to filter oncontentType
Returns an array of slugs of all the content objects in the system.
Get all content for export as flat data
inData
- The data to use for exporting, usually concrete implementtions can override this.This utility tries to get the content type by id/slug or fails
id
Get an id from a slug of a content object
slug
- The slug to search an ID for.siteID
- The site this slug belongs toGet latest edits according to criteria
author
- The author object to use for retrievalisPublished
- If passed, check if content is published or in draft mode. Else defaults to all statesmax
- The maximum number of records to returnsiteID
- The site to get edits fromGet the appropriate service by passed content type. If an invalid type is passed, we return ourselves
type
- The content type to detectGet the top commented content entries
max
- The maximum to retrieve, defaults to 5 entriessiteID
- The site to filter onGet the top visited content entries
max
- The maximum to retrieve, defaults to 5 entriessiteID
- The site to filter onGet the total content counts according to the passed filters
siteID
- The site to filter oncategoryId
- The category Id to filter onGet a unique slug hash
slug
- The slug to unique itImport data from an array of structures or a single structure of data
importData
- A struct or array of data to importoverride
- Override content if found in the database, defaults to falseimportLog
- The import log buffersite
- If passed, we use this specific site, else we discover it via content dataImport data from a ContentBox JSON file. Returns the import log
importFile
- The json file to importoverride
- Override content if found in the database, defaults to falseImport a content object from a ContentBox JSON structure
contentData
- The content structure inflated from JSONimportLog
- The string builder import logparent
- If the inflated content object has a parent then it can be linked directly, no inflating necessary. Usually for recursionsnewContent
- Map of new content by slug; useful for avoiding new content collisions with recusive relationshipssite
- The site we are using for the contentoverride
- Are we overriding persisted data or not?Verify an incoming slug is unique or not
slug
- The slug to search for uniquenesscontentID
- Limit the search to the passed contentID usually for updatessiteID
- The site to filter oncontentType
- The content type uniquenessSearches published content with cool paramters, remember published content only
searchTerm
- The search term to searchmax
- The maximum number of records to paginateoffset
- The offset in the paginationasQuery
- Return as query or array of objects, defaults to array of objectssortOrder
- The sorting of the search results, defaults to publishedDate DESCisPublished
- Search for published, non-published or both content objects [true, false, 'all']searchActiveContent
- Search only content titles or both title and active content. Defaults to both.contentTypes
- Limit search to list of content types (comma-delimited). Leave blank to search all content typesexcludeIDs
- List of IDs to exclude from searchshowInSearch
- If true, it makes sure content has been stored as searchable, defaults to null, which means it searches no matter what this bit sayssiteID
- The site ID to filter onpropertyList
- A list of properties to retrieve as a projection instead of array of objectsUpdate a content's hits with some async flava
content
- A content object or id to update the hits onasync
- Async or not